def test_gaps_in_target(self): """Moderna should model gaps in the target, too.""" a = read_alignment(ALIGN_TARGET_GAP) m = RnaModel(self.t, a) m.apply_alignment() m.insert_all_fragments() self.assertEqual( m.get_sequence().seq_with_modifications.replace('_', ''), '..CUGACCU#P')
def test_create_model_with_gaps(self): """Should create the model automatically.""" a = read_alignment(ALIGN_1B23_1QF6) t = Template(RNA_1B23, 'file', 'R') m = RnaModel(t, a) m.apply_alignment() m.insert_all_fragments() self.assertEqual( m.get_sequence().seq_with_modifications.replace('_', ''), 'GCCGAUAUAGCUCAGDDGGDAGAGCAGCGCAUUCGUEAUGCGAAG7UCGUAGGTPCGACUCCUAUUAUCGGCACCA' )
def test_doublegap_model(self): """Should create a model filling two gaps""" a = read_alignment('''> target GGGAUAGUUCCAGABU#A > template GGGA-AG--CCAGABU#A ''') t = Template(DOUBLEGAP, 'file', 'A') m = RnaModel(t, a) m.apply_alignment() m.insert_all_fragments() m.fix_backbone() self.assertEqual(m.get_sequence(), Sequence('GGGAUAGUUCCAGABU#A'))
def test_oppositegap_model(self): """Should create a model with close gaps in the other respective sequence""" a = read_alignment('''> target GGGAGAGCRUUAG-BU#A > template GGGAGAGCR--AGABU#A ''') t = Template(OPPOSITEGAP, 'file', 'A') m = RnaModel(t, a) m.apply_alignment() m.insert_all_fragments() self.assertEqual( m.get_sequence().seq_with_modifications.replace('_', ''), 'GGGAGAGCRUUAGBU#A')