Exemple #1
0
 def test_FabCollection_igblast_query_1(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection)
     fab_collection.igblast_server_query()
     self.assertAlmostEqual(
         fab_collection.germline_identity['Heavy', 'Total'].iloc[0], 93.8)
Exemple #2
0
 def test_FabCollection_igblast_query_1(self):
     # check germline assignment score
     fab_collection = FabCollection(light_chains=self.light_chain_collection,
                                    heavy_chains=self.heavy_chain_collection,
                                    names=['Fab1', 'Fab2'])
     fab_collection.igblast_server_query()
     self.assertAlmostEqual(fab_collection.germline['Heavy', 'Score'].loc['Fab1'], 1.82e-66)
Exemple #3
0
 def test_FabCollection_ec_2(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection)
     self.assertAlmostEqual(
         fab_collection.extinction_coefficients(normalise=True)[0],
         2.1082102969136987)
Exemple #4
0
 def test_FabCollection_input4(self):
     light_chain_collection = ChainCollection(path='./tests/Data/chain_collection_light_2_sequences.json')
     heavy_chain_collection = ChainCollection(path='./tests/Data/chain_collection_heavy_2_sequences.json')
     fab_collection = FabCollection(light_chains=light_chain_collection,
                                    heavy_chains=heavy_chain_collection,
                                    names=['Fab1', 'Fab2'])
     self.assertEqual(fab_collection.numbering_table()['Light']['CDR3']['L89'].loc['Fab1'], 'Q')
Exemple #5
0
 def test_FabCollection_igblast_query_1(self):
     # check germline assignment
     fab_collection = FabCollection(light_chains=self.light_chain_collection,
                                    heavy_chains=self.heavy_chain_collection,
                                    names=['Fab1', 'Fab2'])
     fab_collection.igblast_server_query()
     self.assertEqual(fab_collection.germline['Heavy', 'Assignment']['Fab1'], 'IGHV1-8*01')
Exemple #6
0
 def test_FabCollection_json1(self):
     light_chain_collection = ChainCollection.load_from_file(
         path='./tests/Data/chain_collection_light_2_sequences.json')
     heavy_chain_collection = ChainCollection.load_from_file(
         path='./tests/Data/chain_collection_heavy_2_sequences.json')
     fab_collection = FabCollection(light_chains=light_chain_collection,
                                    heavy_chains=heavy_chain_collection,
                                    names=['Fab1', 'Fab2'])
     fab_collection.save(file_format='json', path='./tests/fab_1')
     self.assertTrue(os.path.isfile('./tests/fab_1.json'))
Exemple #7
0
 def test_FabCollection_slicing_5(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection,
         names=['Fab1', 'Fab2'])
     self.assertEqual(fab_collection[[0, 1]]._light_chains.names,
                      ['LightSeq1', 'LightSeq2'])
Exemple #8
0
 def test_FabCollection_input_3(self):
     # check if input with a list of Chain objects
     self.assertIsInstance(
         FabCollection(
             heavy_chains=[self.heavy_chain_1, self.heavy_chain_2],
             light_chains=[self.light_chain_1, self.light_chain_2]),
         FabCollection)
Exemple #9
0
 def test_FabCollection_germline_identity(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection,
         names=['Fab1', 'Fab2'])
     self.assertAlmostEqual(
         fab_collection.germline_identity['Average']['CDR3'].loc['Fab1'],
         78.55)
Exemple #10
0
 def test_FabCollection_json2(self):
     fab_collection = FabCollection.load_from_file(
         path='./tests/fab_1.json', show_progressbar=False, verbose=False)
     light_chain_collection = ChainCollection.load_from_file(
         path='./tests/Data/chain_collection_light_2_sequences.json')
     heavy_chain_collection = ChainCollection.load_from_file(
         path='./tests/Data/chain_collection_heavy_2_sequences.json')
     self.assertEqual(fab_collection._light_chains.sequences[0],
                      light_chain_collection.sequences[0])
     self.assertEqual(fab_collection._heavy_chains.sequences[0],
                      heavy_chain_collection.sequences[0])
Exemple #11
0
 def test_FabCollection_input_2(self):
     # check if input with a list with fab objects works
     self.assertIsInstance(FabCollection(fab=[self.fab_1, self.fab_2]),
                           FabCollection)
Exemple #12
0
 def test_FabCollection_input_1(self):
     self.assertIsInstance(
         FabCollection(light_chains=self.light_chain_collection,
                       heavy_chains=self.light_chain_collection),
         FabCollection)
Exemple #13
0
 def test_FabCollection_slicing_2(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection,
         names=['Fab1', 'Fab2'])
     self.assertEqual(fab_collection[0].name, 'Fab1')
Exemple #14
0
 def test_FabCollection_slicing_1(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection,
         names=['Fab1', 'Fab2'])
     self.assertIsInstance(fab_collection[0], Fab)
Exemple #15
0
 def test_FabCollection_charge(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection)
     self.assertAlmostEqual(fab_collection.charge().sum(),
                            -2.0354649111988743)
Exemple #16
0
 def test_FabCollection_n_ab(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection)
     self.assertEqual(fab_collection.n_ab, 2)
Exemple #17
0
 def test_FabCollection_names(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection,
         names=['Fab1', 'Fab2'])
     self.assertEqual(fab_collection.names[0], 'Fab1')
Exemple #18
0
 def test_FabCollection_MW(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection)
     self.assertAlmostEqual(fab_collection.molecular_weights()[0],
                            25078.143331999992)
Exemple #19
0
 def test_FabCollection_name_4(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection)
     self.assertEqual(fab_collection._light_chains.names[1], 'LightSeq2')
Exemple #20
0
 def test_FabCollection_name_1(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection)
     self.assertEqual(fab_collection._heavy_chains.names[0], 'Seq1')
Exemple #21
0
 def test_FabCollection_total_charge(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection)
     self.assertAlmostEqual(fab_collection.total_charge()[0],
                            3.3658691836339365)
Exemple #22
0
 def test_FabCollection_len(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection)
     self.assertEqual(len(fab_collection), 2)
Exemple #23
0
 def test_FabCollection_HMatrix(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection)
     self.assertEqual(fab_collection.hydrophobicity_matrix().shape,
                      (2, 296))
Exemple #24
0
 def test_FabCollection_ec_1(self):
     fab_collection = FabCollection(
         light_chains=self.light_chain_collection,
         heavy_chains=self.heavy_chain_collection)
     self.assertEqual(fab_collection.extinction_coefficients()[0], 52870)