Skip to content

Commit

Permalink
Merge pull request #13 from kdm9/bugfixes
Browse files Browse the repository at this point in the history
Fix a missing import and actually run the tests
  • Loading branch information
Kuanhao-Chao authored Jul 10, 2024
2 parents d24cf1a + adb046e commit caaa7ed
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run tests

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip flake8
sudo apt install wget
wget https://github.com/lh3/miniprot/releases/download/v0.13/miniprot-0.13_x64-linux.tar.bz2
tar xvf miniprot-0.13_x64-linux.tar.bz2
cp miniprot-0.13_x64-linux/miniprot /usr/local/bin
rm -rf miniprot-0.13_x64-linux*
wget https://github.com/lh3/minimap2/releases/download/v2.28/minimap2-2.28_x64-linux.tar.bz2
tar xvf minimap2-2.28_x64-linux.tar.bz2
mv minimap2-2.28_x64-linux/k8 minimap2-2.28_x64-linux/paftools.js minimap2-2.28_x64-linux/minimap2 /usr/local/bin
rm -rf minimap2-2.28_x64-linux*
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install lifton
run: |
python -m pip install -e .
- name: Test using example from test dir
run: |
cd test && bash -xeu lifton_chr22_example.sh
4 changes: 2 additions & 2 deletions lifton/lifton.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from lifton import mapping, intervals, lifton_utils, annotation, extract_sequence, stats, logger, run_liftoff, run_miniprot, run_evaluation, __version__
from lifton import intervals, lifton_utils, annotation, extract_sequence, stats, logger, run_liftoff, run_miniprot, run_evaluation, __version__
from intervaltree import Interval
import argparse
from pyfaidx import Fasta
Expand Down Expand Up @@ -349,4 +349,4 @@ def main(arglist=None):
args = parse_args(arglist)
if not run_miniprot.check_miniprot_installed():
sys.exit("miniprot is not installed. Please install miniprot before running LiftOn.")
run_all_lifton_steps(args)
run_all_lifton_steps(args)

0 comments on commit caaa7ed

Please sign in to comment.