Skip to content

Commit

Permalink
fixing se bam name sorting for genrich
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelruizperez committed Aug 15, 2023
1 parent 3932ea2 commit 238f781
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions subworkflows/local/bam_nofilter_bamtools.nf
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,26 @@ workflow BAM_NOFILTER_BAMTOOLS {
ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions.first())

//
// Name sort PE BAM before filtering with pysam
// Name sort BAM
//
SAMTOOLS_SORT (
ch_bam_b.paired_end
ch_bam_b
)
ch_bam_b_pe = SAMTOOLS_SORT.out.bam.paired_end
ch_bam_b_se = SAMTOOLS_SORT.out.bam.single_end
ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first())

//
// Sort, index PE BAM file and run samtools stats, flagstat and idxstats
//
BAM_SORT_STATS_SAMTOOLS (
SAMTOOLS_SORT.out.bam,
ch_bam_b_pe,
ch_fasta
)
ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions.first())

emit:
name_bam = SAMTOOLS_SORT.out.bam.mix(ch_bam_b.single_end) // channel: [ val(meta), [ bam ] ]
name_bam = ch_bam_b_pe.mix(ch_bam_b_se.single_end) // channel: [ val(meta), [ bam ] ]
bam = BAM_SORT_STATS_SAMTOOLS.out.bam.mix(ch_bam_b.single_end) // channel: [ val(meta), [ bam ] ]
stats = BAM_SORT_STATS_SAMTOOLS.out.stats.mix(BAM_STATS_SAMTOOLS.out.stats) // channel: [ val(meta), [ stats ] ]
flagstat = BAM_SORT_STATS_SAMTOOLS.out.flagstat.mix(BAM_STATS_SAMTOOLS.out.flagstat) // channel: [ val(meta), [ flagstat ] ]
Expand Down

0 comments on commit 238f781

Please sign in to comment.