Skip to content

Commit

Permalink
Created new test for charge
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalshaikh42 committed Jul 5, 2018
1 parent 1701131 commit 13308f5
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 13308f5

Please sign in to comment.