Guest User

Untitled

a guest
Nov 23rd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. # calculate variance of fcs(fold changes) for each quantiles of means
  2. # and returns gene names which abs(fcs) > 2*Zscores
  3.  
  4. # objects
  5. # means: numeric vector of means
  6. # fcs: numeric vector of fold changes
  7. # LAB: names of probes
  8.  
  9. zscores = function(i){
  10. qt = quantile(means, c(0:10)*0.1)
  11. cls = findInterval(means, qt)
  12. zs = tapply(fcs, findInterval(means, qt), sd)
  13. sig = which(abs(fcs) > zs[cls]*2)
  14. plot(means, fcs, ylim=c(-1,1), pch=16, cex=0.6)
  15. points(means[sig], fcs[sig], ylim=c(-1,1), col=2, pch=16, cex=0.6)
  16. return(LAB[sig])
  17. }
Add Comment
Please, Sign In to add comment