Skip to content

Commit

Permalink
Merge branch 'zerodivide' into 'dev'
Browse files Browse the repository at this point in the history
Fix a divide-by-zero

See merge request research/medaka!552
  • Loading branch information
cjw85 committed Aug 15, 2023
2 parents 2aa5a56 + 525f4b4 commit 938167e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 30 deletions.
28 changes: 0 additions & 28 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ stages:
- build
- deploy

variables:
DOCKERTAG: "medaka/medaka:latest"


# Install a particular Python and set PYTHON envvar for Makefile
.install-pyenv: &install-pyenv |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
Expand Down Expand Up @@ -76,14 +72,6 @@ test-mem-check:
- make mem_check


test-docker:
image: ${DOCKERDEV_IMAGE}
stage: test
script:
- apk --no-cache add make
- DOCKERTAG=$DOCKERTAG make docker
- docker run --rm -v $PWD:/data $DOCKERTAG medaka_consensus -x -i /data/medaka/test/data/test_reads.fasta.gz -d /data/medaka/test/data/draft_ref.fasta -o /data/dockertest

###
# Source distribution
#
Expand Down Expand Up @@ -209,19 +197,3 @@ push-github:
rules:
- if: '$CI_COMMIT_TAG =~ /^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$/'

push-dockerhub:
image: ${DOCKERDEV_IMAGE}
stage: deploy
script:
- apk --no-cache add make
- echo ${DOCKERHUB_TOKEN} | docker login --username ${DOCKERHUB_USER} --password-stdin
- DOCKERTAG=$DOCKERTAG make docker
- LATEST="ontresearch/medaka:latest"
- TAG="ontresearch/medaka:$CI_COMMIT_TAG"
- docker tag $DOCKERTAG $LATEST
- docker tag $DOCKERTAG $TAG
- docker push ${LATEST}
- docker push ${TAG}
rules:
- if: '$CI_COMMIT_TAG =~ /^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$/'

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
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).

## [v1.9.1]
### Fixed
- A long-standing bug in pileup_counts that manifests for single-position pileups on ARM64.

## [v1.9.0]
### Added
- Added `medaka tandem` targeted tandem repeat variant calling.
Expand Down
2 changes: 1 addition & 1 deletion medaka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import subprocess
import sys

__version__ = "1.9.0"
__version__ = "1.9.1"

try:
import parasail
Expand Down
2 changes: 1 addition & 1 deletion src/medaka_counts.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ plp_data calculate_pileup(

// reallocate output if necessary
if (n_cols + max_ins > pileup->buffer_cols) {
float cols_per_pos = (float) (n_cols + max_ins) / (pos - start);
float cols_per_pos = (float) (n_cols + max_ins) / (1 + pos - start);
// max_ins can dominate so add at least that
buffer_cols = max_ins + max(2 * pileup->buffer_cols, (int) cols_per_pos * (end - start));
enlarge_plp_data(pileup, buffer_cols);
Expand Down

0 comments on commit 938167e

Please sign in to comment.