Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚡ Optimize samtools/depth step #74

Merged
merged 9 commits into from
Apr 11, 2024
Prev Previous commit
Next Next commit
⚡ calculate coverage depth by chromosome
  • Loading branch information
bunop committed Apr 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit c2749839a6508cc00f5596c4d0adeafc56711d61
9 changes: 5 additions & 4 deletions modules/nf-core/samtools/depth/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions modules/nf-core/samtools/depth/samtools-depth.diff

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions subworkflows/local/cram_freebayes_parallel/main.nf
Original file line number Diff line number Diff line change
@@ -18,8 +18,16 @@ workflow CRAM_FREEBAYES_PARALLEL {
main:
ch_versions = Channel.empty()

// calculate total coverage depth for all samples
SAMTOOLS_DEPTH( bam, [[], []] )
// read chromosome list from fasta index
chromosome_ch = fai.map{ it -> it[1] }
.splitCsv(header: false, sep: '\t')
.map{ row -> [[id: row[0], length: row[1]], row[0]] }
// .view()

// calculate total coverage depth for all samples by chromosome
// bam is a value channel; chromosome_ch is a queue channel
// for every chromosome
SAMTOOLS_DEPTH( bam, bai, chromosome_ch )
ch_versions = ch_versions.mix(SAMTOOLS_DEPTH.out.versions)

// split fasta in chunks relying BAM size