GenotypeMatrix object## S3 method for class 'TabixFile,GRanges':
readGenotypeMatrix(file, regions, subset,
noIndels=TRUE, onlyPass=TRUE,
na.limit=1, MAF.limit=1,
na.action=c("impute.major", "omit", "fail"),
MAF.action=c("invert", "omit", "ignore", "fail"),
sex=NULL)
## S3 method for class 'TabixFile,missing':
readGenotypeMatrix(file, regions, ...)
## S3 method for class 'character,GRanges':
readGenotypeMatrix(file, regions, ...)
## S3 method for class 'character,missing':
readGenotypeMatrix(file, regions, ...)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.GRanges object that specifies
which genomic regions to read from the VCF file; if missing,
the entire VCF file is read.GenotypeMatrix object that
is returned. Moreover, minor allele frequencies (MAFs) are only
computed from the genotypes of the samples specified by subset.TRUE (default), only single-nucleotide
variants (SNVs) are considered and indels are skipped.TRUE (default), only variants are considered
whose value in the FILTER column is NULL, all samples are treated the same
without any modifications; if sex is a factor with levels
F (female) and M (male) that is as long as
subset or as the VCF file has samples, this argument is
interpreted as the sex of the samples. In this case, the genotypes
corresponding to male samples are
doubled before further processing. This is designed for mixed-sex
analyses of the X chromosome outside of the pseudoautosomal
regions.TabixFile,GRanges.GenotypeMatrix tabix API provided by the
GenotypeMatrix object. Reading can be restricted
to certain regions by specifying the regions object.
Note that it might not be possible to read a very large VCF file
as a whole. For all variants, filters in terms of missing values and MAFs can be
applied. Moreover, variants with MAFs greater than 0.5 can filtered
out or inverted. For details, see descriptions of parameters
na.limit, MAF.limit, na.action, and
MAF.action above.
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.
GenotypeMatrix vcfFile <- system.file("examples/example1.vcf.gz", package="podkat")
readGenotypeMatrix(vcfFile)
readGenotypeMatrix(vcfFile, onlyPass=FALSE, MAF.action="ignore")Run the code above in your browser using DataLab