first add
This commit is contained in:
30
rebuildinpython/test_andromeda.py
Normal file
30
rebuildinpython/test_andromeda.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import unittest
|
||||
from andromeda import Peptide, Modification, Pscore
|
||||
|
||||
class TestAndromeda(unittest.TestCase):
|
||||
def test_calc_ptm_score(self):
|
||||
sequence = "PEPTIDE"
|
||||
fixed_modifications = []
|
||||
variable_modifications = [
|
||||
Modification(1, 80, ['E', 'D'], 'anywhere'),
|
||||
Modification(2, 42, ['P'], 'anywhere')
|
||||
]
|
||||
mod_count = [1, 1]
|
||||
spec_masses = [100, 105, 110, 115, 120]
|
||||
spec_intensities = [10, 20, 30, 40, 50]
|
||||
ms2_tol = 0.1
|
||||
ms2_tol_unit = "Da"
|
||||
topx = 1
|
||||
mz = 500
|
||||
charge = 2
|
||||
|
||||
score, best_pep, counts, delta, description, intensities, mass_diffs, mod_prob, mod_score_diffs = Pscore.calc_ptm_score(
|
||||
ms2_tol, ms2_tol_unit, topx, sequence, fixed_modifications, variable_modifications, mod_count, spec_masses, spec_intensities, mz, charge
|
||||
)
|
||||
|
||||
self.assertIsNotNone(best_pep)
|
||||
self.assertGreater(score, 0)
|
||||
self.assertEqual(counts, 24) # Number of possible modifications
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user