forked from prihoda/AbNumber
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add automated tests, add Binder link
- Loading branch information
Showing
7 changed files
with
91 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build & Test | ||
|
||
on: | ||
push: | ||
schedule: | ||
- cron: '0 3 * * 1' | ||
|
||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 5 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- 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 env update -f environment.yml | ||
pip install . --no-deps | ||
- name: Test with pytest | ||
run: | | ||
conda install pytest | ||
pytest test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
channels: | ||
- nodefaults | ||
- bioconda | ||
- conda-forge | ||
dependencies: | ||
# Dependencies for local setup only. Make sure to update meta.yml in bioconda channel. | ||
- python >= 3.6 | ||
- pip | ||
- pandas | ||
- biopython | ||
- anarci == 2020.04.23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import pytest | ||
from abnumber import Chain, ChainParseError, Position | ||
from abnumber.germlines import HUMAN_IMGT_IG_V, HUMAN_IMGT_IG_J | ||
|
||
|
||
def test_imgt_61A(): | ||
"""Related to ANARCI issue: https://github.com/oxpig/ANARCI/issues/14""" | ||
assert Position.from_string('61A', 'H', 'imgt') > Position.from_string('61', 'H', 'imgt') | ||
seq = 'EVQLVESGGGLVQPGGSLRLSCAASGIILDYYPIGWFRQAPGKEREGVAFITNSDDSTIYTNYADSVKGRFTISRDKNSLYLQMNSLRAEDTAVYYCSSKASFLIGKDDQGIDAGEYDYWGQGTMVTVSS' | ||
with pytest.raises(NotImplementedError): | ||
chain = Chain(seq, 'imgt') | ||
|
||
|
||
def test_light_chain_IMGT_position_21(): | ||
# Check bug from ANARCI 2021.02.04 | ||
# When numbering full Kappa chains, position IMGT 21 contains a gap | ||
# When numbering V gene only, position IMGT 21 contains an amino acid as expected | ||
# Test against this by making sure that same numbering is assigned when numbering V gene and VJ genes concatenated | ||
# https://github.com/oxpig/ANARCI/issues/17 | ||
for germline in HUMAN_IMGT_IG_V['K']['aligned_sequences']: | ||
v_seq = HUMAN_IMGT_IG_V['K']['aligned_sequences'][germline].replace('-', '') | ||
first_j_gene = list(HUMAN_IMGT_IG_J['K']['aligned_sequences'].keys())[0] | ||
j_seq = HUMAN_IMGT_IG_J['K']['aligned_sequences'][first_j_gene].replace('-', '') | ||
vj_seq = v_seq + j_seq | ||
try: | ||
v_chain = Chain(v_seq, 'imgt') | ||
vj_chain = Chain(vj_seq, 'imgt') | ||
except Exception as e: | ||
print(e) | ||
continue | ||
v_positions = [str(p) for p in v_chain.positions] | ||
vj_positions = [str(p) for p in vj_chain.positions] | ||
|
||
len_limit = len(v_seq) - 20 | ||
assert ','.join(v_positions[:len_limit]) == ','.join(vj_positions[:len_limit]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters