Learn R Programming

SeqArray (version 1.12.5)

seqVCF_Header: Parse the Header of a VCF File

Description

Parses the header of a VCF file.

Usage

seqVCF_Header(vcf.fn, getnum=FALSE)

Arguments

vcf.fn
the file name; or a connection object
getnum
if TRUE, return the number of samples and variants

Value

Return a list (with a class name "SeqVCFHeaderClass", S3 object):
fileformat
the file format
info
the ID description in the INFO field
filter
the ID description in the FILTER field
format
the ID description in the FORMAT field
alt
the ID description in the ALT field
contig
the description in the contig field
assembly
the link of assembly
reference
genome reference, or NULL if unknown
header
the other header lines
ploidy
ploidy, two for humans
num.sample
the number of samples
num.variant
the number of variants

Details

The ID description contains four columns: ID -- variable name; Number -- the number of elements, see the webpage of the 1000 Genomes Project; Type -- data type; Description -- a variable description.

References

Danecek, P., Auton, A., Abecasis, G., Albers, C.A., Banks, E., DePristo, M.A., Handsaker, R.E., Lunter, G., Marth, G.T., Sherry, S.T., et al. (2011). The variant call format and VCFtools. Bioinformatics 27, 2156-2158.

See Also

seqVCF_SampID, seqVCF2GDS

Examples

Run this code
# the VCF file
(vcf.fn <- seqExampleFileName("vcf"))
# or vcf.fn <- "C:/YourFolder/Your_VCF_File.vcf"

# get sample id
seqVCF_Header(vcf.fn, getnum=TRUE)

# use a connection object
f <- file(vcf.fn, "r")
seqVCF_Header(f, getnum=TRUE)
close(f)

Run the code above in your browser using DataLab