Esempio n. 1
0
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        ComputeGrids_18 = self
        from traceback import print_exc
        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://kryptonite.nbcr.net/opal2",
                                    replace=False)
        except:
            pass
        try:
            ## saving node input Ports ##
            input_Ports_19 = self.macroNetwork.ipNode
            apply(input_Ports_19.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_19 = None

        try:
            ## saving node output Ports ##
            output_Ports_20 = self.macroNetwork.opNode
            apply(output_Ports_20.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
            output_Ports_20.move(217, 471)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_20 = None

        try:
            ## saving node GetComputeGridsInputs ##
            from Vision.StandardNodes import Generic
            GetComputeGridsInputs_21 = Generic(constrkw={},
                                               name='GetComputeGridsInputs',
                                               library=stdlib)
            self.macroNetwork.addNode(GetComputeGridsInputs_21, 217, 79)
            apply(
                GetComputeGridsInputs_21.addInputPort, (), {
                    'singleConnection': True,
                    'name': 'ligands',
                    'cast': True,
                    'datatype': 'LigandDB',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'rect',
                    'color': '#FFCCFF',
                    'originalDatatype': 'None'
                })
            apply(
                GetComputeGridsInputs_21.addInputPort, (), {
                    'singleConnection': True,
                    'name': 'receptor_pdbqt',
                    'cast': True,
                    'datatype': 'receptor_prepared',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'triangle',
                    'color': '#009900',
                    'originalDatatype': 'None'
                })
            apply(
                GetComputeGridsInputs_21.addInputPort, (), {
                    'singleConnection': True,
                    'name': 'gpf_obj',
                    'cast': True,
                    'datatype': 'gpf_template',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'triangle',
                    'color': '#FF3333',
                    'originalDatatype': 'None'
                })
            apply(
                GetComputeGridsInputs_21.addOutputPort, (), {
                    'name': 'gpf_template_path',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            apply(
                GetComputeGridsInputs_21.addOutputPort, (), {
                    'name': 'filter_file',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            apply(
                GetComputeGridsInputs_21.addOutputPort, (), {
                    'name': 'ligand_lib',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            apply(
                GetComputeGridsInputs_21.addOutputPort, (), {
                    'name': 'prepared_receptor',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            code = """def doit(self, ligands, receptor_pdbqt, gpf_obj):
        gpf_path = gpf_obj.fullpath

        if not(os.path.exists(gpf_path)):
            print "ERROR: GPF template " + gpf_path + " does not exist!"
            return '''stop'''

        filter_file = ligands.filter_file
        ligand_lib = ligands.loc
        prepared_receptor = receptor_pdbqt.path

        pass

        self.outputData(gpf_template_path=gpf_path, filter_file=filter_file, ligand_lib=ligand_lib, prepared_receptor=prepared_receptor)

## to ouput data on port gpf_template_path use
## self.outputData(gpf_template_path=data)
## to ouput data on port filter_file use
## self.outputData(filter_file=data)
## to ouput data on port ligand_lib use
## self.outputData(ligand_lib=data)
## to ouput data on port prepared_receptor use
## self.outputData(prepared_receptor=data)






"""
            GetComputeGridsInputs_21.configure(function=code)
            apply(GetComputeGridsInputs_21.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore Generic named GetComputeGridsInputs in network self.macroNetwork"
            print_exc()
            GetComputeGridsInputs_21 = None

        try:
            ## saving node prepareGPF_kryptonite_nbcr_net ##
            from NetworkEditor.items import FunctionNode
            prepareGPF_kryptonite_nbcr_net_22 = FunctionNode(
                functionOrString='prepareGPF_kryptonite_nbcr_net',
                host="http://kryptonite.nbcr.net/opal2",
                namedArgs={
                    'singlelib': '',
                    'r_url': '',
                    'zpoints': '',
                    'filter_file_url': '',
                    'lib': '',
                    'ypoints': '',
                    'filter_file': '',
                    'gpf': '',
                    'xcenter': 'auto',
                    'urllib': '',
                    'p': '',
                    'r': '',
                    'o': '',
                    'zcenter': 'auto',
                    'v': False,
                    'userlib': '',
                    'xpoints': '',
                    'localRun': False,
                    'ycenter': 'auto',
                    'execPath': ''
                },
                constrkw={
                    'functionOrString': "'prepareGPF_kryptonite_nbcr_net'",
                    'host': '"http://kryptonite.nbcr.net/opal2"',
                    'namedArgs': {
                        'singlelib': '',
                        'r_url': '',
                        'zpoints': '',
                        'filter_file_url': '',
                        'lib': '',
                        'ypoints': '',
                        'filter_file': '',
                        'gpf': '',
                        'xcenter': 'auto',
                        'urllib': '',
                        'p': '',
                        'r': '',
                        'o': '',
                        'zcenter': 'auto',
                        'v': False,
                        'userlib': '',
                        'xpoints': '',
                        'localRun': False,
                        'ycenter': 'auto',
                        'execPath': ''
                    }
                },
                name='prepareGPF_kryptonite_nbcr_net',
                library=wslib)
            self.macroNetwork.addNode(prepareGPF_kryptonite_nbcr_net_22, 217,
                                      141)
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['singlelib'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['r_url'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['zpoints'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.
                inputPortByName['filter_file_url'].configure, (),
                {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['lib'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['ypoints'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.
                inputPortByName['filter_file'].configure, (),
                {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['gpf'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['xcenter'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['urllib'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['p'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['r'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['o'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['zcenter'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['v'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['userlib'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['xpoints'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['localRun'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['ycenter'].
                configure, (), {'defaultValue': None})
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['execPath'].
                configure, (), {'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'singlelib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'r_url'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'zpoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'filter_file_url'].widget.set(r"", run=False)
            apply(
                prepareGPF_kryptonite_nbcr_net_22.inputPortByName['lib'].
                widget.configure, (), {
                    'choices':
                    ('sample', 'NCIDS_SC', 'NCI_DS1', 'NCI_DS2', 'oldNCI',
                     'human_metabolome', 'chembridge_building_blocks',
                     'drugbank_nutraceutics', 'drugbank_smallmol',
                     'fda_approved')
                })
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'lib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'ypoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'filter_file'].rebindWidget()
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'filter_file'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'filter_file'].unbindWidget()
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'gpf'].rebindWidget()
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'gpf'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'gpf'].unbindWidget()
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'xcenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'urllib'].rebindWidget()
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'urllib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'urllib'].unbindWidget()
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName['p'].widget.set(
                r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'r'].rebindWidget()
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName['r'].widget.set(
                r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'r'].unbindWidget()
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName['o'].widget.set(
                r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'zcenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName['v'].widget.set(
                0, run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'userlib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'xpoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'localRun'].widget.set(0, run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'ycenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            apply(prepareGPF_kryptonite_nbcr_net_22.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore FunctionNode named prepareGPF_kryptonite_nbcr_net in network self.macroNetwork"
            print_exc()
            prepareGPF_kryptonite_nbcr_net_22 = None

        try:
            ## saving node autogrid_kryptonite_nbcr_net ##
            from NetworkEditor.items import FunctionNode
            autogrid_kryptonite_nbcr_net_23 = FunctionNode(
                functionOrString='autogrid_kryptonite_nbcr_net',
                host="http://kryptonite.nbcr.net/opal2",
                namedArgs={
                    'p_url': '',
                    'infile_url': '',
                    'l': 'output.glg',
                    'o': False,
                    'p': '',
                    'localRun': False,
                    'inFile': '',
                    'execPath': ''
                },
                constrkw={
                    'functionOrString': "'autogrid_kryptonite_nbcr_net'",
                    'host': '"http://kryptonite.nbcr.net/opal2"',
                    'namedArgs': {
                        'p_url': '',
                        'infile_url': '',
                        'l': 'output.glg',
                        'o': False,
                        'p': '',
                        'localRun': False,
                        'inFile': '',
                        'execPath': ''
                    }
                },
                name='autogrid_kryptonite_nbcr_net',
                library=wslib)
            self.macroNetwork.addNode(autogrid_kryptonite_nbcr_net_23, 251,
                                      292)
            apply(
                autogrid_kryptonite_nbcr_net_23.inputPortByName['p_url'].
                configure, (), {'defaultValue': None})
            apply(
                autogrid_kryptonite_nbcr_net_23.inputPortByName['infile_url'].
                configure, (), {'defaultValue': None})
            apply(
                autogrid_kryptonite_nbcr_net_23.inputPortByName['l'].configure,
                (), {'defaultValue': None})
            apply(
                autogrid_kryptonite_nbcr_net_23.inputPortByName['o'].configure,
                (), {'defaultValue': None})
            apply(
                autogrid_kryptonite_nbcr_net_23.inputPortByName['p'].configure,
                (), {'defaultValue': None})
            apply(
                autogrid_kryptonite_nbcr_net_23.inputPortByName['localRun'].
                configure, (), {'defaultValue': None})
            apply(
                autogrid_kryptonite_nbcr_net_23.inputPortByName['inFile'].
                configure, (), {'defaultValue': None})
            apply(
                autogrid_kryptonite_nbcr_net_23.inputPortByName['execPath'].
                configure, (), {'defaultValue': None})
            autogrid_kryptonite_nbcr_net_23.inputPortByName[
                'p_url'].rebindWidget()
            autogrid_kryptonite_nbcr_net_23.inputPortByName[
                'p_url'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_23.inputPortByName[
                'p_url'].unbindWidget()
            autogrid_kryptonite_nbcr_net_23.inputPortByName[
                'infile_url'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_23.inputPortByName['l'].widget.set(
                r"output.glg", run=False)
            autogrid_kryptonite_nbcr_net_23.inputPortByName['o'].widget.set(
                0, run=False)
            autogrid_kryptonite_nbcr_net_23.inputPortByName['p'].widget.set(
                r"", run=False)
            autogrid_kryptonite_nbcr_net_23.inputPortByName[
                'localRun'].widget.set(0, run=False)
            autogrid_kryptonite_nbcr_net_23.inputPortByName[
                'inFile'].rebindWidget()
            autogrid_kryptonite_nbcr_net_23.inputPortByName[
                'inFile'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_23.inputPortByName[
                'inFile'].unbindWidget()
            autogrid_kryptonite_nbcr_net_23.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            apply(autogrid_kryptonite_nbcr_net_23.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore FunctionNode named autogrid_kryptonite_nbcr_net in network self.macroNetwork"
            print_exc()
            autogrid_kryptonite_nbcr_net_23 = None

        try:
            ## saving node GetMainURLFromList ##
            from WebServices.VisionInterface.WSNodes import GetMainURLFromListNode
            GetMainURLFromList_24 = GetMainURLFromListNode(
                constrkw={}, name='GetMainURLFromList', library=wslib)
            self.macroNetwork.addNode(GetMainURLFromList_24, 251, 348)
            apply(GetMainURLFromList_24.inputPortByName['urls'].configure, (),
                  {'defaultValue': None})
            apply(GetMainURLFromList_24.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore GetMainURLFromListNode named GetMainURLFromList in network self.macroNetwork"
            print_exc()
            GetMainURLFromList_24 = None

        try:
            ## saving node MakeAutogridResultObj ##
            from Vision.StandardNodes import Generic
            MakeAutogridResultObj_25 = Generic(constrkw={},
                                               name='MakeAutogridResultObj',
                                               library=stdlib)
            self.macroNetwork.addNode(MakeAutogridResultObj_25, 121, 402)
            apply(
                MakeAutogridResultObj_25.addInputPort, (), {
                    'singleConnection': True,
                    'name': 'autogrid_result_url',
                    'cast': True,
                    'datatype': 'string',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white',
                    'originalDatatype': 'None'
                })
            apply(
                MakeAutogridResultObj_25.addOutputPort, (), {
                    'name': 'autogrid_result_obj',
                    'datatype': 'autogrid_results',
                    'height': 8,
                    'width': 12,
                    'shape': 'triangle',
                    'color': '#FF33CC'
                })
            code = """def doit(self, autogrid_result_url):
        from AutoDockTools.VisionInterface.Adt.autogrid_results import autogrid_results

        agro = autogrid_results(autogrid_result_url, '''url''')
        
	pass
## to ouput data on port autogrid_result_obj use
        self.outputData(autogrid_result_obj=agro)

"""
            MakeAutogridResultObj_25.configure(function=code)
            apply(MakeAutogridResultObj_25.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore Generic named MakeAutogridResultObj in network self.macroNetwork"
            print_exc()
            MakeAutogridResultObj_25 = None

        try:
            ## saving node GetURLFromList ##
            from WebServices.VisionInterface.WSNodes import GetURLFromListNode
            GetURLFromList_26 = GetURLFromListNode(constrkw={},
                                                   name='GetURLFromList',
                                                   library=wslib)
            self.macroNetwork.addNode(GetURLFromList_26, 110, 198)
            apply(GetURLFromList_26.inputPortByName['urllist'].configure, (),
                  {'defaultValue': None})
            apply(GetURLFromList_26.inputPortByName['ext'].configure, (),
                  {'defaultValue': None})
            GetURLFromList_26.inputPortByName['ext'].widget.set(r"gpf",
                                                                run=False)
            apply(GetURLFromList_26.configure, (), {'paramPanelImmediate': 1})
        except:
            print "WARNING: failed to restore GetURLFromListNode named GetURLFromList in network self.macroNetwork"
            print_exc()
            GetURLFromList_26 = None

        #self.macroNetwork.run()
        self.macroNetwork.freeze()

        ## saving connections for network ComputeGrids ##
        input_Ports_19 = self.macroNetwork.ipNode
        if input_Ports_19 is not None and GetComputeGridsInputs_21 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_19,
                    GetComputeGridsInputs_21,
                    "new",
                    "ligands",
                    blocking=True,
                    splitratio=[0.25038057532685992, 0.40242243717082576])
            except:
                print "WARNING: failed to restore connection between input_Ports_19 and GetComputeGridsInputs_21 in network self.macroNetwork"
        if input_Ports_19 is not None and GetComputeGridsInputs_21 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_19,
                    GetComputeGridsInputs_21,
                    "new",
                    "receptor_pdbqt",
                    blocking=True,
                    splitratio=[0.31642654296910228, 0.49356822236979669])
            except:
                print "WARNING: failed to restore connection between input_Ports_19 and GetComputeGridsInputs_21 in network self.macroNetwork"
        if input_Ports_19 is not None and GetComputeGridsInputs_21 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_19,
                    GetComputeGridsInputs_21,
                    "new",
                    "gpf_obj",
                    blocking=True,
                    splitratio=[0.57570983312901203, 0.33826779179418875])
            except:
                print "WARNING: failed to restore connection between input_Ports_19 and GetComputeGridsInputs_21 in network self.macroNetwork"
        if GetComputeGridsInputs_21 is not None and prepareGPF_kryptonite_nbcr_net_22 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetComputeGridsInputs_21,
                    prepareGPF_kryptonite_nbcr_net_22,
                    "gpf_template_path",
                    "gpf",
                    blocking=True,
                    splitratio=[0.37911517364560754, 0.49588454022594075])
            except:
                print "WARNING: failed to restore connection between GetComputeGridsInputs_21 and prepareGPF_kryptonite_nbcr_net_22 in network self.macroNetwork"
        if GetComputeGridsInputs_21 is not None and prepareGPF_kryptonite_nbcr_net_22 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetComputeGridsInputs_21,
                    prepareGPF_kryptonite_nbcr_net_22,
                    "filter_file",
                    "filter_file",
                    blocking=True,
                    splitratio=[0.51555458245420727, 0.58910990532612562])
            except:
                print "WARNING: failed to restore connection between GetComputeGridsInputs_21 and prepareGPF_kryptonite_nbcr_net_22 in network self.macroNetwork"
        if GetComputeGridsInputs_21 is not None and prepareGPF_kryptonite_nbcr_net_22 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetComputeGridsInputs_21,
                    prepareGPF_kryptonite_nbcr_net_22,
                    "ligand_lib",
                    "urllib",
                    blocking=True,
                    splitratio=[0.45378244060628786, 0.49829462092378918])
            except:
                print "WARNING: failed to restore connection between GetComputeGridsInputs_21 and prepareGPF_kryptonite_nbcr_net_22 in network self.macroNetwork"
        if GetComputeGridsInputs_21 is not None and prepareGPF_kryptonite_nbcr_net_22 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetComputeGridsInputs_21,
                    prepareGPF_kryptonite_nbcr_net_22,
                    "prepared_receptor",
                    "r",
                    blocking=True,
                    splitratio=[0.30158184825681655, 0.46256232709378253])
            except:
                print "WARNING: failed to restore connection between GetComputeGridsInputs_21 and prepareGPF_kryptonite_nbcr_net_22 in network self.macroNetwork"
        if GetComputeGridsInputs_21 is not None and autogrid_kryptonite_nbcr_net_23 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetComputeGridsInputs_21,
                    autogrid_kryptonite_nbcr_net_23,
                    "prepared_receptor",
                    "inFile",
                    blocking=True,
                    splitratio=[0.63016045430148715, 0.62091422998177115])
            except:
                print "WARNING: failed to restore connection between GetComputeGridsInputs_21 and autogrid_kryptonite_nbcr_net_23 in network self.macroNetwork"
        if autogrid_kryptonite_nbcr_net_23 is not None and GetMainURLFromList_24 is not None:
            try:
                self.macroNetwork.connectNodes(
                    autogrid_kryptonite_nbcr_net_23,
                    GetMainURLFromList_24,
                    "result",
                    "urls",
                    blocking=True,
                    splitratio=[0.4713453370864038, 0.73699665503637379])
            except:
                print "WARNING: failed to restore connection between autogrid_kryptonite_nbcr_net_23 and GetMainURLFromList_24 in network self.macroNetwork"
        if GetMainURLFromList_24 is not None and MakeAutogridResultObj_25 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetMainURLFromList_24,
                    MakeAutogridResultObj_25,
                    "newurl",
                    "autogrid_result_url",
                    blocking=True,
                    splitratio=[0.37530325590010172, 0.67260462300696811])
            except:
                print "WARNING: failed to restore connection between GetMainURLFromList_24 and MakeAutogridResultObj_25 in network self.macroNetwork"
        output_Ports_20 = self.macroNetwork.opNode
        if MakeAutogridResultObj_25 is not None and output_Ports_20 is not None:
            try:
                self.macroNetwork.connectNodes(
                    MakeAutogridResultObj_25,
                    output_Ports_20,
                    "autogrid_result_obj",
                    "new",
                    blocking=True,
                    splitratio=[0.54860274312929591, 0.61692487705230459])
            except:
                print "WARNING: failed to restore connection between MakeAutogridResultObj_25 and output_Ports_20 in network self.macroNetwork"
        if GetMainURLFromList_24 is not None and output_Ports_20 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetMainURLFromList_24,
                    output_Ports_20,
                    "newurl",
                    "new",
                    blocking=True,
                    splitratio=[0.56961778623989434, 0.55443680742298707])
            except:
                print "WARNING: failed to restore connection between GetMainURLFromList_24 and output_Ports_20 in network self.macroNetwork"
        if prepareGPF_kryptonite_nbcr_net_22 is not None and GetURLFromList_26 is not None:
            try:
                self.macroNetwork.connectNodes(
                    prepareGPF_kryptonite_nbcr_net_22,
                    GetURLFromList_26,
                    "result",
                    "urllist",
                    blocking=True,
                    splitratio=[0.38550670487593142, 0.45424125807822219])
            except:
                print "WARNING: failed to restore connection between prepareGPF_kryptonite_nbcr_net_22 and GetURLFromList_26 in network self.macroNetwork"
        if GetURLFromList_26 is not None and autogrid_kryptonite_nbcr_net_23 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetURLFromList_26,
                    autogrid_kryptonite_nbcr_net_23,
                    "url",
                    "p_url",
                    blocking=True,
                    splitratio=[0.65566147293832433, 0.57782517914212228])
            except:
                print "WARNING: failed to restore connection between GetURLFromList_26 and autogrid_kryptonite_nbcr_net_23 in network self.macroNetwork"
        self.macroNetwork.runOnNewData.value = False

        ## modifying MacroInputNode dynamic ports
        input_Ports_19 = self.macroNetwork.ipNode
        input_Ports_19.outputPorts[1].configure(
            name='GetComputeGridsInputs_ligands')
        input_Ports_19.outputPorts[2].configure(
            name='GetComputeGridsInputs_receptor_pdbqt')
        input_Ports_19.outputPorts[3].configure(
            name='GetComputeGridsInputs_gpf_obj')

        ## modifying MacroOutputNode dynamic ports
        output_Ports_20 = self.macroNetwork.opNode
        output_Ports_20.inputPorts[1].configure(singleConnection='auto')
        output_Ports_20.inputPorts[2].configure(singleConnection='auto')
        output_Ports_20.inputPorts[1].configure(
            name='MakeAutogridResultObj_autogrid_result_obj')
        output_Ports_20.inputPorts[2].configure(
            name='GetMainURLFromList_newurl')
        ## configure MacroNode input ports
        ComputeGrids_18.inputPorts[0].configure(
            name='GetComputeGridsInputs_ligands')
        ComputeGrids_18.inputPorts[0].configure(datatype='LigandDB')
        ComputeGrids_18.inputPorts[1].configure(
            name='GetComputeGridsInputs_receptor_pdbqt')
        ComputeGrids_18.inputPorts[1].configure(datatype='receptor_prepared')
        ComputeGrids_18.inputPorts[2].configure(
            name='GetComputeGridsInputs_gpf_obj')
        ComputeGrids_18.inputPorts[2].configure(datatype='gpf_template')
        ## configure MacroNode output ports
        ComputeGrids_18.outputPorts[0].configure(
            name='MakeAutogridResultObj_autogrid_result_obj')
        ComputeGrids_18.outputPorts[0].configure(datatype='autogrid_results')
        ComputeGrids_18.outputPorts[1].configure(
            name='GetMainURLFromList_newurl')
        ComputeGrids_18.outputPorts[1].configure(datatype='string')

        ComputeGrids_18.shrink()

        ## reset modifications ##
        ComputeGrids_18.resetTags()
        ComputeGrids_18.buildOriginalList()
Esempio n. 2
0
                                              name='Output Directory Browser',
                                              library=stdlib)
    masterNet.addNode(Output_Directory_Browser_6, 456, 245)
    Output_Directory_Browser_6.inputPortByName['directory'].widget.set(
        r"AutoDockSL_0.1_output", run=False)
    apply(Output_Directory_Browser_6.configure, (), {'paramPanelImmediate': 1})
except:
    print "WARNING: failed to restore DirBrowserNE named Output Directory Browser in network masterNet"
    print_exc()
    Output_Directory_Browser_6 = None

try:
    ## saving node GetMainURLFromList ##
    from WebServices.VisionInterface.WSNodes import GetMainURLFromListNode
    GetMainURLFromList_7 = GetMainURLFromListNode(constrkw={},
                                                  name='GetMainURLFromList',
                                                  library=wslib)
    masterNet.addNode(GetMainURLFromList_7, 173, 308)
    apply(GetMainURLFromList_7.configure, (), {
        'paramPanelImmediate': 1,
        'expanded': False
    })
except:
    print "WARNING: failed to restore GetMainURLFromListNode named GetMainURLFromList in network masterNet"
    print_exc()
    GetMainURLFromList_7 = None

#masterNet.run()
masterNet.freeze()

## saving connections for network AutoDockSL-0.1 ##
Esempio n. 3
0
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        AutodockVsCSF_0 = self
        from traceback import print_exc
        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://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_1 = self.macroNetwork.ipNode
            apply(input_Ports_1.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_1 = None

        try:
            ## saving node output Ports ##
            output_Ports_2 = self.macroNetwork.opNode
            apply(output_Ports_2.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
            output_Ports_2.move(183, 363)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_2 = None

        try:
            ## saving node PrepareADVSInputs ##
            from Vision.StandardNodes import Generic
            PrepareADVSInputs_3 = Generic(constrkw={},
                                          name='PrepareADVSInputs',
                                          library=stdlib)
            self.macroNetwork.addNode(PrepareADVSInputs_3, 217, 76)
            apply(
                PrepareADVSInputs_3.addInputPort, (), {
                    'singleConnection': True,
                    'name': 'ligands',
                    'cast': True,
                    'datatype': 'LigandDB',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'rect',
                    'color': '#FFCCFF',
                    'originalDatatype': 'None'
                })
            apply(
                PrepareADVSInputs_3.addInputPort, (), {
                    'singleConnection': True,
                    'name': 'autogrid_results',
                    'cast': True,
                    'datatype': 'autogrid_results',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'triangle',
                    'color': '#FF33CC',
                    'originalDatatype': 'None'
                })
            apply(
                PrepareADVSInputs_3.addInputPort, (), {
                    'singleConnection': True,
                    'name': 'dpf_template_obj',
                    'cast': True,
                    'datatype': 'dpf_template',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'triangle',
                    'color': '#9933FF',
                    'originalDatatype': 'None'
                })
            apply(
                PrepareADVSInputs_3.addOutputPort, (), {
                    'name': 'filter_file',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            apply(
                PrepareADVSInputs_3.addOutputPort, (), {
                    'name': 'ligand_lib',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            apply(
                PrepareADVSInputs_3.addOutputPort, (), {
                    'name': 'dpf_template_file',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            apply(
                PrepareADVSInputs_3.addOutputPort, (), {
                    'name': 'autogrid_res_url',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            apply(
                PrepareADVSInputs_3.addOutputPort, (), {
                    'name': 'autogrid_res_local',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            code = """def doit(self, ligands, autogrid_results, dpf_template_obj):
        dpf = dpf_template_obj.fullpath

        if not(os.path.exists(dpf)):
            print "ERROR: DPF template " + dpf + " does not exist!"
            return '''stop'''
    
        filter_file = ligands.filter_file
        
        if autogrid_results.type == '''url''':
            autogrid_result_url = autogrid_results.path
            autogrid_result_local = ""
        else:
            autogrid_result_url = ""
            autogrid_result_local = autogrid_results.path
        
        ligand_lib = ligands.loc
        
	pass

        self.outputData(filter_file=filter_file, ligand_lib=ligand_lib, dpf_template_file=dpf, autogrid_res_url=autogrid_result_url, autogrid_res_local=autogrid_result_local)

## to ouput data on port filter_file use
## self.outputData(filter_file=data)
## to ouput data on port ligand_lib use
## self.outputData(ligand_lib=data)
## to ouput data on port dpf_template_file use
## self.outputData(dpf_template_file=data)
## to ouput data on port autogrid_res_url use
## self.outputData(autogrid_res_url=data)
## to ouput data on port autogrid_res_local use
## self.outputData(autogrid_res_local=data)









"""
            PrepareADVSInputs_3.configure(function=code)
            apply(PrepareADVSInputs_3.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore Generic named PrepareADVSInputs in network self.macroNetwork"
            print_exc()
            PrepareADVSInputs_3 = None

        try:
            ## saving node autodock_kryptonite_nbcr_net ##
            from NetworkEditor.items import FunctionNode
            autodock_kryptonite_nbcr_net_4 = FunctionNode(
                functionOrString='autodock_kryptonite_nbcr_net',
                host="http://kryptonite.nbcr.net/opal2",
                namedArgs={
                    'ga_run': '',
                    'lib': '',
                    'filter_file_url': '',
                    'ga_num_evals': '',
                    'filter_file': '',
                    'sched': 'SGE',
                    'urllib': '',
                    'ga_num_generations': '',
                    'dpf': '',
                    'u': '',
                    'utar': '',
                    'userlib': '',
                    'ga_pop_size': '',
                    'localRun': False,
                    'email': '',
                    'execPath': ''
                },
                constrkw={
                    'functionOrString': "'autodock_kryptonite_nbcr_net'",
                    'host': '"http://kryptonite.nbcr.net/opal2"',
                    'namedArgs': {
                        'ga_run': '',
                        'lib': '',
                        'filter_file_url': '',
                        'ga_num_evals': '',
                        'filter_file': '',
                        'sched': 'SGE',
                        'urllib': '',
                        'ga_num_generations': '',
                        'dpf': '',
                        'u': '',
                        'utar': '',
                        'userlib': '',
                        'ga_pop_size': '',
                        'localRun': False,
                        'email': '',
                        'execPath': ''
                    }
                },
                name='autodock_kryptonite_nbcr_net',
                library=wslib)
            self.macroNetwork.addNode(autodock_kryptonite_nbcr_net_4, 217, 132)
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['ga_run'].
                configure, (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['lib'].
                configure, (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.
                inputPortByName['filter_file_url'].configure, (),
                {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['ga_num_evals'].
                configure, (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['filter_file'].
                configure, (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['sched'].
                configure, (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['urllib'].
                configure, (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.
                inputPortByName['ga_num_generations'].configure, (),
                {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['dpf'].
                configure, (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['u'].configure,
                (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['utar'].
                configure, (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['userlib'].
                configure, (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['ga_pop_size'].
                configure, (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['localRun'].
                configure, (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['email'].
                configure, (), {'defaultValue': None})
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['execPath'].
                configure, (), {'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'ga_run'].widget.set(r"", run=False)
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['lib'].widget.
                configure, (), {
                    'choices':
                    ('sample', 'NCIDS_SC', 'NCI_DS1', 'NCI_DS2',
                     'human_metabolome', 'chembridge_building_blocks',
                     'drugbank_nutraceutics', 'drugbank_smallmol',
                     'fda_approved')
                })
            autodock_kryptonite_nbcr_net_4.inputPortByName['lib'].widget.set(
                r"", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'filter_file_url'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'ga_num_evals'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'filter_file'].rebindWidget()
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'filter_file'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'filter_file'].unbindWidget()
            apply(
                autodock_kryptonite_nbcr_net_4.inputPortByName['sched'].widget.
                configure, (), {'choices': ('SGE', 'CSF')})
            autodock_kryptonite_nbcr_net_4.inputPortByName['sched'].widget.set(
                r"CSF", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'urllib'].rebindWidget()
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'urllib'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'urllib'].unbindWidget()
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'ga_num_generations'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName['dpf'].rebindWidget(
            )
            autodock_kryptonite_nbcr_net_4.inputPortByName['dpf'].widget.set(
                r"", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName['dpf'].unbindWidget(
            )
            autodock_kryptonite_nbcr_net_4.inputPortByName['u'].rebindWidget()
            autodock_kryptonite_nbcr_net_4.inputPortByName['u'].widget.set(
                r"", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName['u'].unbindWidget()
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'utar'].rebindWidget()
            autodock_kryptonite_nbcr_net_4.inputPortByName['utar'].widget.set(
                r"", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'utar'].unbindWidget()
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'userlib'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'ga_pop_size'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'localRun'].widget.set(0, run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName['email'].widget.set(
                r"", run=False)
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            apply(autodock_kryptonite_nbcr_net_4.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore FunctionNode named autodock_kryptonite_nbcr_net in network self.macroNetwork"
            print_exc()
            autodock_kryptonite_nbcr_net_4 = None

        try:
            ## saving node GetMainURLFromList ##
            from WebServices.VisionInterface.WSNodes import GetMainURLFromListNode
            GetMainURLFromList_5 = GetMainURLFromListNode(
                constrkw={}, name='GetMainURLFromList', library=wslib)
            self.macroNetwork.addNode(GetMainURLFromList_5, 217, 188)
            apply(GetMainURLFromList_5.inputPortByName['urls'].configure, (),
                  {'defaultValue': None})
            apply(GetMainURLFromList_5.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore GetMainURLFromListNode named GetMainURLFromList in network self.macroNetwork"
            print_exc()
            GetMainURLFromList_5 = None

        try:
            ## saving node GetMainURLFromList ##
            from WebServices.VisionInterface.WSNodes import GetMainURLFromListNode
            GetMainURLFromList_7 = GetMainURLFromListNode(
                constrkw={}, name='GetMainURLFromList', library=wslib)
            self.macroNetwork.addNode(GetMainURLFromList_7, 201, 301)
            apply(GetMainURLFromList_7.inputPortByName['urls'].configure, (),
                  {'defaultValue': None})
            apply(GetMainURLFromList_7.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore GetMainURLFromListNode named GetMainURLFromList in network self.macroNetwork"
            print_exc()
            GetMainURLFromList_7 = None

        try:
            ## saving node AutodockSlice_oolitevm_calit2_optiputer_net ##
            from NetworkEditor.items import FunctionNode
            AutodockSlice_oolitevm_calit2_optiputer_net_8 = FunctionNode(
                functionOrString='AutodockSlice_oolitevm_calit2_optiputer_net',
                host="http://oolitevm.calit2.optiputer.net/opal2",
                namedArgs={
                    'execPath': '',
                    'localRun': False,
                    'divisor': '',
                    'lib': '',
                    'input_url': ''
                },
                constrkw={
                    'functionOrString':
                    "'AutodockSlice_oolitevm_calit2_optiputer_net'",
                    'host': '"http://oolitevm.calit2.optiputer.net/opal2"',
                    'namedArgs': {
                        'execPath': '',
                        'localRun': False,
                        'divisor': '',
                        'lib': '',
                        'input_url': ''
                    }
                },
                name='AutodockSlice_oolitevm_calit2_optiputer_net',
                library=wslib)
            self.macroNetwork.addNode(
                AutodockSlice_oolitevm_calit2_optiputer_net_8, 200, 240)
            apply(
                AutodockSlice_oolitevm_calit2_optiputer_net_8.
                inputPortByName['execPath'].configure, (),
                {'defaultValue': None})
            apply(
                AutodockSlice_oolitevm_calit2_optiputer_net_8.
                inputPortByName['localRun'].configure, (),
                {'defaultValue': None})
            apply(
                AutodockSlice_oolitevm_calit2_optiputer_net_8.
                inputPortByName['divisor'].configure, (),
                {'defaultValue': None})
            apply(
                AutodockSlice_oolitevm_calit2_optiputer_net_8.
                inputPortByName['lib'].configure, (), {'defaultValue': None})
            apply(
                AutodockSlice_oolitevm_calit2_optiputer_net_8.
                inputPortByName['input_url'].configure, (),
                {'defaultValue': None})
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'localRun'].widget.set(0, run=False)
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'divisor'].widget.set(r"", run=False)
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'lib'].rebindWidget()
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'lib'].widget.set(r"", run=False)
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'lib'].unbindWidget()
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'input_url'].rebindWidget()
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'input_url'].widget.set(r"", run=False)
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'input_url'].unbindWidget()
            apply(AutodockSlice_oolitevm_calit2_optiputer_net_8.configure, (),
                  {
                      'paramPanelImmediate': 1,
                      'expanded': False
                  })
        except:
            print "WARNING: failed to restore FunctionNode named AutodockSlice_oolitevm_calit2_optiputer_net in network self.macroNetwork"
            print_exc()
            AutodockSlice_oolitevm_calit2_optiputer_net_8 = None

        #self.macroNetwork.run()
        self.macroNetwork.freeze()

        ## saving connections for network AutodockVsCSF ##
        if autodock_kryptonite_nbcr_net_4 is not None and GetMainURLFromList_5 is not None:
            try:
                self.macroNetwork.connectNodes(
                    autodock_kryptonite_nbcr_net_4,
                    GetMainURLFromList_5,
                    "result",
                    "urls",
                    blocking=True,
                    splitratio=[0.36974288957131424, 0.63465596053596318])
            except:
                print "WARNING: failed to restore connection between autodock_kryptonite_nbcr_net_4 and GetMainURLFromList_5 in network self.macroNetwork"
        if PrepareADVSInputs_3 is not None and autodock_kryptonite_nbcr_net_4 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareADVSInputs_3,
                    autodock_kryptonite_nbcr_net_4,
                    "filter_file",
                    "filter_file",
                    blocking=True,
                    splitratio=[0.33230642287344903, 0.65770700108889613])
            except:
                print "WARNING: failed to restore connection between PrepareADVSInputs_3 and autodock_kryptonite_nbcr_net_4 in network self.macroNetwork"
        if PrepareADVSInputs_3 is not None and autodock_kryptonite_nbcr_net_4 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareADVSInputs_3,
                    autodock_kryptonite_nbcr_net_4,
                    "ligand_lib",
                    "urllib",
                    blocking=True,
                    splitratio=[0.50680104599665787, 0.51414170500293577])
            except:
                print "WARNING: failed to restore connection between PrepareADVSInputs_3 and autodock_kryptonite_nbcr_net_4 in network self.macroNetwork"
        if PrepareADVSInputs_3 is not None and autodock_kryptonite_nbcr_net_4 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareADVSInputs_3,
                    autodock_kryptonite_nbcr_net_4,
                    "dpf_template_file",
                    "dpf",
                    blocking=True,
                    splitratio=[0.51615646597598808, 0.25661305528484007])
            except:
                print "WARNING: failed to restore connection between PrepareADVSInputs_3 and autodock_kryptonite_nbcr_net_4 in network self.macroNetwork"
        if PrepareADVSInputs_3 is not None and autodock_kryptonite_nbcr_net_4 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareADVSInputs_3,
                    autodock_kryptonite_nbcr_net_4,
                    "autogrid_res_url",
                    "u",
                    blocking=True,
                    splitratio=[0.5760732944947704, 0.2032376887917188])
            except:
                print "WARNING: failed to restore connection between PrepareADVSInputs_3 and autodock_kryptonite_nbcr_net_4 in network self.macroNetwork"
        if PrepareADVSInputs_3 is not None and autodock_kryptonite_nbcr_net_4 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareADVSInputs_3,
                    autodock_kryptonite_nbcr_net_4,
                    "autogrid_res_local",
                    "utar",
                    blocking=True,
                    splitratio=[0.52802808938949819, 0.66978534572736881])
            except:
                print "WARNING: failed to restore connection between PrepareADVSInputs_3 and autodock_kryptonite_nbcr_net_4 in network self.macroNetwork"
        input_Ports_1 = self.macroNetwork.ipNode
        if input_Ports_1 is not None and PrepareADVSInputs_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    PrepareADVSInputs_3,
                    "new",
                    "ligands",
                    blocking=True,
                    splitratio=[0.23314258225660414, 0.72184112037432979])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and PrepareADVSInputs_3 in network self.macroNetwork"
        if input_Ports_1 is not None and PrepareADVSInputs_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    PrepareADVSInputs_3,
                    "new",
                    "autogrid_results",
                    blocking=True,
                    splitratio=[0.56916626620432731, 0.43089669830392019])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and PrepareADVSInputs_3 in network self.macroNetwork"
        if input_Ports_1 is not None and PrepareADVSInputs_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    PrepareADVSInputs_3,
                    "new",
                    "dpf_template_obj",
                    blocking=True,
                    splitratio=[0.26502286453989665, 0.3911248444502638])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and PrepareADVSInputs_3 in network self.macroNetwork"
        output_Ports_2 = self.macroNetwork.opNode
        if GetMainURLFromList_7 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetMainURLFromList_7,
                    output_Ports_2,
                    "newurl",
                    "new",
                    blocking=True,
                    splitratio=[0.2408747073082603, 0.22897876889044461])
            except:
                print "WARNING: failed to restore connection between GetMainURLFromList_7 and output_Ports_2 in network self.macroNetwork"
        if PrepareADVSInputs_3 is not None and AutodockSlice_oolitevm_calit2_optiputer_net_8 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareADVSInputs_3,
                    AutodockSlice_oolitevm_calit2_optiputer_net_8,
                    "ligand_lib",
                    "lib",
                    blocking=True,
                    splitratio=[0.36439875698533941, 0.58443612376117082])
            except:
                print "WARNING: failed to restore connection between PrepareADVSInputs_3 and AutodockSlice_oolitevm_calit2_optiputer_net_8 in network self.macroNetwork"
        if GetMainURLFromList_5 is not None and AutodockSlice_oolitevm_calit2_optiputer_net_8 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetMainURLFromList_5,
                    AutodockSlice_oolitevm_calit2_optiputer_net_8,
                    "newurl",
                    "input_url",
                    blocking=True,
                    splitratio=[0.32808833199778697, 0.69237553555389719])
            except:
                print "WARNING: failed to restore connection between GetMainURLFromList_5 and AutodockSlice_oolitevm_calit2_optiputer_net_8 in network self.macroNetwork"
        if AutodockSlice_oolitevm_calit2_optiputer_net_8 is not None and GetMainURLFromList_7 is not None:
            try:
                self.macroNetwork.connectNodes(
                    AutodockSlice_oolitevm_calit2_optiputer_net_8,
                    GetMainURLFromList_7,
                    "result",
                    "urls",
                    blocking=True,
                    splitratio=[0.69930142895840763, 0.2984777644803871])
            except:
                print "WARNING: failed to restore connection between AutodockSlice_oolitevm_calit2_optiputer_net_8 and GetMainURLFromList_7 in network self.macroNetwork"
        self.macroNetwork.runOnNewData.value = True

        ## modifying MacroInputNode dynamic ports
        input_Ports_1 = self.macroNetwork.ipNode
        input_Ports_1.outputPorts[1].configure(
            name='PrepareADVSInputs_ligands')
        input_Ports_1.outputPorts[2].configure(
            name='PrepareADVSInputs_autogrid_results')
        input_Ports_1.outputPorts[3].configure(
            name='PrepareADVSInputs_dpf_template_obj')

        ## modifying MacroOutputNode dynamic ports
        output_Ports_2 = self.macroNetwork.opNode
        output_Ports_2.inputPorts[1].configure(singleConnection='auto')
        output_Ports_2.inputPorts[1].configure(
            name='GetMainURLFromList_newurl')
        ## configure MacroNode input ports
        AutodockVsCSF_0.inputPorts[0].configure(
            name='PrepareADVSInputs_ligands')
        AutodockVsCSF_0.inputPorts[0].configure(datatype='LigandDB')
        AutodockVsCSF_0.inputPorts[1].configure(
            name='PrepareADVSInputs_autogrid_results')
        AutodockVsCSF_0.inputPorts[1].configure(datatype='autogrid_results')
        AutodockVsCSF_0.inputPorts[2].configure(
            name='PrepareADVSInputs_dpf_template_obj')
        AutodockVsCSF_0.inputPorts[2].configure(datatype='dpf_template')
        ## configure MacroNode output ports
        AutodockVsCSF_0.outputPorts[0].configure(
            name='GetMainURLFromList_newurl')
        AutodockVsCSF_0.outputPorts[0].configure(datatype='string')

        AutodockVsCSF_0.shrink()

        ## reset modifications ##
        AutodockVsCSF_0.resetTags()
        AutodockVsCSF_0.buildOriginalList()
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from Vision.StandardNodes import stdlib
        from WebServices.VisionInterface.WSNodes import wslib
        ## building macro network ##
        GromosCluster_33 = self
        from traceback import print_exc
        from Vision.StandardNodes import stdlib
        from WebServices.VisionInterface.WSNodes import wslib
        masterNet.getEditor().addLibraryInstance(
            wslib, "WebServices.VisionInterface.WSNodes", "wslib")
        from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
        try:
            addOpalServerAsCategory("http://kryptonite.nbcr.net/opal2",
                                    replace=False)
        except:
            pass
        try:
            ## saving node input Ports ##
            input_Ports_34 = self.macroNetwork.ipNode
            input_Ports_34.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            )
            print_exc()
            input_Ports_34 = None

        try:
            ## saving node output Ports ##
            output_Ports_35 = self.macroNetwork.opNode
            output_Ports_35.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
            output_Ports_35.move(236, 302)
        except:
            print(
                "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            )
            print_exc()
            output_Ports_35 = None

        try:
            ## saving node GROMOS_ClusterFiles_kryptonite_nbcr_net ##
            from NetworkEditor.items import FunctionNode
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36 = FunctionNode(
                functionOrString='GROMOS_ClusterFiles_kryptonite_nbcr_net',
                host="http://kryptonite.nbcr.net/opal2",
                namedArgs={
                    'expert_options': '',
                    'rmsd': '0.125',
                    'traj': '',
                    'prefix': '',
                    'default_options':
                    '-o -g -dist -ev -sz -tr -ntr -clid -cl',
                    'active': '',
                    'localRun': False,
                    'method': 'gromos',
                    'execPath': ''
                },
                constrkw={
                    'functionOrString':
                    "'GROMOS_ClusterFiles_kryptonite_nbcr_net'",
                    'host': '"http://kryptonite.nbcr.net/opal2"',
                    'namedArgs': {
                        'expert_options': '',
                        'rmsd': '0.125',
                        'traj': '',
                        'prefix': '',
                        'default_options':
                        '-o -g -dist -ev -sz -tr -ntr -clid -cl',
                        'active': '',
                        'localRun': False,
                        'method': 'gromos',
                        'execPath': ''
                    }
                },
                name='GROMOS_ClusterFiles_kryptonite_nbcr_net',
                library=wslib)
            self.macroNetwork.addNode(
                GROMOS_ClusterFiles_kryptonite_nbcr_net_36, 200, 98)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'expert_options'].configure(*(), **{'defaultValue': None})
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'rmsd'].configure(*(), **{
                    'defaultValue': None,
                    'required': True
                })
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'traj'].configure(*(), **{
                    'defaultValue': None,
                    'required': True
                })
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'prefix'].configure(*(), **{'defaultValue': None})
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'default_options'].configure(*(), **{'defaultValue': None})
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'active'].configure(*(), **{
                    'defaultValue': None,
                    'required': True
                })
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'localRun'].configure(*(), **{'defaultValue': None})
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'method'].configure(*(), **{'defaultValue': None})
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'execPath'].configure(*(), **{'defaultValue': None})
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'expert_options'].widget.set(r"", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'rmsd'].rebindWidget()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'rmsd'].widget.set(r"0.125", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'rmsd'].unbindWidget()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'traj'].rebindWidget()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'traj'].widget.set(r"", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'traj'].unbindWidget()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'prefix'].widget.set(r"", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'default_options'].widget.set(
                    r"-o -g -dist -ev -sz -tr -ntr -clid -cl", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'active'].rebindWidget()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'active'].widget.set(r"", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'active'].unbindWidget()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'localRun'].widget.set(0, run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'method'].widget.configure(
                    *(), **{
                        'choices': ('gromos', 'linkage', 'jarvis-patrick',
                                    'monte-carlo', 'diagonalization')
                    })
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'method'].widget.set(r"gromos", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore FunctionNode named GROMOS_ClusterFiles_kryptonite_nbcr_net in network self.macroNetwork"
            )
            print_exc()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36 = None

        try:
            ## saving node GetClusterFrameLink ##
            from WebServices.VisionInterface.WSNodes import GetMainURLFromListNode
            GetClusterFrameLink_46 = GetMainURLFromListNode(
                constrkw={}, name='GetClusterFrameLink', library=wslib)
            self.macroNetwork.addNode(GetClusterFrameLink_46, 200, 164)
            GetClusterFrameLink_46.inputPortByName['urls'].configure(
                *(), **{'defaultValue': None})
            code = """def doit(self, urls):   
            url = urls[0]
            filename = url.split('''/''')[len(url.split('''/'''))-1]
            nurl = url.strip(filename)
            nurl = nurl + '''cluster_frames'''
            pass
            self.outputData(newurl=nurl)

"""
            GetClusterFrameLink_46.configure(function=code)
            GetClusterFrameLink_46.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore GetMainURLFromListNode named GetClusterFrameLink in network self.macroNetwork"
            )
            print_exc()
            GetClusterFrameLink_46 = None

        try:
            ## saving node DownloadSaveDir ##
            from WebServices.VisionInterface.WSNodes import DownloadSaveDirNode
            DownloadSaveDir_51 = DownloadSaveDirNode(constrkw={},
                                                     name='DownloadSaveDir',
                                                     library=wslib)
            self.macroNetwork.addNode(DownloadSaveDir_51, 253, 241)
            DownloadSaveDir_51.inputPortByName['url'].configure(
                *(), **{'defaultValue': None})
            DownloadSaveDir_51.inputPortByName['path'].configure(
                *(), **{'defaultValue': None})
            DownloadSaveDir_51.inputPortByName['cutdirs'].configure(
                *(), **{'defaultValue': None})
            DownloadSaveDir_51.inputPortByName['url'].rebindWidget()
            DownloadSaveDir_51.inputPortByName['url'].widget.set(r"",
                                                                 run=False)
            DownloadSaveDir_51.inputPortByName['url'].unbindWidget()
            DownloadSaveDir_51.configure(*(), **{'paramPanelImmediate': 1})
        except:
            print(
                "WARNING: failed to restore DownloadSaveDirNode named DownloadSaveDir in network self.macroNetwork"
            )
            print_exc()
            DownloadSaveDir_51 = None

        try:
            ## saving node Entry ##
            from Vision.StandardNodes import EntryNE
            Entry_54 = EntryNE(constrkw={}, name='Entry', library=stdlib)
            self.macroNetwork.addNode(Entry_54, 347, 154)
            Entry_54.inputPortByName['entry'].configure(
                *(), **{'defaultValue': None})
            Entry_54.inputPortByName['entry'].widget.set(r"3", run=False)
            Entry_54.configure(*(), **{'paramPanelImmediate': 1})
        except:
            print(
                "WARNING: failed to restore EntryNE named Entry in network self.macroNetwork"
            )
            print_exc()
            Entry_54 = None

        #self.macroNetwork.run()
        self.macroNetwork.freeze()

        ## saving connections for network GromosCluster ##
        input_Ports_34 = self.macroNetwork.ipNode
        if input_Ports_34 is not None and GROMOS_ClusterFiles_kryptonite_nbcr_net_36 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_34,
                    GROMOS_ClusterFiles_kryptonite_nbcr_net_36,
                    "new",
                    "traj",
                    blocking=True,
                    splitratio=[0.45411042113261574, 0.54335719372693991])
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_34 and GROMOS_ClusterFiles_kryptonite_nbcr_net_36 in network self.macroNetwork"
                )
        if input_Ports_34 is not None and GROMOS_ClusterFiles_kryptonite_nbcr_net_36 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_34,
                    GROMOS_ClusterFiles_kryptonite_nbcr_net_36,
                    "new",
                    "active",
                    blocking=True,
                    splitratio=[0.50935546751136695, 0.51596797621119816])
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_34 and GROMOS_ClusterFiles_kryptonite_nbcr_net_36 in network self.macroNetwork"
                )
        if input_Ports_34 is not None and GROMOS_ClusterFiles_kryptonite_nbcr_net_36 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_34,
                    GROMOS_ClusterFiles_kryptonite_nbcr_net_36,
                    "new",
                    "rmsd",
                    blocking=True,
                    splitratio=[0.72697457023572398, 0.5609730307022871])
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_34 and GROMOS_ClusterFiles_kryptonite_nbcr_net_36 in network self.macroNetwork"
                )
        if GROMOS_ClusterFiles_kryptonite_nbcr_net_36 is not None and GetClusterFrameLink_46 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GROMOS_ClusterFiles_kryptonite_nbcr_net_36,
                    GetClusterFrameLink_46,
                    "result",
                    "urls",
                    blocking=True,
                    splitratio=[0.72920790745169972, 0.25586352865051565])
            except:
                print(
                    "WARNING: failed to restore connection between GROMOS_ClusterFiles_kryptonite_nbcr_net_36 and GetClusterFrameLink_46 in network self.macroNetwork"
                )
        if GetClusterFrameLink_46 is not None and DownloadSaveDir_51 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetClusterFrameLink_46,
                    DownloadSaveDir_51,
                    "newurl",
                    "url",
                    blocking=True,
                    splitratio=[0.6813604229397745, 0.24060738045908744])
            except:
                print(
                    "WARNING: failed to restore connection between GetClusterFrameLink_46 and DownloadSaveDir_51 in network self.macroNetwork"
                )
        if input_Ports_34 is not None and DownloadSaveDir_51 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_34,
                    DownloadSaveDir_51,
                    "new",
                    "path",
                    blocking=True,
                    splitratio=[0.26234570709625593, 0.71051250549253275])
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_34 and DownloadSaveDir_51 in network self.macroNetwork"
                )
        output_Ports_35 = self.macroNetwork.opNode
        if DownloadSaveDir_51 is not None and output_Ports_35 is not None:
            try:
                self.macroNetwork.connectNodes(
                    DownloadSaveDir_51,
                    output_Ports_35,
                    "output",
                    "new",
                    blocking=True,
                    splitratio=[0.32827353595918307, 0.22147048732628238])
            except:
                print(
                    "WARNING: failed to restore connection between DownloadSaveDir_51 and output_Ports_35 in network self.macroNetwork"
                )
        if Entry_54 is not None and DownloadSaveDir_51 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Entry_54,
                    DownloadSaveDir_51,
                    "string",
                    "cutdirs",
                    blocking=True,
                    splitratio=[0.28715327854931738, 0.50903858482741082])
            except:
                print(
                    "WARNING: failed to restore connection between Entry_54 and DownloadSaveDir_51 in network self.macroNetwork"
                )
        self.macroNetwork.runOnNewData.value = False

        ## modifying MacroInputNode dynamic ports
        input_Ports_34 = self.macroNetwork.ipNode
        input_Ports_34.outputPorts[1].configure(
            name='GROMOS_ClusterFiles_kryptonite_nbcr_net_traj')
        input_Ports_34.outputPorts[2].configure(
            name='GROMOS_ClusterFiles_kryptonite_nbcr_net_active')
        input_Ports_34.outputPorts[3].configure(
            name='GROMOS_ClusterFiles_kryptonite_nbcr_net_rmsd')
        input_Ports_34.outputPorts[4].configure(name='DownloadSaveDir_path')

        ## modifying MacroOutputNode dynamic ports
        output_Ports_35 = self.macroNetwork.opNode
        output_Ports_35.inputPorts[1].configure(singleConnection='auto')
        output_Ports_35.inputPorts[1].configure(name='DownloadSaveDir_output')
        ## configure MacroNode input ports
        GromosCluster_33.inputPorts[0].configure(
            name='GROMOS_ClusterFiles_kryptonite_nbcr_net_traj')
        GromosCluster_33.inputPorts[0].configure(datatype='string')
        GromosCluster_33.inputPorts[1].configure(
            name='GROMOS_ClusterFiles_kryptonite_nbcr_net_active')
        GromosCluster_33.inputPorts[1].configure(datatype='string')
        GromosCluster_33.inputPorts[2].configure(
            name='GROMOS_ClusterFiles_kryptonite_nbcr_net_rmsd')
        GromosCluster_33.inputPorts[2].configure(datatype='string')
        GromosCluster_33.inputPorts[3].configure(name='DownloadSaveDir_path')
        GromosCluster_33.inputPorts[3].configure(datatype='string')
        ## configure MacroNode output ports
        GromosCluster_33.outputPorts[0].configure(
            name='DownloadSaveDir_output')
        GromosCluster_33.outputPorts[0].configure(datatype='string')

        GromosCluster_33.shrink()

        ## reset modifications ##
        GromosCluster_33.resetTags()
        GromosCluster_33.buildOriginalList()
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from Vision.StandardNodes import stdlib
        from WebServices.VisionInterface.WSNodes import wslib
        ## building macro network ##
        Vina_30 = self
        from traceback import print_exc
        from Vision.StandardNodes import stdlib
        from WebServices.VisionInterface.WSNodes import wslib
        masterNet.getEditor().addLibraryInstance(
            wslib, "WebServices.VisionInterface.WSNodes", "wslib")
        from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
        try:
            addOpalServerAsCategory("http://kryptonite.nbcr.net/opal2",
                                    replace=False)
        except:
            pass
        try:
            ## saving node input Ports ##
            input_Ports_31 = self.macroNetwork.ipNode
            input_Ports_31.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            )
            print_exc()
            input_Ports_31 = None

        try:
            ## saving node output Ports ##
            output_Ports_32 = self.macroNetwork.opNode
            output_Ports_32.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            )
            print_exc()
            output_Ports_32 = None

        try:
            ## saving node AutodockVina_Screening_kryptonite_nbcr_net ##
            from NetworkEditor.items import FunctionNode
            AutodockVina_Screening_kryptonite_nbcr_net_33 = FunctionNode(
                functionOrString='AutodockVina_Screening_kryptonite_nbcr_net',
                host="http://kryptonite.nbcr.net/opal2",
                namedArgs={
                    'num_modes': '',
                    'energy_range': '',
                    'seed': '',
                    'receptor': '',
                    'size_y': '',
                    'size_z': '',
                    'out': '',
                    'log': '',
                    'urllib': '',
                    'exhaustiveness': '',
                    'localRun': False,
                    'flex': '',
                    'center_z': '',
                    'center_x': '',
                    'center_y': '',
                    'userlib': '',
                    'size_x': '',
                    'config': '',
                    'filter': '',
                    'ligand_db': '',
                    'cpu': '',
                    'execPath': ''
                },
                constrkw={
                    'functionOrString':
                    "'AutodockVina_Screening_kryptonite_nbcr_net'",
                    'host': '"http://kryptonite.nbcr.net/opal2"',
                    'namedArgs': {
                        'num_modes': '',
                        'energy_range': '',
                        'seed': '',
                        'receptor': '',
                        'size_y': '',
                        'size_z': '',
                        'out': '',
                        'log': '',
                        'urllib': '',
                        'exhaustiveness': '',
                        'localRun': False,
                        'flex': '',
                        'center_z': '',
                        'center_x': '',
                        'center_y': '',
                        'userlib': '',
                        'size_x': '',
                        'config': '',
                        'filter': '',
                        'ligand_db': '',
                        'cpu': '',
                        'execPath': ''
                    }
                },
                name='AutodockVina_Screening_kryptonite_nbcr_net',
                library=wslib)
            self.macroNetwork.addNode(
                AutodockVina_Screening_kryptonite_nbcr_net_33, 217, 185)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'num_modes'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'energy_range'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'seed'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'receptor'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'size_y'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'size_z'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'out'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'log'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'urllib'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'exhaustiveness'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'localRun'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'flex'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'center_z'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'center_x'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'center_y'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'userlib'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'size_x'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'config'].configure(*(), **{
                    'defaultValue': None,
                    'required': True
                })
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'filter'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'ligand_db'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'cpu'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'execPath'].configure(*(), **{'defaultValue': None})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'num_modes'].widget.configure(
                    *(), **{
                        'choices':
                        ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10')
                    })
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'num_modes'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'energy_range'].widget.configure(
                    *(), **{'choices': ('1', '2', '3')})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'energy_range'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'seed'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'receptor'].rebindWidget()
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'receptor'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'receptor'].unbindWidget()
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'size_y'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'size_z'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'out'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'log'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'urllib'].rebindWidget()
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'urllib'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'urllib'].unbindWidget()
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'exhaustiveness'].widget.configure(
                    *(),
                    **{'choices': ('1', '2', '3', '4', '5', '6', '7', '8')})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'exhaustiveness'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'localRun'].widget.set(0, run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'flex'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'center_z'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'center_x'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'center_y'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'userlib'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'size_x'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'config'].rebindWidget()
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'config'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'config'].unbindWidget()
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'filter'].rebindWidget()
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'filter'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'filter'].unbindWidget()
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'ligand_db'].widget.configure(
                    *(), **{
                        'choices':
                        ('sample', 'NCIDS_SC', 'NCI_DS1', 'NCI_DS2',
                         'human_metabolome', 'chembridge_building_blocks',
                         'drugbank_nutraceutics', 'drugbank_smallmol',
                         'asinex', 'fda_approved', 'otava',
                         'zinc_natural_products')
                    })
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'ligand_db'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'cpu'].widget.configure(*(), **{'choices': ('1', '2')})
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'cpu'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            AutodockVina_Screening_kryptonite_nbcr_net_33.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore FunctionNode named AutodockVina_Screening_kryptonite_nbcr_net in network self.macroNetwork"
            )
            print_exc()
            AutodockVina_Screening_kryptonite_nbcr_net_33 = None

        try:
            ## saving node PrepareVinaInputs ##
            from Vision.StandardNodes import Generic
            PrepareVinaInputs_34 = Generic(constrkw={},
                                           name='PrepareVinaInputs',
                                           library=stdlib)
            self.macroNetwork.addNode(PrepareVinaInputs_34, 140, 107)
            PrepareVinaInputs_34.addInputPort(
                *(), **{
                    'singleConnection': True,
                    'name': 'receptor_obj',
                    'cast': True,
                    'datatype': 'receptor_prepared',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'triangle',
                    'color': '#009900',
                    'originalDatatype': 'None'
                })
            PrepareVinaInputs_34.addInputPort(
                *(), **{
                    'singleConnection': True,
                    'name': 'ligand_obj',
                    'cast': True,
                    'datatype': 'LigandDB',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'rect',
                    'color': '#FFCCFF',
                    'originalDatatype': 'None'
                })
            PrepareVinaInputs_34.addOutputPort(
                *(), **{
                    'name': 'receptor_file',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            PrepareVinaInputs_34.addOutputPort(
                *(), **{
                    'name': 'ligand_lib',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            PrepareVinaInputs_34.addOutputPort(
                *(), **{
                    'name': 'filter_file',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            code = """def doit(self, receptor_obj, ligand_obj):
        receptor_file = receptor_obj.path
        filter_file = ligand_obj.filter_file
        ligand_lib = ligand_obj.loc

        if receptor_obj.type == "local":
            if not(os.path.exists(receptor_file)):
                print "ERROR: receptor_file " + receptor_file + " does not exist"
                return '''stop'''
        
	pass
        self.outputData(receptor_file=receptor_file, ligand_lib=ligand_lib, filter_file=filter_file)
## to ouput data on port receptor_file use
## self.outputData(receptor_file=data)
## to ouput data on port ligand_lib use
## self.outputData(ligand_lib=data)
## to ouput data on port filter_file use
## self.outputData(filter_file=data)






"""
            PrepareVinaInputs_34.configure(function=code)
            PrepareVinaInputs_34.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore Generic named PrepareVinaInputs in network self.macroNetwork"
            )
            print_exc()
            PrepareVinaInputs_34 = None

        try:
            ## saving node GetMainURLFromList ##
            from WebServices.VisionInterface.WSNodes import GetMainURLFromListNode
            GetMainURLFromList_35 = GetMainURLFromListNode(
                constrkw={}, name='GetMainURLFromList', library=wslib)
            self.macroNetwork.addNode(GetMainURLFromList_35, 217, 248)
            GetMainURLFromList_35.inputPortByName['urls'].configure(
                *(), **{'defaultValue': None})
            GetMainURLFromList_35.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore GetMainURLFromListNode named GetMainURLFromList in network self.macroNetwork"
            )
            print_exc()
            GetMainURLFromList_35 = None

        #self.macroNetwork.run()
        self.macroNetwork.freeze()

        ## saving connections for network Vina ##
        if PrepareVinaInputs_34 is not None and AutodockVina_Screening_kryptonite_nbcr_net_33 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareVinaInputs_34,
                    AutodockVina_Screening_kryptonite_nbcr_net_33,
                    "receptor_file",
                    "receptor",
                    blocking=True,
                    splitratio=[0.48630431331124768, 0.72717758735716731])
            except:
                print(
                    "WARNING: failed to restore connection between PrepareVinaInputs_34 and AutodockVina_Screening_kryptonite_nbcr_net_33 in network self.macroNetwork"
                )
        if PrepareVinaInputs_34 is not None and AutodockVina_Screening_kryptonite_nbcr_net_33 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareVinaInputs_34,
                    AutodockVina_Screening_kryptonite_nbcr_net_33,
                    "ligand_lib",
                    "urllib",
                    blocking=True,
                    splitratio=[0.61963739449043087, 0.74955133389937689])
            except:
                print(
                    "WARNING: failed to restore connection between PrepareVinaInputs_34 and AutodockVina_Screening_kryptonite_nbcr_net_33 in network self.macroNetwork"
                )
        if PrepareVinaInputs_34 is not None and AutodockVina_Screening_kryptonite_nbcr_net_33 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareVinaInputs_34,
                    AutodockVina_Screening_kryptonite_nbcr_net_33,
                    "filter_file",
                    "filter",
                    blocking=True,
                    splitratio=[0.32670226336274166, 0.25123642944789149])
            except:
                print(
                    "WARNING: failed to restore connection between PrepareVinaInputs_34 and AutodockVina_Screening_kryptonite_nbcr_net_33 in network self.macroNetwork"
                )
        if AutodockVina_Screening_kryptonite_nbcr_net_33 is not None and GetMainURLFromList_35 is not None:
            try:
                self.macroNetwork.connectNodes(
                    AutodockVina_Screening_kryptonite_nbcr_net_33,
                    GetMainURLFromList_35,
                    "result",
                    "urls",
                    blocking=True,
                    splitratio=[0.23401196873379349, 0.68593608346615742])
            except:
                print(
                    "WARNING: failed to restore connection between AutodockVina_Screening_kryptonite_nbcr_net_33 and GetMainURLFromList_35 in network self.macroNetwork"
                )
        output_Ports_32 = self.macroNetwork.opNode
        if GetMainURLFromList_35 is not None and output_Ports_32 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetMainURLFromList_35,
                    output_Ports_32,
                    "newurl",
                    "new",
                    blocking=True,
                    splitratio=[0.26588001265563421, 0.34355863787969732])
            except:
                print(
                    "WARNING: failed to restore connection between GetMainURLFromList_35 and output_Ports_32 in network self.macroNetwork"
                )
        input_Ports_31 = self.macroNetwork.ipNode
        if input_Ports_31 is not None and PrepareVinaInputs_34 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_31,
                    PrepareVinaInputs_34,
                    "new",
                    "receptor_obj",
                    blocking=True,
                    splitratio=[0.59193136382656331, 0.41134942510734418])
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_31 and PrepareVinaInputs_34 in network self.macroNetwork"
                )
        if input_Ports_31 is not None and PrepareVinaInputs_34 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_31,
                    PrepareVinaInputs_34,
                    "new",
                    "ligand_obj",
                    blocking=True,
                    splitratio=[0.29092159940560591, 0.60619808825531374])
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_31 and PrepareVinaInputs_34 in network self.macroNetwork"
                )
        if input_Ports_31 is not None and AutodockVina_Screening_kryptonite_nbcr_net_33 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_31,
                    AutodockVina_Screening_kryptonite_nbcr_net_33,
                    "new",
                    "config",
                    blocking=True,
                    splitratio=[0.24239548372031838, 0.55842775396640953])
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_31 and AutodockVina_Screening_kryptonite_nbcr_net_33 in network self.macroNetwork"
                )
        self.macroNetwork.runOnNewData.value = True

        ## modifying MacroInputNode dynamic ports
        input_Ports_31 = self.macroNetwork.ipNode
        input_Ports_31.outputPorts[1].configure(
            name='PrepareVinaInputs_receptor_obj')
        input_Ports_31.outputPorts[2].configure(
            name='PrepareVinaInputs_ligand_obj')
        input_Ports_31.outputPorts[3].configure(
            name='AutodockVina_Screening_kryptonite_nbcr_net_config')

        ## modifying MacroOutputNode dynamic ports
        output_Ports_32 = self.macroNetwork.opNode
        output_Ports_32.inputPorts[1].configure(singleConnection='auto')
        output_Ports_32.inputPorts[1].configure(
            name='GetMainURLFromList_newurl')
        ## configure MacroNode input ports
        Vina_30.inputPorts[0].configure(name='PrepareVinaInputs_receptor_obj')
        Vina_30.inputPorts[0].configure(datatype='receptor_prepared')
        Vina_30.inputPorts[1].configure(name='PrepareVinaInputs_ligand_obj')
        Vina_30.inputPorts[1].configure(datatype='LigandDB')
        Vina_30.inputPorts[2].configure(
            name='AutodockVina_Screening_kryptonite_nbcr_net_config')
        Vina_30.inputPorts[2].configure(datatype='string')
        ## configure MacroNode output ports
        Vina_30.outputPorts[0].configure(name='GetMainURLFromList_newurl')
        Vina_30.outputPorts[0].configure(datatype='string')

        Vina_30.shrink()

        ## reset modifications ##
        Vina_30.resetTags()
        Vina_30.buildOriginalList()
Esempio n. 6
0
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        AutodockVS_9 = self
        from traceback import print_exc
        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://kryptonite.nbcr.net/opal2",
                                    replace=False)
        except:
            pass
        try:
            ## saving node input Ports ##
            input_Ports_10 = self.macroNetwork.ipNode
            input_Ports_10.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            )
            print_exc()
            input_Ports_10 = None

        try:
            ## saving node output Ports ##
            output_Ports_11 = self.macroNetwork.opNode
            output_Ports_11.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            )
            print_exc()
            output_Ports_11 = None

        try:
            ## saving node PrepareADVSInputs ##
            from Vision.StandardNodes import Generic
            PrepareADVSInputs_12 = Generic(constrkw={},
                                           name='PrepareADVSInputs',
                                           library=stdlib)
            self.macroNetwork.addNode(PrepareADVSInputs_12, 217, 76)
            PrepareADVSInputs_12.addInputPort(
                *(), **{
                    'singleConnection': True,
                    'name': 'ligands',
                    'cast': True,
                    'datatype': 'LigandDB',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'rect',
                    'color': '#FFCCFF',
                    'originalDatatype': 'None'
                })
            PrepareADVSInputs_12.addInputPort(
                *(), **{
                    'singleConnection': True,
                    'name': 'autogrid_results',
                    'cast': True,
                    'datatype': 'autogrid_results',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'triangle',
                    'color': '#FF33CC',
                    'originalDatatype': 'None'
                })
            PrepareADVSInputs_12.addInputPort(
                *(), **{
                    'singleConnection': True,
                    'name': 'dpf_template_obj',
                    'cast': True,
                    'datatype': 'dpf_template',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'triangle',
                    'color': '#9933FF',
                    'originalDatatype': 'None'
                })
            PrepareADVSInputs_12.addOutputPort(
                *(), **{
                    'name': 'filter_file',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            PrepareADVSInputs_12.addOutputPort(
                *(), **{
                    'name': 'ligand_lib',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            PrepareADVSInputs_12.addOutputPort(
                *(), **{
                    'name': 'dpf_template_file',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            PrepareADVSInputs_12.addOutputPort(
                *(), **{
                    'name': 'autogrid_res_url',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            PrepareADVSInputs_12.addOutputPort(
                *(), **{
                    'name': 'autogrid_res_local',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            code = """def doit(self, ligands, autogrid_results, dpf_template_obj):
        dpf = dpf_template_obj.fullpath

        if not(os.path.exists(dpf)):
            print "ERROR: DPF template " + dpf + " does not exist!"
            return '''stop'''
    
        filter_file = ligands.filter_file
        
        if autogrid_results.type == '''url''':
            autogrid_result_url = autogrid_results.path
            autogrid_result_local = ""
        else:
            autogrid_result_url = ""
            autogrid_result_local = autogrid_results.path
        
        ligand_lib = ligands.loc
        
	pass

        self.outputData(filter_file=filter_file, ligand_lib=ligand_lib, dpf_template_file=dpf, autogrid_res_url=autogrid_result_url, autogrid_res_local=autogrid_result_local)

## to ouput data on port filter_file use
## self.outputData(filter_file=data)
## to ouput data on port ligand_lib use
## self.outputData(ligand_lib=data)
## to ouput data on port dpf_template_file use
## self.outputData(dpf_template_file=data)
## to ouput data on port autogrid_res_url use
## self.outputData(autogrid_res_url=data)
## to ouput data on port autogrid_res_local use
## self.outputData(autogrid_res_local=data)









"""
            PrepareADVSInputs_12.configure(function=code)
            PrepareADVSInputs_12.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore Generic named PrepareADVSInputs in network self.macroNetwork"
            )
            print_exc()
            PrepareADVSInputs_12 = None

        try:
            ## saving node autodock_kryptonite_nbcr_net ##
            from NetworkEditor.items import FunctionNode
            autodock_kryptonite_nbcr_net_13 = FunctionNode(
                functionOrString='autodock_kryptonite_nbcr_net',
                host="http://kryptonite.nbcr.net/opal2",
                namedArgs={
                    'ga_run': '',
                    'lib': '',
                    'filter_file_url': '',
                    'ga_num_evals': '',
                    'filter_file': '',
                    'sched': 'SGE',
                    'urllib': '',
                    'ga_num_generations': '',
                    'dpf': '',
                    'u': '',
                    'utar': '',
                    'userlib': '',
                    'ga_pop_size': '',
                    'localRun': False,
                    'email': '',
                    'execPath': ''
                },
                constrkw={
                    'functionOrString': "'autodock_kryptonite_nbcr_net'",
                    'host': '"http://kryptonite.nbcr.net/opal2"',
                    'namedArgs': {
                        'ga_run': '',
                        'lib': '',
                        'filter_file_url': '',
                        'ga_num_evals': '',
                        'filter_file': '',
                        'sched': 'SGE',
                        'urllib': '',
                        'ga_num_generations': '',
                        'dpf': '',
                        'u': '',
                        'utar': '',
                        'userlib': '',
                        'ga_pop_size': '',
                        'localRun': False,
                        'email': '',
                        'execPath': ''
                    }
                },
                name='autodock_kryptonite_nbcr_net',
                library=wslib)
            self.macroNetwork.addNode(autodock_kryptonite_nbcr_net_13, 217,
                                      132)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'ga_run'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName['lib'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'filter_file_url'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'ga_num_evals'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'filter_file'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName['sched'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'urllib'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'ga_num_generations'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName['dpf'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName['u'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName['utar'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'userlib'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'ga_pop_size'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'localRun'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName['email'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'execPath'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'ga_run'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'lib'].widget.configure(
                    *(), **{
                        'choices':
                        ('sample', 'NCIDS_SC', 'NCI_DS1', 'NCI_DS2',
                         'human_metabolome', 'chembridge_building_blocks',
                         'drugbank_nutraceutics', 'drugbank_smallmol',
                         'fda_approved')
                    })
            autodock_kryptonite_nbcr_net_13.inputPortByName['lib'].widget.set(
                r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'filter_file_url'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'ga_num_evals'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'filter_file'].rebindWidget()
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'filter_file'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'filter_file'].unbindWidget()
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'sched'].widget.configure(*(), **{'choices': ('SGE', 'CSF')})
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'sched'].widget.set(r"SGE", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'urllib'].rebindWidget()
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'urllib'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'urllib'].unbindWidget()
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'ga_num_generations'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'dpf'].rebindWidget()
            autodock_kryptonite_nbcr_net_13.inputPortByName['dpf'].widget.set(
                r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'dpf'].unbindWidget()
            autodock_kryptonite_nbcr_net_13.inputPortByName['u'].rebindWidget()
            autodock_kryptonite_nbcr_net_13.inputPortByName['u'].widget.set(
                r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName['u'].unbindWidget()
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'utar'].rebindWidget()
            autodock_kryptonite_nbcr_net_13.inputPortByName['utar'].widget.set(
                r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'utar'].unbindWidget()
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'userlib'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'ga_pop_size'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'localRun'].widget.set(0, run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'email'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_13.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_13.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore FunctionNode named autodock_kryptonite_nbcr_net in network self.macroNetwork"
            )
            print_exc()
            autodock_kryptonite_nbcr_net_13 = None

        try:
            ## saving node GetMainURLFromList ##
            from WebServices.VisionInterface.WSNodes import GetMainURLFromListNode
            GetMainURLFromList_14 = GetMainURLFromListNode(
                constrkw={}, name='GetMainURLFromList', library=wslib)
            self.macroNetwork.addNode(GetMainURLFromList_14, 217, 188)
            GetMainURLFromList_14.inputPortByName['urls'].configure(
                *(), **{'defaultValue': None})
            GetMainURLFromList_14.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore GetMainURLFromListNode named GetMainURLFromList in network self.macroNetwork"
            )
            print_exc()
            GetMainURLFromList_14 = None

        #self.macroNetwork.run()
        self.macroNetwork.freeze()

        ## saving connections for network AutodockVS ##
        input_Ports_10 = self.macroNetwork.ipNode
        if input_Ports_10 is not None and PrepareADVSInputs_12 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_10,
                    PrepareADVSInputs_12,
                    "new",
                    "ligands",
                    blocking=True,
                    splitratio=[0.60597534741634829, 0.41083180453223428])
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_10 and PrepareADVSInputs_12 in network self.macroNetwork"
                )
        if input_Ports_10 is not None and PrepareADVSInputs_12 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_10,
                    PrepareADVSInputs_12,
                    "new",
                    "autogrid_results",
                    blocking=True,
                    splitratio=[0.64561658610430228, 0.21974682015753622])
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_10 and PrepareADVSInputs_12 in network self.macroNetwork"
                )
        if input_Ports_10 is not None and PrepareADVSInputs_12 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_10,
                    PrepareADVSInputs_12,
                    "new",
                    "dpf_template_obj",
                    blocking=True,
                    splitratio=[0.52491295380143521, 0.32751034461281114])
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_10 and PrepareADVSInputs_12 in network self.macroNetwork"
                )
        if autodock_kryptonite_nbcr_net_13 is not None and GetMainURLFromList_14 is not None:
            try:
                self.macroNetwork.connectNodes(
                    autodock_kryptonite_nbcr_net_13,
                    GetMainURLFromList_14,
                    "result",
                    "urls",
                    blocking=True,
                    splitratio=[0.36974288957131424, 0.63465596053596318])
            except:
                print(
                    "WARNING: failed to restore connection between autodock_kryptonite_nbcr_net_13 and GetMainURLFromList_14 in network self.macroNetwork"
                )
        output_Ports_11 = self.macroNetwork.opNode
        if GetMainURLFromList_14 is not None and output_Ports_11 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetMainURLFromList_14,
                    output_Ports_11,
                    "newurl",
                    "new",
                    blocking=True,
                    splitratio=[0.34850477186787743, 0.35637513198385085])
            except:
                print(
                    "WARNING: failed to restore connection between GetMainURLFromList_14 and output_Ports_11 in network self.macroNetwork"
                )
        if PrepareADVSInputs_12 is not None and autodock_kryptonite_nbcr_net_13 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareADVSInputs_12,
                    autodock_kryptonite_nbcr_net_13,
                    "filter_file",
                    "filter_file",
                    blocking=True,
                    splitratio=[0.33230642287344903, 0.65770700108889613])
            except:
                print(
                    "WARNING: failed to restore connection between PrepareADVSInputs_12 and autodock_kryptonite_nbcr_net_13 in network self.macroNetwork"
                )
        if PrepareADVSInputs_12 is not None and autodock_kryptonite_nbcr_net_13 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareADVSInputs_12,
                    autodock_kryptonite_nbcr_net_13,
                    "ligand_lib",
                    "urllib",
                    blocking=True,
                    splitratio=[0.50680104599665787, 0.51414170500293577])
            except:
                print(
                    "WARNING: failed to restore connection between PrepareADVSInputs_12 and autodock_kryptonite_nbcr_net_13 in network self.macroNetwork"
                )
        if PrepareADVSInputs_12 is not None and autodock_kryptonite_nbcr_net_13 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareADVSInputs_12,
                    autodock_kryptonite_nbcr_net_13,
                    "dpf_template_file",
                    "dpf",
                    blocking=True,
                    splitratio=[0.51615646597598808, 0.25661305528484007])
            except:
                print(
                    "WARNING: failed to restore connection between PrepareADVSInputs_12 and autodock_kryptonite_nbcr_net_13 in network self.macroNetwork"
                )
        if PrepareADVSInputs_12 is not None and autodock_kryptonite_nbcr_net_13 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareADVSInputs_12,
                    autodock_kryptonite_nbcr_net_13,
                    "autogrid_res_url",
                    "u",
                    blocking=True,
                    splitratio=[0.5760732944947704, 0.2032376887917188])
            except:
                print(
                    "WARNING: failed to restore connection between PrepareADVSInputs_12 and autodock_kryptonite_nbcr_net_13 in network self.macroNetwork"
                )
        if PrepareADVSInputs_12 is not None and autodock_kryptonite_nbcr_net_13 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareADVSInputs_12,
                    autodock_kryptonite_nbcr_net_13,
                    "autogrid_res_local",
                    "utar",
                    blocking=True,
                    splitratio=[0.52802808938949819, 0.66978534572736881])
            except:
                print(
                    "WARNING: failed to restore connection between PrepareADVSInputs_12 and autodock_kryptonite_nbcr_net_13 in network self.macroNetwork"
                )
        self.macroNetwork.runOnNewData.value = False

        ## modifying MacroInputNode dynamic ports
        input_Ports_10 = self.macroNetwork.ipNode
        input_Ports_10.outputPorts[1].configure(
            name='PrepareADVSInputs_ligands')
        input_Ports_10.outputPorts[2].configure(
            name='PrepareADVSInputs_autogrid_results')
        input_Ports_10.outputPorts[3].configure(
            name='PrepareADVSInputs_dpf_template_obj')

        ## modifying MacroOutputNode dynamic ports
        output_Ports_11 = self.macroNetwork.opNode
        output_Ports_11.inputPorts[1].configure(singleConnection='auto')
        output_Ports_11.inputPorts[1].configure(
            name='GetMainURLFromList_newurl')
        ## configure MacroNode input ports
        AutodockVS_9.inputPorts[0].configure(name='PrepareADVSInputs_ligands')
        AutodockVS_9.inputPorts[0].configure(datatype='LigandDB')
        AutodockVS_9.inputPorts[1].configure(
            name='PrepareADVSInputs_autogrid_results')
        AutodockVS_9.inputPorts[1].configure(datatype='autogrid_results')
        AutodockVS_9.inputPorts[2].configure(
            name='PrepareADVSInputs_dpf_template_obj')
        AutodockVS_9.inputPorts[2].configure(datatype='dpf_template')
        ## configure MacroNode output ports
        AutodockVS_9.outputPorts[0].configure(name='GetMainURLFromList_newurl')
        AutodockVS_9.outputPorts[0].configure(datatype='string')

        AutodockVS_9.shrink()

        ## reset modifications ##
        AutodockVS_9.resetTags()
        AutodockVS_9.buildOriginalList()
Esempio n. 7
0
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from Vision.StandardNodes import stdlib
        from WebServices.VisionInterface.WSNodes import wslib
        ## building macro network ##
        GromosCluster_33 = self
        from traceback import print_exc
        from Vision.StandardNodes import stdlib
        from WebServices.VisionInterface.WSNodes import wslib
        masterNet.getEditor().addLibraryInstance(wslib,"WebServices.VisionInterface.WSNodes", "wslib")
        from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
        try:
            addOpalServerAsCategory("http://kryptonite.nbcr.net/opal2", replace=False)
        except:
            pass
        try:
            ## saving node input Ports ##
            input_Ports_34 = self.macroNetwork.ipNode
            apply(input_Ports_34.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_34=None

        try:
            ## saving node output Ports ##
            output_Ports_35 = self.macroNetwork.opNode
            apply(output_Ports_35.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            output_Ports_35.move(236, 302)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_35=None

        try:
            ## saving node GROMOS_ClusterFiles_kryptonite_nbcr_net ##
            from NetworkEditor.items import FunctionNode
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36 = FunctionNode(functionOrString='GROMOS_ClusterFiles_kryptonite_nbcr_net', host="http://kryptonite.nbcr.net/opal2", namedArgs={'expert_options': '', 'rmsd': '0.125', 'traj': '', 'prefix': '', 'default_options': '-o -g -dist -ev -sz -tr -ntr -clid -cl', 'active': '', 'localRun': False, 'method': 'gromos', 'execPath': ''}, constrkw={'functionOrString': "'GROMOS_ClusterFiles_kryptonite_nbcr_net'", 'host': '"http://kryptonite.nbcr.net/opal2"', 'namedArgs': {'expert_options': '', 'rmsd': '0.125', 'traj': '', 'prefix': '', 'default_options': '-o -g -dist -ev -sz -tr -ntr -clid -cl', 'active': '', 'localRun': False, 'method': 'gromos', 'execPath': ''}}, name='GROMOS_ClusterFiles_kryptonite_nbcr_net', library=wslib)
            self.macroNetwork.addNode(GROMOS_ClusterFiles_kryptonite_nbcr_net_36,200,98)
            apply(GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['expert_options'].configure, (), {'defaultValue': None})
            apply(GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['rmsd'].configure, (), {'defaultValue': None, 'required': True})
            apply(GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['traj'].configure, (), {'defaultValue': None, 'required': True})
            apply(GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['prefix'].configure, (), {'defaultValue': None})
            apply(GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['default_options'].configure, (), {'defaultValue': None})
            apply(GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['active'].configure, (), {'defaultValue': None, 'required': True})
            apply(GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['localRun'].configure, (), {'defaultValue': None})
            apply(GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['method'].configure, (), {'defaultValue': None})
            apply(GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['execPath'].configure, (), {'defaultValue': None})
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['expert_options'].widget.set(r"", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['rmsd'].rebindWidget()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['rmsd'].widget.set(r"0.125", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['rmsd'].unbindWidget()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['traj'].rebindWidget()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['traj'].widget.set(r"", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['traj'].unbindWidget()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['prefix'].widget.set(r"", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['default_options'].widget.set(r"-o -g -dist -ev -sz -tr -ntr -clid -cl", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['active'].rebindWidget()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['active'].widget.set(r"", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['active'].unbindWidget()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['localRun'].widget.set(0, run=False)
            apply(GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['method'].widget.configure, (), {'choices': ('gromos', 'linkage', 'jarvis-patrick', 'monte-carlo', 'diagonalization')})
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['method'].widget.set(r"gromos", run=False)
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36.inputPortByName['execPath'].widget.set(r"", run=False)
            apply(GROMOS_ClusterFiles_kryptonite_nbcr_net_36.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore FunctionNode named GROMOS_ClusterFiles_kryptonite_nbcr_net in network self.macroNetwork"
            print_exc()
            GROMOS_ClusterFiles_kryptonite_nbcr_net_36=None

        try:
            ## saving node GetClusterFrameLink ##
            from WebServices.VisionInterface.WSNodes import GetMainURLFromListNode
            GetClusterFrameLink_46 = GetMainURLFromListNode(constrkw={}, name='GetClusterFrameLink', library=wslib)
            self.macroNetwork.addNode(GetClusterFrameLink_46,200,164)
            apply(GetClusterFrameLink_46.inputPortByName['urls'].configure, (), {'defaultValue': None})
            code = """def doit(self, urls):   
            url = urls[0]
            filename = url.split('''/''')[len(url.split('''/'''))-1]
            nurl = url.strip(filename)
            nurl = nurl + '''cluster_frames'''
            pass
            self.outputData(newurl=nurl)

"""
            GetClusterFrameLink_46.configure(function=code)
            apply(GetClusterFrameLink_46.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore GetMainURLFromListNode named GetClusterFrameLink in network self.macroNetwork"
            print_exc()
            GetClusterFrameLink_46=None

        try:
            ## saving node DownloadSaveDir ##
            from WebServices.VisionInterface.WSNodes import DownloadSaveDirNode
            DownloadSaveDir_51 = DownloadSaveDirNode(constrkw={}, name='DownloadSaveDir', library=wslib)
            self.macroNetwork.addNode(DownloadSaveDir_51,253,241)
            apply(DownloadSaveDir_51.inputPortByName['url'].configure, (), {'defaultValue': None})
            apply(DownloadSaveDir_51.inputPortByName['path'].configure, (), {'defaultValue': None})
            apply(DownloadSaveDir_51.inputPortByName['cutdirs'].configure, (), {'defaultValue': None})
            DownloadSaveDir_51.inputPortByName['url'].rebindWidget()
            DownloadSaveDir_51.inputPortByName['url'].widget.set(r"", run=False)
            DownloadSaveDir_51.inputPortByName['url'].unbindWidget()
            apply(DownloadSaveDir_51.configure, (), {'paramPanelImmediate': 1})
        except:
            print "WARNING: failed to restore DownloadSaveDirNode named DownloadSaveDir in network self.macroNetwork"
            print_exc()
            DownloadSaveDir_51=None

        try:
            ## saving node Entry ##
            from Vision.StandardNodes import EntryNE
            Entry_54 = EntryNE(constrkw={}, name='Entry', library=stdlib)
            self.macroNetwork.addNode(Entry_54,347,154)
            apply(Entry_54.inputPortByName['entry'].configure, (), {'defaultValue': None})
            Entry_54.inputPortByName['entry'].widget.set(r"3", run=False)
            apply(Entry_54.configure, (), {'paramPanelImmediate': 1})
        except:
            print "WARNING: failed to restore EntryNE named Entry in network self.macroNetwork"
            print_exc()
            Entry_54=None

        #self.macroNetwork.run()
        self.macroNetwork.freeze()

        ## saving connections for network GromosCluster ##
        input_Ports_34 = self.macroNetwork.ipNode
        if input_Ports_34 is not None and GROMOS_ClusterFiles_kryptonite_nbcr_net_36 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_34, GROMOS_ClusterFiles_kryptonite_nbcr_net_36, "new", "traj", blocking=True
                    , splitratio=[0.45411042113261574, 0.54335719372693991])
            except:
                print "WARNING: failed to restore connection between input_Ports_34 and GROMOS_ClusterFiles_kryptonite_nbcr_net_36 in network self.macroNetwork"
        if input_Ports_34 is not None and GROMOS_ClusterFiles_kryptonite_nbcr_net_36 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_34, GROMOS_ClusterFiles_kryptonite_nbcr_net_36, "new", "active", blocking=True
                    , splitratio=[0.50935546751136695, 0.51596797621119816])
            except:
                print "WARNING: failed to restore connection between input_Ports_34 and GROMOS_ClusterFiles_kryptonite_nbcr_net_36 in network self.macroNetwork"
        if input_Ports_34 is not None and GROMOS_ClusterFiles_kryptonite_nbcr_net_36 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_34, GROMOS_ClusterFiles_kryptonite_nbcr_net_36, "new", "rmsd", blocking=True
                    , splitratio=[0.72697457023572398, 0.5609730307022871])
            except:
                print "WARNING: failed to restore connection between input_Ports_34 and GROMOS_ClusterFiles_kryptonite_nbcr_net_36 in network self.macroNetwork"
        if GROMOS_ClusterFiles_kryptonite_nbcr_net_36 is not None and GetClusterFrameLink_46 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GROMOS_ClusterFiles_kryptonite_nbcr_net_36, GetClusterFrameLink_46, "result", "urls", blocking=True
                    , splitratio=[0.72920790745169972, 0.25586352865051565])
            except:
                print "WARNING: failed to restore connection between GROMOS_ClusterFiles_kryptonite_nbcr_net_36 and GetClusterFrameLink_46 in network self.macroNetwork"
        if GetClusterFrameLink_46 is not None and DownloadSaveDir_51 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetClusterFrameLink_46, DownloadSaveDir_51, "newurl", "url", blocking=True
                    , splitratio=[0.6813604229397745, 0.24060738045908744])
            except:
                print "WARNING: failed to restore connection between GetClusterFrameLink_46 and DownloadSaveDir_51 in network self.macroNetwork"
        if input_Ports_34 is not None and DownloadSaveDir_51 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_34, DownloadSaveDir_51, "new", "path", blocking=True
                    , splitratio=[0.26234570709625593, 0.71051250549253275])
            except:
                print "WARNING: failed to restore connection between input_Ports_34 and DownloadSaveDir_51 in network self.macroNetwork"
        output_Ports_35 = self.macroNetwork.opNode
        if DownloadSaveDir_51 is not None and output_Ports_35 is not None:
            try:
                self.macroNetwork.connectNodes(
                    DownloadSaveDir_51, output_Ports_35, "output", "new", blocking=True
                    , splitratio=[0.32827353595918307, 0.22147048732628238])
            except:
                print "WARNING: failed to restore connection between DownloadSaveDir_51 and output_Ports_35 in network self.macroNetwork"
        if Entry_54 is not None and DownloadSaveDir_51 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Entry_54, DownloadSaveDir_51, "string", "cutdirs", blocking=True
                    , splitratio=[0.28715327854931738, 0.50903858482741082])
            except:
                print "WARNING: failed to restore connection between Entry_54 and DownloadSaveDir_51 in network self.macroNetwork"
        self.macroNetwork.runOnNewData.value = False

        ## modifying MacroInputNode dynamic ports
        input_Ports_34 = self.macroNetwork.ipNode
        input_Ports_34.outputPorts[1].configure(name='GROMOS_ClusterFiles_kryptonite_nbcr_net_traj')
        input_Ports_34.outputPorts[2].configure(name='GROMOS_ClusterFiles_kryptonite_nbcr_net_active')
        input_Ports_34.outputPorts[3].configure(name='GROMOS_ClusterFiles_kryptonite_nbcr_net_rmsd')
        input_Ports_34.outputPorts[4].configure(name='DownloadSaveDir_path')

        ## modifying MacroOutputNode dynamic ports
        output_Ports_35 = self.macroNetwork.opNode
        output_Ports_35.inputPorts[1].configure(singleConnection='auto')
        output_Ports_35.inputPorts[1].configure(name='DownloadSaveDir_output')
        ## configure MacroNode input ports
        GromosCluster_33.inputPorts[0].configure(name='GROMOS_ClusterFiles_kryptonite_nbcr_net_traj')
        GromosCluster_33.inputPorts[0].configure(datatype='string')
        GromosCluster_33.inputPorts[1].configure(name='GROMOS_ClusterFiles_kryptonite_nbcr_net_active')
        GromosCluster_33.inputPorts[1].configure(datatype='string')
        GromosCluster_33.inputPorts[2].configure(name='GROMOS_ClusterFiles_kryptonite_nbcr_net_rmsd')
        GromosCluster_33.inputPorts[2].configure(datatype='string')
        GromosCluster_33.inputPorts[3].configure(name='DownloadSaveDir_path')
        GromosCluster_33.inputPorts[3].configure(datatype='string')
        ## configure MacroNode output ports
        GromosCluster_33.outputPorts[0].configure(name='DownloadSaveDir_output')
        GromosCluster_33.outputPorts[0].configure(datatype='string')

        GromosCluster_33.shrink()

        ## reset modifications ##
        GromosCluster_33.resetTags()
        GromosCluster_33.buildOriginalList()