Description Usage Arguments Details Value Examples
Read a VCF file and return the called SNVs as a GRanges
instance.
Only SNVs with a single ALT allele are returned, and, by default, all
filtered SNVs are excluded from the returned value.
1 2 |
f |
A |
genome |
A genome identifier. |
exclude.filtered |
filt |
read.info |
Read INFO field, default is to ignore the INFO field. Set
this to |
read.geno |
Read genotypes from VCF, the default is to ignore the
genotypes. Set this to |
filter.func |
a function used to filter variants from the returned
|
details
A VCF
instance from the VariantAnnotation package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
# To simply read a VCF excluding filtered variants use
x <- read.vcf(f, 'hg19', read.info = TRUE, filter.func = func)
# For more complicated filtering you can pass a filter function. This
# example assuming the VCF has been annotated with SnpEff and we are only
# interested in variants that have not been filtered and have a SnpEff
# impact of HIGH or MODERATE.
func <- function(vcf) {
x <- rowData(vcf)
x[unlist(lapply(info(vcf)$EFF,
function(x) any(grepl('(HIGH)|(MODERATE)', x))))]
}
f <- system.file('extdata', 'example.vcf', package = 'GenomicVis')
x <- read.vcf(f, 'hg19', read.info = TRUE, filter.func = func)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.