Exemplo n.º 1
0
    def setup(self, cmd_args, **options):
        #trim off basepairs on the end do not need them in the simulation
        ss = ssfactory.factory.get_structure(
            cmd_args.cseq[3:-3] + "+" + cmd_args.fseq[3:-3],
            cmd_args.css[3:-3]  + "+" + cmd_args.fss[3:-3],
            to_RNA=1
        )

        #update secondary structure to include tertiary contact motifs
        m1 = rm.manager.get_motif(name='GAAA_tetraloop')
        m2 = rm.manager.get_motif(name='GGAA_tetraloop')
        ss.add_motif(m1.secondary_structure, m1.name)
        ss.add_motif(m2.secondary_structure, m2.name)

        m2 = rm.manager.get_motif(name='GGAA_tetraloop')
        last_end_id = None
        for i, end in enumerate(m2.ends):
            if end.name() == "A1-A6":
                last_end_id = m2.end_ids[i]
                break
        last_end = ss.motif('GGAA_tetraloop').get_end_by_id(last_end_id)
        conn = ss.motif_topology_from_end(ss.ends[1], last_end=last_end)
        mtt = motif_tree_topology.MotifTreeTopology(conn)
        mt = motif_tree.motif_tree_from_topology(mtt, sterics=0)
        mset = motif_state_ensemble_tree.MotifStateEnsembleTree(mt=mt)

        ni = -1
        ei = -1
        for n in mt:
            if n.data.name == 'GGAA_tetraloop':
                ni = n.index
                bp = n.data.get_basepair(name="A1-A6")[0]
                ei = n.data.ends.index(bp)


        if cmd_args.pdbs:
            mt.write_pdbs("good")
            mst = mset.to_mst()
            n1 = mst.get_node(ni)
            n2 = mst.get_node(mt.last_node().index-1)
            end_state_1 = n1.data.cur_state.end_states[ei]
            end_state_2 = n2.data.cur_state.end_states[1]
            scorer = thermo_fluc_sampler.FrameScorer()
            score = scorer.score(end_state_1, end_state_2)
            print "distance + rotation diff = ",score
            exit()

        self.simulator = thermo_fluc_sampler.ThermoFlucSimulation()
        self.simulator.setup(mset, ni, mt.last_node().index-1, ei, 1)
        self.simulator.run()
Exemplo n.º 2
0
def new_build():
    seq1 = 'CTAGGATATGGGGGGUUUUUGGGAACAAAAACCCCCCTAAGTCCTAG'
    seq2 = 'CTAGGAATCTGGAAGTACCGAGGAAACTCGGTACTTCCTGTGTCCTAG'

    db1  = '(((((((..((((((((((((....))))))))))))...)))))))'
    db2  = '((((((....((((((((((((....))))))))))))....))))))'

    ss = ssfactory.factory.get_structure(seq1 +"+" + seq2, db1 + "+" + db2, to_RNA=1)
    m1 = rm.manager.get_motif(name='GAAA_tetraloop')
    m2 = rm.manager.get_motif(name='GGAA_tetraloop')
    ss.add_motif(m1.secondary_structure, m1.name)
    ss.add_motif(m2.secondary_structure, m2.name)
    ss_m = ss.motif('GGAA_tetraloop')
    last_end = None
    for i, end in enumerate(ss_m.ends):
        if ss_m.end_ids[i] == 'GGGAAC_LUUUUR_CCUGUGUC_LLULUULL_GAAUCUGG_RRUURURR':
            last_end = end
            break
    conn = ss.motif_topology_from_end(ss.ends[1], last_end=last_end)
    mtt = motif_tree_topology.MotifTreeTopology(conn)
    mt = motif_tree.motif_tree_from_topology(mtt, sterics=0)
    mt.write_pdbs()