Skip to content

Commit

Permalink
Merge 717d1e8 into 2d86b54
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Simkovic committed Jul 10, 2018
2 parents 2d86b54 + 717d1e8 commit cfd9777
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"

install:
- sudo apt-get update
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changelog
------------
Added
~~~~~
- Support for Python 3.7
- ``Cython`` added as dependency and ``SciPy`` removed
- ``conkit.misc.deprecate`` decorator for easier tagging
- ``ContactMap.match`` provides keyword to ``add_false_negatives`` found in the reference but not in contact map
Expand Down
8 changes: 4 additions & 4 deletions conkit/core/contactmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,8 @@ def match(self,
# 3. Add false negatives
# ================================================================
if add_false_negatives:
for contact in contact_map2:
contactid = tuple([contact.res1_seq, contact.res2_seq])
for contactid in contact_map2.as_list():
contactid = tuple(contactid)
if contactid not in contact_map1:
contact = contact_map2[contactid].copy()
contact.false_negative = True
Expand All @@ -787,8 +787,8 @@ def match(self,
# 4. Remove unmatched contacts
# ================================================================
if remove_unmatched:
for contact in contact_map1:
contactid = tuple([contact.res1_seq, contact.res2_seq])
for contactid in contact_map1.as_list():
contactid = tuple(contactid)
if contact_map1[contactid].status_unknown:
contact_map1.remove(contactid)

Expand Down
6 changes: 5 additions & 1 deletion conkit/core/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def __add__(self, other):
seq = self.seq + other.seq
return Sequence(id, seq)

def __len__(self):
"""The sequence length"""
return len(self._seq)

def __repr__(self):
if self.seq_len > 12:
seq_string = ''.join([self.seq[:5], '...', self.seq[-5:]])
Expand Down Expand Up @@ -156,7 +160,7 @@ def seq_encoded(self):
@property
def seq_len(self):
"""The protein sequence length"""
return len(self.seq)
return len(self)

def align_global(self, other, id_chars=2, nonid_chars=1, gap_open_pen=-0.5, gap_ext_pen=-0.1, inplace=False):
"""Generate a global alignment between two :obj:`Sequence <conkit.core.sequence.Sequence>` instances
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def version():
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]

Expand Down

0 comments on commit cfd9777

Please sign in to comment.