Skip to content

Commit

Permalink
Merge pull request #545 from uclahs-cds/czhu-add-enzyme-lysN
Browse files Browse the repository at this point in the history
Add enzyme lysN
  • Loading branch information
zhuchcn authored Jul 29, 2022
2 parents 1cbf6de + 56b31e3 commit ba4c8b1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

---

## [0.9.2] - 2022-07-28
## [0.9.2] - 2022-07-29

- For circRNA, each reading frame subgraph is now replicated for 3 times in order to catch all variant peptides that read through the junction site. #514

- Enzyme lysN is added. #523

- For `decoyFasta`, overlapping decoy sequences are also counted and printed to the stdout when using reverse. #474

---
Expand Down
1 change: 1 addition & 0 deletions moPepGen/aa/expasy_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
'hydroxylamine': r'N(?=G)',
'iodosobenzoic acid': r'W',
'lysc': r'K',
'lysn': r'\w(?=K)',
'ntcb': r'\w(?=C)',
'pepsin ph1.3': r'((?<=[^HKR][^P])[^R](?=[FL][^P]))|'
r'((?<=[^HKR][^P])[FL](?=\w[^P]))',
Expand Down
15 changes: 11 additions & 4 deletions test/unit/test_aa.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def testcreate_unique_peptide_pool_by_length(self):

class TestAminoAcidSeqRecord(unittest.TestCase):
""" Test case for AminoAcidSeqRecord """
def testinfer_ids_ensembl_case1(self):
def test_infer_ids_ensembl_case1(self):
""" Test that ids are infered correctly with ENSMBLE style. """
seq = aa.AminoAcidSeqRecord(
seq=Seq('GTGG'),
Expand All @@ -77,7 +77,7 @@ def testinfer_ids_ensembl_case1(self):
self.assertEqual(seq.transcript_id, 'ENST00000631435')
self.assertEqual(seq.gene_id, 'ENSG00000282253')

def testinfer_ids_ensembl_case2(self):
def test_nfer_ids_ensembl_case2(self):
""" Test that error will raise with GENCODE style. """
header = 'ENSP00000493376.2|ENST00000641515.2|ENSG00000186092.6|OTTH'+\
'UMG00000001094.4|OTTHUMT00000003223.4|OR4F5-202|OR4F5|326'
Expand All @@ -90,7 +90,7 @@ def testinfer_ids_ensembl_case2(self):
with self.assertRaises(ValueError):
seq.infer_ids_ensembl()

def testinfer_ids_gencode_case1(self):
def test_infer_ids_gencode_case1(self):
""" Test that ids are infered correctly with ENSMBLE style. """
header = 'ENSP00000493376.2|ENST00000641515.2|ENSG00000186092.6|OTTH'+\
'UMG00000001094.4|OTTHUMT00000003223.4|OR4F5-202|OR4F5|326'
Expand All @@ -107,7 +107,7 @@ def testinfer_ids_gencode_case1(self):
self.assertEqual(seq.gene_id, 'ENSG00000186092.6')
self.assertEqual(seq.transcript_id, 'ENST00000641515.2')

def testinfer_ids_gencode_case2(self):
def test_infer_ids_gencode_case2(self):
""" Test that error will raise with ENSEMBL style """
seq = aa.AminoAcidSeqRecord(
seq=Seq('GTGG'),
Expand All @@ -122,6 +122,13 @@ def testinfer_ids_gencode_case2(self):
with self.assertRaises(ValueError):
seq.infer_ids_gencode()

def test_enzyme_lysn(self):
""" Ensures that lysN cleaves lysine at N-terminus """
seq = aa.AminoAcidSeqRecord('ACDEGKILMNP')
expected = {'ACDEG', 'KILMNP'}
fragments = seq.enzymatic_cleave(rule='lysn', miscleavage=0, min_mw=0, min_length=0)
received = {str(x.seq) for x in fragments}
self.assertEqual(expected, received)

class TestCaseVariantPeptidePool(unittest.TestCase):
""" Test cases for VariantPeptidePool """
Expand Down

0 comments on commit ba4c8b1

Please sign in to comment.