Skip to content

Commit

Permalink
Merge pull request #103 from sanger-tol/more_bugfixes
Browse files Browse the repository at this point in the history
More bugfixes
  • Loading branch information
muffato authored Jul 18, 2024
2 parents 7547ead + b83f05c commit 5420de2
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ General tidy up of the configuration and the pipeline
- Increased the resources for blastn
- Removed some options that were not used or not needed
- All relevant outputs are now copied to the output directory
- Fixed some blast parameters to match the behaviour of the Snakemake pipeline

### Parameters

Expand Down
12 changes: 9 additions & 3 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,15 @@ process {
}

withName: "BLAST_BLASTN" {
cpus = { check_max( 24 * task.attempt, 'cpus' ) }
memory = { check_max( 100.MB * task.attempt, 'memory' ) }
time = { check_max( 12.h * task.attempt, 'time' ) }

// There are blast failures we don't know how to fix. Just ignore for now
errorStrategy = { task.exitStatus in ((130..145) + 104) ? (task.attempt == process.maxRetries ? 'ignore' : 'retry') : 'finish' }

// Most jobs complete quickly but some need a lot longer. For those outliers,
// the CPU usage remains usually low, often nearing a single CPU
cpus = { check_max( 6 - (task.attempt-1), 'cpus' ) }
memory = { check_max( 1.GB * Math.pow(4, task.attempt-1), 'memory' ) }
time = { check_max( 10.h * Math.pow(4, task.attempt-1), 'time' ) }
}

withName:CUSTOM_DUMPSOFTWAREVERSIONS {
Expand Down
2 changes: 1 addition & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ process {
}

withName: "BLAST_BLASTN" {
ext.args = "-outfmt '6 qseqid staxids bitscore std' -max_target_seqs 10 -max_hsps 1 -evalue 1.0e-10 -lcase_masking -dust '20 64 1'"
ext.args = "-task megablast -outfmt '6 qseqid staxids bitscore std' -max_target_seqs 10 -max_hsps 1 -evalue 1.0e-10 -lcase_masking -dust '20 64 1'"
}

withName: "CUSTOM_DUMPSOFTWAREVERSIONS" {
Expand Down
6 changes: 4 additions & 2 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
"diamond/blastp": {
"branch": "master",
"git_sha": "b29f6beb86d1d24d680277fb1a3f4de7b8b8a92c",
"installed_by": ["modules"]
"installed_by": ["modules"],
"patch": "modules/nf-core/diamond/blastp/diamond-blastp.diff"
},
"diamond/blastx": {
"branch": "master",
"git_sha": "b29f6beb86d1d24d680277fb1a3f4de7b8b8a92c",
"installed_by": ["modules"]
"installed_by": ["modules"],
"patch": "modules/nf-core/diamond/blastx/diamond-blastx.diff"
},
"fastawindows": {
"branch": "master",
Expand Down
16 changes: 13 additions & 3 deletions modules/nf-core/blast/blastn/blast-blastn.diff

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion modules/nf-core/blast/blastn/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions modules/nf-core/diamond/blastp/diamond-blastp.diff

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions modules/nf-core/diamond/blastp/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions modules/nf-core/diamond/blastx/diamond-blastx.diff

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions modules/nf-core/diamond/blastx/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion subworkflows/local/busco_diamond_blastp.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ workflow BUSCO_DIAMOND {
| transpose()
| filter { rank,id -> rank =~ /species/ }
| map { rank, id -> id}
| first
| set { ch_taxid }


Expand Down Expand Up @@ -116,7 +117,7 @@ workflow BUSCO_DIAMOND {
// Hardcoded to match the format expected by blobtools
def outext = 'txt'
def cols = 'qseqid staxids bitscore qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore'
DIAMOND_BLASTP ( ch_busco_genes, blastp, outext, cols )
DIAMOND_BLASTP ( ch_busco_genes, blastp, outext, cols, ch_taxid )
ch_versions = ch_versions.mix ( DIAMOND_BLASTP.out.versions.first() )


Expand Down
3 changes: 2 additions & 1 deletion subworkflows/local/run_blastx.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ workflow RUN_BLASTX {
fasta // channel: [ val(meta), path(fasta) ]
table // channel: [ val(meta), path(busco_table) ]
blastx // channel: [ val(meta), path(blastx_db) ]
taxon_id // channel: val(taxon_id)


main:
Expand All @@ -30,7 +31,7 @@ workflow RUN_BLASTX {
// Hardocded to match the format expected by blobtools
def outext = 'txt'
def cols = 'qseqid staxids bitscore qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore'
DIAMOND_BLASTX ( BLOBTOOLKIT_CHUNK.out.chunks, blastx, outext, cols)
DIAMOND_BLASTX ( BLOBTOOLKIT_CHUNK.out.chunks, blastx, outext, cols, taxon_id )
ch_versions = ch_versions.mix ( DIAMOND_BLASTX.out.versions.first() )


Expand Down
3 changes: 2 additions & 1 deletion workflows/blobtoolkit.nf
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ workflow BLOBTOOLKIT {
PREPARE_GENOME.out.genome,
BUSCO_DIAMOND.out.first_table,
ch_blastx,
BUSCO_DIAMOND.out.taxon_id,
)
ch_versions = ch_versions.mix ( RUN_BLASTX.out.versions )

Expand All @@ -151,7 +152,7 @@ workflow BLOBTOOLKIT {
RUN_BLASTX.out.blastx_out,
PREPARE_GENOME.out.genome,
ch_blastn,
BUSCO_DIAMOND.out.taxon_id
BUSCO_DIAMOND.out.taxon_id,
)

//
Expand Down

0 comments on commit 5420de2

Please sign in to comment.