changeset 2:877d2be25a6a draft default tip

planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 994ecff7807bb0eb9dac740d67ad822415b0b464
author genouest
date Thu, 19 Apr 2018 03:44:31 -0400
parents 6bbc90a11c3f
children
files AskoR.R AskoR_DE.R askor_de.xml test-data/out.pdf
diffstat 4 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/AskoR.R	Wed Apr 18 06:26:17 2018 -0400
+++ b/AskoR.R	Thu Apr 19 03:44:31 2018 -0400
@@ -278,13 +278,17 @@
   colnames(ASKOlist$stat.table)[colnames(ASKOlist$stat.table)=="contrast"] <- paste("measured_in", "Contrast", sep="@") # header formatting for askomics
   o <- order(ASKOlist$stat.table$FDR)                                                                                   # ordering genes by FDR value
   ASKOlist$stat.table<-ASKOlist$stat.table[o,]
+  
   #
   dir.create(parameters$out_dir)
   write.table(ASKOlist$stat.table,paste0(parameters$out_dir,"/", parameters$organism, contrasko, ".txt"),                                    #
               sep=parameters$sep, col.names = T, row.names = F, quote=FALSE)
-
+  
+  
   if(parameters$heatmap==TRUE){
-    cpm_gstats<-cpm(dge, log=TRUE)[o,][1:parameters$numhigh,]
+    numhigh=parameters$numhigh
+    if (numhigh>length(o)) {numhigh=length(o)}
+    cpm_gstats<-cpm(dge, log=TRUE)[o,][1:numhigh,]
     heatmap.2(cpm_gstats, cexRow=0.5, cexCol=0.8, scale="row", labCol=dge$samples$Name, xlab=contrast, Rowv = FALSE, dendrogram="col")
   }
 
@@ -362,6 +366,7 @@
     select_counts<-row.names(samples)
     #countT<-count[,c(parameters$col_counts:length(colnames(count)))]
     countT<-count[,select_counts]
+    #print(countT)
     dge<-DGEList(counts=countT, samples=samples)
     # if(is.null(parameters$select_sample)==FALSE){
     #   slct<-grep(parameters$select_sample, colnames(countT))
@@ -480,7 +485,8 @@
 }
 
 GEnorm <- function(filtered_GE, parameters){
-  filtered_cpm <- cpm(filtered_GE, log=TRUE)   #nouveau calcul Cpm sur donn?es filtr?es, si log=true alors valeurs cpm en log2
+  filtered_cpm=log2(1000000*filtered_GE$counts/colSums(filtered_GE$counts))
+  #filtered_cpm <- cpm(filtered_GE, log=TRUE, normalized.lib.sizes=TRUE)   #nouveau calcul Cpm sur donn?es filtr?es, si log=true alors valeurs cpm en log2
   colnames(filtered_cpm)<-rownames(filtered_GE$samples)
   boxplot(filtered_cpm,
           col=filtered_GE$samples$color,         #boxplot des scores cpm non normalis?s
@@ -509,7 +515,7 @@
   cormat<-cor(lcpm)
  # color<- colorRampPalette(c("yellow", "white", "green"))(20)
   color<-colorRampPalette(c("black","red","yellow","white"),space="rgb")(28)
-  heatmap(cormat, col=color, symm=TRUE,RowSideColors =as.character(dge$samples$color), ColSideColors = as.character(dge$samples$color))
+  heatmap.2(cormat, col=color, symm=TRUE,RowSideColors =as.character(dge$samples$color), ColSideColors = as.character(dge$samples$color))
   #MDS
   mds <- cmdscale(dist(t(lcpm)),k=3, eig=TRUE)
   eigs<-round((mds$eig)*100/sum(mds$eig[mds$eig>0]),2)
--- a/AskoR_DE.R	Wed Apr 18 06:26:17 2018 -0400
+++ b/AskoR_DE.R	Thu Apr 19 03:44:31 2018 -0400
@@ -2,7 +2,7 @@
 source(paste0(askor_path,"/AskoR.R"))
 
 ##############################################
-##                Parameters                ##
+##                Parameters                ##  
 ##############################################
 
 parameters<-Asko_start()
@@ -31,7 +31,7 @@
 cat("Total number of genes : ", dim(data$dge$counts)[1], "\n")
 cat("Total number of samples : ", dim(data$dge$counts)[2], "\n")
 cat("summary of CPM by samples\n")
-summary(cpm(data$dge))
+summary(cpm(data$dge, normalized.lib.sizes=FALSE))
 pdf(parameters$output_pdf)
 asko_data<-asko3c(data)
 cat("Filtering genes with more than ", parameters$threshold_cpm, " CPM in ",parameters$replicate_cpm,"samples\n")
@@ -42,3 +42,5 @@
 cat("Statistical analysis\n")
 DEanalysis(asko_norm,data, asko_data,parameters)
 dev.off()
+
+
--- a/askor_de.xml	Wed Apr 18 06:26:17 2018 -0400
+++ b/askor_de.xml	Thu Apr 19 03:44:31 2018 -0400
@@ -59,7 +59,7 @@
           #end if
     ]]></command>
     <inputs>
-        <param format="tabular,csv" name="fileofcounts" type="data" label="File of counts" />
+        <param format="tabular,tsv,csv" name="fileofcounts" type="data" label="File of counts" />
         <param format="tabular,tsv" name="samples" type="data" label="Descriptions of the samples" />
         <param format="tabular,tsv" name="contrasts" type="data" label="Descriptions of the contrasts" />
         <section name="adv" title="Format options" expanded="false">
Binary file test-data/out.pdf has changed