Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrittoborges committed Feb 21, 2018
2 parents dad1338 + ba7768a commit a4d4e0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion proteofav/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def _add_mmcif_res_full(table):
:return: returns a modified pandas DataFrame
"""

table.is_copy = False
# adds both 'label' and 'auth' entries
if 'label_seq_id' in table:
table['label_seq_id_full'] = (table['label_seq_id'] +
Expand Down Expand Up @@ -410,7 +411,7 @@ def _remove_multiple_altlocs(table):
altloc = table.loc[ix, 'label_alt_id']
if altloc != '.':
# table.loc[ix, 'label_alt_id'] = '.'
table.set_value(ix, 'label_alt_id', '.')
table.at[ix, 'label_alt_id'] = '.'
atomid = table.loc[ix, 'label_atom_id']
try:
for nx in range(1, 100, 1):
Expand Down
2 changes: 1 addition & 1 deletion proteofav/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ def _fetch_icgc_variants(identifier):
' Duplicated index for {}.'.format(identifier))
else:
data = data.join(consequence.apply(pd.Series), rsuffix='_protein')
transition = data.aaMutation.str.extract(transition_regex)
transition = data.aaMutation.str.extract(transition_regex, expand=False)
data = data.join(transition)

return data
6 changes: 4 additions & 2 deletions tests/test_variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ def test_fetch_ensembl_uniprot_mapping(self):
r = self.fetch_ensembl_uniprot_mapping(self.ensembl_id2)
self.assertTrue(r.ok)
uniprots = self.get_uniprot_id_from_mapping(r.json())
self.assertEqual(uniprots, ['A0A024RBG4', self.uniprot_id2])
self.assertIn('A0A024RBG4', uniprots)
self.assertIn(self.uniprot_id2, uniprots)

def test_to_table_uniprot_ensembl_mapping_full(self):
"""
Expand Down Expand Up @@ -534,7 +535,8 @@ def test_get_uniprot_id_from_mapping(self):

r = self.get_uniprot_id_from_mapping(data.json(), full_entry=False,
uniprot_id=None)
self.assertEqual(r, ['A0A024RBG4', self.uniprot_id2])
self.assertIn('A0A024RBG4', r)
self.assertIn(self.uniprot_id2, r)

r = self.get_uniprot_id_from_mapping(data.json(), full_entry=True,
uniprot_id=None)
Expand Down

0 comments on commit a4d4e0a

Please sign in to comment.