qtlClassifier | R Documentation |
A QTL cis/trans classifier
qtlClassifier(geneSNP, SNPPos, genePos, radius)
geneSNP |
data.frame with columns on gene, SNP and biomarker (e.g., expression, protein). |
SNPPos |
data.frame containing SNP, chromosome and position. |
genePos |
data.frame containing gene, chromosome, start and end positions. |
radius |
flanking distance. |
The function obtains QTL (simply called SNP here) cis/trans classification based on gene positions.
It returns a geneSNP-prefixed data.frame with the following columns:
geneChrom gene chromosome.
geneStart gene start.
geneEnd gene end.
SNPChrom pQTL chromosome.
SNPPos pQTL position.
Type cis/trans labels.
This is adapted from iBMQ/eqtlClassifier as an xQTL (x=e, p, me, ...) classifier.
cis.vs.trans.classification
## Not run:
merged <- read.delim("INF1.merge",as.is=TRUE)
hits <- merge(merged[c("CHR","POS","MarkerName","prot","log10p")],
inf1[c("prot","uniprot")],by="prot")
names(hits) <- c("prot","Chr","bp","SNP","log10p","uniprot")
options(width=200)
geneSNP <- merge(hits[c("prot","SNP","log10p")],
inf1[c("prot","gene")],by="prot")[c("gene","SNP","prot","log10p")]
SNPPos <- hits[c("SNP","Chr","bp")]
genePos <- inf1[c("gene","chr","start","end")]
cvt <- qtlClassifier(geneSNP,SNPPos,genePos,1e6)
cvt
cistrans <- cis.vs.trans.classification(hits,inf1,"uniprot")
cis.vs.trans <- with(cistrans,data)
cistrans.check <- merge(cvt[c("gene","SNP","Type")],cis.vs.trans[c("p.gene","SNP","cis.trans")],
by.x=c("gene","SNP"),by.y=c("p.gene","SNP"))
with(cistrans.check,table(Type,cis.trans))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.