Skip to content

Commit

Permalink
Release 1.1.1 (#16)
Browse files Browse the repository at this point in the history
@olga24912 found that running StringDecomposer outside of the git repo (for example, after installation) fails. Reason: git hash, reported in the log, is obtained with a explicit call to git at every execution (contrary to, for example, saving it during make and invoking the saved hash during every launch). This PR:

    Adds a github action test that ensures correct execution that is initialized outside of the git repo;
    Disables report of git hash in the log.

In the future, we should find a better strategy to report git hash.

See also: #15
  • Loading branch information
seryrzu authored Jul 21, 2021
1 parent e9c3cc5 commit 5c71918
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 5 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/install_notRootLaunch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Install with test launch not in root directory

on: [push, workflow_dispatch]

jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda install -y --file requirements.txt
- name: Install
run: |
make install
make uninstall
- name: Run test dataset
run: |
mkdir test && cd test
make -C .. test_launch
- name: Run test dataset w/ install
run: |
cd test
make -C .. test_launch_install
make -C .. uninstall
- name: Run test dataset w/ binary
run: |
cd test
make -C .. install
stringdecomposer ../stringdecomposer/test_data/read.fa ../stringdecomposer/test_data/DXZ1_star_monomers.fa -o . --second-best
make -C .. uninstall
- name: Run test dataset w/ binary 2
run: |
make install
cd test
stringdecomposer ../stringdecomposer/test_data/read.fa ../stringdecomposer/test_data/DXZ1_star_monomers.fa -o . --second-best
make -C .. uninstall
- name: Run test dataset w/ binary 3
run: |
make install
cd ..
mkdir test && cd test
stringdecomposer ../stringdecomposer/stringdecomposer/test_data/read.fa ../stringdecomposer/stringdecomposer/test_data/DXZ1_star_monomers.fa -o . --second-best
make -C ../stringdecomposer uninstall
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# StringDecomposer

## Version 1.1
## Version 1.1.1

As an input StringDecomposer algorithm takes the set of monomers (typically, alpha satellites) and a genomic segment (assembly, Oxford Nanopore or a PacBio HiFi read) that contains a tandem repeat consisting of the given monomers.
StringDecomposer partitions this segment into distinct monomers, providing an accurate translation from the nucleotide alphabet into the monomer alphabet.
Expand Down Expand Up @@ -110,15 +110,18 @@ Optional arguments:

## Latest updates

### StringDecomposer 1.1 release (28 July 2021)
### StringDecomposer 1.1.1 release (20 July 2021)

* git hash is disabled to enable execution outside of git repo

### StringDecomposer 1.1 release (28 June 2021)

* CI support via github actions
* improved build and installation
* removal of unnecessary dependencies
* py module of StringDecomposer saves commit hash and has a logger

### StringDecomposer 1.0 release (11 August 2020)

* initial StringDecomposer release
* conda support
* results of StringDecomposer monomer annotation for available centromere assemblies and ONT and Hifi reads of cen6, cen8, and cenX can be found at [Figshare](https://doi.org/10.6084/m9.figshare.12783371)
Expand Down
2 changes: 1 addition & 1 deletion stringdecomposer/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.1"
__version__ = "1.1.1"
4 changes: 3 additions & 1 deletion stringdecomposer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ def main():
logger = get_logger(logfn, logger_name='StringDecomposer')

logger.info(f'cmd: {sys.argv}')
logger.info(f'git hash: {get_git_revision_short_hash()}')
# TODO get_git_revision_short_hash is commented out
# since it does not work when stringdecomposer is run from outside of repo
# logger.info(f'git hash: {get_git_revision_short_hash()}')

raw_decomp_fn = os.path.join(args.out_dir, args.out_file + "_raw.tsv")
raw_decomposition = run(args.sequences, args.monomers, args.threads, args.scoring, args.batch_size, raw_decomp_fn, args.ed_thr, logger)
Expand Down
4 changes: 4 additions & 0 deletions stringdecomposer/py/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
import subprocess


# Disclaimer: this code can only be run from the git repo and thus should not
# be used in scripts intended for installation


def get_git_revision_hash():
return subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()

Expand Down

0 comments on commit 5c71918

Please sign in to comment.