예제 #1
0
    '''selected_frags_Dict = { residue_number : ( ( mer, pos, picker_rank, SHD_rank ),
                                                  ( boltzmann_prob, total_score ), 
                                                  ( density_score, rmsd ) )              '''


    ''' after the first round, every position has a fragment assigned, 
        now we can start do Monte Carlo sampling ''' 
    #selected_frags_Dict = {}

    # three object are being created
    etable = ScoreTable( density_score_Dict, overlap_score_Dict, nonoverlap_score_Dict )     
    wts = Weights( args.density_score_wt, args.overlap_score_wt, args.closab_score_wt, args.clash_score_wt )
    scorefxn = ScoreFunction( etable, wts, args.null_frag_score )

    for each_round in range( 1, args.round+1 ):
        scorefxn.clean_selected_frags_dict()
        #mypose = Pose()

        if args.starts_with:
            assert not args.dump_results == args.starts_with
            print "Initialize with %s" % args.starts_with
            pkl = open( args.starts_with , "rb" )
            scorefxn.selected_frags_dict = pickle.load( pkl )
        else:
            scorefxn.initialize( args.initialization )

        for each_step in range( args.steps ):
            print "round: %s  cycle: %s" %( each_round, each_step )
            pos = pos_list[ random.randrange( 0, len( pos_list ) ) ] # pick a residue number to start with

            boltzmann_prob_Dict = {}