Learn R Programming

gQTLstats (version 1.4.2)

queryVCF: obtain SnpMatrix from VCF genotypes

Description

obtain SnpMatrix from VCF genotypes

Usage

queryVCF(gr, vcf.tf, samps, genome = "hg19", getSM = TRUE,
   snvOnly=TRUE)

Arguments

gr
GRanges instance; SNPs lying within will be processed
vcf.tf
TabixFile instance pointing to VCF
samps
samples to be retained
genome
tag identifying build
getSM
logical; if FALSE, genotypeToSnpMatrix will not be run and only the output of readVcf is returned.
snvOnly
logical, if TRUE, will confine results to SNV

Value

  • a list of length two
  • readoutoutput of readVcf
  • smoutput of genotypeToSnpMatrix run on the read result

Examples

Run this code
require(Rsamtools)
tf20 = TabixFile(system.file("vcf/c20exch.vcf.gz", package="gQTLstats"))
require(geuvPack)
data(geuFPKM)
lgeu = geuFPKM[ which(seqnames(geuFPKM)=="chr20"), 
    which(geuFPKM$popcode=="CEU") ]
seqlevelsStyle(lgeu) = "NCBI"
rng = rowRanges(lgeu)[232] # CPNE1
myq = queryVCF( rng, tf20, samps=colnames(lgeu), genome="hg19" )
myq

Run the code above in your browser using DataLab