def test_score(self): _mirs = utils.load_fasta('tests/input/hsa-miR-30a-3p.fa') _mrnas = utils.load_fasta('tests/input/NM_024573.fa') obj = miRmap(seq_mrn=_mrnas['NM_024573'], seq_mir=_mirs['hsa-miR-30a-3p']) obj.routine() self.assertAlmostEqualList(obj._target_scan.tgs_aus, [-0.05019, -0.11319], places=4) self.assertAlmostEqualList(obj._target_scan.tgs_pairing3ps, [0.00312, 0.05150], places=4) self.assertAlmostEqualList(obj._target_scan.tgs_positions, [-0.01526, -0.03190], places=4) self.assertAlmostEqualList(obj._prob_binomial.prob_binomials, [0.07013, 0.83698], places=4) try: self.assertAlmostEqualList(obj._thermodynamic.dg_duplexs, [-7.50000, -7.70000], places=4) self.assertAlmostEqualList(obj._thermodynamic.dg_bindings, [-8.48000, -8.79000], places=4) self.assertAlmostEqualList(obj._thermodynamic.dg_opens, [14.10000, 14.10000], places=4) except AttributeError: #: Validate if python-only model is used. self.assertEqual(obj.model, 'python_only_seed')
def test_load_fasta(self): with self.assertRaises(IOError): utils.load_fasta("NONEXISTENT.fa") fa = utils.load_fasta('tests/input/NM_024573.fa') fa_content = { 'NM_024573': ( 'CUUGAUUUAGGAGCUCUCAGUUGCAUAGAAAGAUCUGGUGAGCACCUUUUCAUCCCCAGAAAAGGAGCAC' 'GUGAAUUGAGUCGCCUGGCGGCUCUGUACGCGCUCAGGGAAGCUUAGCUUCUUGGUGCCCAUCUACGUGC' 'ACUGGAUGAUUUUUCUUUUGAACAUUUUGCCCCACUACACUGUUUUGGGGAUAGCUGGGUUAAGCAAGUU' 'AAAGAUAUUUACAUUUAUAUUGGAAUUUUAGCAACUUUUUUUCAGGUUAAAUAUAUAAUUUCAAGUGCUU' 'UUAAUGAACUUAUUUUUAAUUGGCUAGGGAGCAAAAAAUAAGUGAGUUCUGCUUUUAGUUAGUUAACCUU' 'GUUCUUUUCUUAAAUAGUACACUGCAUGGUAUUUAAUAUUCCAGGAAGCAUGGGAUUUUAUUUUGCUUGA' 'UUUUGGGCACAUGAAAUAAUAGCUCUAGGAAAAUGCGCAUCUUAAUGACUCUUUGUAAAGAGAGGCAUUU' 'CUUACAACUGUGAUGUUUGCUUACAUAAAAGUUACCUCAUAAGUUAAUUCUAACUUUUAUUCUUGAAUUU' 'UAUUUCAUUUCAAUAGCUUGUUUCAUUUGCACGCCUUUGUAUUUUGAUUGACCUGUAGAAUGGAUGUUAG' 'GAAACUCAAAAUUGAACACAGUGAAACAAAUGGUAUUUGAAGAAAUGUAAUAUCUUUUAUAUUCUAUUUA' 'UGAUAUCCAUAAUCAAAUGAGAUUAUUUUACCACAUAAAUGUUUUAAAUAUCAGAUUUUUAGUUUGCAGU' 'UUUAGGAAAAUGCUUUAGAUAGAAAAGGUUCUUAUGCAUUGAAUUUGGAGUACUACCAACAAUGAAUGAA' 'UUUAUUUUUUAUAUUCUUACACAUUUUAUUGGUCAUUGUCACAGAUAGUAAAUACUAAAAAUUUCAGGUC' 'AGUUUGUUUUGAAACUGAAAUUGGAAAUAAAUCUGGAAAUGUUUUGUUGCACUAAAAUAAUAAAAUGAAU' 'UGUACUG' ) } self.assertIsInstance(fa, dict) self.assertEqual(fa.keys(), fa_content.keys()) self.assertEqual(fa['NM_024573'], fa_content['NM_024573'])
def setUp(self): _mirs = utils.load_fasta('tests/input/hsa-miR-30a-3p.fa') _mrnas = utils.load_fasta('tests/input/NM_024573.fa') args = { 'target_seq': _mrnas['NM_024573'], 'mirna_seq': _mirs['hsa-miR-30a-3p'], } self.seed = seed.mmSeed(**args) self.seed.find_potential_targets_with_seed()