From ad81b8d445174b8921e6887d6ad09d30f05cd257 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Mon, 18 Sep 2023 17:43:14 -0700 Subject: [PATCH] Allow specifying UniProt ID for a chain's sequence --- doc/DecoratorsAndAttributes.md | 1 + test/test_chain.py | 3 +++ tools/build/make_decorators.py | 1 + 3 files changed, 5 insertions(+) diff --git a/doc/DecoratorsAndAttributes.md b/doc/DecoratorsAndAttributes.md index ea955258..89717f59 100644 --- a/doc/DecoratorsAndAttributes.md +++ b/doc/DecoratorsAndAttributes.md @@ -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 | diff --git a/test/test_chain.py b/test/test_chain.py index 4158bef7..107be42f 100644 --- a/test/test_chain.py +++ b/test/test_chain.py @@ -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 @@ -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__': diff --git a/tools/build/make_decorators.py b/tools/build/make_decorators.py index 0dd778c3..d803003b 100755 --- a/tools/build/make_decorators.py +++ b/tools/build/make_decorators.py @@ -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')])