Description Usage Arguments Details Value Note Author(s) Examples
test for variant-expression associations in cis or generally, using VCF and RangedSummarizedExperiment representations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | cisAssoc(summex, vcf.tf, rhs = ~1, nperm = 3, cisradius =
50000, genome = "hg19", assayind = 1, lbmaf = 1e-06,
lbgtf = 1e-06, dropUnivHet = TRUE, infoFields =
c("LDAF", "SVTYPE"), simpleSNV = TRUE)
cisEsts(summex, vcf.tf, rhs = ~1, nperm = 3, cisradius =
50000, genome = "hg19", assayind = 1, lbmaf = 1e-06,
lbgtf = 1e-06, dropUnivHet = TRUE, infoFields =
c("LDAF", "SVTYPE"), simpleSNV = TRUE)
cisCount(summex, vcf.tf, rhs = ~1, cisradius =
50000, genome = "hg19", assayind = 1, lbmaf = 1e-06,
lbgtf = 1e-06, dropUnivHet = TRUE, infoFields =
c("LDAF", "SVTYPE"), simpleSNV = TRUE)
AllAssoc(summex, vcf.tf, variantRange, rhs = ~1, nperm = 3,
genome = "hg19", assayind = 1, lbmaf = 1e-06, lbgtf = 1e-06,
dropUnivHet = TRUE, infoFields = c("LDAF", "SVTYPE"))
|
summex |
a |
vcf.tf |
instance of |
rhs |
formula ‘right hand side’ for adjustments to be made
as |
nperm |
number of permutations to be used for plug-in FDR computation |
cisradius |
distance in bp around each gene body to be searched for SNP association |
genome |
tag suitable for use in GenomeInfoDb structures |
assayind |
index of |
lbmaf |
lower bound on MAF of SNP to retain for analysis, computed using
|
lbgtf |
lower bound on genotype frequency of SNP to retain for analysis |
dropUnivHet |
logical, if TRUE, will check for columns of SnpMatrix instance that possess no values other than "NA" and "A/B". See http://www.biostars.org/p/117155/#117270 |
infoFields |
character – VCF fields to retain in vcfInfo() part of query |
simpleSNV |
logical – will use simple computation of
|
variantRange |
GRanges instance that defines the scope of the VCF to be used for testing against all features on summex |
snp.rhs.tests
is the
workhorse for statistical modeling. VCF content is
transformed to the byte-code (which allows for uncertain imputation)
and used in fast testing.
distToGene is a helper function that should be replaced with something from the Bioconductor annotation subsystem
cisAssoc: a GRanges-class
instance
with mcols including chisq, permScore...
cisCount: enumerate locations in VCF that would be tested
seqlevelsStyle for summex and vcf.tf content must agree
VJ Carey <stvjd@channing.harvard.edu>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | require(GenomeInfoDb)
require(geuvPack)
require(Rsamtools)
#
# obtain geuvadis expression measures as FPKM
#
data(geuFPKM)
#
# confine the chromosome 20
#
lgeu = geuFPKM[ which(seqnames(geuFPKM)=="chr20"), ]
seqlevelsStyle(lgeu) = "NCBI"
#
# acquire subset of genotypes on chr20
#
tf20 = TabixFile(system.file("vcf/c20exch.vcf.gz", package="gQTLstats"))
if (require(VariantAnnotation)) scanVcfHeader(tf20)
#
# perform a general technical confounder correction, and confine
# attention to CEU samples
#
lgeue = clipPCs(lgeu[,which(lgeu$popcode=="CEU")], 1:2)
#
# obtain all score test statistics for SNP:gene pairs at radius 50k
#
set.seed(1234)
litc = cisAssoc(lgeue[c(162,201),], tf20, nperm=2, lbmaf=.05, cisradius=50000)
#
# obtain all estimates for SNP:gene pairs at radius 50k
#
set.seed(1234)
lite = cisEsts(lgeue[c(162,201),], tf20, nperm=2, lbmaf=.05, cisradius=50000)
summary(litc$chisq)
mysr = range(litc)
#
# compute the plug-in FDR
#
litc$pifdr = gQTLstats:::pifdr(litc$chisq, c(litc$permScore_1, litc$permScore_2))
litc[which(litc$pifdr < .01)]
#
# trans association testing. leave to the user the question of
# whether a test is actually cis
#
lita = AllAssoc(geuFPKM[1:10,], tf20, mysr)
lita3 = AllAssoc(geuFPKM[11:20,], tf20, mysr)
#lita5 = AllAssoc(geuFPKM[21:30,], tf20, mysr)
#
# This retains the top 5 (default) associations per SNP
#
n1 = gQTLstats:::collapseToBuf(lita, lita3)
#n1 = collapseToBuf(n1, lita5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.