Skip to content

Commit

Permalink
Add decoy_prefix and decoy_suffix to protxml tests. Version 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
levitsky committed May 28, 2018
1 parent 31dd8dd commit 2747b67
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5b6
3.5
16 changes: 15 additions & 1 deletion tests/test_protxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,30 @@ def test_qvalues(self):
q = protxml.qvalues(self.path, **self._kw)
self.assertEqual(list(q['q']), [0, 1])

def test_qvalues_prefix(self):
q = protxml.qvalues(self.path, decoy_prefix='DECO', **self._kw)
self.assertEqual(list(q['q']), [0, 1])

def test_df(self):
df = protxml.DataFrame(self.path)
self.assertEqual(df.shape, (2, 15))

def test_filter_df(self):
kw = self._kw.copy()
del kw['full_output']
kw['key'] = 'probability'
del kw['key']
fdf = protxml.filter_df(self.path, **kw)
self.assertEqual(fdf.shape, (2, 17))

def test_filter_df_suffix(self):
kw = self._kw.copy()
del kw['full_output']
del kw['key']
kw['remove_decoy'] = True
df = protxml.DataFrame(self.path)
df['protein_name'] = df.protein_name.str.replace(r'DECOY_(.*)', r'\1_SUF')
fdf = protxml.filter_df(df, decoy_suffix='_SUF', **kw)
self.assertEqual(fdf.shape, (1, 17))

if __name__ == '__main__':
unittest.main()

0 comments on commit 2747b67

Please sign in to comment.