-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfeatures_test_regions.py
35 lines (26 loc) · 1.41 KB
/
features_test_regions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import unittest
from abpytools.features.regions import ChainDomains
from abpytools.core.chain_collection import ChainCollection
class AbDomainTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.ab_file = './tests/Data/chain_collection_heavy_2_sequences.json'
def test_ChainDomains_instantiation(self):
chain_domain = ChainDomains(path=self.ab_file)
self.assertIsInstance(chain_domain, ChainDomains)
def test_ChainDomains_ChainCollection_instantiation(self):
chain_collection = ChainCollection.load_from_file(self.ab_file)
chain_domain = ChainDomains(antibody_objects=chain_collection)
self.assertIsInstance(chain_domain, ChainDomains)
def test_ChainDomains_cdr_length(self):
chain_domain = ChainDomains(path=self.ab_file)
self.assertEqual(chain_domain.cdr_lengths()[0, 0], 7)
def test_ChainDomains_cdr_sequence(self):
chain_domain = ChainDomains(path=self.ab_file)
self.assertEqual(chain_domain.cdr_sequences()['Seq1']['CDR3'], 'GLRYTRAGMIWG')
def test_ChainDomains_framework_length(self):
chain_domain = ChainDomains(path=self.ab_file)
self.assertEqual(chain_domain.framework_length()[0, 0], 25)
def test_ChainDomains_framework_sequence(self):
chain_domain = ChainDomains(path=self.ab_file)
self.assertEqual(chain_domain.framework_sequences()['Seq1']['FR4'], 'WGQGTLVTVSS')