R/summary.eqtl.R

Defines functions summary.eqtl

Documented in summary.eqtl

summary.eqtl <- function(object, sig=0.01, ...){
  
  ws <- object$windowSize
  trans <- FALSE
  if(is.null(ws)){
    ws <- "trans-eQTL"
    trans <- TRUE
  }

  p.values <- sapply(object$eqtl,"[",3)
  
  if(trans){
    cat("trans-EQTL Summary\n")
  } else {
    cat("cis-EQTL Summary\n")
  }
  cat("---------------\n")
  cat("Type of test                                  :",object$method,"\n")

  testedGenes <- 0
  if(trans){
    testedGenes <- length(object$xAnnot)
  } else {
    testedGenes <- length(object$eqtl)
  }
  cat("Tested genes                                  :",testedGenes,"\n")

  cat("Total number of SNPs (in geno object)         :",dim(object$geno[[3]])[1],"\n")
  cat("Window size (in MB)                           :",ws,"\n")
  if(!trans) cat("Average (median) number of SNP in window      :",mean(sapply(p.values,length)),"(",median(sapply(p.values,length)),")\n")
  sigP <- sapply(p.values, function(x){sum(x<=sig, na.rm=TRUE)})
  if(!trans) cat("Average (median) number of sig. (p<",sig,") SNP in window :",mean(sigP),"(",median(sigP),")\n")
  invisible(object)
} 

Try the GenomicTools package in your browser

Any scripts or data that you put into this service are public.

GenomicTools documentation built on March 13, 2020, 3:08 a.m.