Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 42 additions & 25 deletions subworkflows/nf-core/fasta_gxf_busco_plot/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ workflow FASTA_GXF_BUSCO_PLOT {
val_busco_cleanup // val(boolean); Set to true to remove BUSCO intermediate files

main:
ch_versions = Channel.empty()
ch_versions = channel.empty()
ch_db_path = val_busco_lineages_path
? Channel.of(file(val_busco_lineages_path, checkIfExists: true))
: Channel.of( [ [] ] )
? channel.of(file(val_busco_lineages_path, checkIfExists: true))
: channel.of( [ [] ] )
ch_config_path = val_busco_config
? Channel.of(file(val_busco_config, checkIfExists: true))
: Channel.of( [ [] ] )
ch_busco_cleanup = Channel.of([val_busco_cleanup])
? channel.of(file(val_busco_config, checkIfExists: true))
: channel.of( [ [] ] )
ch_busco_cleanup = channel.of([val_busco_cleanup])

// MODULE: BUSCO_BUSCO as BUSCO_ASSEMBLY
ch_busco_assembly_inputs = ch_fasta
| combine(
Channel.of(val_mode)
channel.of(val_mode)
)
| combine(
Channel.fromList(val_lineages)
channel.fromList(val_lineages)
)
| map { meta, fasta, mode, lineage ->
[
Expand All @@ -58,14 +58,22 @@ workflow FASTA_GXF_BUSCO_PLOT {
| combine(
ch_busco_cleanup
)
| multiMap { meta, fasta, mode, lineage, db, config, cleanup ->
fasta: [ meta, fasta ]
mode: mode
lineage: lineage
db: db
config: config
cleanup: cleanup
}

BUSCO_ASSEMBLY(
ch_busco_assembly_inputs.map { meta, fasta, _mode, _lineage, _db, _config, _cleanup -> [ meta, fasta ] },
ch_busco_assembly_inputs.map { _meta, _fasta, mode, _lineage, _db, _config, _cleanup -> mode },
ch_busco_assembly_inputs.map { _meta, _fasta, _mode, lineage, _db, _config, _cleanup -> lineage },
ch_busco_assembly_inputs.map { _meta, _fasta, _mode, _lineage, db, _config, _cleanup -> db },
ch_busco_assembly_inputs.map { _meta, _fasta, _mode, _lineage, _db, config, _cleanup -> config },
ch_busco_assembly_inputs.map { _meta, _fasta, _mode, _lineage, _db, _config, cleanup -> cleanup }
ch_busco_assembly_inputs.fasta,
ch_busco_assembly_inputs.mode,
ch_busco_assembly_inputs.lineage,
ch_busco_assembly_inputs.db,
ch_busco_assembly_inputs.config,
ch_busco_assembly_inputs.cleanup
)

ch_assembly_batch_summary = BUSCO_ASSEMBLY.out.batch_summary
Expand All @@ -77,7 +85,7 @@ workflow FASTA_GXF_BUSCO_PLOT {
// MODULE: BUSCO_GENERATEPLOT as PLOT_ASSEMBLY
ch_assembly_plot_summary = ch_assembly_short_summaries_txt
| map { meta, txt ->
def lineage_name = meta.lineage - '_odb'
def lineage_name = meta.lineage - ~/'_odb[0-9]+$'/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work for _odb12, etc.

[
"short_summary.specific.${meta.lineage}.${meta.id}_${lineage_name}.txt",
txt.text
Expand All @@ -92,7 +100,7 @@ workflow FASTA_GXF_BUSCO_PLOT {

// MODULE: GFFREAD as EXTRACT_PROTEINS
ch_gffread_inputs = val_mode !in [ 'geno', 'genome' ]
? Channel.empty()
? channel.empty()
: ch_fasta
| map { meta, fasta -> [ meta.id, meta, fasta ] }
| join(
Expand All @@ -112,10 +120,10 @@ workflow FASTA_GXF_BUSCO_PLOT {
// MODULE: BUSCO_BUSCO as BUSCO_ANNOTATION
ch_busco_annotation_inputs = ch_proteins
| combine(
Channel.of('proteins')
channel.of('proteins')
)
| combine(
Channel.fromList(val_lineages)
channel.fromList(val_lineages)
)
| map { meta, fasta, mode, lineage ->
[
Expand All @@ -132,14 +140,23 @@ workflow FASTA_GXF_BUSCO_PLOT {
| combine(
ch_busco_cleanup
)
| multiMap { meta, fasta, mode, lineage, db, config, cleanup ->
fasta: [ meta, fasta ]
mode: mode
lineage: lineage
db: db
config: config
cleanup: cleanup
}


BUSCO_ANNOTATION(
ch_busco_annotation_inputs.map { meta, fasta, _mode, _lineage, _db, _config, _cleanup -> [ meta, fasta ] },
ch_busco_annotation_inputs.map { _meta, _fasta, mode, _lineage, _db, _config, _cleanup -> mode },
ch_busco_annotation_inputs.map { _meta, _fasta, _mode, lineage, _db, _config, _cleanup -> lineage },
ch_busco_annotation_inputs.map { _meta, _fasta, _mode, _lineage, db, _config, _cleanup -> db },
ch_busco_annotation_inputs.map { _meta, _fasta, _mode, _lineage, _db, config, _cleanup -> config },
ch_busco_annotation_inputs.map { _meta, _fasta, _mode, _lineage, _db, _config, cleanup -> cleanup }
ch_busco_annotation_inputs.fasta,
ch_busco_annotation_inputs.mode,
ch_busco_annotation_inputs.lineage,
ch_busco_annotation_inputs.db,
ch_busco_annotation_inputs.config,
ch_busco_annotation_inputs.cleanup
)

ch_annotation_batch_summary = BUSCO_ANNOTATION.out.batch_summary
Expand All @@ -151,7 +168,7 @@ workflow FASTA_GXF_BUSCO_PLOT {
// MODULE: BUSCO_GENERATEPLOT as PLOT_ANNOTATION
ch_annotation_plot_summary = ch_annotation_short_summaries_txt
| map { meta, txt ->
def lineage_name = meta.lineage - '_odb'
def lineage_name = meta.lineage - ~/'_odb[0-9]+$'/
[
"short_summary.specific.${meta.lineage}.${meta.id}_${lineage_name}.proteins.txt",
txt.text
Expand Down
Loading