Skip to content

fix: pip install mikado now works (#443) #639

fix: pip install mikado now works (#443)

fix: pip install mikado now works (#443) #639

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Mikado
on:
[ push, pull_request ]
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
os: [ubuntu-latest, macos-latest]
steps:
- name: Install system development tools
if: startsWith(runner.os, 'Linux')
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt update
sudo apt install -y build-essential zlib1g-dev zlib1g
- uses: actions/checkout@v2
- uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache conda
id: cache-miniconda
uses: actions/cache@v2
env:
CACHE_NUMBER: 1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('./environment.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
miniconda-version: "latest"
environment-file: ./environment.yml
mamba-version: "*"
use-mamba: true
channels: conda-forge, defaults
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
# auto-update-conda: false
activate-environment: "mikado2"
# auto-activate-base: false
- name: Install dependencies
run: |
gcc --help
pip install -r requirements.txt
python -c "import pysam; print(pysam.__version__)"
pip install Cython pytest-cov
python setup.py develop
- name: Test light
run: |
pytest -m slow Mikado/tests/test_light.py::LightTest::test_subprocess_multi_empty_orfs
- name: Test full with coverage
if: startsWith(runner.os, 'Linux')
run: |
pytest --cov=Mikado --cov-report=xml --cov-config=.coveragerc -m 'not triage';
- name: Test full without coverage
if: startsWith(runner.os, 'macOS')
run: |
pytest -m 'not triage';
- name: Upload coverage to Codecov
if: startsWith(runner.os, 'Linux')
uses: codecov/codecov-action@v1
- name: Test daijin
if: startsWith(runner.os, 'Linux')
run: |
mamba install -c bioconda -c conda-forge -y bioconda::portcullis stringtie scallop "gmap!=2021.02.22" \
star hisat2 prodigal blast diamond transdecoder conda-forge::gnuplot kallisto samtools gffread;
cd sample_data; snakemake --latency-wait 60 --jobs 5 --cores 5
- name: Test daijin mikado
if: startsWith(runner.os, 'macOS')
run: |
mamba install -c bioconda -c conda-forge -y prodigal blast diamond transdecoder kallisto samtools gffread;
cd sample_data; snakemake --latency-wait 60 --jobs 5 --cores 5 complete_no_assemble
- name: Test fast
run: |
python -c "import Mikado; Mikado.test(label='fast')";
- name: Test seed
run: |
# Check that the seed is set properly
mikado serialise --junctions sample_data/junctions.bed --genome Mikado/tests/chr5.fas.gz \
--transcripts Mikado/tests/check_seed.fa --configuration Mikado/tests/check_seed.yaml;
mikado pick --log $(pwd)/pick.20a.log --procs 2 --seed 20 --genome Mikado/tests/chr5.fas.gz \
--configuration Mikado/tests/check_seed.yaml -od 20a Mikado/tests/check_seed.gtf;
mikado pick --log $(pwd)/pick.20b.log --procs 2 --seed 20 --genome Mikado/tests/chr5.fas.gz \
--configuration Mikado/tests/check_seed.yaml -od 20b Mikado/tests/check_seed.gtf;
mikado pick --log $(pwd)/pick.20c.log --procs 2 --seed 20 --genome Mikado/tests/chr5.fas.gz \
--json-conf Mikado/tests/check_seed.yaml -od 20c Mikado/tests/check_seed.gtf;
mikado pick --log $(pwd)/pick.20d.log --procs 2 --seed 20 --genome Mikado/tests/chr5.fas.gz \
--json-conf Mikado/tests/check_seed.yaml -od 20d Mikado/tests/check_seed.gtf;
mikado pick --log $(pwd)/pick.10.log --procs 2 --seed 1000 --genome Mikado/tests/chr5.fas.gz \
--json-conf Mikado/tests/check_seed.yaml -od 1000 Mikado/tests/check_seed.gtf;
if [[ $(diff -q 20a 20b) || $(diff -q 20a 20c) || $(diff -q 20a 20d) ]]; then exit 1; fi
if [[ ! $(diff -q 20a 1000) ]]; then exit 1; fi