Mercurial > repos > yufei-luo > s_mart
comparison SMART/DiffExpAnal/DESeqTools/barplotNul.R @ 18:94ab73e8a190
Uploaded
author | m-zytnicki |
---|---|
date | Mon, 29 Apr 2013 03:20:15 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
17:b0e8584489e6 | 18:94ab73e8a190 |
---|---|
1 # barplotNul | |
2 # barplot representing null counts per sample | |
3 | |
4 # input : counts, target, projectName | |
5 # output : barplotNul (png) | |
6 | |
7 # created Feb 7th, 2012 | |
8 # modified April 30th, 2012 (target$group instead of target) | |
9 | |
10 barplotNul <- function( counts, group, OUT_barplotNulName, out = TRUE ){ | |
11 | |
12 if (out) png( file=OUT_barplotNulName ) | |
13 | |
14 N <- apply(counts, 2, function(x){sum(x == 0)})/nrow(counts) | |
15 barplot(N, col=as.integer(group)+1, main = "Proportion of null counts per Sample", ylim = c(0,1)) | |
16 legend("topright", as.character(unique(group)), lty=1, col=as.integer(unique(group))+1) | |
17 | |
18 if (out) dev.off() | |
19 } |