Skip to content

Commit

Permalink
Add funcscan code
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmezz committed Oct 10, 2024
1 parent 2bd8352 commit a744175
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 18 deletions.
2 changes: 2 additions & 0 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -760,12 +760,14 @@ Summary tool-specific plots and tables of following tools are currently displaye
The pipeline can also generate input files for the following downstream
pipelines:

- [nf-core/funcscan](https://nf-co.re/funcscan)
- [nf-core/taxprofiler](https://nf-co.re/taxprofiler)

<details markdown="1">
<summary>Output files</summary>

- `downstream_samplesheets/`
- `funcscan.csv`: Filled out nf-core/funcscan `--input` csv with absolute paths to the assembly FASTA files produced by MAG (MEGAHIT, SPAdes, SPAdesHybrid)
- `taxprofiler.csv`: Partially filled out nf-core/taxprofiler preprocessed short reads csv with paths to database directories or `.fast1.gz` relative to the results directory

</details>
Expand Down
13 changes: 13 additions & 0 deletions subworkflows/local/generate_downstream_samplesheets/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ workflow GENERATE_DOWNSTREAM_SAMPLESHEETS {
.tap{ ch_header }
}

if ( params.generate_pipeline_samplesheets == 'funcscan' ) {
format = 'csv'
format_sep = ','
ch_list_for_samplesheet = ch_assemblies
.map {
meta, filename ->
def sample = meta.id
def fasta = file(params.outdir).toString() + '/Assembly/' + meta.assembler + '/' + filename.getName()
[ sample: sample, fasta: fasta ]
}
.tap{ ch_header }
}

// Constructs the header string and then the strings of each row, and
// finally concatenates for saving.
ch_header
Expand Down
49 changes: 31 additions & 18 deletions workflows/mag.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_mag_
//
// SUBWORKFLOW: Consisting of a mix of local and nf-core/modules
//
include { BINNING_PREPARATION } from '../subworkflows/local/binning_preparation'
include { BINNING } from '../subworkflows/local/binning'
include { BINNING_REFINEMENT } from '../subworkflows/local/binning_refinement'
include { BUSCO_QC } from '../subworkflows/local/busco_qc'
include { VIRUS_IDENTIFICATION } from '../subworkflows/local/virus_identification'
include { CHECKM_QC } from '../subworkflows/local/checkm_qc'
include { GUNC_QC } from '../subworkflows/local/gunc_qc'
include { GTDBTK } from '../subworkflows/local/gtdbtk'
include { ANCIENT_DNA_ASSEMBLY_VALIDATION } from '../subworkflows/local/ancient_dna'
include { DOMAIN_CLASSIFICATION } from '../subworkflows/local/domain_classification'
include { DEPTHS } from '../subworkflows/local/depths'
include { GENERATE_DOWNSTREAM_SAMPLESHEETS } from '../subworkflows/local/generate_downstream_samplesheets/main.nf'
include { BINNING_PREPARATION } from '../subworkflows/local/binning_preparation'
include { BINNING } from '../subworkflows/local/binning'
include { BINNING_REFINEMENT } from '../subworkflows/local/binning_refinement'
include { BUSCO_QC } from '../subworkflows/local/busco_qc'
include { VIRUS_IDENTIFICATION } from '../subworkflows/local/virus_identification'
include { CHECKM_QC } from '../subworkflows/local/checkm_qc'
include { GUNC_QC } from '../subworkflows/local/gunc_qc'
include { GTDBTK } from '../subworkflows/local/gtdbtk'
include { ANCIENT_DNA_ASSEMBLY_VALIDATION } from '../subworkflows/local/ancient_dna'
include { DOMAIN_CLASSIFICATION } from '../subworkflows/local/domain_classification'
include { DEPTHS } from '../subworkflows/local/depths'
include { GENERATE_DOWNSTREAM_SAMPLESHEETS as GENERATE_DOWNSTREAM_SAMPLESHEETS_FUNCSCAN } from '../subworkflows/local/generate_downstream_samplesheets/main.nf'
include { GENERATE_DOWNSTREAM_SAMPLESHEETS as GENERATE_DOWNSTREAM_SAMPLESHEETS_TAXPROFILER } from '../subworkflows/local/generate_downstream_samplesheets/main.nf'

//
// MODULE: Installed directly from nf-core/modules
Expand Down Expand Up @@ -1006,13 +1007,25 @@ workflow MAG {
//
// Samplesheet generation
//
ch_input_for_samplesheet = Channel
.empty()
.mix( ch_short_reads_assembly )
// if ( params.generate_pipeline_samplesheets.contains("taxprofiler") ) {
ch_input_for_samplesheet = Channel
.empty()
.mix( ch_short_reads_assembly )

if ( params.generate_downstream_samplesheets ) {
GENERATE_DOWNSTREAM_SAMPLESHEETS ( ch_input_for_samplesheet )
}
if ( params.generate_downstream_samplesheets ) {
GENERATE_DOWNSTREAM_SAMPLESHEETS_TAXPROFILER ( ch_input_for_samplesheet )
}
// }

// if ( params.generate_pipeline_samplesheets.contains("funcscan") ) {
ch_input_for_samplesheet = Channel
.empty()
.mix( ch_assemblies )

if ( params.generate_downstream_samplesheets ) {
GENERATE_DOWNSTREAM_SAMPLESHEETS_FUNCSCAN ( ch_input_for_samplesheet )
}
// }

//
// Collate and save software versions
Expand Down

0 comments on commit a744175

Please sign in to comment.