Mercurial > repos > davidecangelosi > pipe_t
annotate pipe-t.R @ 24:6ae13912ab03 draft
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit a642a9310fd2d16488b42aef5e0cde8124e978e3
author | davidecangelosi |
---|---|
date | Wed, 29 May 2019 07:32:50 -0400 |
parents | 465e643e1ea1 |
children | f008adc272a2 |
rev | line source |
---|---|
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
1 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
2 cat("\n Started! \n") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
3 #sessionInfo() |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
4 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
5 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
6 # Send R errors to stderr |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
7 options(show.error.messages = F, error = function(){cat(geterrmessage(), file = stderr()); q("no", 1, F)}) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
8 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
9 # Avoid crashing Galaxy with an UTF8 error on German LC settings |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
10 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
11 suppressPackageStartupMessages({ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
12 library(HTqPCR) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
13 library(base) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
14 library(Biobase) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
15 library(utils) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
16 library(stats) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
17 library(graphics) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
18 library(grDevices) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
19 library(RColorBrewer) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
20 library(limma) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
21 library(RankProd) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
22 library(methods) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
23 library(impute) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
24 library(BBmisc) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
25 library(affy) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
26 library(psych) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
27 library(zoo) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
28 library(Hmisc) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
29 }) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
30 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
31 cat("\n R libraries...loaded!\n") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
32 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
33 args = commandArgs(trailingOnly=TRUE) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
34 dpfiles<-basename(args[1]) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
35 path000<-dirname(args[1]) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
36 format<-args[2] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
37 nfeatures<-args[3] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
38 rawout<-args[4] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
39 path <- args[5] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
40 dcCtmin<-args[6] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
41 dcCtmax<-args[7] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
42 dcflag<-args[8] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
43 x<-args[9] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
44 normalizationMethod<-args[10] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
45 if (normalizationMethod=="deltaCt") { |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
46 submethod<-args[11] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
47 switch(submethod, |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
48 "userdefined"={ |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
49 normalizers<-args[12] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
50 outputNorm<-args[13] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
51 outputECDF<-args[14] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
52 percentofnastoremove<-args[15] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
53 outputRemaining<-args[16] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
54 imputeMethod<-args[17] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
55 if (imputeMethod=="knn") { |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
56 kappa<- args[18] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
57 macsp<-args[19] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
58 outputIMP<-args[20] |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
59 |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
60 DEAMethod<-args[21] |
18
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
61 if (DEAMethod=="ttest" || DEAMethod=="wtest") { |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
62 alternative<- args[22] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
63 paired<-args[23] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
64 replicates<- args[24] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
65 sort<-args[25] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
66 stringent<- args[26] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
67 padjust<-args[27] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
68 outputDEA<-args[28] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
69 filtnames<-args[29] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
70 } else { |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
71 outputDEA<-args[22] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
72 filtnames<-args[23] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
73 } |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
74 } else { |
10
bc5697f41720
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 2c7880131d5a3ca88ddc31e2a52a12fa17774178
davidecangelosi
parents:
9
diff
changeset
|
75 #mean, median, cubic |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
76 outputIMP<-args[18] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
77 DEAMethod<-args[19] |
18
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
78 if (DEAMethod=="ttest" || DEAMethod=="wtest") { |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
79 alternative<- args[20] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
80 paired<-args[21] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
81 replicates<- args[22] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
82 sort<-args[23] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
83 stringent<- args[24] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
84 padjust<-args[25] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
85 outputDEA<-args[26] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
86 filtnames<-args[27] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
87 } else { |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
88 outputDEA<-args[20] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
89 filtnames<-args[21] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
90 } |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
91 } |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
92 }, |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
93 "genorm"={ |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
94 user_number<-as.numeric(args[12]) |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
95 outputNorm<-args[13] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
96 outputECDF<-args[14] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
97 percentofnastoremove<-args[15] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
98 outputRemaining<-args[16] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
99 imputeMethod<-args[17] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
100 if (imputeMethod=="knn") { |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
101 kappa<- args[18] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
102 macsp<-args[19] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
103 outputIMP<-args[20] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
104 |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
105 DEAMethod<-args[21] |
18
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
106 if (DEAMethod=="ttest" || DEAMethod=="wtest") { |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
107 alternative<- args[22] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
108 paired<-args[23] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
109 replicates<- args[24] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
110 sort<-args[25] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
111 stringent<- args[26] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
112 padjust<-args[27] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
113 outputDEA<-args[28] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
114 filtnames<-args[29] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
115 } else { |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
116 outputDEA<-args[22] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
117 filtnames<-args[23] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
118 } |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
119 } else { |
10
bc5697f41720
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 2c7880131d5a3ca88ddc31e2a52a12fa17774178
davidecangelosi
parents:
9
diff
changeset
|
120 #mean, median, cubic |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
121 outputIMP<-args[18] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
122 DEAMethod<-args[19] |
18
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
123 if (DEAMethod=="ttest" || DEAMethod=="wtest") { |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
124 alternative<- args[20] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
125 paired<-args[21] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
126 replicates<- args[22] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
127 sort<-args[23] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
128 stringent<- args[24] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
129 padjust<-args[25] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
130 outputDEA<-args[26] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
131 filtnames<-args[27] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
132 } else { |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
133 outputDEA<-args[20] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
134 filtnames<-args[21] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
135 } |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
136 } |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
137 |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
138 }, |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
139 "normfinder"={ |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
140 user_number<-as.numeric(args[12]) |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
141 outputNorm<-args[13] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
142 outputECDF<-args[14] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
143 percentofnastoremove<-args[15] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
144 outputRemaining<-args[16] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
145 imputeMethod<-args[17] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
146 if (imputeMethod=="knn") { |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
147 kappa<- args[18] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
148 macsp<-args[19] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
149 outputIMP<-args[20] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
150 |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
151 DEAMethod<-args[21] |
18
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
152 if (DEAMethod=="ttest" || DEAMethod=="wtest") { |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
153 alternative<- args[22] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
154 paired<-args[23] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
155 replicates<- args[24] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
156 sort<-args[25] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
157 stringent<- args[26] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
158 padjust<-args[27] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
159 outputDEA<-args[28] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
160 filtnames<-args[29] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
161 } else { |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
162 outputDEA<-args[22] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
163 filtnames<-args[23] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
164 } |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
165 } else { |
10
bc5697f41720
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 2c7880131d5a3ca88ddc31e2a52a12fa17774178
davidecangelosi
parents:
9
diff
changeset
|
166 #mean, median, cubic |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
167 outputIMP<-args[18] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
168 DEAMethod<-args[19] |
18
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
169 if (DEAMethod=="ttest" || DEAMethod=="wtest") { |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
170 alternative<- args[20] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
171 paired<-args[21] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
172 replicates<- args[22] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
173 sort<-args[23] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
174 stringent<- args[24] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
175 padjust<-args[25] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
176 outputDEA<-args[26] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
177 filtnames<-args[27] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
178 } else { |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
179 outputDEA<-args[20] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
180 filtnames<-args[21] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
181 } |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
182 } |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
183 |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
184 }, |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
185 stop("Enter something that switches me!") |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
186 ) |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
187 }else { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
188 outputNorm<-args[11] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
189 outputECDF<-args[12] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
190 percentofnastoremove<-args[13] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
191 outputRemaining<-args[14] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
192 imputeMethod<-args[15] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
193 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
194 if (imputeMethod=="knn") { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
195 kappa<- args[16] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
196 macsp<-args[17] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
197 outputIMP<-args[18] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
198 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
199 DEAMethod<-args[19] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
200 |
18
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
201 if (DEAMethod=="ttest" || DEAMethod=="wtest") { |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
202 alternative<- args[20] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
203 paired<-args[21] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
204 replicates<- args[22] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
205 sort<-args[23] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
206 stringent<- args[24] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
207 padjust<-args[25] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
208 outputDEA<-args[26] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
209 filtnames<-args[27] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
210 } else { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
211 outputDEA<-args[20] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
212 filtnames<-args[21] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
213 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
214 } else { |
10
bc5697f41720
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 2c7880131d5a3ca88ddc31e2a52a12fa17774178
davidecangelosi
parents:
9
diff
changeset
|
215 #mean, median, cubic |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
216 outputIMP<-args[16] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
217 DEAMethod<-args[17] |
18
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
218 if (DEAMethod=="ttest" || DEAMethod=="wtest") { |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
219 alternative<- args[18] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
220 paired<-args[19] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
221 replicates<- args[20] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
222 sort<-args[21] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
223 stringent<- args[22] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
224 padjust<-args[23] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
225 outputDEA<-args[24] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
226 filtnames<-args[25] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
227 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
228 } else { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
229 outputDEA<-args[18] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
230 filtnames<-args[19] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
231 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
232 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
233 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
234 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
235 cat("\n Initialization completed! \n") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
236 |
2
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
237 .readCtEDS <- |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
238 function(readfile=readfile, n.data=n.data, i=i, nspots=nspots, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
239 { |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
240 # Scan through beginning of file, max 100 lines |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
241 file.header <- readLines(con=readfile, n=100) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
242 n.header <- grep("^Well", file.header) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
243 if (length(n.header)==0) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
244 n.header <- 0 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
245 # Read data, skip the required lines |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
246 out <- read.delim(file=readfile, header=TRUE, colClasses="character", nrows=nspots*n.data[i], skip=n.header-1, strip.white=TRUE, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
247 out |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
248 } # .readCtEDS |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
249 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
250 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
251 .readCtPlain <- |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
252 function(readfile=readfile, header=header, n.features=n.features, n.data=n.data, i=i, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
253 { |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
254 # A check for file dimensions. Read a single file. |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
255 sample <- read.delim(file=readfile, header=header, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
256 nspots <- nrow(sample) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
257 if (nspots != n.features*n.data[1]) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
258 warning(paste(n.features, "gene names (rows) expected, got", nspots)) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
259 # Read in the required file |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
260 out <- read.delim(file=readfile, header=header, colClasses="character", nrows=nspots*n.data[i], ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
261 # Return |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
262 out |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
263 } # .readCtPlain |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
264 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
265 .readCtSDS <- |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
266 function(readfile=readfile, n.data=n.data, i=i, nspots=nspots, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
267 { |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
268 # Scan through beginning of file, max 100 lines |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
269 file.header <- readLines(con=readfile, n=100) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
270 n.header <- grep("^#", file.header) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
271 if (length(n.header)==0) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
272 n.header <- 0 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
273 # Read data, skip the required lines |
15
5e8bf316343d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d5c46b42061ff823c19437d1c803119ef8b95627
davidecangelosi
parents:
14
diff
changeset
|
274 out <- read.delim(file=readfile, header=TRUE, colClasses="character", nrows=nspots*n.data[i], skip=n.header-1, strip.white=TRUE, ...) |
2
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
275 # Return |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
276 out |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
277 } # .readCtSDS |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
278 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
279 .readCtLightCycler <- |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
280 function(readfile=readfile, n.data=n.data, i=i, nspots=nspots, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
281 { |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
282 # Read data, skip the required lines |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
283 out <- read.delim(file=readfile, header=TRUE, as.is=TRUE, nrows=nspots*n.data[i], skip=1, strip.white=TRUE, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
284 # Return |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
285 out |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
286 } # .readCtLightCycler |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
287 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
288 .readCtCFX <- function(readfile=readfile, n.data=n.data, i=i, nspots=nspots, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
289 { |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
290 # Read data, skip the required lines |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
291 out <- read.csv(file=readfile, header=TRUE, as.is=TRUE, nrows=nspots*n.data[i], strip.white=TRUE, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
292 # Return |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
293 out |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
294 } # .readCtCFX |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
295 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
296 .readCtOpenArray <- |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
297 function(readfile=readfile, n.data=n.data, i=i, nspots=nspots, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
298 { |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
299 # Read data |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
300 out <- read.csv(file=readfile, header=TRUE, as.is=TRUE, nrows=nspots*n.data[i], strip.white=TRUE, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
301 # Regard those marked as outliers as "Unreliable" |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
302 out$ThroughHole.Outlier[out$ThroughHole.Outlier=="False"] <- "OK" |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
303 out$ThroughHole.Outlier[out$ThroughHole.Outlier=="True"] <- "Unreliable" |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
304 # Return |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
305 out |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
306 } # .readCtOpenArray |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
307 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
308 .readCtBioMark <- |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
309 function(readfile=readfile, n.data=n.data, i=i, nspots=nspots, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
310 { |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
311 # Scan through beginning of file, max 100 lines |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
312 file.header <- readLines(con=readfile, n=100) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
313 n.header <- grep("^ID", file.header)-1 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
314 if (length(n.header)==0) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
315 n.header <- 0 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
316 # Read data, skip the required lines |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
317 out <- read.csv(file=readfile, header=TRUE, as.is=TRUE, nrows=nspots*n.data[i], skip=n.header, strip.white=TRUE, ...) |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
318 # Convert the calls into flags |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
319 out$Call[out$Call=="Pass"] <- "OK" |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
320 out$Call[out$Call=="Fail"] <- "Undetermined" |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
321 # Return |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
322 out |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
323 } # .readCtBioMark |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
324 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
325 |
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
326 |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
327 readCtDataDav<- |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
328 function (files, path = NULL, n.features = 384, format = "plain", |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
329 column.info, flag, feature, type, position, Ct, header = FALSE, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
330 SDS = FALSE, n.data = 1, samples, na.value = 40, sample.info, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
331 ...) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
332 { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
333 if (missing(files)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
334 stop("No input files specified") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
335 if (length(files) != length(n.data) & length(n.data) != 1) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
336 stop("n.data must either be a single integer, or same length as number of files") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
337 if (length(n.data) == 1) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
338 n.data <- rep(n.data, length(files)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
339 nsamples <- sum(n.data) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
340 ncum <- cumsum(n.data) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
341 s.names <- NULL |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
342 nspots <- n.features |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
343 if (SDS) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
344 warning("Please use format='SDS'. The SDS' parameter is retained for backward compatibility only.") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
345 format <- "SDS" |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
346 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
347 if (!missing(flag) | !missing(feature) | !missing(type) | |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
348 !missing(position) | !missing(Ct)) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
349 warning("Please use 'column.info' for providing a list of column numbers containing particular information. The use of 'flag', 'feature', 'type', 'position' and 'Ct' is deprecated and will be removed in future versions.") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
350 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
351 if (missing(column.info)) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
352 column.info <- switch(format, EDS = list(flag="EXPFAIL", feature="Target.Name", position="Well.Position", Ct="CT"), |
4
e248cd7769e8
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit fe7763760d58ae2b51441b67162bb5f86cffa91e
davidecangelosi
parents:
3
diff
changeset
|
353 plain = list(flag = 4, feature = 6, type = 7, position = 3, Ct = 8), |
15
5e8bf316343d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d5c46b42061ff823c19437d1c803119ef8b95627
davidecangelosi
parents:
14
diff
changeset
|
354 #SDS = list(flag = 4,feature = 6, type = 7, position = 3, Ct = 8), |
17
81f51d722102
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit e398b5c7a84d650a355ab3a7fbff2757f7a1ca78
davidecangelosi
parents:
16
diff
changeset
|
355 SDS = list(flag = "Omit",feature = "Detector", type = "Task", Ct = "Avg.Ct"), |
4
e248cd7769e8
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit fe7763760d58ae2b51441b67162bb5f86cffa91e
davidecangelosi
parents:
3
diff
changeset
|
356 LightCycler = list(feature = "Name", |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
357 position = "Pos", Ct = "Cp"), CFX = list(feature = "Content", |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
358 position = "Well", Ct = "Cq.Mean"), OpenArray = list(flag = "ThroughHole.Outlier", |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
359 feature = "Assay.Assay.ID", type = "Assay.Assay.Type", |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
360 position = "ThroughHole.Address", Ct = "ThroughHole.Ct"), |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
361 BioMark = list(flag = "Call", feature = "Name.1", |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
362 position = "ID", Ct = "Value")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
363 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
364 X <- matrix(0, nspots, nsamples) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
365 X.flags <- as.data.frame(X) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
366 X.cat <- data.frame(matrix("OK", ncol = nsamples, nrow = nspots), |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
367 stringsAsFactors = FALSE) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
368 for (i in seq_along(files)) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
369 if (i == 1) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
370 cols <- 1:ncum[i] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
371 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
372 else { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
373 cols <- (ncum[i - 1] + 1):ncum[i] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
374 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
375 readfile <- ifelse(is.null(path), files[i], file.path(path, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
376 files[i])) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
377 sample <- switch(format, EDS =.readCtEDS(readfile = readfile, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
378 n.data = n.data, i = i, nspots = nspots, ...), plain = .readCtPlain(readfile = readfile, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
379 header = header, n.features = n.features, n.data = n.data, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
380 i = i, ...), SDS = .readCtSDS(readfile = readfile, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
381 n.data = n.data, i = i, nspots = nspots, ...), LightCycler = .readCtLightCycler(readfile = readfile, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
382 n.data = n.data, i = i, nspots = nspots, ...), CFX = .readCtCFX(readfile = readfile, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
383 n.data = n.data, i = i, nspots = nspots, ...), OpenArray = .readCtOpenArray(readfile = readfile, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
384 n.data = n.data, i = i, nspots = nspots, ...), BioMark = .readCtBioMark(readfile = readfile, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
385 n.data = n.data, i = i, nspots = nspots, ...)) |
7
3e099c082954
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 5c55ecdfd6ed19c7eb7558f278884511620df5dd
davidecangelosi
parents:
6
diff
changeset
|
386 #if (format == "SDS") { |
3e099c082954
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 5c55ecdfd6ed19c7eb7558f278884511620df5dd
davidecangelosi
parents:
6
diff
changeset
|
387 # if("Avg Ct" %in% colnames(n.data)){ |
3e099c082954
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 5c55ecdfd6ed19c7eb7558f278884511620df5dd
davidecangelosi
parents:
6
diff
changeset
|
388 # data <- matrix(sample[, column.info[["Avg.Ct"]]], ncol = n.data[i]) |
3e099c082954
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 5c55ecdfd6ed19c7eb7558f278884511620df5dd
davidecangelosi
parents:
6
diff
changeset
|
389 # } elseif { |
3e099c082954
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 5c55ecdfd6ed19c7eb7558f278884511620df5dd
davidecangelosi
parents:
6
diff
changeset
|
390 # cat("\n Unsupported SDS format! ") |
3e099c082954
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 5c55ecdfd6ed19c7eb7558f278884511620df5dd
davidecangelosi
parents:
6
diff
changeset
|
391 # } |
3e099c082954
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 5c55ecdfd6ed19c7eb7558f278884511620df5dd
davidecangelosi
parents:
6
diff
changeset
|
392 #}else{ |
3e099c082954
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 5c55ecdfd6ed19c7eb7558f278884511620df5dd
davidecangelosi
parents:
6
diff
changeset
|
393 data <- matrix(sample[, column.info[["Ct"]]], ncol = n.data[i]) |
3e099c082954
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 5c55ecdfd6ed19c7eb7558f278884511620df5dd
davidecangelosi
parents:
6
diff
changeset
|
394 # } |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
395 undeter <- apply(data, 2, function(x) x %in% c("Undetermined", |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
396 "No Ct")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
397 X.cat[, cols][undeter] <- "Undetermined" |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
398 nas <- c("Undetermined", "No Ct", "999", "N/A") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
399 if (is.null(na.value)) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
400 data[data %in% nas | data == 0] <- NA |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
401 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
402 else { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
403 data[data %in% nas | is.na(data) | data == 0] <- na.value |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
404 } |
16
254114751c2e
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit f13c9430052e43a372b0bf311a663498ff79b4fe
davidecangelosi
parents:
15
diff
changeset
|
405 X[, cols] <- suppressWarnings({apply(data, 2, function(x) as.numeric(as.character(x)))}) |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
406 if ("flag" %in% names(column.info)) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
407 flags <- matrix(sample[, column.info[["flag"]]], |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
408 ncol = n.data[i]) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
409 flags[flags == "-"] <- "Failed" |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
410 flags[flags == "+"] <- "Passed" |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
411 X.flags[, cols] <- flags |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
412 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
413 else { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
414 X.flags[, cols] <- "Passed" |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
415 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
416 if (format == "OpenArray") { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
417 s.names <- c(s.names, unique(sample$SampleInfo.SampleID)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
418 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
419 else if (format %in% c("EDS","plain", "SDS")) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
420 s.names <- c(s.names, unique(sample[, 2])) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
421 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
422 else { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
423 s.names <- s.names |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
424 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
425 if (i == 1) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
426 featPos <- paste("feature", 1:nspots, sep = "") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
427 if ("position" %in% names(column.info)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
428 featPos <- as.character(sample[1:nspots, column.info[["position"]]]) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
429 featType <- factor(rep("Target", nspots)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
430 if ("type" %in% names(column.info)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
431 featType <- sample[1:nspots, column.info[["type"]]] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
432 featName <- paste("feature", 1:nspots, sep = "") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
433 if ("feature" %in% names(column.info)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
434 featName <- as.character(sample[1:nspots, column.info[["feature"]]]) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
435 df <- data.frame(featureNames = featName, featureType = as.factor(featType), |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
436 featurePos = featPos) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
437 metaData <- data.frame(labelDescription = c("Name of the qPCR feature (gene)", |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
438 "Type pf feature", "Position on assay")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
439 featData <- AnnotatedDataFrame(data = df, varMetadata = metaData) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
440 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
441 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
442 if (!missing(samples)) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
443 if (length(samples) < nsamples) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
444 warning("Not enough sample names provided; using Sample1, Sample2, ... instead\n") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
445 samples <- paste("Sample", 1:nsamples, sep = "") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
446 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
447 else if (length(samples) == nsamples) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
448 samples <- samples |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
449 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
450 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
451 else if (missing(samples)) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
452 if (length(files) == nsamples) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
453 samples <- gsub("(.+)\\..+", "\\1", files) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
454 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
455 else if (length(s.names) == nsamples) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
456 samples <- s.names |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
457 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
458 else { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
459 samples <- paste("Sample", 1:nsamples, sep = "") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
460 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
461 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
462 samples <- make.unique(samples) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
463 if (any(is.na(X))) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
464 warning("One or more samples contain NAs. Consider replacing these with e.g. Ct=40 now.") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
465 if (missing(sample.info)) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
466 pdata <- data.frame(sample = 1:length(samples), row.names = samples) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
467 sample.info <- new("AnnotatedDataFrame", data = pdata, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
468 varMetadata = data.frame(labelDescription = "Sample numbering", |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
469 row.names = "Sample names")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
470 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
471 X.hist <- data.frame(history = capture.output(match.call(readCtData)), |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
472 stringsAsFactors = FALSE) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
473 out <- new("qPCRset", exprs = X, phenoData = sample.info, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
474 featureData = featData, featureCategory = X.cat, flag = X.flags, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
475 CtHistory = X.hist) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
476 out |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
477 } |
2
6cd22b1fbf6d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 18d030f0c2e423a04617a3827ba5a652c8d7867a
davidecangelosi
parents:
0
diff
changeset
|
478 |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
479 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
480 head(read.delim(file.path(path000, dpfiles), sep="\t")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
481 files <- read.delim(file.path(path000, dpfiles), sep="\t") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
482 switch(format, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
483 "EDS"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
484 columns<- list(flag="EXPFAIL", feature="Target.Name", position="Well.Position", Ct="CT") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
485 metadata <- data.frame(labelDescription = c("sampleName", "Treatment"), row.names = c("sampleName", "Treatment")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
486 phenoData <- new("AnnotatedDataFrame", data = files, varMetadata = metadata) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
487 rownames(phenoData)=as.vector(files$sampleName) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
488 raw<- readCtDataDav(files = as.vector(files$sampleName), header=TRUE, format="EDS", column.info=columns, path = path,sample.info=phenoData,n.features = as.numeric(nfeatures)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
489 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
490 "plain"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
491 metadata <- data.frame(labelDescription = c("sampleName", "Treatment"), row.names = c("sampleName", "Treatment")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
492 phenoData <- new("AnnotatedDataFrame", data = files, varMetadata = metadata) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
493 rownames(phenoData)=as.vector(files$sampleName) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
494 raw<- readCtDataDav(files = as.vector(files$sampleName), header=FALSE, format="plain", path = path, sample.info=phenoData,n.features = as.numeric(nfeatures)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
495 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
496 "SDS"={ |
15
5e8bf316343d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d5c46b42061ff823c19437d1c803119ef8b95627
davidecangelosi
parents:
14
diff
changeset
|
497 #columns<- list(feature=3, Ct=6, flag=11) |
8
e5953805ad7a
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7d54176ff26ed5f4411edb0582a3704dd90253c0
davidecangelosi
parents:
7
diff
changeset
|
498 #columns <-list(flag = "Omit",feature = "Detector", type = "Task", position = "Wells", Ct = "Avg.Ct") |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
499 metadata <- data.frame(labelDescription = c("sampleName", "Treatment"), row.names = c("sampleName", "Treatment")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
500 phenoData <- new("AnnotatedDataFrame", data = files, varMetadata = metadata) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
501 rownames(phenoData)=as.vector(files$sampleName) |
15
5e8bf316343d
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d5c46b42061ff823c19437d1c803119ef8b95627
davidecangelosi
parents:
14
diff
changeset
|
502 raw<- readCtDataDav(files = files$sampleName, header=TRUE,format="SDS",path = path, sample.info=phenoData, n.features=as.numeric(nfeatures)) |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
503 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
504 "LightCycler"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
505 metadata <- data.frame(labelDescription = c("sampleName", "Treatment"), row.names = c("sampleName", "Treatment")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
506 phenoData <- new("AnnotatedDataFrame", data = files, varMetadata = metadata) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
507 rownames(phenoData)=as.vector(files$sampleName) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
508 raw <- readCtDataDav(files = files$sampleName, path = path, format = "LightCycler", sample.info=phenoData,n.features = as.numeric(nfeatures)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
509 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
510 "CFX"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
511 metadata <- data.frame(labelDescription = c("sampleName", "Treatment"), row.names = c("sampleName", "Treatment")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
512 phenoData <- new("AnnotatedDataFrame", data = files, varMetadata = metadata) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
513 rownames(phenoData)=as.vector(files$sampleName) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
514 raw <- readCtDataDav(files = files$sampleName, path = path, format = "CFX", sample.info=phenoData,n.features = as.numeric(nfeatures)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
515 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
516 "OpenArray"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
517 metadata <- data.frame(labelDescription = c("sampleName", "Treatment"), row.names = c("sampleName", "Treatment")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
518 phenoData <- new("AnnotatedDataFrame", data = files, varMetadata = metadata) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
519 rownames(phenoData)=as.vector(files$sampleName) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
520 raw <- readCtDataDav(files = files$sampleName, path = path, format = "OpenArray", sample.info=phenoData,n.features = as.numeric(nfeatures)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
521 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
522 "BioMark"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
523 metadata <- data.frame(labelDescription = c("sampleName", "Treatment"), row.names = c("sampleName", "Treatment")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
524 phenoData <- new("AnnotatedDataFrame", data = files, varMetadata = metadata) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
525 rownames(phenoData)=as.vector(files$sampleName) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
526 raw <- readCtDataDav(files = files$sampleName, path = path, format = "BioMark", sample.info=phenoData, n.features = as.numeric(nfeatures)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
527 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
528 stop("Enter something that switches me!") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
529 ) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
530 cat("\n Files read correctly! ") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
531 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
532 write.table(exprs(raw), file=rawout, quote=FALSE, row.names=TRUE, col.names=TRUE,sep = "\t") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
533 #################################################################################################################### |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
534 #Set a new categories for the values meeting two criterions |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
535 switch(format, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
536 "EDS"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
537 unreliable<-setCategory(raw, Ct.max=dcCtmax, Ct.min=dcCtmin,replicates=FALSE, flag=dcflag, flag.out="Y", quantile=NULL) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
538 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
539 "plain"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
540 unreliable<-setCategory(raw, Ct.max=dcCtmax, Ct.min=dcCtmin,replicates=FALSE, flag=dcflag, flag.out="Flagged", quantile=NULL) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
541 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
542 "SDS"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
543 unreliable<-setCategory(raw, Ct.max=dcCtmax, Ct.min=dcCtmin,replicates=FALSE, flag=dcflag, flag.out="TRUE", quantile=NULL) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
544 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
545 "LightCycler"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
546 unreliable<-setCategory(raw, Ct.max=dcCtmax, Ct.min=dcCtmin,replicates=FALSE, flag=dcflag, flag.out="Y", quantile=NULL) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
547 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
548 "CFX"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
549 unreliable<-setCategory(raw, Ct.max=dcCtmax, Ct.min=dcCtmin,replicates=FALSE, flag=dcflag, flag.out="Y", quantile=NULL) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
550 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
551 "OpenArray"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
552 unreliable<-setCategory(raw, Ct.max=dcCtmax, Ct.min=dcCtmin,replicates=FALSE, flag=dcflag, flag.out="TRUE ", quantile=NULL) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
553 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
554 "BioMark"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
555 unreliable<-setCategory(raw, Ct.max=dcCtmax, Ct.min=dcCtmin,replicates=FALSE, flag=dcflag, flag.out="Fail", quantile=NULL) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
556 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
557 stop("Enter something that switches me!") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
558 ) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
559 #unreliable<-setCategory(raw, Ct.max=dcCtmax, Ct.min=dcCtmin,replicates=FALSE, flag=dcflag, flag.out="Y", quantile=NULL) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
560 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
561 #################################################################################################################### |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
562 #Filter out the values of the new category |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
563 xFilter <- filterCategory(unreliable) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
564 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
565 cat("\n Categorization completed! ") |
23
465e643e1ea1
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 4ddffbbbad77ef6dd023dc3311a820413a8fa3c4
davidecangelosi
parents:
22
diff
changeset
|
566 minvalue<-min(exprs(xFilter), na.rm = TRUE) |
465e643e1ea1
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 4ddffbbbad77ef6dd023dc3311a820413a8fa3c4
davidecangelosi
parents:
22
diff
changeset
|
567 maxvalue<-max(exprs(xFilter), na.rm = TRUE) |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
568 png(x, # create PNG for the heat map |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
569 width = 10*300, # 5 x 300 pixels |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
570 height = 10*300, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
571 res = 300, # 300 pixels per inch |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
572 pointsize = 8) |
13
969d0bbbf5a9
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 413fab99454e4e29072af0120eacea0a78f966c1
davidecangelosi
parents:
12
diff
changeset
|
573 |
23
465e643e1ea1
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 4ddffbbbad77ef6dd023dc3311a820413a8fa3c4
davidecangelosi
parents:
22
diff
changeset
|
574 plotCtBoxes(xFilter, ylim=c(as.numeric(minvalue), as.numeric(maxvalue)), cex.lab=3, cex.axis = 2,stratify=NULL, xlab = "Samples", ylab="Ct", mar = c(8,8,8,8), names=as.character(seq(1, ncol(xFilter), 1))) # smaller font size |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
575 dev.off() |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
576 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
577 #write.table(exprs(xFilter), file=x, quote=FALSE, row.names=TRUE, col.names=TRUE,sep = "\t") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
578 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
579 #################################################################################################################### |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
580 #NORMALIZATION |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
581 #method version 3.5.1 + Global mean |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
582 normalizeCtDataDav <- |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
583 function(q, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
584 norm = "deltaCt", |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
585 deltaCt.genes = NULL, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
586 scale.rank.samples, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
587 rank.type = "pseudo.median", |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
588 Ct.max = dcCtmax, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
589 geo.mean.ref, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
590 verbose = TRUE) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
591 { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
592 # Extract the data |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
593 data <- exprs(q) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
594 data.norm <- data |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
595 # Get the normalisation method |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
596 method <- match.arg(norm, c("quantile", "scale.rankinvariant", "norm.rankinvariant", "deltaCt", "geometric.mean", "globalmean")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
597 # Some general stuff that will be used by both rank.invariant methods |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
598 if (method %in% c("scale.rankinvariant", "norm.rankinvariant")) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
599 # Index to use for too high Ct values |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
600 #Ct.index <- data>Ct.max |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
601 data.Ctmax <- data |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
602 Ct.index <- is.na(data) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
603 #data.Ctmax[Ct.index] <- NA |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
604 data<-na.spline(data) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
605 # Define what to rank against |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
606 if (rank.type=="pseudo.median") { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
607 ref.data <- apply(data.Ctmax, 1, median, na.rm=TRUE) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
608 } else if (rank.type=="pseudo.mean") { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
609 ref.data <- apply(data.Ctmax, 1, mean, na.rm=TRUE) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
610 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
611 # Mark + replace NA values with something temporary |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
612 na.index <- is.na(ref.data) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
613 ref.data[na.index] <- 30 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
614 # Run the rank.invariant function |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
615 data.rankinvar <- apply(data, 2, normalize.invariantset, ref=ref.data) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
616 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
617 # The actual normalisation |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
618 switch(method, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
619 quantile = { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
620 # Use an internal limma function |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
621 data.norm <- normalizeQuantiles(data) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
622 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
623 scale.rankinvariant = { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
624 # Get all the rank invariant genes |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
625 ri.genes <- sapply(data.rankinvar, "[[", "i.set") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
626 # Remove those with too high Ct values |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
627 ri.genes[Ct.index] <- FALSE |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
628 # Remove those that were all NA for potentially other reasons |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
629 ri.genes[na.index,] <- FALSE |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
630 # Select those to use here |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
631 ri.count <- rowSums(ri.genes) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
632 if (missing(scale.rank.samples)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
633 scale.rank.samples <- ncol(data)-1 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
634 ri.index <- ri.count >= scale.rank.samples |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
635 if (sum(ri.index)==0) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
636 stop(paste("No rank invariant genes were found across", scale.rank.samples, "samples")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
637 # Extract the corresponding Ct values; average |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
638 ri.mean <- colMeans(data[ri.index,,drop=FALSE]) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
639 ri.scale <- ri.mean/ri.mean[1] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
640 # Correct the data |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
641 data.norm <- t(t(data)*ri.scale) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
642 # Print info |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
643 if (verbose) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
644 cat(c("Scaling Ct values\n\tUsing rank invariant genes:", paste(featureNames(q)[ri.index], collapse=" "), "\n")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
645 cat(c("\tScaling factors:", format(ri.scale, digits=3), "\n")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
646 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
647 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
648 norm.rankinvariant = { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
649 # Print info |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
650 if (verbose) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
651 cat("Normalizing Ct values\n\tUsing rank invariant genes:\n") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
652 # Correct the data based on the calculations above |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
653 for (i in 1:ncol(data)) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
654 # Check if there are any rank invariant genes |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
655 ri.sub <- data.rankinvar[[i]] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
656 ri.genes <- ri.sub[["i.set"]] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
657 # Remove those that don't pass the Ct.max criteria |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
658 ri.genes[Ct.index[,i]] <- FALSE |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
659 # Remove those that are NA for other reasons |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
660 ri.genes[na.index] <- FALSE |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
661 if (sum(ri.genes)==0) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
662 warning(paste("\tNo rank invariant genes were found for sample ", sampleNames(q)[i], "; sample not normalized\n", sep="")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
663 next |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
664 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
665 # If verbose, print some info |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
666 if (verbose) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
667 cat(paste("\t", sampleNames(q)[i], ": ", sum(ri.genes), " rank invariant genes\n", sep="")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
668 # The actual correction |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
669 data.norm[,i] <- as.numeric(approx(ri.sub$n.curve$y, ri.sub$n.curve$x, xout=data[,i], rule=2)$y) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
670 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
671 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
672 deltaCt = { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
673 # Which are the reference genes (endogenous controls) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
674 if (is.null(deltaCt.genes)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
675 deltaCt.genes <- unique(featureNames(q)[featureType(q)=="Endogenous Control"]) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
676 c.index <- featureNames(q) %in% deltaCt.genes |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
677 if (verbose) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
678 cat(c("Calculating deltaCt values\n\tUsing control gene(s):", paste(deltaCt.genes, collapse=" "), "\n")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
679 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
680 # Run though all cards; perform internal normalisation |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
681 for (c in 1:ncol(data)) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
682 # Calculate the control genes |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
683 refCt <- mean(data[c.index,c], na.rm=TRUE) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
684 refsd <- sd(data[c.index,c], na.rm=TRUE) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
685 # Difference for target and controls |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
686 data.norm[,c] <- data[,c]-refCt |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
687 # Print results |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
688 if (verbose) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
689 cat(paste("\tCard ", c, ":\tMean=", format(refCt, dig=4), "\tStdev=", format(refsd, dig=3), "\n", sep="")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
690 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
691 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
692 geometric.mean = { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
693 # For each column, calculate the geometric mean of Ct values<Ct.max |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
694 #geo.mean <- apply(data, 2, function(x) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
695 # xx <- log2(subset(x, x<Ct.max)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
696 # 2^mean(xx)}) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
697 geo.mean <- apply(data, 2, function(x) { |
20
9227f7b1c50b
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit ff16cfc0a6c2b83c1e32d1204e91f3a20d6dc231
davidecangelosi
parents:
19
diff
changeset
|
698 xx <- subset(x, x<Ct.max) |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
699 geometric.mean(xx)}) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
700 # Which sample to scale to |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
701 #if (missing(geo.mean.ref)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
702 # geo.mean.ref <- 1 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
703 # Calculate the scaling factor |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
704 #geo.scale <- geo.mean/geo.mean[geo.mean.ref] |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
705 # Adjust the data accordingly |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
706 data.norm <- t(t(data) - geo.mean) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
707 if (verbose) { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
708 cat(c("Scaling Ct values\n\tUsing geometric mean within each sample\n")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
709 #cat(c("\tScaling factors:", format(geo.scale, digits=3), "\n")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
710 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
711 } # switch |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
712 ,globalmean = { |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
713 glo <- apply(data, 2, function(x) { |
20
9227f7b1c50b
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit ff16cfc0a6c2b83c1e32d1204e91f3a20d6dc231
davidecangelosi
parents:
19
diff
changeset
|
714 xx <- subset(x, x <Ct.max) |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
715 mean(xx) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
716 }) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
717 data.norm <- t(t(data) - glo) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
718 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
719 ) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
720 # Replace with the normalised Ct exprs |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
721 exprs(q) <- data.norm |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
722 # Add to the history of the object |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
723 if (nrow(getCtHistory(q))==0) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
724 setCtHistory(q) <- data.frame(history="Manually created qPCRset object.", stringsAsFactors=FALSE) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
725 setCtHistory(q) <- rbind(getCtHistory(q), capture.output(match.call(normalizeCtData))) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
726 # Return the normalised object |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
727 q |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
728 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
729 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
730 switch(normalizationMethod, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
731 "deltaCt"={ |
9
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
732 delete.na <- function(DF, n=0) { |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
733 DF[rowSums(is.na(DF)) <= n,] |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
734 } |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
735 switch(submethod, |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
736 "userdefined"={ |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
737 normalizedDataset <- normalizeCtDataDav(xFilter, norm="deltaCt", deltaCt.genes =explode(normalizers, sep = ",")) |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
738 }, |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
739 "genorm"={ |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
740 library(NormqPCR) |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
741 genorm <- selectHKs(t(delete.na(as.matrix(exprs(xFilter)),0)), method = "geNorm", Symbols = rownames(as.matrix(delete.na(exprs(xFilter),0))), minNrHK = as.numeric(user_number), trace=TRUE, log = TRUE) |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
742 genorm |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
743 normalizedDataset <- normalizeCtDataDav(xFilter, norm="deltaCt", deltaCt.genes =genorm$ranking[1:length(genorm$meanM[genorm$meanM<1.5])]) |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
744 }, |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
745 "normfinder"={ |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
746 library(NormqPCR) |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
747 normfinder <- selectHKs(as.matrix(t(delete.na(exprs(xFilter),0))), group= files$Treatment , method = "NormFinder", Symbols =rownames(as.matrix(delete.na(exprs(xFilter),0))), minNrHK = as.numeric(user_number), trace=TRUE, log = TRUE) |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
748 normfinder |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
749 normalizedDataset <- normalizeCtDataDav(xFilter, norm="deltaCt", deltaCt.genes =normfinder$ranking) |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
750 }, |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
751 stop("Enter something that switches me!") |
69f5c4d6e6bd
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 7664e4dc44eb4f141ffd01627ee66858cc9887ff
davidecangelosi
parents:
8
diff
changeset
|
752 ) |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
753 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
754 "quantile"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
755 normalizedDataset <- normalizeCtDataDav(xFilter, norm=normalizationMethod) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
756 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
757 "scale.rankinvariant"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
758 normalizedDataset <- normalizeCtDataDav(xFilter, norm=normalizationMethod) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
759 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
760 "norm.rankinvariant"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
761 normalizedDataset <- normalizeCtDataDav(xFilter, norm=normalizationMethod) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
762 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
763 "geometric.mean"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
764 normalizedDataset <- normalizeCtDataDav(xFilter, norm=normalizationMethod) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
765 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
766 "globalmean"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
767 normalizedDataset <- normalizeCtDataDav(xFilter, norm=normalizationMethod) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
768 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
769 stop("Enter something that switches me!") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
770 ) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
771 |
12
11393eb1c557
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d1be332a7da0e53b3e6451f0aeda0675f190dd64
davidecangelosi
parents:
10
diff
changeset
|
772 |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
773 cat("\n Data normalized correctly! \n") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
774 write.table(exprs(normalizedDataset), file=outputNorm, quote=FALSE, row.names=TRUE, col.names=TRUE,sep = "\t") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
775 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
776 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
777 png(outputECDF, # create PNG for the heat map |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
778 width = 10*300, # 5 x 300 pixels |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
779 height = 10*300, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
780 res = 300, # 300 pixels per inch |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
781 pointsize = 8) # smaller font size |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
782 vec=c() |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
783 for (i in 1:nrow(exprs(xFilter))){ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
784 CVX<-(sd(2^-exprs(xFilter)[i,], na.rm = TRUE)/mean(2^-exprs(xFilter)[i,], na.rm = TRUE))*100 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
785 vec=c(vec, c(CVX)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
786 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
787 vec<-na.omit(vec) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
788 P = ecdf(vec) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
789 gm=c() |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
790 for (i in 1:nrow(exprs(normalizedDataset))){ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
791 CVGM<-(sd(2^-exprs(normalizedDataset)[i,], na.rm = TRUE)/mean(2^-exprs(normalizedDataset)[i,], na.rm = TRUE))*100 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
792 gm=c(gm, c(CVGM)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
793 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
794 gm<-na.omit(gm) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
795 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
796 PY = ecdf(gm) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
797 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
798 plot_colors <- c(rgb(r=0.0,g=0.0,b=0.9), "red", "forestgreen",rgb(r=0.0,g=0.0,b=0.0),rgb(r=0.5,g=0.0,b=0.3),rgb(r=0.0,g=0.4,b=0.4)) |
14
3168db2e0ff5
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 4e1ae25e30206be75710403c7500980ddb474beb
davidecangelosi
parents:
13
diff
changeset
|
799 par(mar = c(8,8,8,8)) |
3168db2e0ff5
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 4e1ae25e30206be75710403c7500980ddb474beb
davidecangelosi
parents:
13
diff
changeset
|
800 plot(P,cex.lab=3, cex.axis = 2,col=plot_colors[1],xlim=c(0.0,600), ylim=c(0.0,1),xaxp = c(0.0, 600, 6),yaxp = c(0.0, 1, 10), cex=1.3, lwd=5, main=paste("p-value=", formatC(ks.test(vec,gm)$p.value, format = "e", digits = 2)),xlab="CV(%)",ylab="Empirical Cumulative Distribution") |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
801 lines(PY, lwd=5, col=plot_colors[6],cex=1.3) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
802 legend("bottomright", c("not normalized", "normalized"), cex=1.3, col=c(plot_colors[1],plot_colors[6]), lwd=c(5,5)); |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
803 dev.off() |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
804 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
805 #Two-sample Kolmogorov-Smirnov |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
806 ks.test(vec,gm) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
807 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
808 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
809 #write.table(exprs(qFiltNAs), file=outputIMP, quote=FALSE, row.names=TRUE, col.names=TRUE,sep = "\t") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
810 png(outputIMP, # create PNG for the heat map |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
811 width = 10*300, # 5 x 300 pixels |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
812 height = 10*300, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
813 res = 300, # 300 pixels per inch |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
814 pointsize = 8) |
13
969d0bbbf5a9
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 413fab99454e4e29072af0120eacea0a78f966c1
davidecangelosi
parents:
12
diff
changeset
|
815 |
24
6ae13912ab03
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit a642a9310fd2d16488b42aef5e0cde8124e978e3
davidecangelosi
parents:
23
diff
changeset
|
816 plotCtBoxes(normalizedDataset, ylim=c(min(exprs(normalizedDataset), na.rm = TRUE),max(exprs(normalizedDataset), na.rm = TRUE)),cex.lab=3, cex.axis = 2,stratify=NULL, xlab = "Samples", ylab="DeltaCt", mar = c(8,8,8,8), names=as.character(seq(1, ncol(normalizedDataset), 1))) # smaller font size |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
817 dev.off() |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
818 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
819 ################################################## Filtering based on number of NAs################################################## |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
820 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
821 #FILTERING on the basis of NAs |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
822 #qPCRset.R |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
823 setMethod("exprs", signature(object="qPCRset"), definition = |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
824 function (object) {x <- assayDataElement(object, "exprs"); rownames(x) <- featureNames(object); colnames(x) <- sampleNames(phenoData(object));x} |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
825 ) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
826 ncatn <- as.integer(n.samples(normalizedDataset))*as.integer(percentofnastoremove)/100 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
827 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
828 qFiltNAs <- filterCtData(normalizedDataset, remove.category=c("Undetermined","Unreliable"), n.category=as.integer(ncatn),remove.name=explode(filtnames, sep = ",")) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
829 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
830 cat("\n Data filtered correctly! \n") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
831 |
3
e2fcf5a4609c
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 51ea950c5c71f2cc8f45bc56cc5609ee7a12a3df
davidecangelosi
parents:
2
diff
changeset
|
832 if (anyNA(exprs(qFiltNAs))){ |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
833 switch(imputeMethod, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
834 "knn"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
835 imp<-impute.knn(exprs(qFiltNAs) ,k = as.integer(kappa), maxp = as.integer(macsp), rng.seed=362436069) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
836 exprs(qFiltNAs)=imp$data |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
837 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
838 "mestdagh"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
839 #Mesdagh |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
840 #sostituisce a NA -1000 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
841 for (i in 1:nrow(exprs(qFiltNAs))){ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
842 for(j in 1:ncol(exprs(qFiltNAs))){ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
843 if(is.na(exprs(qFiltNAs)[i,j])>0)exprs(qFiltNAs)[i,j]<- -1000 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
844 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
845 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
846 temp<-exprs(qFiltNAs) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
847 for (i in 1:nrow(exprs(qFiltNAs))){ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
848 for(j in 1:ncol(exprs(qFiltNAs))){ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
849 if(exprs(qFiltNAs)[i,j]<(-100))exprs(qFiltNAs)[i,j]<- max(temp[i,])+1 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
850 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
851 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
852 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
853 "cubic"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
854 exprs(qFiltNAs) <- na.spline(exprs(qFiltNAs)) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
855 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
856 "mean"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
857 exprs(qFiltNAs)<-impute(exprs(qFiltNAs),mean) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
858 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
859 "median"={ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
860 exprs(qFiltNAs)<-impute(exprs(qFiltNAs),median) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
861 }, |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
862 stop("Enter something that switches me!") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
863 ) |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
864 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
865 cat("\n Imputation completed! \n") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
866 }else{ |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
867 cat("\n Nothing to impute! \n") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
868 } |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
869 |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
870 write.table(exprs(qFiltNAs), file=outputRemaining, quote=FALSE, row.names=TRUE, col.names=TRUE, sep = "\t") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
871 |
18
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
872 switch(DEAMethod, |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
873 "ttest"={ |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
874 #Differential expression analysis (paired t test+BH). Returns Fold change in linear scale. |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
875 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) |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
876 write.table(DEG, file=outputDEA, quote=FALSE, row.names=TRUE, col.names=TRUE,sep = "\t") |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
877 }, |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
878 "wtest"={ |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
879 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) |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
880 write.table(DEG, file=outputDEA, quote=FALSE, row.names=TRUE, col.names=TRUE,sep = "\t") |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
881 }, |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
882 "rp"={ |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
883 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) |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
884 write.table(DEG[1:5], file=outputDEA, quote=FALSE, row.names=TRUE, col.names=TRUE,sep = "\t") |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
885 }, |
21
1e3113e565db
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit f53b88658dc1aa6627b064d7c8bed1562dfbc1dc
davidecangelosi
parents:
20
diff
changeset
|
886 "none"={ |
1e3113e565db
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit f53b88658dc1aa6627b064d7c8bed1562dfbc1dc
davidecangelosi
parents:
20
diff
changeset
|
887 }, |
18
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
888 stop("Enter something that switches me!") |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
889 ) |
2a6088c11d42
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit d953cf83d97f579b4b03a30cd320f760d0ecdefc
davidecangelosi
parents:
17
diff
changeset
|
890 |
19
8503457bd0c4
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit f98eba79c2036aa3e1b8f9048c0b1e61d4d87b60
davidecangelosi
parents:
18
diff
changeset
|
891 |
0
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
892 cat("\n Differential expression analysis completed correctly! \n") |
185ba61836ab
planemo upload for repository https://github.com/igg-molecular-biology-lab/pipe-t.git commit 04049039da97e1c9a8048e732afca48f2741cadf
davidecangelosi
parents:
diff
changeset
|
893 cat("\n Workflow ended correctly! \n") |