vcf2sm {GGtools} | R Documentation |
generate a SnpMatrix instance on the basis of a VCF (4.0) file.
vcf2sm(tbxfi, ..., gr, nmetacol)
tbxfi |
instance of |
... |
not used |
gr |
instance of |
nmetacol |
numeric: tells number of columns used in each record as locus-level metadata |
This function is relevant only for diallelic SNP. If any base call is denoted ‘.’, the associated genotype is set to missing (raw 0), even if the nonmissing call is ALT, implying at least one ALT.
an instance of SnpMatrix-class
VJ Carey <stvjc@channing.harvard.edu>
http://www.1000genomes.org/wiki/doku.php?id=1000_genomes:analysis:vcf4.0
# SRC: ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/pilot_data/release/2010_07/exon/CEU.exon.2010_03.genotypes.vcf.gz vref = system.file("vcf/CEU.exon.2010_09.genotypes.vcf.gz", package="GGtools") gg = GenomicRanges::GRanges(seqnames="1", IRanges::IRanges(10e6,20e6)) vcf2sm(Rsamtools::TabixFile(vref), gr=gg, nmetacol=9L)