vcf2sm: generate a SnpMatrix instance on the basis of a VCF (4.0)...

Description Usage Arguments Details Value Author(s) References Examples

Description

generate a SnpMatrix instance on the basis of a VCF (4.0) file.

Usage

1
vcf2sm(tbxfi, ..., gr, nmetacol)

Arguments

tbxfi

instance of TabixFile-class

...

not used

gr

instance of GRanges-class

nmetacol

numeric: tells number of columns used in each record as locus-level metadata

Details

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.

Value

an instance of SnpMatrix-class

Author(s)

VJ Carey <stvjc@channing.harvard.edu>

References

http://www.1000genomes.org/wiki/doku.php?id=1000_genomes:analysis:vcf4.0

Examples

1
2
3
4
# 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)

GGtools documentation built on Nov. 8, 2020, 6:32 p.m.