annotate test-data/output_countsummary.Rnw @ 2:9527a3d6ebd2 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:29 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
9527a3d6ebd2 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
9527a3d6ebd2 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
9527a3d6ebd2 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 "#__".
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
4 \documentclass{article}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
5
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
6 \usepackage{amsmath}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
7 \usepackage{amscd}
9527a3d6ebd2 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}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
9 \usepackage{ifthen}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
10 \usepackage{fullpage}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
11 \usepackage[utf8]{inputenc}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
12 % \usepackage{longtable}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
13
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
14 \begin{document}
9527a3d6ebd2 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}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
16
9527a3d6ebd2 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}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
18 \author{Wei Li}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
19
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
20 \maketitle
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
21
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
22
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
23 \tableofcontents
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
24
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
25 \section{Summary}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
26
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
27 %Function definition
9527a3d6ebd2 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>>=
9527a3d6ebd2 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){
9527a3d6ebd2 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);
9527a3d6ebd2 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");
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
32 return (xtb);
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
33 }
9527a3d6ebd2 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){
9527a3d6ebd2 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);
9527a3d6ebd2 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");
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
37 return (xtb);
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
38 }
9527a3d6ebd2 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){
9527a3d6ebd2 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);
9527a3d6ebd2 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");
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
42 return (xtb);
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
43 }
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
44
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
45
9527a3d6ebd2 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",
9527a3d6ebd2 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",
9527a3d6ebd2 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",
9527a3d6ebd2 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");
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
50
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
51
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
52
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
53 genboxplot<-function(filename,...){
9527a3d6ebd2 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)
9527a3d6ebd2 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)
9527a3d6ebd2 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)])
9527a3d6ebd2 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)
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
58
9527a3d6ebd2 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,...)
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
60 }
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
61
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
62
9527a3d6ebd2 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,...){
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
64 if(isfile){
9527a3d6ebd2 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)
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
66 }else{
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
67 slmed=filename;
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
68 }
9527a3d6ebd2 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))
9527a3d6ebd2 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)]
9527a3d6ebd2 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)) ]
9527a3d6ebd2 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){
9527a3d6ebd2 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)) })
9527a3d6ebd2 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})))
9527a3d6ebd2 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})))
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
76 hst1=histlist[[1]]
9527a3d6ebd2 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], ... )
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
78 }
9527a3d6ebd2 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){
9527a3d6ebd2 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)){
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
81 hstn=histlist[[i]]
9527a3d6ebd2 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])
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
83 }
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
84 }
9527a3d6ebd2 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)
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
86 }
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
87
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
88
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
89
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
90 genclustering<-function(filename,...){
9527a3d6ebd2 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)
9527a3d6ebd2 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)
9527a3d6ebd2 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)])
9527a3d6ebd2 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)
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
95
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
96 result=tryCatch({
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
97 library(gplots);
9527a3d6ebd2 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)
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
99 }, error=function(e){
9527a3d6ebd2 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,...)
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
101 });
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
102 }
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
103
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
104 ctfit_tx=0;
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
105
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
106
9527a3d6ebd2 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),...){
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
108 par(new=TRUE)
9527a3d6ebd2 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)
9527a3d6ebd2 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,...)
9527a3d6ebd2 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,...)
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
112 }
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
113
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
114
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
115 genpcaplot<-function(filename,...){
9527a3d6ebd2 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)
9527a3d6ebd2 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)
9527a3d6ebd2 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)])
9527a3d6ebd2 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)
9527a3d6ebd2 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)
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
121
9527a3d6ebd2 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));
9527a3d6ebd2 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)) ]
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
124 # first 2 PCA
9527a3d6ebd2 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]));
9527a3d6ebd2 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);
9527a3d6ebd2 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));
9527a3d6ebd2 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){
9527a3d6ebd2 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)
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
130 }else{
9527a3d6ebd2 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){
9527a3d6ebd2 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)
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
133 }
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
134 }
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
135
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
136
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
137 }
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
138
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
139 genpcavar<-function(){
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
140 # % variance
9527a3d6ebd2 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
9527a3d6ebd2 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;
9527a3d6ebd2 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){
9527a3d6ebd2 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];
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
145 }
9527a3d6ebd2 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');
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
147 }
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
148
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
149 @
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
150
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
151 %__FILE_SUMMARY__
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
152
9527a3d6ebd2 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.
9527a3d6ebd2 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.
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
155
9527a3d6ebd2 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>>=
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
157 library(xtable)
9527a3d6ebd2 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");
9527a3d6ebd2 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");
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
160 reads=c(2500);
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
161 mappedreads=c(1453);
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
162 totalsgrnas=c(2550);
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
163 zerocounts=c(1276);
9527a3d6ebd2 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);
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
165
9527a3d6ebd2 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);
9527a3d6ebd2 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",
9527a3d6ebd2 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),
9527a3d6ebd2 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'),
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
170 table.placement = "tbp",
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
171 caption.placement = "top"))
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
172 @
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
173
9527a3d6ebd2 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>>=
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
175 library(xtable)
9527a3d6ebd2 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);
9527a3d6ebd2 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",
9527a3d6ebd2 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),
9527a3d6ebd2 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'),
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
180 table.placement = "tbp",
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
181 caption.placement = "top"))
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
182 @
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
183
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
184
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
185
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
186
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
187
9527a3d6ebd2 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>>=
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
189 library(xtable)
9527a3d6ebd2 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);
9527a3d6ebd2 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",
9527a3d6ebd2 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),
9527a3d6ebd2 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'),
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
194 table.placement = "tbp",
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
195 caption.placement = "top"))
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
196 @
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
197
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
198
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
199
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
200
9527a3d6ebd2 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.
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
202
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
203 \begin{itemize}
9527a3d6ebd2 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;
9527a3d6ebd2 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;
9527a3d6ebd2 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;
9527a3d6ebd2 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;
9527a3d6ebd2 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;
9527a3d6ebd2 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;
9527a3d6ebd2 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;
9527a3d6ebd2 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;
9527a3d6ebd2 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.
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
213 \end{itemize}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
214
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
215
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
216
9527a3d6ebd2 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}
9527a3d6ebd2 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.
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
219
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
220
9527a3d6ebd2 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>>=
9527a3d6ebd2 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");
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
223 @
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
224
9527a3d6ebd2 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.
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
226
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
227
9527a3d6ebd2 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>>=
9527a3d6ebd2 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");
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
230 @
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
231
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
232 %__INDIVIDUAL_PAGE__
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
233
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
234
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
235
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
236 \end{document}
9527a3d6ebd2 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mageck commit 49e456dda49db1f52fc876f406a10273a408b1a2
iuc
parents:
diff changeset
237