예제 #1
0
 def test_insert_all_fragments_retain_template(self):
     """The template sequence should not change."""
     m2 = RnaModel(template=self.t,
                   alignment=self.a,
                   model_chain_name='A',
                   data_type='file',
                   data=MINI_TEMPLATE)
     m2.insert_all_fragments()
     self.assertEqual(self.t.get_sequence(), self.seq_before)
예제 #2
0
 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')
예제 #3
0
 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'
     )
예제 #4
0
    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'))
예제 #5
0
    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')