Skip to content

Commit

Permalink
Merge pull request #105 from briney/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
briney committed Apr 7, 2022
2 parents 3ec5fec + f9ceb04 commit 21ca273
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 21 deletions.
27 changes: 20 additions & 7 deletions .travis.yml
@@ -1,11 +1,23 @@
language: python

python:
# - "3.6"
# - "3.7"
- "3.8"
- "3.9"

dist:
- bionic
- focal

# pick the appropriate requirements file
matrix:
include:
- python: "3.7"
env: REQUIREMENTS=requirements.txt
- python: "3.8"
env: REQUIREMENTS=requirements.txt
# matrix:
# include:
# - python: "3.8"
# env: REQUIREMENTS=requirements.txt
# - python: "3.9"
# env: REQUIREMENTS=requirements.txt

branches:
only:
- master
Expand All @@ -16,7 +28,8 @@ before_install:
- sudo apt-get install -y build-essential muscle mafft cd-hit
# command to install dependencies
install:
- pip install -r $REQUIREMENTS
# - pip install -r $REQUIREMENTS
- pip install -r requirements.txt
# command to run tests
script:
- pytest # or py.test for Python versions 3.5 and below
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -69,7 +69,7 @@ A few helper scripts are included with abstar:
To run the test suite, clone or download the repository and run `pytest ./` from the top-level directory.

### requirements
Python 3.7+
Python 3.8+
abutils
biopython
celery
Expand Down
4 changes: 3 additions & 1 deletion abstar/__init__.py
@@ -1,4 +1,6 @@
from __future__ import absolute_import, division, print_function, unicode_literals
import warnings
from Bio import BiopythonWarning
warnings.simplefilter('ignore', BiopythonWarning)

