comparison pipe-t.R @ 18:2a6088c11d42 draft

planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
author davidecangelosi
date Tue, 28 May 2019 04:33:16 -0400
parents 81f51d722102
children 8503457bd0c4
comparison
equal deleted inserted replaced
17:81f51d722102 18:2a6088c11d42
56 kappa<- args[18] 56 kappa<- args[18]
57 macsp<-args[19] 57 macsp<-args[19]
58 outputIMP<-args[20] 58 outputIMP<-args[20]
59 59
60 DEAMethod<-args[21] 60 DEAMethod<-args[21]
61 if (DEAMethod=="ttest") { 61 if (DEAMethod=="ttest" || DEAMethod=="wtest") {
62 alternative<- args[22] 62 alternative<- args[22]
63 paired<-args[23] 63 paired<-args[23]
64 replicates<- args[24] 64 replicates<- args[24]
65 sort<-args[25] 65 sort<-args[25]
66 stringent<- args[26] 66 stringent<- args[26]
73 } 73 }
74 } else { 74 } else {
75 #mean, median, cubic 75 #mean, median, cubic
76 outputIMP<-args[18] 76 outputIMP<-args[18]
77 DEAMethod<-args[19] 77 DEAMethod<-args[19]
78 if (DEAMethod=="ttest") { 78 if (DEAMethod=="ttest" || DEAMethod=="wtest") {
79 alternative<- args[20] 79 alternative<- args[20]
80 paired<-args[21] 80 paired<-args[21]
81 replicates<- args[22] 81 replicates<- args[22]
82 sort<-args[23] 82 sort<-args[23]
83 stringent<- args[24] 83 stringent<- args[24]
101 kappa<- args[18] 101 kappa<- args[18]
102 macsp<-args[19] 102 macsp<-args[19]
103 outputIMP<-args[20] 103 outputIMP<-args[20]
104 104
105 DEAMethod<-args[21] 105 DEAMethod<-args[21]
106 if (DEAMethod=="ttest") { 106 if (DEAMethod=="ttest" || DEAMethod=="wtest") {
107 alternative<- args[22] 107 alternative<- args[22]
108 paired<-args[23] 108 paired<-args[23]
109 replicates<- args[24] 109 replicates<- args[24]
110 sort<-args[25] 110 sort<-args[25]
111 stringent<- args[26] 111 stringent<- args[26]
118 } 118 }
119 } else { 119 } else {
120 #mean, median, cubic 120 #mean, median, cubic
121 outputIMP<-args[18] 121 outputIMP<-args[18]
122 DEAMethod<-args[19] 122 DEAMethod<-args[19]
123 if (DEAMethod=="ttest") { 123 if (DEAMethod=="ttest" || DEAMethod=="wtest") {
124 alternative<- args[20] 124 alternative<- args[20]
125 paired<-args[21] 125 paired<-args[21]
126 replicates<- args[22] 126 replicates<- args[22]
127 sort<-args[23] 127 sort<-args[23]
128 stringent<- args[24] 128 stringent<- args[24]
147 kappa<- args[18] 147 kappa<- args[18]
148 macsp<-args[19] 148 macsp<-args[19]
149 outputIMP<-args[20] 149 outputIMP<-args[20]
150 150
151 DEAMethod<-args[21] 151 DEAMethod<-args[21]
152 if (DEAMethod=="ttest") { 152 if (DEAMethod=="ttest" || DEAMethod=="wtest") {
153 alternative<- args[22] 153 alternative<- args[22]
154 paired<-args[23] 154 paired<-args[23]
155 replicates<- args[24] 155 replicates<- args[24]
156 sort<-args[25] 156 sort<-args[25]
157 stringent<- args[26] 157 stringent<- args[26]
164 } 164 }
165 } else { 165 } else {
166 #mean, median, cubic 166 #mean, median, cubic
167 outputIMP<-args[18] 167 outputIMP<-args[18]
168 DEAMethod<-args[19] 168 DEAMethod<-args[19]
169 if (DEAMethod=="ttest") { 169 if (DEAMethod=="ttest" || DEAMethod=="wtest") {
170 alternative<- args[20] 170 alternative<- args[20]
171 paired<-args[21] 171 paired<-args[21]
172 replicates<- args[22] 172 replicates<- args[22]
173 sort<-args[23] 173 sort<-args[23]
174 stringent<- args[24] 174 stringent<- args[24]
196 macsp<-args[17] 196 macsp<-args[17]
197 outputIMP<-args[18] 197 outputIMP<-args[18]
198 198
199 DEAMethod<-args[19] 199 DEAMethod<-args[19]
200 200
201 if (DEAMethod=="ttest") { 201 if (DEAMethod=="ttest" || DEAMethod=="wtest") {
202 alternative<- args[20] 202 alternative<- args[20]
203 paired<-args[21] 203 paired<-args[21]
204 replicates<- args[22] 204 replicates<- args[22]
205 sort<-args[23] 205 sort<-args[23]
206 stringent<- args[24] 206 stringent<- args[24]
213 } 213 }
214 } else { 214 } else {
215 #mean, median, cubic 215 #mean, median, cubic
216 outputIMP<-args[16] 216 outputIMP<-args[16]
217 DEAMethod<-args[17] 217 DEAMethod<-args[17]
218 if (DEAMethod=="ttest") { 218 if (DEAMethod=="ttest" || DEAMethod=="wtest") {
219 alternative<- args[18] 219 alternative<- args[18]
220 paired<-args[19] 220 paired<-args[19]
221 replicates<- args[20] 221 replicates<- args[20]
222 sort<-args[21] 222 sort<-args[21]
223 stringent<- args[22] 223 stringent<- args[22]
866 cat("\n Nothing to impute! \n") 866 cat("\n Nothing to impute! \n")
867 } 867 }
868 868
869 write.table(exprs(qFiltNAs), file=outputRemaining, quote=FALSE, row.names=TRUE, col.names=TRUE, sep = "\t") 869 write.table(exprs(qFiltNAs), file=outputRemaining, quote=FALSE, row.names=TRUE, col.names=TRUE, sep = "\t")
870 870
871 switch(DEAMethod,
872 "ttest"={
873 #Differential expression analysis (paired t test+BH). Returns Fold change in linear scale.
874 DEG<-ttestCtData(qFiltNAs, groups = files$Treatment, alternative = alternative, paired = ifelse(paired=="TRUE", TRUE, FALSE), replicates =ifelse(replicates=="TRUE", TRUE, FALSE), sort=ifelse(sort=="TRUE", TRUE, FALSE), stringent=ifelse(stringent=="TRUE", TRUE, FALSE), p.adjust=padjust)
875 write.table(DEG, file=outputDEA, quote=FALSE, row.names=TRUE, col.names=TRUE,sep = "\t")
876 },
877 "wtest"={
878 DEG<-mannwhitneyCtData(qFiltNAs, groups = files$Treatment, alternative = alternative, paired = ifelse(paired=="TRUE", TRUE, FALSE), replicates =ifelse(replicates=="TRUE", TRUE, FALSE), sort=ifelse(sort=="TRUE", TRUE, FALSE), stringent=ifelse(stringent=="TRUE", TRUE, FALSE), p.adjust=padjust)
879 write.table(DEG, file=outputDEA, quote=FALSE, row.names=TRUE, col.names=TRUE,sep = "\t")
880 },
881 "rp"={
882 DEG<-RP(exprs(qFiltNAs), as.numeric(pData(qFiltNAs)$Treatment)-1, num.perm = 1000,logged = TRUE, gene.names = featureNames(qFiltNAs), huge=TRUE, plot = FALSE, rand = 123)
883 write.table(DEG[1:5], file=outputDEA, quote=FALSE, row.names=TRUE, col.names=TRUE,sep = "\t")
884 },
885 stop("Enter something that switches me!")
886 )
887
871 if (DEAMethod=="ttest") { 888 if (DEAMethod=="ttest") {
872 #Differential expression analysis (paired t test+BH). Returns Fold change in linear scale. 889 #Differential expression analysis (paired t test+BH). Returns Fold change in linear scale.
873 DEG<-ttestCtData(qFiltNAs, groups = files$Treatment, alternative = alternative, paired = ifelse(paired=="TRUE", TRUE, FALSE), replicates =ifelse(replicates=="TRUE", TRUE, FALSE), sort=ifelse(sort=="TRUE", TRUE, FALSE), stringent=ifelse(stringent=="TRUE", TRUE, FALSE), p.adjust=padjust) 890 DEG<-ttestCtData(qFiltNAs, groups = files$Treatment, alternative = alternative, paired = ifelse(paired=="TRUE", TRUE, FALSE), replicates =ifelse(replicates=="TRUE", TRUE, FALSE), sort=ifelse(sort=="TRUE", TRUE, FALSE), stringent=ifelse(stringent=="TRUE", TRUE, FALSE), p.adjust=padjust)
874 write.table(DEG, file=outputDEA, quote=FALSE, row.names=TRUE, col.names=TRUE,sep = "\t") 891 write.table(DEG, file=outputDEA, quote=FALSE, row.names=TRUE, col.names=TRUE,sep = "\t")
875 } 892 }