Commit c16471f6 authored by Midoux Cedric's avatar Midoux Cedric
Browse files

no biom, tsv export

parent 5ade9a3c
...@@ -12,9 +12,9 @@ rule makeSequenceTable: ...@@ -12,9 +12,9 @@ rule makeSequenceTable:
input: input:
expand("work/dada/{sample}.rds", sample=SAMPLES) expand("work/dada/{sample}.rds", sample=SAMPLES)
output: output:
table = "work/dada/seqtab.rds", rds = "work/dada/seqtab.rds",
fasta = "work/dada/seqtab.fasta", fasta = "work/dada/seqtab.fasta",
biom = "work/dada/dada2.biom" tsv = "work/dada/seqtab.tsv"
threads: threads:
config["THREADS"] config["THREADS"]
script: script:
......
...@@ -7,8 +7,8 @@ rule all: ...@@ -7,8 +7,8 @@ rule all:
input: input:
"report/multiqc_report.html", "report/multiqc_report.html",
expand("work/dada/{sample}.rds", sample=SAMPLES), expand("work/dada/{sample}.rds", sample=SAMPLES),
"work/dada/seqtab.rds", "work/dada/seqtab.fasta",
"work/dada/seqtab.fasta" "work/dada/seqtab.tsv"
include: "quality.smk" include: "quality.smk"
include: "preprocess.smk" include: "preprocess.smk"
......
library(dada2) library(dada2)
library(biomformat)
dada_list <- lapply(snakemake@input, readRDS) dada_list <- lapply(snakemake@input, readRDS)
names(dada_list) <- lapply(snakemake@input, function(x){basename(tools::file_path_sans_ext(x))}) names(dada_list) <- lapply(snakemake@input, function(x){basename(tools::file_path_sans_ext(x))})
...@@ -7,9 +6,8 @@ names(dada_list) <- lapply(snakemake@input, function(x){basename(tools::file_pat ...@@ -7,9 +6,8 @@ names(dada_list) <- lapply(snakemake@input, function(x){basename(tools::file_pat
seqtab <- makeSequenceTable(dada_list, orderBy = "abundance") seqtab <- makeSequenceTable(dada_list, orderBy = "abundance")
seqtab.nochim <- removeBimeraDenovo(seqtab, method="consensus", multithread = snakemake@threads, verbose = TRUE) seqtab.nochim <- removeBimeraDenovo(seqtab, method="consensus", multithread = snakemake@threads, verbose = TRUE)
saveRDS(seqtab.nochim, snakemake@output$table) saveRDS(seqtab.nochim, snakemake@output$rds)
uniquesToFasta(seqtab.nochim, snakemake@output$fasta) uniquesToFasta(seqtab.nochim, snakemake@output$fasta)
biom <- make_biom(t(seqtab.nochim)) write.table(t(seqtab.nochim), snakemake@output$tsv, sep = "\t", quote = FALSE)
write_biom(biom, snakemake@output$biom)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment