Skip to content

Instantly share code, notes, and snippets.

@genomewalker
Created October 12, 2017 09:27
Show Gist options
  • Save genomewalker/c723e0486a3f26e0a5d475d1880d9389 to your computer and use it in GitHub Desktop.
Save genomewalker/c723e0486a3f26e0a5d475d1880d9389 to your computer and use it in GitHub Desktop.
big_dada <- function(X){
cat("Processing:", X, "\n")
cat("Derep F:", X, "\n")
derepF <- derepFastq(filtpathF[[X]])
cat("Inferring F:", X, "\n")
ddF <- dada(derepF, err=errF, multithread=TRUE)
cat("Derep R:", X, "\n")
derepR <- derepFastq(filtpathR[[X]])
cat("Inferring R:", X, "\n")
ddR <- dada(derepR, err=errR, multithread=TRUE)
cat("Merging:", X, "\n")
merger <- mergePairs(ddF, derepF, ddR, derepR)
return(list(merger = merger, dadaFs = ddF, dadaRs = ddR))
}
library(pbmcapply)
names(filtpathF) <- sample.names
names(filtpathR) <- sample.names
mergers_l <- pbmclapply(sample.names, big_dada, mc.cores = 16)
# names(mergers_l) <- sample.names
# dadaFs <- purrr::map(mergers_l, "dadaFs")
# dadaRs <- purrr::map(mergers_l, "dadaRs")
# mergers <- purrr::map(mergers_l, "merger")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment