annotate test-data/out.count.Rnw @ 2:82a180e6b582 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
author iuc
date Wed, 04 Apr 2018 11:03:05 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
1 % This is a template file for Sweave used in MAGeCK
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
2 % Author: Wei Li, Shirley Liu lab
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
3 % Do not modify lines beginning with "#__".
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
4 \documentclass{article}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
5
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
6 \usepackage{amsmath}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
7 \usepackage{amscd}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
8 \usepackage[tableposition=top]{caption}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
9 \usepackage{ifthen}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
10 \usepackage{fullpage}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
11 \usepackage[utf8]{inputenc}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
12 % \usepackage{longtable}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
13
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
14 \begin{document}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
15 \setkeys{Gin}{width=0.9\textwidth}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
16
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
17 \title{MAGeCK Count Report}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
18 \author{Wei Li}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
19
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
20 \maketitle
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
21
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
22
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
23 \tableofcontents
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
24
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
25 \section{Summary}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
26
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
27 %Function definition
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
28 <<label=funcdef,include=FALSE,echo=FALSE>>=
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
29 genreporttable<-function(filelist,labellist,reads,mappedreads){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
30 xtb=data.frame(Label=labellist,Reads=reads,MappedReads=mappedreads,MappedPercentage=mappedreads/reads);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
31 colnames(xtb)=c("Label","Reads","Mapped","Percentage");
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
32 return (xtb);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
33 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
34 genreporttable2<-function(filelist,labellist,sgrnas,zerocounts,gini){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
35 xtb=data.frame(Label=labellist,TotalsgRNAs=sgrnas,ZeroCounts=zerocounts,GiniIndex=gini);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
36 colnames(xtb)=c("Label","TotalsgRNA","ZeroCounts","GiniIndex");
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
37 return (xtb);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
38 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
39 genreporttable3<-function(filelist,labellist){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
40 xtb=data.frame(File=filelist,Label=labellist);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
41 colnames(xtb)=c("File","Label");
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
42 return (xtb);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
43 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
44
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
45
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
46 colors=c( "#E41A1C", "#377EB8", "#4DAF4A", "#984EA3", "#FF7F00", "#A65628", "#F781BF",
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
47 "#999999", "#66C2A5", "#FC8D62", "#8DA0CB", "#E78AC3", "#A6D854", "#FFD92F", "#E5C494", "#B3B3B3",
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
48 "#8DD3C7", "#FFFFB3", "#BEBADA", "#FB8072", "#80B1D3", "#FDB462", "#B3DE69", "#FCCDE5",
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
49 "#D9D9D9", "#BC80BD", "#CCEBC5", "#FFED6F");
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
50
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
51
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
52
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
53 genboxplot<-function(filename,...){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
54 #slmed=read.table(filename,header=T)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
55 slmed=read.table(filename,header=T)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
56 slmat=as.matrix(slmed[,c(-1,-2)])
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
57 slmat_log=log2(slmat+1)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
58
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
59 boxplot(slmat_log,pch='.',las=2,ylab='log2(read counts)',cex.axis=0.8,...)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
60 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
61
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
62
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
63 genhistplot<-function(filename,isfile=T,...){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
64 if(isfile){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
65 slmed=read.table(filename,header=T)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
66 }else{
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
67 slmed=filename;
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
68 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
69 tabsmat=as.matrix(log2(slmed[,c(-1,-2)]+1))
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
70 colnames(tabsmat)=colnames(slmed)[c(-1,-2)]
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
71 samplecol=colors[((1:ncol(tabsmat)) %% length(colors)) ]
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
72 if(ncol(tabsmat)>=1){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
73 histlist=lapply(1:ncol(tabsmat),function(X){ return (hist(tabsmat[,X],plot=F,breaks=40)) })
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
74 xrange=range(unlist(lapply(histlist,function(X){X$mids})))
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
75 yrange=range(unlist(lapply(histlist,function(X){X$counts})))
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
76 hst1=histlist[[1]]
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
77 plot(hst1$mids,hst1$counts,type='b',pch=20,xlim=c(0,xrange[2]*1.2),ylim=c(0,yrange[2]*1.2),xlab='log2(counts)',ylab='Frequency',main='Distribution of read counts',col = samplecol[1], ... )
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
78 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
79 if(ncol(tabsmat)>=2){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
80 for(i in 2:ncol(tabsmat)){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
81 hstn=histlist[[i]]
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
82 lines(hstn$mids,hstn$counts,type='b',pch=20,col=samplecol[i])
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
83 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
84 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
85 legend('topright',colnames(tabsmat),pch=20,lwd=1,col=samplecol)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
86 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
87
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
88
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
89
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
90 genclustering<-function(filename,...){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
91 #slmed=read.table(filename,header=T)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
92 slmed=read.table(filename,header=T)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
93 slmat=as.matrix(slmed[,c(-1,-2)])
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
94 slmat_log=log2(slmat+1)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
95
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
96 result=tryCatch({
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
97 library(gplots);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
98 heatmap.2(cor(slmat_log),trace = 'none',density.info = 'none',cexRow = 0.8,cexCol = 0.8,offsetRow = -0.2,offsetCol = -0.2)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
99 }, error=function(e){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
100 heatmap(cor(slmat_log),scale='none',cexRow = 0.8,cexCol = 0.8,cex.axis=0.8,...)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
101 });
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
102 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
103
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
104 ctfit_tx=0;
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
105
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
106
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
107 panel.plot<-function(x,y,textnames=names(x),...){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
108 par(new=TRUE)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
109 m<-cbind(x,y)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
110 plot(m,pch=20,xlim = range(x)*1.1,ylim=range(y)*1.1,...)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
111 text(x,y,textnames,...)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
112 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
113
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
114
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
115 genpcaplot<-function(filename,...){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
116 #slmed=read.table(filename,header=T)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
117 slmed=read.table(filename,header=T)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
118 slmat=as.matrix(slmed[,c(-1,-2)])
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
119 slmat_log=log2(slmat+1)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
120 ctfit_tx<<-prcomp(t(slmat_log),center=TRUE)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
121
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
122 # par(mfrow=c(2,1));
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
123 samplecol=colors[((1:ncol(slmat)) %% length(colors)) ]
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
124 # first 2 PCA
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
125 #plot(ctfit_tx$x[,1],ctfit_tx$x[,2],xlab='PC1',ylab='PC2',main='First 2 PCs',col=samplecol,xlim=1.1*range(ctfit_tx$x[,1]),ylim=1.1*range(ctfit_tx$x[,2]));
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
126 #text(ctfit_tx$x[,1],ctfit_tx$x[,2],rownames(ctfit_tx$x),col=samplecol);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
127 # par(mfrow=c(1,1));
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
128 if(length(samplecol)>2){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
129 pairs(ctfit_tx$x[,1:3],panel=panel.plot,textnames=rownames(ctfit_tx$x),main='First 3 principle components',col=samplecol)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
130 }else{
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
131 if(length(samplecol)>1){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
132 pairs(ctfit_tx$x[,1:2],panel=panel.plot,textnames=rownames(ctfit_tx$x),main='First 2 principle components',col=samplecol)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
133 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
134 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
135
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
136
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
137 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
138
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
139 genpcavar<-function(){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
140 # % variance
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
141 varpca=ctfit_tx$sdev^2
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
142 varpca=varpca/sum(varpca)*100;
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
143 if(length(varpca)>10){
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
144 varpca=varpca[1:10];
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
145 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
146 plot(varpca,type='b',lwd=2,pch=20,xlab='PCs',ylab='% Variance explained');
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
147 }
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
148
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
149 @
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
150
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
151 %__FILE_SUMMARY__
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
152
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
153 The statistics of comparisons are listed in Table 1 and Table 2.
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
154 The corresponding fastq files in each row are listed in Table 3.
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
155
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
156 <<label=tab1,echo=FALSE,results=tex>>=
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
157 library(xtable)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
158 filelist=c("input_0.gz");
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
159 labellist=c("test1_fastq_gz");
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
160 reads=c(2500);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
161 mappedreads=c(1453);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
162 totalsgrnas=c(2550);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
163 zerocounts=c(1276);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
164 giniindex=c(0.5266899931488773);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
165
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
166 cptable=genreporttable(filelist,labellist,reads,mappedreads);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
167 print(xtable(cptable, caption = "Summary of comparisons", label = "tab:one",
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
168 digits = c(0, 0, 0, 0,2),
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
169 align=c('c', 'c','c', 'c', 'c'),
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
170 table.placement = "tbp",
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
171 caption.placement = "top"))
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
172 @
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
173
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
174 <<label=tab2,echo=FALSE,results=tex>>=
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
175 library(xtable)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
176 cptable=genreporttable2(filelist,labellist,totalsgrnas,zerocounts,giniindex);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
177 print(xtable(cptable, caption = "Summary of comparisons", label = "tab:two",
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
178 digits = c(0, 0,0, 0,2),
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
179 align=c('c', 'c','c', 'c', 'c'),
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
180 table.placement = "tbp",
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
181 caption.placement = "top"))
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
182 @
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
183
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
184
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
185
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
186
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
187
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
188 <<label=tab3,echo=FALSE,results=tex>>=
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
189 library(xtable)
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
190 cptable=genreporttable3(filelist,labellist);
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
191 print(xtable(cptable, caption = "Summary of samples", label = "tab:three",
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
192 digits = c(0,0, 0),
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
193 align=c('c', 'p{9cm}', 'c'),
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
194 table.placement = "tbp",
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
195 caption.placement = "top"))
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
196 @
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
197
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
198
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
199
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
200
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
201 The meanings of the columns are as follows.
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
202
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
203 \begin{itemize}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
204 \item \textbf{Row}: The row number in the table;
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
205 \item \textbf{File}: The filename of fastq file;
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
206 \item \textbf{Label}: Assigned label;
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
207 \item \textbf{Reads}: The total read count in the fastq file;
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
208 \item \textbf{Mapped}: Reads that can be mapped to gRNA library;
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
209 \item \textbf{Percentage}: The percentage of mapped reads;
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
210 \item \textbf{TotalsgRNAs}: The number of sgRNAs in the library;
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
211 \item \textbf{ZeroCounts}: The number of sgRNA with 0 read counts;
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
212 \item \textbf{GiniIndex}: The Gini Index of the read count distribution. Gini index can be used to measure the evenness of the read counts, and a smaller value means a more even distribution of the read counts.
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
213 \end{itemize}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
214
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
215
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
216
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
217 \newpage\section{Normalized read count distribution of all samples}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
218 The following figure shows the distribution of median-normalized read counts in all samples.
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
219
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
220
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
221 <<fig=TRUE,echo=FALSE,width=4.5,height=4.5>>=
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
222 genboxplot("output.count_normalized.txt");
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
223 @
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
224
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
225 The following figure shows the histogram of median-normalized read counts in all samples.
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
226
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
227
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
228 <<fig=TRUE,echo=FALSE,width=4.5,height=4.5>>=
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
229 genhistplot("output.count_normalized.txt");
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
230 @
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
231
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
232 %__INDIVIDUAL_PAGE__
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
233
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
234
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
235
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
236 \end{document}
82a180e6b582 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
237