Advertisement
Guest User

Untitled

a guest
May 29th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #For your boxplot,
  2. #Say you wanna make a boxplot for gene UCA1, you wuold type
  3. goi <- norm.all[rownames(norm.all) == "UCA1" , ]
  4. boxplot(goi)
  5.  
  6. #or
  7.  
  8. goi <- melt(norm.all[grepl(x = rownames(norm.all), pattern = "GENEOFINTEREST"), ])
  9. boxplot(goi)
  10.  
  11.  
  12.  
  13.  
  14. studentT <- function(x, s1, s2){
  15. x <- as.numeric(x);
  16. x1 <- x[s1];
  17. x2 <- x[s2];
  18. z <- t.test(x1, x2, alternative = "two.sided");
  19. pval <- z$p.value;
  20. return(pval);
  21. }
  22.  
  23. # We're applying the function studentT to our object tmp.all that has in the first 168 lines normal samples and the rest cancer
  24. tmp.all.pval <- apply(tmp.all, 1, studentT, s1 = c(1:168), s2 = c(169:588))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement