########################################################################
#
#    Vision Macro - Python source code - file generated by vision
#    Wednesday 08 September 2010 12:32:33 
#    
#       The Scripps Research Institute (TSRI)
#       Molecular Graphics Lab
#       La Jolla, CA 92037, USA
#
# Copyright: Daniel Stoffler, Michel Sanner and TSRI
#   
# revision: Guillaume Vareille
#  
#########################################################################
#
# $Header: /opt/cvs/python/packages/share1.5/AutoDockTools/VisionInterface/Adt/Macro/VirtualScreeningCSF.py,v 1.2 2010/09/08 19:38:57 jren Exp $
#
# $Id: VirtualScreeningCSF.py,v 1.2 2010/09/08 19:38:57 jren Exp $
#
 
from NetworkEditor.macros import MacroNode
from NetworkEditor.macros import MacroNode
class VirtualScreeningCSF(MacroNode):
 
    def __init__(self, constrkw={}, name='VirtualScreeningCSF', **kw):
        kw['name'] = name
        apply( MacroNode.__init__, (self,), kw)
 
    def beforeAddingToNetwork(self, net):
        MacroNode.beforeAddingToNetwork(self, net)
        from AutoDockTools.VisionInterface.Adt import Adt
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        net.getEditor().addLibraryInstance(wslib,"WebServices.VisionInterface.WSNodes", "wslib")
        from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
        try:
            addOpalServerAsCategory("http://ws.nbcr.net/opal2", replace=False)
        except:
            pass
        try:
            addOpalServerAsCategory("http://oolitevm.calit2.optiputer.net/opal2", replace=False)
        except:
            pass
        try:
            addOpalServerAsCategory("http://kryptonite.nbcr.net/opal2", replace=False)
        except:
            pass
 
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from AutoDockTools.VisionInterface.Adt import Adt
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        VirtualScreeningCSF_120 = self
        from traceback import print_exc
        from AutoDockTools.VisionInterface.Adt import Adt
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        masterNet.getEditor().addLibraryInstance(wslib,"WebServices.VisionInterface.WSNodes", "wslib")
        from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
        try:
            addOpalServerAsCategory("http://ws.nbcr.net/opal2", replace=False)
        except:
            pass
        try:
            addOpalServerAsCategory("http://oolitevm.calit2.optiputer.net/opal2", replace=False)
        except:
            pass
        try:
            addOpalServerAsCategory("http://kryptonite.nbcr.net/opal2", replace=False)
        except:
            pass
        try:
            ## saving node input Ports ##
            input_Ports_121 = self.macroNetwork.ipNode
            apply(input_Ports_121.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_121=None
 
        try:
            ## saving node output Ports ##
            output_Ports_122 = self.macroNetwork.opNode
            apply(output_Ports_122.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            output_Ports_122.move(217, 330)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_122=None
 
        try:
            ## saving node PrepareReceptor ##
            from Adt.Macro.PrepareReceptor import PrepareReceptor
            PrepareReceptor_141 = PrepareReceptor(constrkw={}, name='PrepareReceptor', library=Adt)
            self.macroNetwork.addNode(PrepareReceptor_141,115,96)
            apply(PrepareReceptor_141.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            Pdb2pqrWS_144 = PrepareReceptor_141.macroNetwork.nodes[2]
            Pdb2pqrOpalService_ws_nbcr_net_148 = Pdb2pqrWS_144.macroNetwork.nodes[3]
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['noopt'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['phi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['psi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['verbose'].widget.set(1, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['chain'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['nodebump'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['chi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['ligand'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['hbond'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['with_ph'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['forcefield'].widget.set(r"AMBER", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['clean'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['inId'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['apbs_input'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['ffout'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['localRun'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['rama'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['execPath'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['assign_only'].widget.set(0, run=False)
            GetURLFromList_149 = Pdb2pqrWS_144.macroNetwork.nodes[4]
            GetURLFromList_149.inputPortByName['ext'].widget.set(r"pqr", run=False)
 
            ## saving connections for network Pdb2pqrWS ##
            Pdb2pqrWS_144.macroNetwork.freeze()
            Pdb2pqrWS_144.macroNetwork.unfreeze()
 
            ## modifying MacroInputNode dynamic ports
            input_Ports_145 = Pdb2pqrWS_144.macroNetwork.ipNode
            input_Ports_145.outputPorts[1].configure(name='CheckFileFormat_value')
 
            ## modifying MacroOutputNode dynamic ports
            output_Ports_146 = Pdb2pqrWS_144.macroNetwork.opNode
            output_Ports_146.inputPorts[1].configure(singleConnection='auto')
            output_Ports_146.inputPorts[2].configure(singleConnection='auto')
            output_Ports_146.inputPorts[1].configure(name='UpdateReceptor_receptor_obj')
            output_Ports_146.inputPorts[2].configure(name='UpdateReceptor_pdb2pqr_result')
            Pdb2pqrWS_144.inputPorts[0].configure(name='CheckFileFormat_value')
            Pdb2pqrWS_144.inputPorts[0].configure(datatype='receptor')
            ## configure MacroNode input ports
            Pdb2pqrWS_144.outputPorts[0].configure(name='UpdateReceptor_receptor_obj')
            Pdb2pqrWS_144.outputPorts[0].configure(datatype='receptor')
            Pdb2pqrWS_144.outputPorts[1].configure(name='UpdateReceptor_pdb2pqr_result')
            Pdb2pqrWS_144.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            Pdb2pqrWS_144.shrink()
            PrepareReceptorWS_151 = PrepareReceptor_141.macroNetwork.nodes[3]
            PrepareReceptorOpalService_ws_nbcr_net_155 = PrepareReceptorWS_151.macroNetwork.nodes[3]
            PrepareReceptorOpalService_ws_nbcr_net_155.inputPortByName['o'].widget.set(r"", run=False)
            PrepareReceptorOpalService_ws_nbcr_net_155.inputPortByName['v'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_155.inputPortByName['localRun'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_155.inputPortByName['execPath'].widget.set(r"", run=False)
            GetURLFromList_156 = PrepareReceptorWS_151.macroNetwork.nodes[4]
            GetURLFromList_156.inputPortByName['ext'].widget.set(r"pdbqt", run=False)
            DownloadToFile_157 = PrepareReceptorWS_151.macroNetwork.nodes[5]
            DownloadToFile_157.inputPortByName['overwrite'].widget.set(1, run=False)
 
            ## saving connections for network PrepareReceptorWS ##
            PrepareReceptorWS_151.macroNetwork.freeze()
            PrepareReceptorWS_151.macroNetwork.unfreeze()
 
            ## modifying MacroInputNode dynamic ports
            input_Ports_152 = PrepareReceptorWS_151.macroNetwork.ipNode
            input_Ports_152.outputPorts[1].configure(name='CheckFileFormat_value')
            input_Ports_152.outputPorts[2].configure(name='PrepareReceptorOpalService_ws_nbcr_net_C')
 
            ## modifying MacroOutputNode dynamic ports
            output_Ports_153 = PrepareReceptorWS_151.macroNetwork.opNode
            output_Ports_153.inputPorts[1].configure(singleConnection='auto')
            output_Ports_153.inputPorts[2].configure(singleConnection='auto')
            output_Ports_153.inputPorts[1].configure(name='UpdateReceptor_receptor_prepared_obj')
            output_Ports_153.inputPorts[2].configure(name='UpdateReceptor_receptor_result')
            PrepareReceptorWS_151.inputPorts[0].configure(name='CheckFileFormat_value')
            PrepareReceptorWS_151.inputPorts[0].configure(datatype='receptor')
            PrepareReceptorWS_151.inputPorts[1].configure(name='PrepareReceptorOpalService_ws_nbcr_net_C')
            PrepareReceptorWS_151.inputPorts[1].configure(datatype='boolean')
            ## configure MacroNode input ports
            PrepareReceptorWS_151.outputPorts[0].configure(name='UpdateReceptor_receptor_prepared_obj')
            PrepareReceptorWS_151.outputPorts[0].configure(datatype='receptor_prepared')
            PrepareReceptorWS_151.outputPorts[1].configure(name='UpdateReceptor_receptor_result')
            PrepareReceptorWS_151.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            PrepareReceptorWS_151.shrink()
 
            ## saving connections for network PrepareReceptor ##
            PrepareReceptor_141.macroNetwork.freeze()
            PrepareReceptor_141.macroNetwork.unfreeze()
 
            ## modifying MacroInputNode dynamic ports
            input_Ports_142 = PrepareReceptor_141.macroNetwork.ipNode
            input_Ports_142.outputPorts[1].configure(name='Pdb2pqrWS_CheckFileFormat_value')
            input_Ports_142.outputPorts[2].configure(name='PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')
 
            ## modifying MacroOutputNode dynamic ports
            output_Ports_143 = PrepareReceptor_141.macroNetwork.opNode
            output_Ports_143.inputPorts[1].configure(singleConnection='auto')
            output_Ports_143.inputPorts[2].configure(singleConnection='auto')
            output_Ports_143.inputPorts[1].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
            output_Ports_143.inputPorts[2].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_result')
            PrepareReceptor_141.inputPorts[0].configure(name='Pdb2pqrWS_CheckFileFormat_value')
            PrepareReceptor_141.inputPorts[0].configure(datatype='receptor')
            PrepareReceptor_141.inputPorts[1].configure(name='PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')
            PrepareReceptor_141.inputPorts[1].configure(datatype='boolean')
            ## configure MacroNode input ports
            PrepareReceptor_141.outputPorts[0].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
            PrepareReceptor_141.outputPorts[0].configure(datatype='receptor_prepared')
            PrepareReceptor_141.outputPorts[1].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_result')
            PrepareReceptor_141.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            PrepareReceptor_141.shrink()
            apply(PrepareReceptor_141.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore PrepareReceptor named PrepareReceptor in network self.macroNetwork"
            print_exc()
            PrepareReceptor_141=None
 
        try:
            ## saving node ComputeGrids ##
            from Adt.Macro.ComputeGrids import ComputeGrids
            ComputeGrids_159 = ComputeGrids(constrkw={}, name='ComputeGrids', library=Adt)
            self.macroNetwork.addNode(ComputeGrids_159,136,207)
            apply(ComputeGrids_159.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            prepareGPF_kryptonite_nbcr_net_163 = ComputeGrids_159.macroNetwork.nodes[3]
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['singlelib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['r_url'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['zpoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['filter_file_url'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['lib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['ypoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['xcenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['p'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['o'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['zcenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['v'].widget.set(0, run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['userlib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['xpoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['localRun'].widget.set(0, run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['ycenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['execPath'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_164 = ComputeGrids_159.macroNetwork.nodes[4]
            autogrid_kryptonite_nbcr_net_164.inputPortByName['infile_url'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_164.inputPortByName['l'].widget.set(r"output.glg", run=False)
            autogrid_kryptonite_nbcr_net_164.inputPortByName['o'].widget.set(0, run=False)
            autogrid_kryptonite_nbcr_net_164.inputPortByName['p'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_164.inputPortByName['localRun'].widget.set(0, run=False)
            autogrid_kryptonite_nbcr_net_164.inputPortByName['execPath'].widget.set(r"", run=False)
            GetURLFromList_167 = ComputeGrids_159.macroNetwork.nodes[7]
            GetURLFromList_167.inputPortByName['ext'].widget.set(r"gpf", run=False)
 
            ## saving connections for network ComputeGrids ##
            ComputeGrids_159.macroNetwork.freeze()
            ComputeGrids_159.macroNetwork.unfreeze()
 
            ## modifying MacroInputNode dynamic ports
            input_Ports_160 = ComputeGrids_159.macroNetwork.ipNode
            input_Ports_160.outputPorts[1].configure(name='GetComputeGridsInputs_ligands')
            input_Ports_160.outputPorts[2].configure(name='GetComputeGridsInputs_receptor_pdbqt')
            input_Ports_160.outputPorts[3].configure(name='GetComputeGridsInputs_gpf_obj')
 
            ## modifying MacroOutputNode dynamic ports
            output_Ports_161 = ComputeGrids_159.macroNetwork.opNode
            output_Ports_161.inputPorts[1].configure(singleConnection='auto')
            output_Ports_161.inputPorts[2].configure(singleConnection='auto')
            output_Ports_161.inputPorts[1].configure(name='MakeAutogridResultObj_autogrid_result_obj')
            output_Ports_161.inputPorts[2].configure(name='GetMainURLFromList_newurl')
            ComputeGrids_159.inputPorts[0].configure(name='GetComputeGridsInputs_ligands')
            ComputeGrids_159.inputPorts[0].configure(datatype='LigandDB')
            ComputeGrids_159.inputPorts[1].configure(name='GetComputeGridsInputs_receptor_pdbqt')
            ComputeGrids_159.inputPorts[1].configure(datatype='receptor_prepared')
            ComputeGrids_159.inputPorts[2].configure(name='GetComputeGridsInputs_gpf_obj')
            ComputeGrids_159.inputPorts[2].configure(datatype='gpf_template')
            ## configure MacroNode input ports
            ComputeGrids_159.outputPorts[0].configure(name='MakeAutogridResultObj_autogrid_result_obj')
            ComputeGrids_159.outputPorts[0].configure(datatype='autogrid_results')
            ComputeGrids_159.outputPorts[1].configure(name='GetMainURLFromList_newurl')
            ComputeGrids_159.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            ComputeGrids_159.shrink()
            apply(ComputeGrids_159.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore ComputeGrids named ComputeGrids in network self.macroNetwork"
            print_exc()
            ComputeGrids_159=None
 
        try:
            ## saving node AutodockVsCSF ##
            from Adt.Macro.AutodockVsCSF import AutodockVsCSF
            AutodockVsCSF_168 = AutodockVsCSF(constrkw={}, name='AutodockVsCSF', library=Adt)
            self.macroNetwork.addNode(AutodockVsCSF_168,234,272)
            apply(AutodockVsCSF_168.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            autodock_kryptonite_nbcr_net_172 = AutodockVsCSF_168.macroNetwork.nodes[3]
            autodock_kryptonite_nbcr_net_172.inputPortByName['ga_run'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['lib'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['filter_file_url'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['ga_num_evals'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['sched'].widget.set(r"CSF", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['ga_num_generations'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['userlib'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['ga_pop_size'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['localRun'].widget.set(0, run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['email'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['execPath'].widget.set(r"", run=False)
            AutodockSlice_oolitevm_calit2_optiputer_net_175 = AutodockVsCSF_168.macroNetwork.nodes[6]
            AutodockSlice_oolitevm_calit2_optiputer_net_175.inputPortByName['execPath'].widget.set(r"", run=False)
            AutodockSlice_oolitevm_calit2_optiputer_net_175.inputPortByName['localRun'].widget.set(0, run=False)
            AutodockSlice_oolitevm_calit2_optiputer_net_175.inputPortByName['divisor'].widget.set(r"", run=False)
 
            ## saving connections for network AutodockVsCSF ##
            AutodockVsCSF_168.macroNetwork.freeze()
            AutodockVsCSF_168.macroNetwork.unfreeze()
 
            ## modifying MacroInputNode dynamic ports
            input_Ports_169 = AutodockVsCSF_168.macroNetwork.ipNode
            input_Ports_169.outputPorts[1].configure(name='PrepareADVSInputs_ligands')
            input_Ports_169.outputPorts[2].configure(name='PrepareADVSInputs_autogrid_results')
            input_Ports_169.outputPorts[3].configure(name='PrepareADVSInputs_dpf_template_obj')
 
            ## modifying MacroOutputNode dynamic ports
            output_Ports_170 = AutodockVsCSF_168.macroNetwork.opNode
            output_Ports_170.inputPorts[1].configure(singleConnection='auto')
            output_Ports_170.inputPorts[1].configure(name='GetMainURLFromList_newurl')
            AutodockVsCSF_168.inputPorts[0].configure(name='PrepareADVSInputs_ligands')
            AutodockVsCSF_168.inputPorts[0].configure(datatype='LigandDB')
            AutodockVsCSF_168.inputPorts[1].configure(name='PrepareADVSInputs_autogrid_results')
            AutodockVsCSF_168.inputPorts[1].configure(datatype='autogrid_results')
            AutodockVsCSF_168.inputPorts[2].configure(name='PrepareADVSInputs_dpf_template_obj')
            AutodockVsCSF_168.inputPorts[2].configure(datatype='dpf_template')
            ## configure MacroNode input ports
            AutodockVsCSF_168.outputPorts[0].configure(name='GetMainURLFromList_newurl')
            AutodockVsCSF_168.outputPorts[0].configure(datatype='string')
            ## configure MacroNode output ports
            AutodockVsCSF_168.shrink()
            apply(AutodockVsCSF_168.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore AutodockVsCSF named AutodockVsCSF in network self.macroNetwork"
            print_exc()
            AutodockVsCSF_168=None
 
        #self.macroNetwork.run()
        self.macroNetwork.freeze()
 
        ## saving connections for network VirtualScreeningCSF ##
        input_Ports_121 = self.macroNetwork.ipNode
        if input_Ports_121 is not None and PrepareReceptor_141 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_121, PrepareReceptor_141, "new", "Pdb2pqrWS_CheckFileFormat_value", blocking=True
                    , splitratio=[0.70852617526621731, 0.39749336046566702])
            except:
                print "WARNING: failed to restore connection between input_Ports_121 and PrepareReceptor_141 in network self.macroNetwork"
        if PrepareReceptor_141 is not None and ComputeGrids_159 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareReceptor_141, ComputeGrids_159, "PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj", "GetComputeGridsInputs_receptor_pdbqt", blocking=True
                    , splitratio=[0.35807693100671723, 0.50862337251735745])
            except:
                print "WARNING: failed to restore connection between PrepareReceptor_141 and ComputeGrids_159 in network self.macroNetwork"
        if input_Ports_121 is not None and ComputeGrids_159 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_121, ComputeGrids_159, "new", "GetComputeGridsInputs_ligands", blocking=True
                    , splitratio=[0.40102167589221782, 0.6253111040879471])
            except:
                print "WARNING: failed to restore connection between input_Ports_121 and ComputeGrids_159 in network self.macroNetwork"
        if input_Ports_121 is not None and AutodockVsCSF_168 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_121, AutodockVsCSF_168, "ComputeGrids_GetComputeGridsInputs_ligands", "PrepareADVSInputs_ligands", blocking=True
                    , splitratio=[0.65260935115862417, 0.64296744661832661])
            except:
                print "WARNING: failed to restore connection between input_Ports_121 and AutodockVsCSF_168 in network self.macroNetwork"
        if ComputeGrids_159 is not None and AutodockVsCSF_168 is not None:
            try:
                self.macroNetwork.connectNodes(
                    ComputeGrids_159, AutodockVsCSF_168, "MakeAutogridResultObj_autogrid_result_obj", "PrepareADVSInputs_autogrid_results", blocking=True
                    , splitratio=[0.50054097826587762, 0.55954672420260165])
            except:
                print "WARNING: failed to restore connection between ComputeGrids_159 and AutodockVsCSF_168 in network self.macroNetwork"
        if input_Ports_121 is not None and ComputeGrids_159 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_121, ComputeGrids_159, "new", "GetComputeGridsInputs_gpf_obj", blocking=True
                    , splitratio=[0.73607423731241384, 0.54225043834950515])
            except:
                print "WARNING: failed to restore connection between input_Ports_121 and ComputeGrids_159 in network self.macroNetwork"
        if input_Ports_121 is not None and AutodockVsCSF_168 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_121, AutodockVsCSF_168, "new", "PrepareADVSInputs_dpf_template_obj", blocking=True
                    , splitratio=[0.24404719659126095, 0.41822006352735946])
            except:
                print "WARNING: failed to restore connection between input_Ports_121 and AutodockVsCSF_168 in network self.macroNetwork"
        if input_Ports_121 is not None and PrepareReceptor_141 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_121, PrepareReceptor_141, "new", "PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C", blocking=True
                    , splitratio=[0.73098254809437191, 0.23999050334763958])
            except:
                print "WARNING: failed to restore connection between input_Ports_121 and PrepareReceptor_141 in network self.macroNetwork"
        output_Ports_122 = self.macroNetwork.opNode
        if AutodockVsCSF_168 is not None and output_Ports_122 is not None:
            try:
                self.macroNetwork.connectNodes(
                    AutodockVsCSF_168, output_Ports_122, "GetMainURLFromList_newurl", "new", blocking=True
                    , splitratio=[0.55528494083678659, 0.33476142488031579])
            except:
                print "WARNING: failed to restore connection between AutodockVsCSF_168 and output_Ports_122 in network self.macroNetwork"
        self.macroNetwork.runOnNewData.value = False
 
        ## modifying MacroInputNode dynamic ports
        input_Ports_121 = self.macroNetwork.ipNode
        input_Ports_121.outputPorts[1].configure(name='PrepareReceptor_Pdb2pqrWS_CheckFileFormat_value')
        input_Ports_121.outputPorts[2].configure(name='ComputeGrids_GetComputeGridsInputs_ligands')
        input_Ports_121.outputPorts[3].configure(name='ComputeGrids_GetComputeGridsInputs_gpf_obj')
        input_Ports_121.outputPorts[4].configure(name='AutodockVsCSF_PrepareADVSInputs_dpf_template_obj')
        input_Ports_121.outputPorts[5].configure(name='PrepareReceptor_PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')
 
        ## modifying MacroOutputNode dynamic ports
        output_Ports_122 = self.macroNetwork.opNode
        output_Ports_122.inputPorts[1].configure(singleConnection='auto')
        output_Ports_122.inputPorts[1].configure(name='AutodockVsCSF_GetMainURLFromList_newurl')
        ## configure MacroNode input ports
        VirtualScreeningCSF_120.inputPorts[0].configure(name='PrepareReceptor_Pdb2pqrWS_CheckFileFormat_value')
        VirtualScreeningCSF_120.inputPorts[0].configure(datatype='receptor')
        VirtualScreeningCSF_120.inputPorts[1].configure(name='ComputeGrids_GetComputeGridsInputs_ligands')
        VirtualScreeningCSF_120.inputPorts[1].configure(datatype='LigandDB')
        VirtualScreeningCSF_120.inputPorts[2].configure(name='ComputeGrids_GetComputeGridsInputs_gpf_obj')
        VirtualScreeningCSF_120.inputPorts[2].configure(datatype='gpf_template')
        VirtualScreeningCSF_120.inputPorts[3].configure(name='AutodockVsCSF_PrepareADVSInputs_dpf_template_obj')
        VirtualScreeningCSF_120.inputPorts[3].configure(datatype='dpf_template')
        VirtualScreeningCSF_120.inputPorts[4].configure(name='PrepareReceptor_PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')
        VirtualScreeningCSF_120.inputPorts[4].configure(datatype='boolean')
        ## configure MacroNode output ports
        VirtualScreeningCSF_120.outputPorts[0].configure(name='AutodockVsCSF_GetMainURLFromList_newurl')
        VirtualScreeningCSF_120.outputPorts[0].configure(datatype='string')
 
        VirtualScreeningCSF_120.shrink()
 
        ## reset modifications ##
        VirtualScreeningCSF_120.resetTags()
        VirtualScreeningCSF_120.buildOriginalList()