Skip to content

Commit

Permalink
Merge pull request #108 from sanger-tol/prod_fix
Browse files Browse the repository at this point in the history
Stopped forcing eutheria_odb10
  • Loading branch information
muffato authored Feb 26, 2024
2 parents 81c53c6 + c17c1c2 commit 7ccbd68
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 34 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [[1.1.1](https://github.com/sanger-tol/genomenote/releases/tag/1.1.1)] [2024-02-26]

### Enhancements & fixes

- Stopped forcing the `eutheria_odb10` BUSCO lineage to be used for all mammals.
This to synchronise this pipeline with the [BlobToolKit pipeline](https://github.com/sanger-tol/blobtoolkit).

## [[1.1.0](https://github.com/sanger-tol/genomenote/releases/tag/1.1.0)] - Golden Retriever - [2024-01-04]

### Enhancements & fixes
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: sanger-tol/genomenote v1.1.0
title: sanger-tol/genomenote v1.1.1
message: >-
If you use this software, please cite it using the
metadata from this file.
Expand Down Expand Up @@ -34,5 +34,5 @@ identifiers:
repository-code: "https://github.com/sanger-tol/genomenote"
license: MIT
commit: TODO
version: 1.1.0
version: 1.1.1
date-released: "2022-10-07"
6 changes: 2 additions & 4 deletions bin/get_odb.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ def get_odb(ncbi_summary, lineage_tax_ids, file_out):
# Do the intersection to find the ancestors that have a BUSCO lineage
odb_arr = [lineage_tax_ids_dict[taxon_id] for taxon_id in ancestor_taxon_ids if taxon_id in lineage_tax_ids_dict]

# The most recent [-1] OBD10 lineage is selected, unless one of the lineage values is "eutheria", then choose "eutheria"
# NOTE: this rule is a guess that hasn't been confirmed by Karen
odb_val = "eutheria_odb10" if "eutheria_odb10" in odb_arr else odb_arr[-1]

# The most recent [-1] OBD10 lineage is selected
odb_val = odb_arr[-1]
out_dir = os.path.dirname(file_out)
make_dir(out_dir)

Expand Down
27 changes: 0 additions & 27 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,6 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Increasing the number of CPUs often gives diminishing returns, so we increase it
following a logarithm curve. Example:
- 0 < value <= 1: start + step
- 1 < value <= 2: start + 2*step
- 2 < value <= 4: start + 3*step
- 4 < value <= 8: start + 4*step
In order to support re-runs, the step increase may be multiplied by the attempt
number prior to calling this function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

// Modified logarithm function that doesn't return negative numbers
def positive_log(value, base) {
if (value <= 1) {
return 0
} else {
return Math.log(value)/Math.log(base)
}
}

def log_increase_cpus(start, step, value, base) {
return check_max(start + step * (1 + Math.ceil(positive_log(value, base))), 'cpus')
}


process {

errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' }
Expand Down
29 changes: 28 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ manifest {
description = """Creating standarised genome assembly publications"""
mainScript = 'main.nf'
nextflowVersion = '!>=22.10.1'
version = '1.1.0'
version = '1.1.1'
doi = '10.5281/zenodo.7949384'
}

Expand Down Expand Up @@ -260,3 +260,30 @@ def check_max(obj, type) {
}
}
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Increasing the number of CPUs often gives diminishing returns, so we increase it
following a logarithm curve. Example:
- 0 < value <= 1: start + step
- 1 < value <= 2: start + 2*step
- 2 < value <= 4: start + 3*step
- 4 < value <= 8: start + 4*step
In order to support re-runs, the step increase may be multiplied by the attempt
number prior to calling this function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

// Modified logarithm function that doesn't return negative numbers
def positive_log(value, base) {
if (value <= 1) {
return 0
} else {
return Math.log(value)/Math.log(base)
}
}

def log_increase_cpus(start, step, value, base) {
return check_max(start + step * (1 + Math.ceil(positive_log(value, base))), 'cpus')
}

0 comments on commit 7ccbd68

Please sign in to comment.