Skip to content

Commit

Permalink
Merge branch 'dev' into circularmapper
Browse files Browse the repository at this point in the history
  • Loading branch information
TCLamnidis authored Jul 25, 2024
2 parents 224994f + 0ceda2c commit b306e74
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ process {
}

withName: ".*BAM_SPLIT_BY_REGION:SAMTOOLS_INDEX" {
// The BAM_SPLIT_BY_REGION SWF only works with bais, so `params.fasta_largeref` should not be passed to it.
tag = { "${meta.reference}:${meta.genomic_region}|${meta.sample_id}_${meta.library_id}" }
ext.args = { params.fasta_largeref ? "-c" : "" }
ext.prefix = { "${meta.sample_id}_${meta.library_id}_${meta.reference}_${meta.genomic_region}_dedupped" }
publishDir = [
enabled: false
Expand Down
8 changes: 5 additions & 3 deletions subworkflows/local/bamfiltering.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include { CAT_FASTQ as CAT_FASTQ_MAPPED } from '../../modules/
workflow FILTER_BAM {

take:
bam // [ [meta], [bam], [bai] ]
bam // [ [meta], [bam], [bai/csi] ]

main:
ch_versions = Channel.empty()
Expand All @@ -37,9 +37,10 @@ workflow FILTER_BAM {
ch_versions = ch_versions.mix( FILTER_BAM_FRAGMENT_LENGTH.out.versions.first() )

SAMTOOLS_LENGTH_FILTER_INDEX ( FILTER_BAM_FRAGMENT_LENGTH.out.bam )
ch_length_filtered_index = params.fasta_largeref ? SAMTOOLS_LENGTH_FILTER_INDEX.out.csi : SAMTOOLS_LENGTH_FILTER_INDEX.out.bai
ch_versions = ch_versions.mix( SAMTOOLS_LENGTH_FILTER_INDEX.out.versions.first() )

ch_bam_for_qualityfilter = FILTER_BAM_FRAGMENT_LENGTH.out.bam.join( SAMTOOLS_LENGTH_FILTER_INDEX.out.bai )
ch_bam_for_qualityfilter = FILTER_BAM_FRAGMENT_LENGTH.out.bam.join( ch_length_filtered_index )

} else {
ch_bam_for_qualityfilter = bam
Expand All @@ -52,9 +53,10 @@ workflow FILTER_BAM {
ch_versions = ch_versions.mix( SAMTOOLS_VIEW_BAM_FILTERING.out.versions.first() )

SAMTOOLS_FILTER_INDEX ( SAMTOOLS_VIEW_BAM_FILTERING.out.bam )
ch_filtered_bam_index = params.fasta_largeref ? SAMTOOLS_FILTER_INDEX.out.csi : SAMTOOLS_FILTER_INDEX.out.bai
ch_versions = ch_versions.mix( SAMTOOLS_FILTER_INDEX.out.versions.first() )

ch_bam_for_genomics = SAMTOOLS_VIEW_BAM_FILTERING.out.bam.join( SAMTOOLS_FILTER_INDEX.out.bai )
ch_bam_for_genomics = SAMTOOLS_VIEW_BAM_FILTERING.out.bam.join( ch_filtered_bam_index )

// Only run if we actually remove mapped reads
if ( params.bamfiltering_mappingquality != 0 || params.bamfiltering_minreadlength != 0 ) {
Expand Down
5 changes: 1 addition & 4 deletions workflows/eager.nf
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,7 @@ workflow EAGER {
//
// MODULE: flagstats of user supplied input BAMs
//
ch_bam_bai_input = ch_samplesheet_bams
.join(SAMTOOLS_INDEX_BAM_INPUT.out.bai)

SAMTOOLS_FLAGSTATS_BAM_INPUT ( ch_bam_bai_input )
SAMTOOLS_FLAGSTATS_BAM_INPUT ( ch_bams_from_input )
ch_versions = ch_versions.mix( SAMTOOLS_FLAGSTATS_BAM_INPUT.out.versions )
ch_flagstat_input_bam = SAMTOOLS_FLAGSTATS_BAM_INPUT.out.flagstat // For endorspy

Expand Down

0 comments on commit b306e74

Please sign in to comment.