annotate AskoR_DE.R @ 0:ceef9bc6bbc7 draft

planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
author genouest
date Thu, 12 Apr 2018 05:23:45 -0400
parents
children 877d2be25a6a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
1 askor_path<-Sys.getenv("ASKOR_PATH")
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
2 source(paste0(askor_path,"/AskoR.R"))
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
3
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
4 ##############################################
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
5 ## Parameters ##
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
6 ##############################################
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
7
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
8 parameters<-Asko_start()
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
9 setwd(parameters$dir_path)
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
10 # source("/home/flegeai/local/askoR/askoStart.R")
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
11 #parameters$col_genes=1
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
12 #parameters$col_counts=7
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
13 # parameters$regex=FALSE
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
14 #parameters$rm_sample=list("T0_4", "T1K_4", "T1A_4", "T2A_4", "T2K_4", "T3K_4", "T3A_4")
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
15 # #parameters$select_sample=c("T0_4", "T1K_4", "T1A_4", "T2A_4", "T2K_4", "T3K_4", "T3A_4")
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
16 # #parameters$rm_sample=list("_4")
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
17 # parameters$organism = "Ap"
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
18 # parameters$fileofcount = NULL
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
19 # parameters$annotation_file = "annotation.txt"
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
20 # parameters$sample_file = "Samples.txt"
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
21 # parameters$contrast_file = "Contrasts.txt"
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
22 # parameters$mk_context="manual"
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
23 # parameters$glm="qlf"
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
24
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
25
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
26 ########################################
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
27 ## Loading the data from the samples ##+
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
28 ########################################
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
29
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
30 data<-loadData(parameters)
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
31 cat("Total number of genes : ", dim(data$dge$counts)[1], "\n")
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
32 cat("Total number of samples : ", dim(data$dge$counts)[2], "\n")
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
33 cat("summary of CPM by samples\n")
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
34 summary(cpm(data$dge))
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
35 pdf(parameters$output_pdf)
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
36 asko_data<-asko3c(data)
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
37 cat("Filtering genes with more than ", parameters$threshold_cpm, " CPM in ",parameters$replicate_cpm,"samples\n")
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
38 asko_filt<-GEfilt(data$dge, parameters)
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
39 cat("Total number of filtered genes : ", dim(asko_filt$counts)[1], "\n")
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
40 asko_norm<-GEnorm(asko_filt,parameters)
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
41 GEcorr(asko_norm,parameters)
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
42 cat("Statistical analysis\n")
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
43 DEanalysis(asko_norm,data, asko_data,parameters)
ceef9bc6bbc7 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/askor commit 08a187f91ba050d584e586d2fcc99d984dac607c
genouest
parents:
diff changeset
44 dev.off()