Skip to content

Commit

Permalink
add skeleton summary process
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Downie committed Dec 12, 2024
1 parent b6f807a commit 674b4ad
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 12 deletions.
6 changes: 6 additions & 0 deletions modules/local/bin_summary/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::r-base=4.4
- conda-forge::r-tidyverse=2.0.0
17 changes: 17 additions & 0 deletions modules/local/bin_summary/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
process BIN_SUMMARY {
label "process_low"

conda "${moduleDir}/environment.yml"
container "docker.io/rocker/tidyverse:4.4"

input:
tuple val(meta), path(stats), path(checkm2), path(taxonomy)

output:
tuple val(meta), path("bin_summary.tsv")

script:
"""
echo test > bin_summary.tsv
"""
}
6 changes: 3 additions & 3 deletions subworkflows/local/bin_qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ workflow BIN_QC {
ch_versions = ch_versions.mix(SEQKIT_STATS.out.versions)

emit:
checkm_tsv = ch_checkm2_tsv
stats = SEQKIT_STATS.out.stats
versions = ch_versions
checkm2_tsv = ch_checkm2_tsv
stats = SEQKIT_STATS.out.stats
versions = ch_versions
}
2 changes: 1 addition & 1 deletion subworkflows/local/binning.nf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ workflow BINNING {
ch_versions = ch_versions.mix(GAWK_MAXBIN2_DEPTHS.out.versions)

ch_maxbin2_input = assemblies
| combine(MAXBIN2_DEPTHS.out.output, by: 0)
| combine(GAWK_MAXBIN2_DEPTHS.out.output, by: 0)
| map { meta, contigs, depths ->
[meta, contigs, [], depths]
}
Expand Down
39 changes: 31 additions & 8 deletions workflows/longreadmag.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ include { BINNING } from '../subworkflows/local/binn
include { BIN_QC } from '../subworkflows/local/bin_qc.nf'
include { BIN_TAXONOMY } from '../subworkflows/local/bin_taxonomy'
include { BIN_REFINEMENT } from '../subworkflows/local/bin_refinement'
include { CONTIG2BIN2FASTA as BINS_TO_PROTEIN } from '../modules/local/contig2bin2fasta/main'
include { BIN_SUMMARY } from '../modules/local/bin_summary'
include { CONTIG2BIN2FASTA as BINS_TO_PROTEIN } from '../modules/local/contig2bin2fasta'
include { PREPARE_DATA } from '../subworkflows/local/prepare_data'
include { READ_MAPPING } from '../subworkflows/local/read_mapping'

Expand Down Expand Up @@ -113,14 +114,36 @@ workflow LONGREADMAG {
if(params.enable_binqc) {
BIN_QC(ch_bins, ch_aa_bins)
ch_versions = ch_versions.mix(BIN_QC.out.versions)
ch_checkm2_tsv = BIN_QC.out.checkm_tsv
} else {
ch_checkm2_tsv = Channel.empty()
}

if(params.enable_taxonomy) {
BIN_TAXONOMY(ch_aa_bins, ch_checkm2_tsv)
ch_versions = ch_versions.mix(BIN_TAXONOMY.out.versions)
if(params.enable_taxonomy) {
BIN_TAXONOMY(ch_aa_bins, BIN_QC.out.checkm2_tsv)
ch_versions = ch_versions.mix(BIN_TAXONOMY.out.versions)

ch_taxonomy_tsv = BIN_TAXONOMY.out.gtdb_ncbi
} else {
ch_taxonomy_tsv = Channel.empty()
}

if(params.enable_summary) {
ch_stats_collated = BIN_QC.out.stats
| map { meta, stats -> [ meta.subMap('id'), stats] }
| groupTuple(by: 0)

ch_checkm2_collated = BIN_QC.out.checkm2_tsv
| map { meta, stats -> [ meta.subMap('id'), stats] }
| groupTuple(by: 0)

ch_taxonomy_collated = ch_taxonomy_tsv
| map { meta, stats -> [ meta.subMap('id'), stats] }
| groupTuple(by: 0)

ch_bin_summary_input = ch_stats_collated
| combine(ch_checkm2_collated, by: 0)
| combine(ch_taxonomy_collated, by: 0)

BIN_SUMMARY(ch_bin_summary_input)
ch_versions = ch_versions.mix(BIN_SUMMARY.out.versions)
}
}
}
}
Expand Down

0 comments on commit 674b4ad

Please sign in to comment.