annotate test-data/gentest.R @ 1:ee763baa80c3 draft default tip

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