def test_build_model(self): cmd = "python %smoderna.py -t %s -a %s -o %s > %s" % ( MODULE_PATH + os.sep, MINI_TEMPLATE, MINI_ALIGNMENT_FILE, self.tmp, self.tmp2) os.system(cmd) t = Template(self.tmp) self.assertEqual(t.get_sequence(), Sequence('ACUGUGAYUA[UACCU#PG'))
class RnaModelTests(TestCase): def setUp(self): self.a = read_alignment(MINI_ALIGNMENT) self.t = Template(MINI_TEMPLATE, seq=Sequence("GCGGAUUUALCUCAG")) self.m = RnaModel(self.t, self.a) self.seq_before = self.t.get_sequence() self.br = BaseRecognizer() def tearDown(self): self.a = None self.t = None self.m = None self.br = None self.seq_before = None
def test_insert_modi_chain(self): cmd = "python %smoderna.py -s %s -c D -o %s -m m22G -p 38 > %s"%(MODULE_PATH+os.sep, RNA_HAIRPIN, self.tmp, self.tmp2) os.system(cmd) t = Template(self.tmp, template_chain_name='D') self.assertEqual(t.get_sequence(),Sequence('CUGCCUQUC/RGC'))
def test_insert_modification(self): cmd = "python %smoderna.py -s %s -o %s -m m22G -p 3 > %s"%(MODULE_PATH+os.sep, MINI_TEMPLATE, self.tmp, self.tmp2) os.system(cmd) t = Template(self.tmp) self.assertEqual(t.get_sequence(),Sequence('GCRGAUUUALCUCAG'))
def load_template(file_path, chain_name='A'): """*load_template(file_path, chain_name='A')* Loads a template structure from a PDB file. Produces a Template object that can be saved in a variable. Each template in ModeRNA has only one chain. By default, the chain with id 'A' is loaded. Another chain id can be specified optionally :Arguments: * path+filename of a PDB structure file * chain id (by default 'A') """ file_path = validate_filename(file_path) t = Template(file_path, 'file', chain_name) log.write_message('Template loaded from %s.\nTemplate sequence:\n%s\n' %(file_path, t.get_sequence().seq_with_modifications)) return t