annotate test-data/gentest.R @ 8:f4986d25e249 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 6248c33a4eacc8785cac321cd4603acf06fae0fd
author iuc
date Thu, 23 May 2024 08:51:14 +0000
parents 19299bb1c6af
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
1 library(dada2, quietly = TRUE)
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
2 library(ggplot2, quietly = TRUE)
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
3
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
4 sample_names <- c("F3D0_S188_L001", "F3D141_S207_L001")
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
5 fwd <- c("F3D0_S188_L001_R1_001.fastq.gz", "F3D141_S207_L001_R1_001.fastq.gz")
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
6 rev <- c("F3D0_S188_L001_R2_001.fastq.gz", "F3D141_S207_L001_R2_001.fastq.gz")
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
7
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
8 filt_fwd <- c("filterAndTrim_F3D0_R1.fq.gz", "filterAndTrim_F3D141_R1.fq.gz")
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
9 filt_rev <- c("filterAndTrim_F3D0_R2.fq.gz", "filterAndTrim_F3D141_R2.fq.gz")
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
10
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
11 print("filterAndTrim")
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
12
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
13 for (i in seq_len(fwd)) {
8
f4986d25e249 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 6248c33a4eacc8785cac321cd4603acf06fae0fd
iuc
parents: 7
diff changeset
14 ftout <- dada2::filterAndTrim(fwd[i], filt_fwd[i], rev[i], filt_rev[i])
f4986d25e249 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 6248c33a4eacc8785cac321cd4603acf06fae0fd
iuc
parents: 7
diff changeset
15 b <- paste(strsplit(fwd[i], ".", fixed = TRUE)[[1]][1], "tab", sep = ".")
f4986d25e249 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 6248c33a4eacc8785cac321cd4603acf06fae0fd
iuc
parents: 7
diff changeset
16 write.table(ftout, b, quote = FALSE, sep = "\t", col.names = NA)
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
17 }
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
18
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
19 # In the test only the 1st data set is used
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
20 t <- data.frame()
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
21 t <- rbind(t, ftout[1, ])
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
22 colnames(t) <- colnames(ftout)
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
23 rownames(t) <- rownames(ftout)[1]
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
24 write.table(t, "filterAndTrim.tab", quote = FALSE, sep = "\t", col.names = NA)
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
25
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
26 names(fwd) <- sample_names
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
27 names(rev) <- sample_names
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
28 names(filt_fwd) <- sample_names
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
29 names(filt_rev) <- sample_names
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
30
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
31 # Plot quality profile (just for one file, Galaxy compares with sim_size)
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
32 print("plots")
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
33 qp <- dada2::plotQualityProfile(fwd)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
34 ggsave("qualityProfile_fwd.pdf", qp, width = 20, height = 15, units = c("cm"))
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
35 qp <- dada2::plotQualityProfile(rev)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
36 ggsave("qualityProfile_rev.pdf", qp, width = 20, height = 15, units = c("cm"))
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
37 qp <- dada2::plotQualityProfile(fwd[1])
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
38 ggsave("qualityProfile.pdf", qp, width = 20, height = 15, units = c("cm"))
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
39
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
40 # Plot complexity (just for one file, Galaxy compares with sim_size)
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
41
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
42 cp <- dada2::plotComplexity(fwd)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
43 ggsave("complexity_fwd.pdf", cp, width = 20, height = 15, units = c("cm"))
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
44 cp <- dada2::plotComplexity(rev)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
45 ggsave("complexity_rev.pdf", cp, width = 20, height = 15, units = c("cm"))
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
46 cp <- dada2::plotComplexity(fwd[1])
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
47 ggsave("complexity.pdf", cp, width = 20, height = 15, units = c("cm"))
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
48
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
49
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
50 # learn Errors
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
51 print("learnErrors")
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
52 err_fwd <- dada2::learnErrors(filt_fwd)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
53 saveRDS(err_fwd, file = "learnErrors_R1.Rdata")
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
54 plot <- dada2::plotErrors(err_fwd)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
55 ggsave("learnErrors_R1.pdf", plot, width = 20, height = 15, units = c("cm"))
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
56
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
57 err_rev <- dada2::learnErrors(filt_rev)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
58 saveRDS(err_rev, file = "learnErrors_R2.Rdata")
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
59 plot <- dada2::plotErrors(err_rev)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
60 ggsave("learnErrors.pdf", plot, width = 20, height = 15, units = c("cm"))
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
61
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
62 # dada
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
63 print("dada")
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
64 dada_fwd <- dada2::dada(filt_fwd, err_fwd)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
65 dada_rev <- dada2::dada(filt_rev, err_rev)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
66 for (id in sample_names) {
8
f4986d25e249 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 6248c33a4eacc8785cac321cd4603acf06fae0fd
iuc
parents: 7
diff changeset
67 saveRDS(dada_fwd[[id]], file = paste("dada_", id, "_R1.Rdata", sep = ""))
f4986d25e249 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 6248c33a4eacc8785cac321cd4603acf06fae0fd
iuc
parents: 7
diff changeset
68 saveRDS(dada_rev[[id]], file = paste("dada_", id, "_R2.Rdata", sep = ""))
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
69 }
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
70
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
71 # merge pairs
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
72 print("mergePairs")
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
73 merged <- dada2::mergePairs(dada_fwd, filt_fwd, dada_rev, filt_rev)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
74 for (id in sample_names) {
8
f4986d25e249 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 6248c33a4eacc8785cac321cd4603acf06fae0fd
iuc
parents: 7
diff changeset
75 saveRDS(merged[[id]], file = paste("mergePairs_", id, ".Rdata", sep = ""))
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
76 }
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
77
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
78
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
79 # make sequence table
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
80 print("makeSequenceTable")
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
81 seqtab <- makeSequenceTable(merged)
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
82 write.table(t(seqtab), file = "makeSequenceTable.tab", quote = FALSE, sep = "\t", row.names = TRUE, col.names = NA)
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
83
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
84 reads_per_seqlen <- tapply(colSums(seqtab), factor(nchar(getSequences(seqtab))), sum)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
85 df <- data.frame(length = as.numeric(names(reads_per_seqlen)), count = reads_per_seqlen)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
86 pdf("makeSequenceTable.pdf")
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
87 ggplot(data = df, aes(x = length, y = count)) +
8
f4986d25e249 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 6248c33a4eacc8785cac321cd4603acf06fae0fd
iuc
parents: 7
diff changeset
88 geom_col() +
f4986d25e249 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 6248c33a4eacc8785cac321cd4603acf06fae0fd
iuc
parents: 7
diff changeset
89 theme_bw()
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
90 bequiet <- dev.off()
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
91
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
92 # remove bimera
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
93 print("removeBimera")
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
94 seqtab_nochim <- dada2::removeBimeraDenovo(seqtab)
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
95 write.table(t(seqtab), file = "removeBimeraDenovo.tab", quote = FALSE, sep = "\t", row.names = TRUE, col.names = NA)
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
96
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
97 # assign taxonomy/species
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
98 tl <- "Level1,Level2,Level3,Level4,Level5"
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
99 tl <- strsplit(tl, ",")[[1]]
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
100
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
101 set.seed(42)
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
102 print("assignTaxonomyAndSpecies")
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
103 taxa <- dada2::assignTaxonomy(seqtab_nochim, "reference.fa.gz", outputBootstraps = TRUE, taxLevels = tl, multithread = 1)
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
104
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
105 taxa$tax <- dada2::addSpecies(taxa$tax, "reference_species.fa.gz")
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
106 write.table(taxa$tax, file = "assignTaxonomyAddspecies.tab", quote = FALSE, sep = "\t", row.names = TRUE, col.names = NA)
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
107
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
108 write.table(taxa$boot, file = "assignTaxonomyAddspecies_boot.tab", quote = FALSE, sep = "\t", row.names = TRUE, col.names = NA)
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
109
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
110
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
111 ## Generate extra test data for parameter testing
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
112 print("alternatives")
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
113 dada2::filterAndTrim(fwd, c("filterAndTrim_single_F3D0_R1.fq.gz", "filterAndTrim_single_F3D141_R1.fq.gz"), rm.phix = TRUE, orient.fwd = "TACGG")
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
114
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
115 dada2::filterAndTrim(fwd, c("filterAndTrim_single_trimmers_F3D0_R1.fq.gz", "filterAndTrim_single_trimmers_F3D141_R1.fq.gz"), truncQ = 30, truncLen = 2, trimLeft = 150, trimRight = 2)
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
116
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
117 dada2::filterAndTrim(fwd, c("filterAndTrim_single_filters_F3D0_R1.fq.gz", "filterAndTrim_single_filters_F3D141_R1.fq.gz"), maxLen = 255, minLen = 60, maxN = 100, minQ = 13, maxEE = 1)
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
118
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
119
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
120 merged_nondef <- dada2::mergePairs(dada_fwd, filt_fwd, dada_rev, filt_rev, minOverlap = 8, maxMismatch = 1, justConcatenate = TRUE, trimOverhang = TRUE)
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
121 for (id in sample_names) {
8
f4986d25e249 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 6248c33a4eacc8785cac321cd4603acf06fae0fd
iuc
parents: 7
diff changeset
122 saveRDS(merged_nondef[[id]], file = paste("mergePairs_", id, "_nondefault.Rdata", sep = ""))
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
123 }
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
124 rb_dada_fwd <- dada2::removeBimeraDenovo(dada_fwd[["F3D0_S188_L001"]])
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
125 write.table(rb_dada_fwd, file = "removeBimeraDenovo_F3D0_dada_uniques.tab", quote = FALSE, sep = "\t", row.names = TRUE, col.names = FALSE)
0
d26cea4b4cc4 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
iuc
parents:
diff changeset
126
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
127 rb_merged <- dada2::removeBimeraDenovo(merged, method = "pooled")
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
128 saveRDS(rb_merged, file = "removeBimeraDenovo_F3D0_mergepairs.Rdata")
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
129
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
130 # SeqCounts
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
131 get_n <- function(x) {
8
f4986d25e249 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 6248c33a4eacc8785cac321cd4603acf06fae0fd
iuc
parents: 7
diff changeset
132 sum(dada2::getUniques(x))
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
133 }
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
134
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
135 print("seqCounts ft")
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
136 samples <- list()
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
137 samples[["F3D0_S188_L001_R1_001.tab"]] <- read.table("F3D0_S188_L001_R1_001.tab", header = TRUE, sep = "\t", row.names = 1)
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
138 dname <- "filter"
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
139 tdf <- samples[["F3D0_S188_L001_R1_001.tab"]]
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
140 names(tdf) <- paste(dname, names(tdf))
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
141 tdf <- cbind(data.frame(samples = names(samples)), tdf)
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
142 write.table(tdf, "seqCounts_filter.tab", quote = FALSE, sep = "\t", row.names = FALSE, col.names = TRUE)
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
143
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
144 samples <- list()
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
145 samples[["F3D0_S188_L001_R1_001.tab"]] <- read.table("F3D0_S188_L001_R1_001.tab", header = TRUE, sep = "\t", row.names = 1)
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
146 samples[["F3D141_S207_L001_R1_001.tab"]] <- read.table("F3D141_S207_L001_R1_001.tab", header = TRUE, sep = "\t", row.names = 1)
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
147 dname <- "filter"
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
148 tdf <- samples[["F3D0_S188_L001_R1_001.tab"]]
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
149 tdf <- rbind(tdf, samples[["F3D141_S207_L001_R1_001.tab"]])
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
150 names(tdf) <- paste(dname, names(tdf))
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
151 tdf <- cbind(data.frame(samples = names(samples)), tdf)
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
152 write.table(tdf, "seqCounts_filter_both.tab", quote = FALSE, sep = "\t", row.names = FALSE, col.names = TRUE)
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
153
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
154 print("seqCounts dada")
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
155 samples <- list()
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
156 samples[["dada_F3D0_S188_L001_R1.Rdata"]] <- readRDS("dada_F3D0_S188_L001_R1.Rdata")
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
157 samples[["dada_F3D141_S207_L001_R1.Rdata"]] <- readRDS("dada_F3D141_S207_L001_R1.Rdata")
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
158 dname <- "dadaF"
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
159 tdf <- data.frame(samples = names(samples))
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
160 tdf[[dname]] <- sapply(samples, get_n)
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
161 write.table(tdf, "seqCounts_dadaF.tab", quote = FALSE, sep = "\t", row.names = FALSE, col.names = TRUE)
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
162
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
163 print("seqCounts mp")
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
164 samples <- list()
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
165 samples[["mergePairs_F3D0_S188_L001.Rdata"]] <- readRDS("mergePairs_F3D0_S188_L001.Rdata")
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
166 samples[["mergePairs_F3D141_S207_L001.Rdata"]] <- readRDS("mergePairs_F3D141_S207_L001.Rdata")
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
167 dname <- "merge"
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
168 tdf <- data.frame(samples = names(samples))
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
169 tdf[[dname]] <- sapply(samples, get_n)
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
170 write.table(tdf, "seqCounts_merge.tab", quote = FALSE, sep = "\t", row.names = FALSE, col.names = TRUE)
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
171
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
172 print("seqCounts st")
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
173 samples <- list()
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
174 samples <- t(as.matrix(read.table("makeSequenceTable.tab", header = TRUE, sep = "\t", row.names = 1)))
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
175 dname <- "seqtab"
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
176 tdf <- data.frame(samples = row.names(samples))
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
177 tdf[[dname]] <- rowSums(samples)
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
178 write.table(tdf, "seqCounts_seqtab.tab", quote = FALSE, sep = "\t", row.names = FALSE, col.names = TRUE)
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
179
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
180 print("seqCounts rb")
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
181 samples <- list()
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
182 samples <- t(as.matrix(read.table("removeBimeraDenovo.tab", header = TRUE, sep = "\t", row.names = 1)))
2
f74c56549143 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
iuc
parents: 0
diff changeset
183 dname <- "nochim"
3
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
184 tdf <- data.frame(samples = row.names(samples))
7d28da5e9e27 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit 8533fe71d1d50f09348da2dc34941724407a1ffe"
iuc
parents: 2
diff changeset
185 tdf[[dname]] <- rowSums(samples)
6
9058d8943303 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
iuc
parents: 3
diff changeset
186 write.table(tdf, "seqCounts_nochim.tab", quote = FALSE, sep = "\t", row.names = FALSE, col.names = TRUE)