From 13308f56b32ee987919eb9d66e05cfd4c0dfed7e Mon Sep 17 00:00:00 2001 From: Bilal Shaikh Date: Thu, 5 Jul 2018 18:51:44 -0400 Subject: [PATCH] Created new test for charge --- tests/test_core.py | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/tests/test_core.py b/tests/test_core.py index 96be972..88bf0ea 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -420,35 +420,13 @@ def test_get_mol_wt(self): # MPN001 self.assertAlmostEqual(self.prot1.get_mol_wt(), 43856.113, delta=0.3) - + # MNP011 self.assertAlmostEqual(self.prot2.get_mol_wt(), 26922.957, delta=0.3) def test_get_charge(self): - # Test is based on Collagen Type IV a3 (https://pubchem.ncbi.nlm.nih.gov/compound/44511378) - dna1 = core.DnaSpeciesType(seq=Bio.Seq.Seq( - 'TGTAATTATTATTCTAATTCTTATTCTTTTTGGTTAGCTTCTTTAAATCCTGAACGT', alphabet=Bio.Alphabet.DNAAlphabet())) - cell1 = dna1.cell = core.Cell() - cell1.knowledge_base = core.KnowledgeBase(translation_table=1) - - gene1 = core.GeneLocus(id='gene1', cell=cell1, polymer=dna1, - start=1, end=dna1.get_len(), strand=core.PolymerStrand.positive) - tu1 = core.TranscriptionUnitLocus( - id='tu1', genes=[gene1], polymer=dna1) - prot1 = core.ProteinSpeciesType(id='prot1', gene=gene1, cell=cell1) - self.assertEqual(prot1.get_charge(), 0) + self.assertEqual(self.prot1.get_charge(), 1) - # Test is based on Tuftsin (hhttps://pubchem.ncbi.nlm.nih.gov/compounds/156080) - dna1 = core.DnaSpeciesType(seq=Bio.Seq.Seq( - 'ACTAAACCTCGT', alphabet=Bio.Alphabet.DNAAlphabet())) - cell1 = dna1.cell = core.Cell() - cell1.knowledge_base = core.KnowledgeBase(translation_table=1) - - gene1 = core.GeneLocus(id='gene1', cell=cell1, polymer=dna1, - start=1, end=dna1.get_len(), strand=core.PolymerStrand.positive) - tu1 = core.TranscriptionUnitLocus( - id='tu1', genes=[gene1], polymer=dna1) - prot1 = core.ProteinSpeciesType(id='prot1', gene=gene1, cell=cell1) - self.assertEqual(prot1.get_charge(), 2) + self.assertEqual(self.prot2.get_charge(), 12) class PolymerLocusTestCase(unittest.TestCase):