Skip to content

Commit

Permalink
Fixed linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp committed Feb 27, 2024
1 parent 6240901 commit 294c4a2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
21 changes: 7 additions & 14 deletions lib/WorkflowAssemblyqc.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,37 @@ class WorkflowAssemblyqc {
public static void initialise(params, log) {
// Check for ncbi_fcs_adaptor_empire
if (!params.ncbi_fcs_adaptor_skip && !params.ncbi_fcs_adaptor_empire) {
log.error('ncbi_fcs_adaptor_empire must be provided when executing NCBI FCS Adaptor')
System.exit(1)
Nextflow.error('ncbi_fcs_adaptor_empire must be provided when executing NCBI FCS Adaptor')
}

// Check for ncbi_fcs_gx_tax_id
if (!params.ncbi_fcs_gx_skip && !params.ncbi_fcs_gx_tax_id) {
log.error('ncbi_fcs_gx_tax_id must be provided when executing NCBI FCS GX')
System.exit(1)
Nextflow.error('ncbi_fcs_gx_tax_id must be provided when executing NCBI FCS GX')
}

// Check for ncbi_fcs_gx_db_path
if (!params.ncbi_fcs_gx_skip && !params.ncbi_fcs_gx_db_path) {
log.error('ncbi_fcs_gx_db_path must be provided when executing NCBI FCS GX')
System.exit(1)
Nextflow.error('ncbi_fcs_gx_db_path must be provided when executing NCBI FCS GX')
}

// Check for busco_mode
if (!params.busco_skip && !params.busco_mode) {
log.error("busco_mode must be provided when executing BUSCO")
System.exit(1)
Nextflow.error("busco_mode must be provided when executing BUSCO")
}

// Check for busco_lineage_datasets
if (!params.busco_skip && !params.busco_lineage_datasets) {
log.error('busco_lineage_datasets must be provided when executing BUSCO')
System.exit(1)
Nextflow.error('busco_lineage_datasets must be provided when executing BUSCO')
}

// Check for tidk_repeat_seq
if (!params.tidk_skip && !params.tidk_repeat_seq) {
log.error('tidk_repeat_seq must be provided when executing TIDK')
System.exit(1)
Nextflow.error('tidk_repeat_seq must be provided when executing TIDK')
}

// Check for kraken2_db_path
if (!params.kraken2_skip && !params.kraken2_db_path) {
log.error('kraken2_db_path must be provided when executing Kraken2')
System.exit(1)
Nextflow.error('kraken2_db_path must be provided when executing Kraken2')
}
}

Expand Down
20 changes: 18 additions & 2 deletions modules/local/createreport.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,34 @@ process CREATEREPORT {
val params_json

output:
path 'report.html'
path 'report.json'
path 'report.html' , emit: html
path 'report.json' , emit: json
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
"""
echo -n '$params_json' > params_json.json
assemblyqc.py > report.html
cat <<-END_VERSIONS > versions.yml
"${task.process}":
python: \$(python --version | tr -d 'Python[:space:]')
pandas: \$(python -c "import pandas; print(pandas.__version__)")
END_VERSIONS
"""

stub:
"""
touch report.html
touch report.json
cat <<-END_VERSIONS > versions.yml
"${task.process}":
python: \$(python --version | tr -d 'Python[:space:]')
pandas: \$(python -c "import pandas; print(pandas.__version__)")
END_VERSIONS
"""
}

0 comments on commit 294c4a2

Please sign in to comment.