Skip to content

Commit

Permalink
update msa_alignment subworkflow to not use conditional includes
Browse files Browse the repository at this point in the history
  • Loading branch information
mirpedrol committed Nov 6, 2024
1 parent 519be3b commit 3c1fdc2
Showing 1 changed file with 45 additions and 23 deletions.
68 changes: 45 additions & 23 deletions subworkflows/mirpedrol/msa_alignment/main.nf
Original file line number Diff line number Diff line change
@@ -1,35 +1,57 @@
if ( params.aligner == "clustalo/align" ) {
include { CLUSTALO_ALIGN as ALIGNER } from '../../../modules/mirpedrol/clustalo/align/main'
} else if ( params.aligner == "famsa/align" ) {
include { FAMSA_ALIGN as ALIGNER } from '../../../modules/mirpedrol/famsa/align/main'
} else if ( params.aligner == "kalign/align" ) {
include { KALIGN_ALIGN as ALIGNER } from '../../../modules/mirpedrol/kalign/align/main'
} else if ( params.aligner == "learnmsa/align" ) {
include { LEARNMSA_ALIGN as ALIGNER } from '../../../modules/mirpedrol/learnmsa/align/main'
} else if ( params.aligner == "mafft" ) {
include { MAFFT as ALIGNER } from '../../../modules/mirpedrol/mafft/main'
} else if ( params.aligner == "magus/align" ) {
include { MAGUS_ALIGN as ALIGNER } from '../../../modules/mirpedrol/magus/align/main'
} else if ( params.aligner == "muscle5/super5" ) {
include { MUSCLE5_SUPER5 as ALIGNER } from '../../../modules/mirpedrol/muscle5/super5/main'
} else if ( params.aligner == "tcoffee/align" ) {
include { TCOFFEE_ALIGN as ALIGNER } from '../../../modules/mirpedrol/tcoffee/align/main'
}
include { CLUSTALO_ALIGN } from '../../../modules/mirpedrol/clustalo/align/main'
include { FAMSA_ALIGN } from '../../../modules/mirpedrol/famsa/align/main'
include { KALIGN_ALIGN } from '../../../modules/mirpedrol/kalign/align/main'
include { LEARNMSA_ALIGN } from '../../../modules/mirpedrol/learnmsa/align/main'
include { MAFFT } from '../../../modules/mirpedrol/mafft/main'
include { MAGUS_ALIGN } from '../../../modules/mirpedrol/magus/align/main'
include { MUSCLE5_SUPER5 } from '../../../modules/mirpedrol/muscle5/super5/main'
include { TCOFFEE_ALIGN } from '../../../modules/mirpedrol/tcoffee/align/main'

workflow MSA_ALIGNMENT {

take:
ch_fasta // channel: [ meta, fasta ]

main:
def ch_out_alignment = Channel.empty()
def ch_versions = Channel.empty()

ch_versions = Channel.empty()

ALIGNER ( ch_fasta )
ch_versions = ch_versions.mix(ALIGNER.out.versions.first())
if ( params.aligner == "clustalo/align" ) {
CLUSTALO_ALIGN( ch_fasta )
ch_out_alignment = ch_out_alignment.mix(CLUSTALO_ALIGN.out.alignment)
ch_versions = ch_versions.mix(CLUSTALO_ALIGN.out.versions.first())
} else if ( params.aligner == "famsa/align" ) {
FAMSA_ALIGN( ch_fasta )
ch_out_alignment = ch_out_alignment.mix(FAMSA_ALIGN.out.alignment)
ch_versions = ch_versions.mix(FAMSA_ALIGN.out.versions.first())
} else if ( params.aligner == "kalign/align" ) {
KALIGN_ALIGN( ch_fasta )
ch_out_alignment = ch_out_alignment.mix(KALIGN_ALIGN.out.alignment)
ch_versions = ch_versions.mix(KALIGN_ALIGN.out.versions.first())
} else if ( params.aligner == "learnmsa/align" ) {
LEARNMSA_ALIGN( ch_fasta )
ch_out_alignment = ch_out_alignment.mix(LEARNMSA_ALIGN.out.alignment)
ch_versions = ch_versions.mix(LEARNMSA_ALIGN.out.versions.first())
} else if ( params.aligner == "mafft" ) {
MAFFT( ch_fasta )
ch_out_alignment = ch_out_alignment.mix(MAFFT.out.alignment)
ch_versions = ch_versions.mix(MAFFT.out.versions.first())
} else if ( params.aligner == "magus/align" ) {
MAGUS_ALIGN( ch_fasta )
ch_out_alignment = ch_out_alignment.mix(MAGUS_ALIGN.out.alignment)
ch_versions = ch_versions.mix(MAGUS_ALIGN.out.versions.first())
} else if ( params.aligner == "muscle5/super5" ) {
MUSCLE5_SUPER5( ch_fasta )
ch_out_alignment = ch_out_alignment.mix(MUSCLE5_SUPER5.out.alignment)
ch_versions = ch_versions.mix(MUSCLE5_SUPER5.out.versions.first())
} else if ( params.aligner == "tcoffee/align" ) {
TCOFFEE_ALIGN( ch_fasta )
ch_out_alignment = ch_out_alignment.mix(TCOFFEE_ALIGN.out.alignment)
ch_versions = ch_versions.mix(TCOFFEE_ALIGN.out.versions.first())
}

emit:
alignment = ALIGNER.out.alignment // channel: [ meta, *.aln.gz ]
versions = ch_versions // channel: [ versions.yml ]
alignment = ch_out_alignment // channel: [ meta, *.aln.gz ]
versions = ch_versions // channel: [ versions.yml ]
}

0 comments on commit 3c1fdc2

Please sign in to comment.