from .core.abstar import run, run_standalone, main, parse_arguments, validate_args
from .preprocess import fastqc, adapter_trim, quality_trim
Expand Down
2 changes: 1 addition & 1 deletion abstar/core/antibody.py
Expand Up @@ -263,7 +263,7 @@ def _vdj_aa(self):
# the only offset that matters is the offset between the full germline and the portion that matched.
#self.v_rf_offset = self.oriented_input.sequence.find(self.vdj_nt) % 3
if self.v.germline_start > 0:
self.v_rf_offset = 3 - self.v.germline_start
self.v_rf_offset = 3 - (self.v.germline_start % 3)
else:
self.v_rf_offset = 0
self.coding_start = self.v.query_start + self.v_rf_offset
Expand Down
4 changes: 2 additions & 2 deletions abstar/tests/test_indels.py
Expand Up @@ -28,7 +28,7 @@ def compare_v_ins_to_reference(antibodies):
errors = []
for antibody in antibodies:
ref = antibody.v
v = GermlineSegment(ref.full, ref.species, ref.db_name, initialize_log=False)
v = GermlineSegment(ref.full, ref.species, ref.db_name, 'bcr', initialize_log=False)
v.query_alignment = ref.query_alignment
v.germline_alignment = ref.germline_alignment
v.alignment_midline = ref.alignment_midline
Expand Down Expand Up @@ -83,7 +83,7 @@ def compare_v_del_to_reference(antibodies):
errors = []
for antibody in antibodies:
ref = antibody.v
v = GermlineSegment(ref.full, ref.species, ref.db_name, initialize_log=False)
v = GermlineSegment(ref.full, ref.species, ref.db_name, 'bcr', initialize_log=False)
v.query_alignment = ref.query_alignment
v.germline_alignment = ref.germline_alignment
v.alignment_midline = ref.alignment_midline
Expand Down
8 changes: 4 additions & 4 deletions abstar/tests/test_mutations.py
Expand Up @@ -40,7 +40,7 @@ def compare_v_nt_mutations_to_reference(antibodies):
for antibody in antibodies:
ref = antibody.v.nt_mutations
ab = MockAntibody()
v = GermlineSegment(antibody.v.full, antibody.v.species, antibody.v.db_name, initialize_log=False)
v = GermlineSegment(antibody.v.full, antibody.v.species, antibody.v.db_name, 'bcr', initialize_log=False)
v.gene_type = antibody.v.gene_type
v.query_alignment = antibody.v.query_alignment
v.germline_alignment = antibody.v.germline_alignment
Expand Down Expand Up @@ -90,7 +90,7 @@ def compare_j_nt_mutations_to_reference(antibodies):
for antibody in antibodies:
ref = antibody.j.nt_mutations
ab = MockAntibody()
j = GermlineSegment(antibody.j.full, antibody.j.species, antibody.j.db_name, initialize_log=False)
j = GermlineSegment(antibody.j.full, antibody.j.species, antibody.j.db_name, 'bcr', initialize_log=False)
j.gene_type = antibody.j.gene_type
j.query_alignment = antibody.j.query_alignment
j.germline_alignment = antibody.j.germline_alignment
Expand Down Expand Up @@ -142,7 +142,7 @@ def compare_v_aa_mutations_to_reference(antibodies):
for antibody in antibodies:
ref = antibody.v.aa_mutations
ab = MockAntibody()
v = GermlineSegment(antibody.v.full, antibody.v.species, antibody.v.db_name, initialize_log=False)
v = GermlineSegment(antibody.v.full, antibody.v.species, antibody.v.db_name, 'bcr', initialize_log=False)
v.gene_type = antibody.v.gene_type
v.query_alignment = antibody.v.query_alignment
v.germline_alignment = antibody.v.germline_alignment
Expand Down Expand Up @@ -197,7 +197,7 @@ def compare_j_aa_mutations_to_reference(antibodies):
for antibody in antibodies:
ref = antibody.j.aa_mutations
ab = MockAntibody()
j = GermlineSegment(antibody.j.full, antibody.j.species, antibody.j.db_name, initialize_log=False)
j = GermlineSegment(antibody.j.full, antibody.j.species, antibody.j.db_name, 'bcr', initialize_log=False)
j.gene_type = antibody.j.gene_type
j.query_alignment = antibody.j.query_alignment
j.germline_alignment = antibody.j.germline_alignment
Expand Down
4 changes: 2 additions & 2 deletions abstar/tests/test_regions.py
Expand Up @@ -32,7 +32,7 @@ def compare_v_regions_to_reference(antibodies):
ab = MockAntibody()
ab.oriented_input = antibody.oriented_input
ab.v_rf_offset = antibody.v_rf_offset
v = GermlineSegment(antibody.v.full, antibody.v.species, antibody.v.db_name, initialize_log=False)
v = GermlineSegment(antibody.v.full, antibody.v.species, antibody.v.db_name, 'bcr', initialize_log=False)
v.query_start = antibody.v.query_start
v.gene_type = antibody.v.gene_type
v._imgt_position_from_raw = antibody.v._imgt_position_from_raw
Expand Down Expand Up @@ -65,7 +65,7 @@ def compare_j_regions_to_reference(antibodies):
ab = MockAntibody()
ab.oriented_input = antibody.oriented_input
ab.v_rf_offset = antibody.v_rf_offset
j = GermlineSegment(antibody.j.full, antibody.j.species, antibody.j.db_name, initialize_log=False)
j = GermlineSegment(antibody.j.full, antibody.j.species, antibody.j.db_name, 'bcr', initialize_log=False)
j.query_start = antibody.j.query_start
j.gene_type = antibody.j.gene_type
j._imgt_position_from_raw = antibody.j._imgt_position_from_raw
Expand Down
17 changes: 17 additions & 0 deletions abstar/utils/output.py
Expand Up @@ -1064,6 +1064,7 @@ def _hadoop_tabular_output(vdj):
'raw_input']

AIRR_HEADER = ['sequence_id',
'umi',
'sequence',
'sequence_aa',
'rev_comp',
Expand All @@ -1072,12 +1073,17 @@ def _hadoop_tabular_output(vdj):
'stop_codon',
'v_call',
'v_gene',
'v_score',
'v_identity',
'v_identity_aa',
'd_call',
'd_gene',
'd_score',
'j_call',
'j_gene',
'j_score',
'j_identity',
'j_identity_aa',
'c_call',
'cdr3_length',
'fwr1_aa',
Expand All @@ -1097,8 +1103,19 @@ def _hadoop_tabular_output(vdj):
'v_deletions',
'junction',
'junction_aa',
'junction_in_frame',
'isotype',
'locus',
'v_cigar',
'd_cigar',
'j_cigar',
'species',
'germline_database',
'raw_input']







2 changes: 1 addition & 1 deletion abstar/version.py
Expand Up @@ -2,4 +2,4 @@
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__ = '0.5.3'
__version__ = '0.5.5'
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -8,4 +8,4 @@ pandas
pyarrow
pymongo
pytest
scikit-bio
scikit-bio==0.5.6
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -59,8 +59,8 @@
'bin/make_basespace_credfile',],
'include_package_data': True,
'classifiers': ['License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Scientific/Engineering :: Bio-Informatics']
}

Expand Down

0 comments on commit 21ca273

Please sign in to comment.