Skip to content

Commit 295f967

Browse files
committed
refactor(samtools): nf-core subworkflows install bam_sort_stats_samtools
1 parent 207640c commit 295f967

File tree

7 files changed

+31
-108
lines changed

7 files changed

+31
-108
lines changed

subworkflows/local/align_star.nf

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
include { STAR_ALIGN } from '../../modules/nf-core/star/align/main'
66
include { STAR_ALIGN_IGENOMES } from '../../modules/local/star_align_igenomes'
7-
include { BAM_SORT_SAMTOOLS } from '../nf-core/bam_sort_samtools'
7+
include { BAM_SORT_STATS_SAMTOOLS } from '../nf-core/bam_sort_stats_samtools/main'
88

99
workflow ALIGN_STAR {
1010
take:
@@ -15,6 +15,7 @@ workflow ALIGN_STAR {
1515
seq_platform // string : sequencing platform
1616
seq_center // string : sequencing center
1717
is_aws_igenome // boolean: whether the genome files are from AWS iGenomes
18+
fasta // channel: /path/to/fasta
1819

1920
main:
2021

@@ -58,8 +59,8 @@ workflow ALIGN_STAR {
5859
//
5960
// Sort, index BAM file and run samtools stats, flagstat and idxstats
6061
//
61-
BAM_SORT_SAMTOOLS ( ch_orig_bam )
62-
ch_versions = ch_versions.mix(BAM_SORT_SAMTOOLS.out.versions)
62+
BAM_SORT_STATS_SAMTOOLS ( ch_orig_bam, fasta )
63+
ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions)
6364

6465
emit:
6566
orig_bam = ch_orig_bam // channel: [ val(meta), bam ]
@@ -71,12 +72,12 @@ workflow ALIGN_STAR {
7172
fastq = ch_fastq // channel: [ val(meta), fastq ]
7273
tab = ch_tab // channel: [ val(meta), tab ]
7374

74-
bam = BAM_SORT_SAMTOOLS.out.bam // channel: [ val(meta), [ bam ] ]
75-
bai = BAM_SORT_SAMTOOLS.out.bai // channel: [ val(meta), [ bai ] ]
76-
csi = BAM_SORT_SAMTOOLS.out.csi // channel: [ val(meta), [ csi ] ]
77-
stats = BAM_SORT_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ]
78-
flagstat = BAM_SORT_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ]
79-
idxstats = BAM_SORT_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ]
75+
bam = BAM_SORT_STATS_SAMTOOLS.out.bam // channel: [ val(meta), [ bam ] ]
76+
bai = BAM_SORT_STATS_SAMTOOLS.out.bai // channel: [ val(meta), [ bai ] ]
77+
csi = BAM_SORT_STATS_SAMTOOLS.out.csi // channel: [ val(meta), [ csi ] ]
78+
stats = BAM_SORT_STATS_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ]
79+
flagstat = BAM_SORT_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ]
80+
idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ]
8081

8182
versions = ch_versions // channel: [ versions.yml ]
8283
}

subworkflows/local/quantify_rsem.nf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
include { RSEM_CALCULATEEXPRESSION } from '../../modules/nf-core/rsem/calculateexpression/main'
66
include { RSEM_MERGE_COUNTS } from '../../modules/local/rsem_merge_counts'
7-
include { BAM_SORT_SAMTOOLS } from '../nf-core/bam_sort_samtools'
7+
include { BAM_SORT_STATS_SAMTOOLS } from '../nf-core/bam_sort_stats_samtools/main'
88

