Skip to content
Merged

Dev #432

Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ process {
time = { 1.h * ( reference.size() < 1e9 ? 10 : reference.size() < 10e9 ? 30 : 48) }
}

withName: '.*:.*:READ_COVERAGE:BEDTOOLS_GENOMECOV' {
memory = { 6.GB * (task.attempt * task.attempt) }
withName: BEDTOOLS_GENOMECOV {
memory = { 8.GB * (task.attempt * task.attempt) }
time = { 12.h * task.attempt }
}

Expand Down Expand Up @@ -247,8 +247,8 @@ process {
// If 100-150GB -> 50GB + (BAM/4GB)
// If >150GB -> BAM/4GB
(bam.size() <= 150e9 ?
50.GB + (1.GB * Math.ceil(bam.size() / 4e9)) :
1.GB * Math.ceil(bam.size() / 4e9)
50.GB + (1.GB * Math.ceil(bam.size() / 3e9)) :
1.GB * Math.ceil(bam.size() / 3e9)
)
) * Math.ceil(task.attempt * 1)
}
Expand All @@ -257,7 +257,7 @@ process {

withName: SAMTOOLS_MARKDUP {
cpus = { 12 * 1 }
memory = { 1.GB * Math.ceil( ( (input.size() / 1e9) / 4 ) ) * task.attempt }
memory = { 1.GB * Math.ceil( ( (input.size() / 1e9) / 3 ) ) * task.attempt }
}

withName: COOLER_CLOAD {
Expand Down Expand Up @@ -347,7 +347,7 @@ process {
}

withName: BEDTOOLS_INTERSECT {
memory = { 6.GB * (task.attempt * task.attempt) }
memory = { 8.GB * (task.attempt * task.attempt) }
}

withName: GENERATE_CRAM_CSV {
Expand Down
5 changes: 4 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ work # Directory containing the nextflow working files

The TreeVal pipeline now contains a command line option for `--mode` which replaces the now depreciated `-entry` parameter.

This enum param expects only one of ["FULL", "RAPID", "RAPID-TOL", "JBROWSE"].
This enum param expects only one of ["FULL", "RAPID", "RAPID-TOL", "JBROWSE", "FULL_COMBINED"].

FULL will run all subworkflows shows in all_steps_list.

Expand All @@ -459,10 +459,13 @@ This qualifies as: if (false && false) { run juicer } or if workflow is RAPID_TO

JBROWSE, generates the data which can be ingested by JBROWSE. Useful when RAPID has been used in a previous run and you now need "the rest" of the data. This runs all subworkflows notes in jbrowse_include_list.

FULL_COMBINED runs all subworkflows in combined_include_list, which includes all steps except selfcomp and gene_alignment.

```
all_steps_list = ["insilico_digest", "gene_alignment", "repeat_density", "gap_finder", "selfcomp", "synteny", "read_coverage", "telo_finder", "busco", "kmer", "hic_mapping", "NONE"]

jbrowse_include_list = ["insilico_digest", "gene_alignment", "selfcomp", "synteny", "busco", "kmer"]
combined_include_list = ["insilico_digest", "repeat_density", "gap_finder", "synteny", "read_coverage", "telo_finder", "busco", "kmer", "hic_mapping"]
rapid_include_list = ["repeat_density", "gap_finder", "read_coverage", "telo_finder", "hic_mapping", "kmer"]
```

Expand Down
4 changes: 2 additions & 2 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
},
"mode": {
"type": "string",
"description": "Run mode specified (FULL, RAPID, RAPID_TOL, JBROWSE)",
"enum": ["FULL", "RAPID", "RAPID_TOL", "JBROWSE"],
"description": "Run mode specified (FULL, RAPID, RAPID_TOL, JBROWSE, FULL_COMBINED)",
"enum": ["FULL", "RAPID", "RAPID_TOL", "JBROWSE", "FULL_COMBINED"],
"fa_icon": "fas fa-folder-open"
},
"run_hires": {
Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/hic_mapping/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ workflow HIC_MAPPING {
//
// LOGIC: MAKE YAHS INPUT
//
ref_yahs.map { meta, ref -> ref }.set{ch_ref}
reference_tuple.map { meta, ref -> ref }.set{ch_ref}
reference_index.map { meta, fai -> fai }.set{ch_fai}

//
Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/utils_nfcore_treeval_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ workflow PIPELINE_INITIALISATION {
nextflow_cli_args // array: List of positional nextflow CLI args
outdir // string: The output directory where the results will be saved
input // string: Path to input YAML
mode // string: Run mode, default FULL, alternatives: JBROWSE, RAPID, RAPID_TOL
mode // string: Run mode, default FULL, alternatives: JBROWSE, RAPID, RAPID_TOL, FULL_COMBINED

main:

Expand Down
53 changes: 34 additions & 19 deletions workflows/treeval.nf
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,53 @@ workflow TREEVAL {
//
ch_versions = Channel.empty()

exclude_steps_list = params.steps.length() > 1 ? params.steps.tokenize(',').collect { it.trim() } : params.steps
exclude_steps_list = params.steps == "NONE" ? [] : params.steps.tokenize(',').collect { it.trim() }

all_steps_list = ["insilico_digest", "gene_alignment", "repeat_density", "gap_finder", "selfcomp", "synteny", "read_coverage", "telo_finder", "busco", "kmer", "hic_mapping", "NONE"]

jbrowse_include_list = ["insilico_digest", "gene_alignment", "selfcomp", "synteny", "busco", "kmer"]

combined_include_list = ["insilico_digest", "repeat_density", "gap_finder", "synteny", "read_coverage", "telo_finder", "busco", "kmer", "hic_mapping"]

rapid_include_list = ["repeat_density", "gap_finder", "read_coverage", "telo_finder", "hic_mapping", "kmer"]

// Map of mode to corresponding include list for cleaner logic
mode_include_map = [
"JBROWSE" : jbrowse_include_list,
"RAPID" : rapid_include_list,
"RAPID_TOL" : rapid_include_list,
"FULL_COMBINED" : combined_include_list
]

//
// Add exclude determined by run mode (JBROWSE, RAPID, RAPID_TOL)
// take all processes, remove those in the mode include list and add on cli added exclude steps.
// Determine workflow steps based on run mode
// Take processes from the mode's include list, remove any CLI excluded steps
//
if (params.mode == "JBROWSE") {
include_workflow_steps = (jbrowse_include_list - exclude_steps_list).unique()
} else if (params.mode == "RAPID") {
include_workflow_steps = (rapid_include_list - exclude_steps_list).unique()
} else if (params.mode == "RAPID_TOL") {
include_workflow_steps = (rapid_include_list - exclude_steps_list).unique()
} else {
include_workflow_steps = (all_steps_list - exclude_steps_list).unique()
}
include_workflow_steps = mode_include_map.containsKey(params.mode) ?
(mode_include_map[params.mode] - exclude_steps_list).unique() :
(all_steps_list - exclude_steps_list).unique()

// This acts as a "double check" for the user
log.info "[Treeval: Info] PROCESSES TO RUN INCLUDE: $include_workflow_steps"

if (!all_steps_list.containsAll(include_workflow_steps)) {
log.error "[Treeval: Error] There is an extra argument given on Command Line (--steps): ${exclude_steps_list - all_steps_list}"
// Validate that all requested steps are valid
invalid_steps = exclude_steps_list - all_steps_list
if (invalid_steps) {
log.error "[Treeval: Error] Invalid step(s) specified in --steps: ${invalid_steps.join(", ")}"
log.error "[Treeval: Error] Valid options are: ${all_steps_list.join(", ")}"
System.exit(1)
}

// Validate that include_workflow_steps contains only valid steps (safety check)
invalid_include_steps = include_workflow_steps - all_steps_list
if (invalid_include_steps) {
log.error "[Treeval: Error] Internal error - invalid workflow steps detected: ${invalid_include_steps.join(", ")}"
System.exit(1)
}

//
// ASSET CHANNELS: Set up channels for required asset files
//
Channel
.fromPath( "${projectDir}/assets/gene_alignment/assm_*.as", checkIfExists: true)
.map { as_file ->
Expand Down Expand Up @@ -186,10 +203,9 @@ workflow TREEVAL {
GENERATE_GENOME.out.dot_genome
)
ch_versions = ch_versions.mix( REPEAT_DENSITY.out.versions )

ch_repeat_density = REPEAT_DENSITY.out.repeat_density
} else {
ch_repeat_density = [[],[]]
ch_repeat_density = Channel.of([[],[]])
}


Expand All @@ -201,7 +217,6 @@ workflow TREEVAL {
reference
)
ch_versions = ch_versions.mix( GAP_FINDER.out.versions )

ch_gap_file = GAP_FINDER.out.gap_file
} else {
ch_gap_file = Channel.of([[],[]])
Expand All @@ -210,7 +225,7 @@ workflow TREEVAL {

//
// SUBWORKFLOW: Takes reference file, .genome file, mummer variables, motif length variable and as
// file to generate a file containing sites of self-complementary sequnce.
// file to generate a file containing sites of self-complementary sequence.
//
if ( include_workflow_steps.contains("selfcomp")) {
SELFCOMP (
Expand All @@ -224,7 +239,7 @@ workflow TREEVAL {

//
// SUBWORKFLOW: Takes reference, the directory of syntenic genomes and order/clade of sequence
// and generated a file of syntenic blocks.
// and generates a file of syntenic blocks.
//
if ( include_workflow_steps.contains("synteny")) {
SYNTENY (
Expand Down