R/Signif.R

`Signif` <-
function (rpval, FDR, type = c("BH", "BY","Bonferroni", "Holm", "Hochberg", "SidakSS", "SidakSD"))
  {
    adjp <- adjustment(rpval, type)
    if(length(adjp) == 1){
      
      sig <- ifelse(adjp <= FDR,1,0)
      
      if(sig == 0){
        
        print("no gene is significant")
      } else{
        
        adjp1 <- c(sig,adjp,adjp)
        names(adjp1) <- c("row.num", "raw p-values", paste (type, sep = " ", "p-values"))
        return(adjp1)
        
      }
      
    } else {
      
      sig  <- which(adjp[, 2] <= FDR)
    
        
    if (length(sig) == 0 ) {
                   print("no gene is significant")
                   }
    else {
          if (length(sig) > 1) {
              adjp1 <- data.frame(sig, adjp[sig,])
               }
          else  {
               adjp1 <- c(sig, adjp[sig,])
	         }
          names(adjp1) <- c("row.num", "raw p-values", paste (type, sep = " ", "p-values"))
          return(adjp1)
	    }
    }

    }

Try the IsoGeneGUI package in your browser

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

IsoGeneGUI documentation built on May 2, 2019, 4:49 p.m.