Skip to content

Commit

Permalink
catching quast error
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaps-bot committed Sep 28, 2023
1 parent deea58c commit 7622abd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,25 @@ process {
]
}


withName: ".*:UNPACK_DB.*" {
if (params.kaiju_db || params.kraken2_db || params.checkv_db || params.blast_db) {
withName: ".*:UNPACK_DB.*:GUNZIP" {
publishDir = [
path: { "${params.outdir}/databases/" },
mode: params.publish_dir_mode,
enabled: params.save_databases
]
}

withName: ".*:UNPACK_DB.*:UNTAR" {
publishDir = [
path: { "${params.outdir}/databases/" },
mode: params.publish_dir_mode,
enabled: params.save_databases
]
}
}


//
// Taxonomic classification
//
Expand Down Expand Up @@ -219,7 +229,7 @@ process {

withName: TRINITY {
cpus = { check_max( 12 * task.attempt, 'cpus' ) } // defeault was 1
errorStrategy = { task.exitStatus == 2 ? 'ignore' : 'retry' } // can fail with very few reads
errorStrategy = { task.exitStatus in [1,2] ? 'ignore' : 'retry' } // can fail with very few reads
ext.args = "--min_contig_length ${params.min_contig_size} --NO_SEQTK"
publishDir = [
path: { "${params.outdir}/assembly/assemblers/trinity/" },
Expand Down Expand Up @@ -905,7 +915,7 @@ process {

withName: QUAST {
ext.args = "--min-contig 0"
errorStrategy = { task.exitStatus == 4 ? 'ignore' : 'terminate' } // can fail if no contigs are present
errorStrategy = { task.exitStatus == 4 ? 'ignore' : 'retry' } // can fail if no contigs are present
publishDir = [
path: { "${params.outdir}/consensus_qc/quast/" },
mode: params.publish_dir_mode,
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/local/fasta_contig_filtering.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ include { QUAST } from '../../modules/nf-core/quast/main'
// Function to extract the contig size & N' per 100 kbp from the QUAST report
def getQuastStats(report_file) {
def contig_size = 0
def n_100 = 0
def n_100 = 100000 // assume the worst
report_file.eachLine { line ->
def contig_size_match = line =~ /Largest contig\s([\d]+)/
def n_100_match = line =~ /N's per 100 kbp\s([\d\.]+)/
if (contig_size_match) contig_size = contig_size_match[0][1].toFloat()
if (n_100) n_100 = n_100_match[0][1].toFloat()
if (n_100_match) n_100 = n_100_match[0][1].toFloat()
}
return [contig_size : contig_size, n_100 : n_100]
}
Expand Down

0 comments on commit 7622abd

Please sign in to comment.