Changeset 1699 in rotdif


Ignore:
Timestamp:
Jun 7, 2019, 11:41:39 AM (13 months ago)
Author:
yuexi
Message:

before ellipsoid

Location:
bin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • bin/main_elm.py

    r1654 r1699  
    9898    ProcessRotdif = subprocess.Popen( ProcessToCallRotdif,stdout=slave_rotdif,stdin=PIPE,bufsize=0,close_fds=True)   
    9999    stdout_rotdif = os.fdopen(master_rotdif, 'r', 0)
    100     rotdif_log = open('ELM_prediction','w')
    101     path_to_live_log = join(str(base_dir),join(str(sub_dir),'ELM_prediction'))
     100    rotdif_log = open('all_prediction','w')
     101    path_to_live_log = join(str(base_dir),join(str(sub_dir),'all_prediction'))
    102102    error_string_md = ''
    103103    timeout = 4 # seconds
     
    168168    Pdbfilename = os.path.basename(PdbStr)
    169169    run_name = json_variables['run_name']
    170     sub_dir = "ELM_"+run_name
     170    sub_dir = run_name + "_ELM"
    171171    #output_res,base_dir = rotdif(sub_dir)
    172172    if os.path.isdir(sub_dir):
     
    179179    output_res,base_dir = rotdif(Pdbfilename, sub_dir)
    180180    #save elm
    181     elm_out = [join(str(base_dir),join(sub_dir,'ELM_prediction'))]
    182     with open('test.txt','w') as wf:
    183         wf.write(str(elm_out)+'\n'+str(base_dir))       
     181    #elm_out = [join(str(base_dir),join(sub_dir,'ELM_prediction'))]       
    184182    #save params
    185     with open(join(str(base_dir),join(sub_dir,"ELM_prediction"))) as in_f:
     183    with open(join(str(base_dir),join(sub_dir,"all_prediction"))) as in_f:
    186184        tmp = in_f.readlines()
    187185    tmp[0]="Parameters\n"
     
    189187        for items in tmp[:17]:
    190188            out_f.write(items)
     189    with open(join(str(base_dir),join(sub_dir,"ELM_prediction")),'w') as out_f2:
     190        for item in tmp[17:]:
     191            out_f2.write(item)
     192    elm_out = [join(str(base_dir),join(sub_dir,'ELM_prediction'))]
    191193    elm_params = [join(str(base_dir),join(sub_dir,"ELM_params"))]
    192194    output_res[ 'elm_out' ] = elm_out
  • bin/main_elmdock.py

    r1653 r1699  
    4242from StringIO import StringIO
    4343import shutil
     44import sys
    4445
    4546if __name__ == "__main__":
     
    5253    run_name = json_variables['run_name']
    5354    #create subfolders
    54     sub_dir = "ELMDOCK_"+run_name
     55    sub_dir = run_name + "_ELMDOCK"
    5556    if os.path.isdir(sub_dir):
    5657        sys.stderr.write("run name already used\n")
     
    6061    old_pdb = os.path.basename(json_variables['pdb_location'][0])
    6162    to_dock = dock(old_relax)
    62     new_pdb = join(sub_dir, old_pdb)
    63     new_relax = join(sub_dir, old_relax)
    64     shutil.move(old_pdb,new_pdb)
    65     shutil.move(old_relax,new_relax)
    66     os.chdir(sub_dir)
    67     output_res, base_dir, dyna_flag, elm_flag, elmdock_flag,relax_loc = rotdif(to_dock,new_relax, new_pdb,sub_dir)
    68     exp_keys = exp_plot(color_list, dyna_flag, elm_flag, elmdock_flag,relax_loc)[1]
    69     outputmd_arr_files = []
     63    if to_dock == True:
     64        new_pdb = join(sub_dir, old_pdb)
     65        new_relax = join(sub_dir, old_relax)
     66        shutil.move(old_pdb,new_pdb)
     67        shutil.move(old_relax,new_relax)
     68        os.chdir(sub_dir)
     69        output_res, base_dir, dyna_flag, elm_flag, elmdock_flag,relax_loc = rotdif(to_dock,new_relax, new_pdb,sub_dir)
     70        exp_keys = exp_plot(color_list, dyna_flag, elm_flag, elmdock_flag,relax_loc)[1]
     71        outputmd_arr_files = []
    7072
    71     if dyna_flag == True:
    72         output_res[ 'diso_plot' ] = diso_plot(color_list, exp_keys, to_dock, dyna_flag, elm_flag, elmdock_flag)
    73         output_res[ 'daxi_plot' ] = daxi_plot(color_list, exp_keys, to_dock, dyna_flag, elm_flag, elmdock_flag)
    74         output_res[ 'dani_plot' ] = dani_plot(color_list,exp_keys, to_dock, dyna_flag, elm_flag, elmdock_flag)
     73        if dyna_flag == True:
     74            output_res[ 'diso_plot' ] = diso_plot(color_list, exp_keys, to_dock, dyna_flag, elm_flag, elmdock_flag)
     75            output_res[ 'daxi_plot' ] = daxi_plot(color_list, exp_keys, to_dock, dyna_flag, elm_flag, elmdock_flag)
     76            output_res[ 'dani_plot' ] = dani_plot(color_list,exp_keys, to_dock, dyna_flag, elm_flag, elmdock_flag)
    7577 
    76     if elm_flag == True:
    77         save_elm(dyna_flag, elm_flag, elmdock_flag)
    78         elm_out = ['ELM_prediction']
    79         output_res[ 'elm_out' ] = elm_out   
     78        if elm_flag == True:
     79            save_elm(dyna_flag, elm_flag, elmdock_flag)
     80            elm_out = ['ELM_prediction']
     81            output_res[ 'elm_out' ] = elm_out   
    8082
    81     if elmdock_flag == True:
    82         save_dock(dyna_flag, elm_flag, elmdock_flag)     
    83         with open('test.txt','w') as in_f:
    84             in_f.write(join(str(base_dir),join(sub_dir,'ELMDOCK')))       
    85         output_res[ 'elmdock_out' ] = [join(str(base_dir),join(sub_dir,'ELMDOCK'))]
    86         output_res[ 'pdb'] = [join(str(base_dir), join(sub_dir,'out_dock.pdb'))]
    87         view_pdb = join(str(base_dir), join(sub_dir,'out_dock.pdb'))
    88         output_res['outputpdb'] = { "file" : view_pdb, "script" : "ribbon" }
     83        if elmdock_flag == True:
     84            save_dock(dyna_flag, elm_flag, elmdock_flag)     
     85            output_res[ 'elmdock_out' ] = [join(str(base_dir),join(sub_dir,'ELMDOCK'))]
     86            output_res[ 'pdb'] = [join(str(base_dir), join(sub_dir,'out_dock.pdb'))]
     87            view_pdb = join(str(base_dir), join(sub_dir,'out_dock.pdb'))
     88            output_res['outputpdb'] = { "file" : view_pdb, "script" : "ribbon ONLY" }
    8989       
    90     output_res[ 'outputrotdif' ] = [join(str(base_dir), join(sub_dir,'elmdock_log.out'))]
    91     print (json.dumps(output_res))
     90        output_res[ 'outputrotdif' ] = [join(str(base_dir), join(sub_dir,'elmdock_log.out'))]
     91        print (json.dumps(output_res))
     92    else:
     93        sys.stderr.write("Only accept 2-domain proteins!")
  • bin/main_rotdif.py

    r1655 r1699  
    5858
    5959    run_name = json_variables['run_name']
    60     sub_dir = "ROTDIF_" + run_name
     60    sub_dir = run_name + "_ROTDIF"
    6161    if os.path.isdir(sub_dir):
    6262        pass
  • bin/run_rotdif.py

    r1655 r1699  
    6565    socket_dict={}
    6666    socket_dict['_uuid'] = json_variables['_uuid']
    67     json_variables['_base_directory'] = sub_dir
     67    #json_variables['_base_directory'] = sub_dir
    6868    base_dir = json_variables[ '_base_directory' ]
    6969    optimization_method_list = json_variables[ 'optimization_method' ]
Note: See TracChangeset for help on using the changeset viewer.