Changeset 1653 in rotdif


Ignore:
Timestamp:
Feb 18, 2019, 9:13:23 PM (17 months ago)
Author:
yuexi
Message:

subfolder

Location:
bin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • bin/main_elmdock.py

    r1647 r1653  
    11#!/usr/bin/python
    2 import os
     2import os,sys
    33import glob
    44import re
     
    2424from StringIO import StringIO
    2525from subprocess import Popen, PIPE, STDOUT
    26 
     26from os.path import join
    2727#import our functions
    2828from run_rotdif_elmdock import rotdif
     
    4141from indicator_chain import dock
    4242from StringIO import StringIO
     43import shutil
    4344
    4445if __name__ == "__main__":
     
    4950    argv_io_string = StringIO(sys.argv[1])
    5051    json_variables = json.load(argv_io_string)
    51     relax_location = json_variables['relax_location']
    52     relax_loc = relax_location[0]
    53     to_dock = dock(relax_loc)
    54     output_res, base_dir, dyna_flag, elm_flag, elmdock_flag = rotdif(to_dock)
     52    run_name = json_variables['run_name']
     53    #create subfolders
     54    sub_dir = "ELMDOCK_"+run_name
     55    if os.path.isdir(sub_dir):
     56        sys.stderr.write("run name already used\n")
     57    else:
     58        os.mkdir(sub_dir)
     59    old_relax = os.path.basename(json_variables['relax_location'][0])
     60    old_pdb = os.path.basename(json_variables['pdb_location'][0])
     61    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)
    5568    exp_keys = exp_plot(color_list, dyna_flag, elm_flag, elmdock_flag,relax_loc)[1]
    5669    outputmd_arr_files = []
    57     log_out = [str(base_dir) + "/" + 'elmdock_log.out']
     70
    5871    if dyna_flag == True:
    5972        output_res[ 'diso_plot' ] = diso_plot(color_list, exp_keys, to_dock, dyna_flag, elm_flag, elmdock_flag)
     
    6376    if elm_flag == True:
    6477        save_elm(dyna_flag, elm_flag, elmdock_flag)
    65         elm_out = [str(base_dir) + "/" + 'ELM_prediction']
     78        elm_out = ['ELM_prediction']
    6679        output_res[ 'elm_out' ] = elm_out   
    6780
    6881    if elmdock_flag == True:
    69         save_dock(dyna_flag, elm_flag, elmdock_flag)
    70         dock_out = [str(base_dir) + "/" + 'ELMDOCK']     
    71         output_res[ 'elmdock_out' ] = dock_out
    72         dock_pdb = [str(base_dir) + "/" + 'out_dock.pdb']
    73         output_res[ 'pdb'] = dock_pdb
    74         view_pdb = str(base_dir) + "/" + 'out_dock.pdb'
     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'))
    7588        output_res['outputpdb'] = { "file" : view_pdb, "script" : "ribbon" }
    7689       
    77         #user_pdb = [str(base_dir)+"/"+'diUb_AB.pdb']
    78     output_res[ 'outputrotdif' ] = log_out
     90    output_res[ 'outputrotdif' ] = [join(str(base_dir), join(sub_dir,'elmdock_log.out'))]
    7991    print (json.dumps(output_res))
  • bin/run_rotdif.py

    r1532 r1653  
    4646    return
    4747
    48 def rotdif(in_dock):
     48def rotdif(in_dock,sub_dir):
    4949    output_res = {}
    5050    json_variables = " "
     
    6464    socket_dict={}
    6565    socket_dict['_uuid'] = json_variables['_uuid']
     66    json_variables['_base_directory'] = sub_dir
    6667    base_dir = json_variables[ '_base_directory' ]
    6768    optimization_method_list = json_variables[ 'optimization_method' ]
  • bin/run_rotdif_elmdock.py

    r1647 r1653  
    11#!/usr/bin/python
    22import os
     3from os.path import join
    34import glob
    45import re
     
    2526from math import exp, expm1, log10, log, log1p
    2627from subprocess import Popen, PIPE, STDOUT
     28import shutil
    2729
    2830def message_box(text,icon):
     
    4648    return
    4749
    48 def rotdif(in_dock):
     50def rotdif(in_dock,new_relax,new_pdb,sub_dir):
    4951    output_res = {}
    5052    json_variables = " "
     
    5254    argv_io_string = StringIO(sys.argv[1])
    5355    json_variables = json.load(argv_io_string)
    54     relax_location = json_variables['relax_location']
    55     RelaxStr = relax_location[0]
    56     Relaxfilename = os.path.basename(RelaxStr)
    57     pdb_location   = json_variables['pdb_location']
    58     PdbStr = pdb_location[0]
    59     Pdbfilename = os.path.basename(PdbStr)
     56    #relax_location = json_variables['relax_location']
     57    #shutil.move(new_relax,join(sub_dir,new_relax))
     58    #RelaxStr = join(sub_dir,new_relax)
     59    Relaxfilename = os.path.basename(new_relax)
     60
     61    #pdb_location   = json_variables['pdb_location']
     62    #shutil.move(new_pdb,join(sub_dir,new_pdb))
     63    #PdbStr = join(sub_dir,new_pdb)
     64    Pdbfilename = os.path.basename(new_pdb)
     65    #os.chdir(sub_dir)
    6066## UDP messaging ##################################################
    6167    UDP_IP = json_variables['_udphost']
     
    155161    output_res[ 'progress_output' ] = str(1.0)
    156162    output_res[ 'progress_text' ] =  'ELMDOCK calculation progress: ' + '100%'
    157     return output_res, base_dir, dyna_flag, elm_flag, elmdock_flag
     163    return output_res, base_dir, dyna_flag, elm_flag, elmdock_flag,Relaxfilename
    158164
    159165def clean_up():
Note: See TracChangeset for help on using the changeset viewer.