Learn R Programming

podkat (version 1.4.2)

readSampleNamesFromVcfHeader: Read Sample Names from VCF File Header

Description

Reads the header of a VCF file and returns sample names as character vector

Usage

readSampleNamesFromVcfHeader(file, ...)

Arguments

file
a TabixFile object or a character string with a file name of the VCF file to read from; if file is a file name, the method internally creates a TabixFile object for this file name.
...
all additional arguments are passed on internally to scanBcfHeader function from the Rsamtools package.

Value

  • a character vector with sample names

Details

This function is a simple wrapper around the scanBcfHeader function from the Rsamtools package that scans the header of a VCF file and returns the sample names as a character vector.

References

http://www.bioinf.jku.at/software/podkat

http://www.1000genomes.org/wiki/analysis/variant-call-format/vcf-variant-call-format-version-42

Li, H., Handsaker, B., Wysoker, A., Fenell, T., Ruan, J., Homer, N., Marth, G., Abecasis, G., Durbin, R., and 1000 Genome Project Data Processing Subgroup (2009) The Sequence Alignment/Map format and SAMtools. Bioinformatics 25, 2078-2079.

See Also

scanBcfHeader

Examples

Run this code
vcfFile <- system.file("examples/example1.vcf.gz", package="podkat")
readSampleNamesFromVcfHeader(vcfFile)

Run the code above in your browser using DataLab