def test_ChainCollection_add_exception_2(self): antibody_chothia = ChainCollection.load_from_file( path='./tests/Data/chain_collection_fasta_test.fasta', numbering_scheme='chothia', show_progressbar=False, verbose=False) antibody_kabat = Chain(sequence=read_sequence( './tests/Data/chain_collection_fasta_test.fasta'), numbering_scheme='kabat') antibody_kabat.load() self.assertRaises(ValueError, operator.add, antibody_chothia, antibody_kabat)
def test_ChainCollection_add_exception_2(self): # check if adding two ChainCollection objects with one sequence each # results in a ChainCollection object with two sequences antibody_chothia = ChainCollection( path='./tests/Data/chain_collection_fasta_test.fasta', numbering_scheme='chothia') antibody_chothia.load(show_progressbar=False, verbose=False) antibody_kabat = Chain(sequence=read_sequence( './tests/Data/chain_collection_fasta_test.fasta'), numbering_scheme='kabat') antibody_kabat.load() self.assertRaises(ValueError, operator.add, antibody_chothia, antibody_kabat)
def test_ChainCollection_chain_2(self): # checks if the chain type is read properly from a Chain object test_chain = Chain(sequence=self.chain_test_sequence) test_chain.load() test_collection = ChainCollection(antibody_objects=[test_chain]) self.assertEqual(test_collection.chain, 'heavy')
def test_ChainCollection_input_2(self): # instantiate ChainCollection with a loaded Chain object test_chain = Chain(sequence=self.chain_test_sequence) test_collection = ChainCollection(antibody_objects=[test_chain]) self.assertIsInstance(test_collection, ChainCollection)
def test_ChainCollection_input_1(self): # instantiate ChainCollection with a Chain (empty) object test_collection = ChainCollection(antibody_objects=[Chain()]) self.assertIsInstance(test_collection, ChainCollection)
def test_ChainCollection_input_exception_2(self): # when ChainCollection.object_list is instantiated with # a list with non Chain objects it throws an error self.assertRaises(ValueError, ChainCollection, [Chain(), 0])
def test_Chain_unnumbered_sequene(self): test_seq = Chain(sequence='TEST') test_seq.load() self.assertEqual(test_seq.status, 'Unnumbered')
def test_Chain_load(self): chain = Chain(sequence=self.test_sequence) chain.load() self.assertIsInstance(chain, Chain)
def test_Chain_hydrophobicity_not_loaded(self): test_sequence = read_sequence( './tests/Data/chain_collection_fasta_test.fasta') obj = Chain(sequence=test_sequence, name="test") self.assertAlmostEqual( obj.ab_hydrophobicity_matrix(HYDROPHOBICITY_FLAGS.EW).sum(), -8.01)
def test_load_from_string(self): test = Chain.load_from_string(sequence=self.test_sequence, name="test", numbering_scheme=NUMBERING_FLAGS.CHOTHIA) self.assertEqual(test.ab_numbering()[82], "H82A")
def test_numbering_scheme_alignment_unknown_scheme(self): test = Chain(sequence=self.test_sequence, name="test", numbering_scheme="MyNumberingScheme123") self.assertRaises(ValueError, test.ab_numbering)
def test_numbering_scheme_alignment(self, name, input, expected): test = Chain(sequence=self.test_sequence, name="test", numbering_scheme=input) self.assertEqual(test.ab_numbering()[82], expected)
def test_ChainCollection_input_1(self): # instantiate ChainCollection with a Chain (empty) object # this doesn't make any sense and raises an error self.assertRaises(ValueError, ChainCollection, [Chain(sequence="")])