Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dialvarezs committed Oct 31, 2024
1 parent 0ebab07 commit 38ce756
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 101 deletions.
10 changes: 3 additions & 7 deletions subworkflows/local/bin_qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,22 @@ workflow BIN_QC {
// Set BUSCO database to empty to allow for --auto-lineage
ch_db_for_busco = Channel
.of([])
.map { empty_db -> [[lineage: ''], []] }
.map { _empty_db -> [[lineage: ''], []] }
.collect()
}

if (params.save_busco_db) {
// publish files downloaded by Busco
ch_downloads = BUSCO.out.busco_downloads
.groupTuple()
.map { lin, downloads -> downloads[0] }
.map { _lin, downloads -> downloads[0] }
.toSortedList()
.flatten()
BUSCO_SAVE_DOWNLOAD(ch_downloads)
}

BUSCO(bins, ch_db_for_busco)

// busco_summary_domain = BUSCO.out.summary_domain.collect()
// busco_summary_specific = BUSCO.out.summary_specific.collect()
// busco_failed_bin = BUSCO.out.failed_bin.collect()

BUSCO_SUMMARY(
BUSCO.out.summary_domain.map { it[1] }.collect().ifEmpty([]),
BUSCO.out.summary_specific.map { it[1] }.collect().ifEmpty([]),
Expand All @@ -80,7 +76,7 @@ workflow BIN_QC {
else if (params.binqc_tool == "checkm") {
// CheckM workflow
ch_bins_for_checkmlineagewf = bins
.filter { meta, bin ->
.filter { meta, _bins ->
meta.domain != "eukarya"
}
.multiMap { meta, fa ->
Expand Down
83 changes: 0 additions & 83 deletions subworkflows/local/busco_qc.nf

This file was deleted.

7 changes: 3 additions & 4 deletions subworkflows/local/gtdbtk.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ include { GTDBTK_SUMMARY } from '../../modules/local/gtdbtk_summary'
workflow GTDBTK {
take:
bins // channel: [ val(meta), [bins] ]
busco_summary // channel: path
checkm_summary // channel: path
bin_qc_summary // channel: path
gtdb // channel: path
gtdb_mash // channel: path

Expand All @@ -19,7 +18,7 @@ workflow GTDBTK {
ch_bin_metrics = Channel.empty()
if ( params.binqc_tool == 'busco' ){
// Collect completeness and contamination metrics from busco summary
ch_bin_metrics = busco_summary
ch_bin_metrics = bin_qc_summary
.splitCsv(header: true, sep: '\t')
.map { row ->
def completeness = -1
Expand All @@ -41,7 +40,7 @@ workflow GTDBTK {
// Collect completeness and contamination metrics from CheckM/CheckM2 summary
bin_name = params.binqc_tool == 'checkm' ? 'Bin Id' : 'Name'

ch_bin_metrics = checkm_summary
ch_bin_metrics = bin_qc_summary
.splitCsv(header: true, sep: '\t')
.map { row ->
def completeness = Double.parseDouble(row.'Completeness')
Expand Down
12 changes: 5 additions & 7 deletions workflows/mag.nf
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,7 @@ workflow MAG {
================================================================================
*/

ch_busco_summary = Channel.empty()
ch_checkm_summary = Channel.empty()
ch_checkm2_summary = Channel.empty()
bin_qc_summary = Channel.empty()

if (!params.skip_binning || params.ancient_dna) {
BINNING_PREPARATION(
Expand Down Expand Up @@ -803,10 +801,11 @@ workflow MAG {
ch_busco_db
)

bin_qc_summary = BIN_QC.out.summary
ch_versions = ch_versions.mix(BIN_QC.out.versions)

if (params.run_gunc) {
ch_input_bins_for_gunc = ch_input_for_postbinning.filter { meta, bins ->
ch_input_bins_for_gunc = ch_input_for_postbinning.filter { meta, _bins ->
meta.domain != "eukarya"
}

Expand Down Expand Up @@ -887,8 +886,7 @@ workflow MAG {

GTDBTK(
ch_gtdb_bins,
ch_busco_summary,
ch_checkm_summary,
bin_qc_summary,
gtdb,
gtdb_mash
)
Expand All @@ -903,7 +901,7 @@ workflow MAG {
if ((!params.skip_binqc) || !params.skip_quast || !params.skip_gtdbtk) {
BIN_SUMMARY(
ch_input_for_binsummary,
params.binqc_tool == "busco" ? ch_busco_summary.ifEmpty([]) : ch_checkm_summary.ifEmpty([]),
bin_qc_summary.ifEmpty([]),
ch_quast_bins_summary.ifEmpty([]),
ch_gtdbtk_summary.ifEmpty([]),
ch_cat_global_summary.ifEmpty([])
Expand Down

0 comments on commit 38ce756

Please sign in to comment.