99
workflow QUANTIFY_RSEM {
1010
take:
@@ -24,8 +24,8 @@ workflow QUANTIFY_RSEM {
2424
//
2525
// Sort, index BAM file and run samtools stats, flagstat and idxstats
2626
//
27-
BAM_SORT_SAMTOOLS ( RSEM_CALCULATEEXPRESSION.out.bam_star )
28-
ch_versions = ch_versions.mix(BAM_SORT_SAMTOOLS.out.versions)
27+
BAM_SORT_STATS_SAMTOOLS ( RSEM_CALCULATEEXPRESSION.out.bam_star, [] )
28+
ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions)
2929

3030
//
3131
// Merge counts across samples
@@ -45,12 +45,12 @@ workflow QUANTIFY_RSEM {
4545
bam_genome = RSEM_CALCULATEEXPRESSION.out.bam_genome // channel: [ val(meta), bam ]
4646
bam_transcript = RSEM_CALCULATEEXPRESSION.out.bam_transcript // channel: [ val(meta), bam ]
4747

48-
bam = BAM_SORT_SAMTOOLS.out.bam // channel: [ val(meta), [ bam ] ]
49-
bai = BAM_SORT_SAMTOOLS.out.bai // channel: [ val(meta), [ bai ] ]
50-
csi = BAM_SORT_SAMTOOLS.out.csi // channel: [ val(meta), [ csi ] ]
51-
stats = BAM_SORT_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ]
52-
flagstat = BAM_SORT_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ]
53-
idxstats = BAM_SORT_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ]
48+
bam = BAM_SORT_STATS_SAMTOOLS.out.bam // channel: [ val(meta), [ bam ] ]
49+
bai = BAM_SORT_STATS_SAMTOOLS.out.bai // channel: [ val(meta), [ bai ] ]
50+
csi = BAM_SORT_STATS_SAMTOOLS.out.csi // channel: [ val(meta), [ csi ] ]
51+
stats = BAM_SORT_STATS_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ]
52+
flagstat = BAM_SORT_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ]
53+
idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ]
5454

5555
merged_counts_gene = RSEM_MERGE_COUNTS.out.counts_gene // path: *.gene_counts.tsv
5656
merged_tpm_gene = RSEM_MERGE_COUNTS.out.tpm_gene // path: *.gene_tpm.tsv

subworkflows/nf-core/bam_sort_samtools.nf

Lines changed: 0 additions & 49 deletions
This file was deleted.

subworkflows/nf-core/bam_stats_samtools.nf

Lines changed: 0 additions & 31 deletions
This file was deleted.

subworkflows/nf-core/dedup_umi_umitools.nf

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

subworkflows/nf-core/mark_duplicates_picard.nf

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workflows/rnaseq.nf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoft
145145
//
146146
include { FASTQC_UMITOOLS_TRIMGALORE } from '../subworkflows/nf-core/fastqc_umitools_trimgalore'
147147
include { FASTQ_ALIGN_HISAT2 } from '../subworkflows/nf-core/fastq_align_hisat2/main'
148-
include { BAM_SORT_SAMTOOLS } from '../subworkflows/nf-core/bam_sort_samtools'
148+
include { BAM_SORT_STATS_SAMTOOLS } from '../subworkflows/nf-core/bam_sort_stats_samtools/main'
149149
include { MARK_DUPLICATES_PICARD } from '../subworkflows/nf-core/mark_duplicates_picard'
150150
include { RSEQC } from '../subworkflows/nf-core/rseqc'
151151
include { DEDUP_UMI_UMITOOLS as DEDUP_UMI_UMITOOLS_GENOME } from '../subworkflows/nf-core/dedup_umi_umitools'
@@ -328,7 +328,8 @@ workflow RNASEQ {
328328
params.star_ignore_sjdbgtf,
329329
'',
330330
params.seq_center ?: '',
331-
is_aws_igenome
331+
is_aws_igenome,
332+
PREPARE_GENOME.out.fasta
332333
)
333334
ch_genome_bam = ALIGN_STAR.out.bam
334335
ch_genome_bam_index = ALIGN_STAR.out.bai
@@ -362,11 +363,12 @@ workflow RNASEQ {
362363
ch_versions = ch_versions.mix(DEDUP_UMI_UMITOOLS_GENOME.out.versions)
363364

364365
// Co-ordinate sort, index and run stats on transcriptome BAM
365-
BAM_SORT_SAMTOOLS (
366-
ch_transcriptome_bam
366+
BAM_SORT_STATS_SAMTOOLS (
367+
ch_transcriptome_bam,
368+
PREPARE_GENOME.out.fasta
367369
)
368-
ch_transcriptome_sorted_bam = BAM_SORT_SAMTOOLS.out.bam
369-
ch_transcriptome_sorted_bai = BAM_SORT_SAMTOOLS.out.bai
370+
ch_transcriptome_sorted_bam = BAM_SORT_STATS_SAMTOOLS.out.bam
371+
ch_transcriptome_sorted_bai = BAM_SORT_STATS_SAMTOOLS.out.bai
370372

371373
// Deduplicate transcriptome BAM file before read counting with Salmon
372374
DEDUP_UMI_UMITOOLS_TRANSCRIPTOME (

0 commit comments

Comments
 (0)