Skip to content

Commit

Permalink
Allow specifying UniProt ID for a chain's sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Sep 19, 2023
1 parent ac807b5 commit ad81b8d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/DecoratorsAndAttributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ The category name is `sequence` and it includes information about the types and
| `sequence` | string | Primary sequence of a chain |
| `sequence offset`| int | Offset from sequence index to residue index |
| `chain type` | string | Type of chain sequence (e.g. Protein, DNA, RNA) |
| `uniprot accession`| string | UniProt accession code for the sequence |
| `first residue index` | int | The index of the first residue (in a domain) |
| `last residue index` | int | The index of the last residue (in a domain) |
| `residue indexes` | ints | The list of indexes in a fragment |
Expand Down
3 changes: 3 additions & 0 deletions test/test_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ def test_chain(self):
self.assertEqual(c.get_chain_type(), 'UnknownChainType')
self.assertEqual(c.get_sequence(), '')
self.assertEqual(c.get_sequence_offset(), 0)
self.assertEqual(c.get_uniprot_accession(), '')
# Check setters
c.set_chain_type('LPolypeptide')
c.set_sequence('CGY')
c.set_sequence_offset(10)
c.set_uniprot_accession('Q13098')
c.set_chain_id('X')

# Check both const and non-const getters
Expand All @@ -37,6 +39,7 @@ def check_rmf(self, cf, c0, c1):
self.assertEqual(c.get_chain_type(), 'LPolypeptide')
self.assertEqual(c.get_sequence(), 'CGY')
self.assertEqual(c.get_sequence_offset(), 10)
self.assertEqual(c.get_uniprot_accession(), 'Q13098')
self.assertEqual(c.get_chain_id(), 'X')

if __name__ == '__main__':
Expand Down
1 change: 1 addition & 0 deletions tools/build/make_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
[Attribute("chain id", "String"),
Attribute("sequence", "String", default=""),
Attribute("sequence offset", "Int", default=0),
Attribute("uniprot accession", "String", default=""),
Attribute("chain type", "String",
default='UnknownChainType')])

Expand Down

0 comments on commit ad81b8d

Please sign in to comment.