Skip to contents

A QTL cis/trans classifier

Usage

qtlClassifier(geneSNP, SNPPos, genePos, radius)

Arguments

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.

Value

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.

Details

The function obtains QTL (simply called SNP here) cis/trans classification based on gene positions.

Note

This is adapted from iBMQ/eqtlClassifier as an xQTL (x=e, p, me, ...) classifier.

Examples

if (FALSE) { # \dontrun{
  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))
} # }