Skip to content

Commit 73920a7

Browse files
committed
simplify names, which greatly simplifies downstream read tracking
1 parent 59832ae commit 73920a7

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

modules/local/dadainfer.nf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ process DADA2_POOLED_INFER {
5151
5252
dereps <- lapply(derep_files, readRDS)
5353
54-
# note this is a bit of a hack, but we want the file name
55-
# included with the name of the derep object. This makes
56-
# sure these are in sync if needed later
57-
names(dereps) <- sapply(dereps, function(x) { x\$file })
54+
names(dereps) <- gsub(".${readmode}.derep.RDS", "", basename(derep_files))
5855
5956
cat(paste0("Denoising ${readmode} reads: pool:", pool, "\\n"))
6057
dds <- dada(dereps,
@@ -66,10 +63,9 @@ process DADA2_POOLED_INFER {
6663
6764
tracking_dds <- as.data.frame(sapply(dds, getN))
6865
colnames(tracking_dds) <- c("dada2.denoised.pooled.${readmode}")
69-
nms <- gsub("(.R[12])?.trim.fastq.gz", "", rownames(tracking_dds))
7066
tracking_dds <- tracking_dds %>%
7167
as_tibble() %>%
72-
mutate(SampleID = nms, .before = 1)
68+
mutate(SampleID = rownames(tracking_dds), .before = 1)
7369
write_csv(tracking_dds, "dada2.denoised.pooled.${readmode}.csv")
7470
"""
7571

0 commit comments

Comments
 (0)