def beforeAddingToNetwork(self, net):
        MacroNode.beforeAddingToNetwork(self, net)
        ## loading libraries ##
        from Vision.matplotlibNodes import matplotliblib
        net.editor.addLibraryInstance(matplotliblib,"Vision.matplotlibNodes", "matplotliblib")

        from MyDefaultLib import mydefaultlib
        net.editor.addLibraryInstance(mydefaultlib,"MyDefaultLib", "mydefaultlib")
    def beforeAddingToNetwork(self, net):
        MacroNode.beforeAddingToNetwork(self, net)
        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        net.editor.addLibraryInstance(adtlib,"AutoDockTools.VisionInterface.AdtNodes", "adtlib")

        from MolKit.VisionInterface.MolKitNodes import molkitlib
        net.editor.addLibraryInstance(molkitlib,"MolKit.VisionInterface.MolKitNodes", "molkitlib")
Esempio n. 3
0
    def beforeAddingToNetwork(self, net):
        MacroNode.beforeAddingToNetwork(self, net)
        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        net.editor.addLibraryInstance(adtlib,"AutoDockTools.VisionInterface.AdtNodes", "adtlib")

        from MolKit.VisionInterface.MolKitNodes import molkitlib
        net.editor.addLibraryInstance(molkitlib,"MolKit.VisionInterface.MolKitNodes", "molkitlib")
Esempio n. 4
0
    def beforeAddingToNetwork(self, net):
        MacroNode.beforeAddingToNetwork(self, net)
        ## loading libraries ##
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        net.editor.addLibraryInstance(molkitlib,"MolKit.VisionInterface.MolKitNodes", "molkitlib")

        from Vision.StandardNodes import stdlib
        net.editor.addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")
Esempio n. 5
0
 def beforeAddingToNetwork(self, net):
     MacroNode.beforeAddingToNetwork(self, net)
     from WebServices.VisionInterface.WSNodes import wslib
     net.getEditor().addLibraryInstance(wslib,"WebServices.VisionInterface.WSNodes", "wslib")
     from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
     try:
         addOpalServerAsCategory("http://kryptonite.nbcr.net/opal2", replace=False)
     except:
         pass
Esempio n. 6
0
    def beforeAddingToNetwork(self, net):
        MacroNode.beforeAddingToNetwork(self, net)
        ## loading libraries ##
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        net.editor.addLibraryInstance(molkitlib,
                                      "MolKit.VisionInterface.MolKitNodes",
                                      "molkitlib")

        from Vision.StandardNodes import stdlib
        net.editor.addLibraryInstance(stdlib, "Vision.StandardNodes", "stdlib")
Esempio n. 7
0
    def beforeAddingToNetwork(self, net):
        MacroNode.beforeAddingToNetwork(self, net)
        ## loading libraries ##
        from Vision.matplotlibNodes import matplotliblib
        net.editor.addLibraryInstance(matplotliblib, "Vision.matplotlibNodes",
                                      "matplotliblib")

        from MyDefaultLib import mydefaultlib
        net.editor.addLibraryInstance(mydefaultlib, "MyDefaultLib",
                                      "mydefaultlib")
Esempio n. 8
0
    def beforeAddingToNetwork(self, net):
        MacroNode.beforeAddingToNetwork(self, net)
        ## loading libraries ##
        from DejaVu.VisionInterface.DejaVuNodes import vizlib
        net.editor.addLibraryInstance(vizlib,
                                      "DejaVu.VisionInterface.DejaVuNodes",
                                      "vizlib")

        from Vision.StandardNodes import stdlib
        net.editor.addLibraryInstance(stdlib, "Vision.StandardNodes", "stdlib")
    def beforeAddingToNetwork(self, net):
        MacroNode.beforeAddingToNetwork(self, net)
        ## loading libraries ##
        from Volume.VisionInterface.VolumeNodes import vollib
        net.editor.addLibraryInstance(vollib,"Volume.VisionInterface.VolumeNodes", "vollib")

        from Vision.StandardNodes import stdlib
        net.editor.addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")

        from DejaVu.VisionInterface.DejaVuNodes import vizlib
        net.editor.addLibraryInstance(vizlib,"DejaVu.VisionInterface.DejaVuNodes", "vizlib")
Esempio n. 10
0
    def beforeAddingToNetwork(self, net):
        MacroNode.beforeAddingToNetwork(self, net)
        ## loading libraries ##
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        net.editor.addLibraryInstance(molkitlib,"MolKit.VisionInterface.MolKitNodes", "molkitlib")

        from DejaVu.VisionInterface.DejaVuNodes import vizlib
        net.editor.addLibraryInstance(vizlib,"DejaVu.VisionInterface.DejaVuNodes", "vizlib")

        from Vision.StandardNodes import stdlib
        net.editor.addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")
        
        if self.library and not self.library.libraryDescr.has_key(self.host[1:-1]):
            from WebServices.VisionInterface.WSNodes import addreplaceCategory
            addreplaceCategory(self.host[1:-1])  
 def beforeAddingToNetwork(self, net):
     MacroNode.beforeAddingToNetwork(self, net)
     from AutoDockTools.VisionInterface.Adt import Adt
     from WebServices.VisionInterface.WSNodes import wslib
     from Vision.StandardNodes import stdlib
     net.getEditor().addLibraryInstance(wslib,"WebServices.VisionInterface.WSNodes", "wslib")
     from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
     try:
         addOpalServerAsCategory("http://ws.nbcr.net/opal2", replace=False)
     except:
         pass
     try:
         addOpalServerAsCategory("http://oolitevm.calit2.optiputer.net/opal2", replace=False)
     except:
         pass
     try:
         addOpalServerAsCategory("http://kryptonite.nbcr.net/opal2", replace=False)
     except:
         pass
Esempio n. 12
0
    def beforeAddingToNetwork(self, net):
        MacroNode.beforeAddingToNetwork(self, net)
        ## loading libraries ##
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        net.editor.addLibraryInstance(molkitlib,
                                      "MolKit.VisionInterface.MolKitNodes",
                                      "molkitlib")

        from DejaVu.VisionInterface.DejaVuNodes import vizlib
        net.editor.addLibraryInstance(vizlib,
                                      "DejaVu.VisionInterface.DejaVuNodes",
                                      "vizlib")

        from Vision.StandardNodes import stdlib
        net.editor.addLibraryInstance(stdlib, "Vision.StandardNodes", "stdlib")

        if self.library and not self.library.libraryDescr.has_key(
                self.host[1:-1]):
            from WebServices.VisionInterface.WSNodes import addreplaceCategory
            addreplaceCategory(self.host[1:-1])
Esempio n. 13
0
 def beforeAddingToNetwork(self, net):
     MacroNode.beforeAddingToNetwork(self, net)
     from AutoDockTools.VisionInterface.Adt import Adt
     from WebServices.VisionInterface.WSNodes import wslib
     from Vision.StandardNodes import stdlib
     net.getEditor().addLibraryInstance(
         wslib, "WebServices.VisionInterface.WSNodes", "wslib")
     from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
     try:
         addOpalServerAsCategory("http://ws.nbcr.net/opal2", replace=False)
     except:
         pass
     try:
         addOpalServerAsCategory(
             "http://oolitevm.calit2.optiputer.net/opal2", replace=False)
     except:
         pass
     try:
         addOpalServerAsCategory("http://kryptonite.nbcr.net/opal2",
                                 replace=False)
     except:
         pass
Esempio n. 14
0
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode

        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        from Vision.StandardNodes import stdlib

        ## building macro network ##
        AD3Dpf_6 = self
        from traceback import print_exc

        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib

        self.macroNetwork.getEditor().addLibraryInstance(adtlib, "AutoDockTools.VisionInterface.AdtNodes", "adtlib")

        from MolKit.VisionInterface.MolKitNodes import molkitlib

        self.macroNetwork.getEditor().addLibraryInstance(molkitlib, "MolKit.VisionInterface.MolKitNodes", "molkitlib")

        from Vision.StandardNodes import stdlib

        self.macroNetwork.getEditor().addLibraryInstance(stdlib, "Vision.StandardNodes", "stdlib")

        try:
            ## saving node input Ports ##
            input_Ports_7 = self.macroNetwork.ipNode
            input_Ports_7.move(158, 4)
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_7 = None

        try:
            ## saving node output Ports ##
            output_Ports_8 = self.macroNetwork.opNode
            output_Ports_8.move(172, 322)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_8 = None

        try:
            ## saving node Docking Parameter File Browser ##
            from AutoDockTools.VisionInterface.AdtNodes import DockingParameterFileBrowserNE

            Docking_Parameter_File_Browser_9 = DockingParameterFileBrowserNE(
                constrkw={}, name="Docking Parameter File Browser", library=adtlib
            )
            self.macroNetwork.addNode(Docking_Parameter_File_Browser_9, 204, 93)
            apply(
                Docking_Parameter_File_Browser_9.inputPortByName["filename"].configure,
                (),
                {"color": "white", "cast": True, "shape": "oval"},
            )
            apply(
                Docking_Parameter_File_Browser_9.outputPortByName["filename"].configure,
                (),
                {"color": "white", "shape": "oval"},
            )
            Docking_Parameter_File_Browser_9.inputPortByName["filename"].widget.set(
                "/mgl/work4/rhuey/dev23/NEWTEST.dpf", run=False
            )
        except:
            print "WARNING: failed to restore DockingParameterFileBrowserNE named Docking Parameter File Browser in network self.macroNetwork"
            print_exc()
            Docking_Parameter_File_Browser_9 = None

        try:
            ## saving node Prepare AD3Dpf ##
            from AutoDockTools.VisionInterface.AdtNodes import AdtPrepareDpf3

            Prepare_AD3Dpf_10 = AdtPrepareDpf3(constrkw={}, name="Prepare AD3Dpf", library=adtlib)
            self.macroNetwork.addNode(Prepare_AD3Dpf_10, 170, 266)
            apply(
                Prepare_AD3Dpf_10.inputPortByName["ligand_filename"].configure,
                (),
                {"color": "white", "cast": True, "shape": "oval"},
            )
            apply(
                Prepare_AD3Dpf_10.inputPortByName["receptor_filename"].configure,
                (),
                {"color": "white", "cast": True, "shape": "oval"},
            )
            apply(
                Prepare_AD3Dpf_10.inputPortByName["dpf_filename"].configure,
                (),
                {"color": "white", "cast": True, "shape": "oval"},
            )
            apply(
                Prepare_AD3Dpf_10.inputPortByName["parameters"].configure,
                (),
                {"color": "cyan", "cast": True, "shape": "oval"},
            )
            apply(
                Prepare_AD3Dpf_10.inputPortByName["outputfilename"].configure,
                (),
                {"color": "white", "cast": True, "shape": "oval"},
            )
            apply(
                Prepare_AD3Dpf_10.outputPortByName["ad3_parameter_file"].configure,
                (),
                {"color": "white", "shape": "oval"},
            )
        except:
            print "WARNING: failed to restore AdtPrepareDpf3 named Prepare AD3Dpf in network self.macroNetwork"
            print_exc()
            Prepare_AD3Dpf_10 = None

        try:
            ## saving node Read Molecule ##
            from MolKit.VisionInterface.MolKitNodes import ReadMolecule

            Read_Molecule_11 = ReadMolecule(constrkw={}, name="Read Molecule", library=molkitlib)
            self.macroNetwork.addNode(Read_Molecule_11, 94, 51)
            apply(
                Read_Molecule_11.inputPortByName["filename"].configure,
                (),
                {"color": "white", "cast": True, "shape": "oval"},
            )
            apply(Read_Molecule_11.outputPortByName["MolSets"].configure, (), {"color": "#c64e70", "shape": "oval"})
        except:
            print "WARNING: failed to restore ReadMolecule named Read Molecule in network self.macroNetwork"
            print_exc()
            Read_Molecule_11 = None

        try:
            ## saving node Read Molecule ##
            from MolKit.VisionInterface.MolKitNodes import ReadMolecule

            Read_Molecule_12 = ReadMolecule(constrkw={}, name="Read Molecule", library=molkitlib)
            self.macroNetwork.addNode(Read_Molecule_12, 187, 47)
            apply(
                Read_Molecule_12.inputPortByName["filename"].configure,
                (),
                {"color": "white", "cast": True, "shape": "oval"},
            )
            apply(Read_Molecule_12.outputPortByName["MolSets"].configure, (), {"color": "#c64e70", "shape": "oval"})
        except:
            print "WARNING: failed to restore ReadMolecule named Read Molecule in network self.macroNetwork"
            print_exc()
            Read_Molecule_12 = None

        try:
            ## saving node File Browser ##
            from Vision.StandardNodes import FileBrowserNE

            File_Browser_13 = FileBrowserNE(constrkw={}, name="File Browser", library=stdlib)
            self.macroNetwork.addNode(File_Browser_13, 286, 143)
            apply(
                File_Browser_13.inputPortByName["filename"].configure,
                (),
                {"color": "white", "cast": True, "shape": "oval"},
            )
            apply(File_Browser_13.outputPortByName["filename"].configure, (), {"color": "white", "shape": "oval"})
        except:
            print "WARNING: failed to restore FileBrowserNE named File Browser in network self.macroNetwork"
            print_exc()
            File_Browser_13 = None

        self.macroNetwork.freeze()

        ## saving connections for network AD3Dpf ##
        if Docking_Parameter_File_Browser_9 is not None and Prepare_AD3Dpf_10 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Docking_Parameter_File_Browser_9, Prepare_AD3Dpf_10, "filename", "dpf_filename", blocking=True
                )
            except:
                print "WARNING: failed to restore connection between Docking_Parameter_File_Browser_9 and Prepare_AD3Dpf_10 in network self.macroNetwork"
        if Read_Molecule_11 is not None and Prepare_AD3Dpf_10 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Read_Molecule_11, Prepare_AD3Dpf_10, "MolSets", "ligand_filename", blocking=True
                )
            except:
                print "WARNING: failed to restore connection between Read_Molecule_11 and Prepare_AD3Dpf_10 in network self.macroNetwork"
        if Read_Molecule_12 is not None and Prepare_AD3Dpf_10 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Read_Molecule_12, Prepare_AD3Dpf_10, "MolSets", "receptor_filename", blocking=True
                )
            except:
                print "WARNING: failed to restore connection between Read_Molecule_12 and Prepare_AD3Dpf_10 in network self.macroNetwork"
        if File_Browser_13 is not None and Prepare_AD3Dpf_10 is not None:
            try:
                self.macroNetwork.connectNodes(
                    File_Browser_13, Prepare_AD3Dpf_10, "filename", "outputfilename", blocking=True
                )
            except:
                print "WARNING: failed to restore connection between File_Browser_13 and Prepare_AD3Dpf_10 in network self.macroNetwork"
        output_Ports_8 = self.macroNetwork.opNode
        if Prepare_AD3Dpf_10 is not None and output_Ports_8 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Prepare_AD3Dpf_10, output_Ports_8, "ad3_parameter_file", "new", blocking=True
                )
            except:
                print "WARNING: failed to restore connection between Prepare_AD3Dpf_10 and output_Ports_8 in network self.macroNetwork"
        self.macroNetwork.unfreeze()

        AD3Dpf_6.shrink()

        ## reset modifications ##
        AD3Dpf_6.resetTags()
        AD3Dpf_6.buildOriginalList()
Esempio n. 15
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 ##
        PrepareReceptor_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://ws.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})
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_2=None

        try:
            ## saving node Pdb2pqrWS ##
            from NetworkEditor.macros import MacroNode
            Pdb2pqrWS_3 = MacroNode(name='Pdb2pqrWS')
            self.macroNetwork.addNode(Pdb2pqrWS_3, 153, 86)
            input_Ports_4 = Pdb2pqrWS_3.macroNetwork.ipNode
            apply(input_Ports_4.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            input_Ports_4.move(65, 10)
            output_Ports_5 = Pdb2pqrWS_3.macroNetwork.opNode
            apply(output_Ports_5.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            output_Ports_5.move(65, 310)
            from Vision.StandardNodes import Generic
            CheckFileFormat_6 = Generic(constrkw={}, name='CheckFileFormat', library=stdlib)
            Pdb2pqrWS_3.macroNetwork.addNode(CheckFileFormat_6,82,62)
            apply(CheckFileFormat_6.addInputPort, (), {'singleConnection': True, 'name': 'value', 'cast': True, 'datatype': 'receptor', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33', 'originalDatatype': 'None'})
            apply(CheckFileFormat_6.addOutputPort, (), {'name': 'receptor_obj', 'datatype': 'receptor', 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33'})
            apply(CheckFileFormat_6.addOutputPort, (), {'name': 'pqr_name', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            apply(CheckFileFormat_6.addOutputPort, (), {'name': 'pdb_path', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            code = """def doit(self, value):
    if value.get_ext_loc('''pqr''') != None or value.get_ext_loc('''pdbqt''') != None:
        self.outputData(receptor_obj=value)
        self.scheduleChildren(portList=[self.getOutputPortByName('''receptor_obj''')])
    else:
        pqr_name = value.get_id() + '''.pqr'''
        pdb_path = value.get_ext_loc('''pdb''')

        self.outputData(receptor_obj=value, pqr_name=pqr_name, pdb_path=pdb_path)
        self.scheduleChildren(portList=[self.getOutputPortByName('''receptor_obj'''), self.getOutputPortByName('''pqr_name'''), self.getOutputPortByName('''pdb_path''')])

"""
            CheckFileFormat_6.configure(function=code)
            apply(CheckFileFormat_6.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            from NetworkEditor.items import FunctionNode
            Pdb2pqrOpalService_ws_nbcr_net_7 = FunctionNode(functionOrString='Pdb2pqrOpalService_ws_nbcr_net', host="http://ws.nbcr.net/opal2", namedArgs={'noopt': False, 'phi': False, 'psi': False, 'verbose': True, 'chain': False, 'nodebump': False, 'chi': False, 'output_file': '', 'ligand': '', 'hbond': False, 'inFile': '', 'with_ph': '', 'forcefield': 'AMBER', 'clean': False, 'inId': '', 'apbs_input': False, 'ffout': '', 'localRun': False, 'rama': False, 'execPath': '', 'assign_only': False}, constrkw={'functionOrString': "'Pdb2pqrOpalService_ws_nbcr_net'", 'host': '"http://ws.nbcr.net/opal2"', 'namedArgs': {'noopt': False, 'phi': False, 'psi': False, 'verbose': True, 'chain': False, 'nodebump': False, 'chi': False, 'output_file': '', 'ligand': '', 'hbond': False, 'inFile': '', 'with_ph': '', 'forcefield': 'AMBER', 'clean': False, 'inId': '', 'apbs_input': False, 'ffout': '', 'localRun': False, 'rama': False, 'execPath': '', 'assign_only': False}}, name='Pdb2pqrOpalService_ws_nbcr_net', library=wslib)
            Pdb2pqrWS_3.macroNetwork.addNode(Pdb2pqrOpalService_ws_nbcr_net_7,99,115)
            apply(Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['output_file'].configure, (), {'defaultValue': None, 'required': True})
            apply(Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['inFile'].configure, (), {'defaultValue': None, 'required': True})
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['noopt'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['phi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['psi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['verbose'].widget.set(1, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['chain'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['nodebump'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['chi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['output_file'].rebindWidget()
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['output_file'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['output_file'].unbindWidget()
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['ligand'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['hbond'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['inFile'].rebindWidget()
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['inFile'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['inFile'].unbindWidget()
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['with_ph'].widget.set(r"", run=False)
            apply(Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['forcefield'].widget.configure, (), {'choices': ('AMBER', 'CHARMM', 'PARSE', 'TYL06')})
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['forcefield'].widget.set(r"AMBER", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['clean'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['inId'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['apbs_input'].widget.set(0, run=False)
            apply(Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['ffout'].widget.configure, (), {'choices': ('AMBER', 'CHARMM', 'PARSE', 'TYL06')})
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['ffout'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['localRun'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['rama'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['execPath'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['assign_only'].widget.set(0, run=False)
            apply(Pdb2pqrOpalService_ws_nbcr_net_7.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            from WebServices.VisionInterface.WSNodes import GetURLFromListNode
            GetURLFromList_8 = GetURLFromListNode(constrkw={}, name='GetURLFromList', library=wslib)
            Pdb2pqrWS_3.macroNetwork.addNode(GetURLFromList_8,117,169)
            GetURLFromList_8.inputPortByName['ext'].widget.set(r"pqr", run=False)
            apply(GetURLFromList_8.configure, (), {'paramPanelImmediate': 1})
            from Vision.StandardNodes import Generic
            UpdateReceptor_9 = Generic(constrkw={}, name='UpdateReceptor', library=stdlib)
            Pdb2pqrWS_3.macroNetwork.addNode(UpdateReceptor_9,82,256)
            apply(UpdateReceptor_9.addInputPort, (), {'singleConnection': True, 'name': 'receptor_obj', 'cast': True, 'datatype': 'receptor', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33', 'originalDatatype': 'None'})
            apply(UpdateReceptor_9.addInputPort, (), {'singleConnection': True, 'name': 'pqr', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': False, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
            apply(UpdateReceptor_9.addOutputPort, (), {'name': 'receptor_obj', 'datatype': 'receptor', 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33'})
            apply(UpdateReceptor_9.addOutputPort, (), {'name': 'pdb2pqr_result', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            code = """def doit(self, receptor_obj, pqr):
        if pqr != '''no data yet''':
            pdb2pqr_result = pqr
            receptor_obj.set_ext_loc(pqr)
        else:
            pdbqt = receptor_obj.get_ext_loc('''pdbqt''')
            pqr = receptor_obj.get_ext_loc('''pqr''')

            if pdbqt != None:
                pdb2pqr_result = pdbqt
            elif pqr != None:
                pdb2pqr_result = pqr

        pass
        self.outputData(receptor_obj=receptor_obj, pdb2pqr_result=pdb2pqr_result)





"""
            UpdateReceptor_9.configure(function=code)
            apply(UpdateReceptor_9.configure, (), {'paramPanelImmediate': 1, 'expanded': False})

            ## saving connections for network Pdb2pqrWS ##
            Pdb2pqrWS_3.macroNetwork.freeze()
            if CheckFileFormat_6 is not None and Pdb2pqrOpalService_ws_nbcr_net_7 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        CheckFileFormat_6, Pdb2pqrOpalService_ws_nbcr_net_7, "pqr_name", "output_file", blocking=True
                        , splitratio=[0.43278717885693868, 0.65281492247209427])
                except:
                    print "WARNING: failed to restore connection between CheckFileFormat_6 and Pdb2pqrOpalService_ws_nbcr_net_7 in network Pdb2pqrWS_3.macroNetwork"
            if CheckFileFormat_6 is not None and Pdb2pqrOpalService_ws_nbcr_net_7 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        CheckFileFormat_6, Pdb2pqrOpalService_ws_nbcr_net_7, "pdb_path", "inFile", blocking=True
                        , splitratio=[0.61978340673276544, 0.69977512898866912])
                except:
                    print "WARNING: failed to restore connection between CheckFileFormat_6 and Pdb2pqrOpalService_ws_nbcr_net_7 in network Pdb2pqrWS_3.macroNetwork"
            if Pdb2pqrOpalService_ws_nbcr_net_7 is not None and GetURLFromList_8 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        Pdb2pqrOpalService_ws_nbcr_net_7, GetURLFromList_8, "result", "urllist", blocking=True
                        , splitratio=[0.73247388879852338, 0.69014271703344965])
                except:
                    print "WARNING: failed to restore connection between Pdb2pqrOpalService_ws_nbcr_net_7 and GetURLFromList_8 in network Pdb2pqrWS_3.macroNetwork"
            if GetURLFromList_8 is not None and UpdateReceptor_9 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        GetURLFromList_8, UpdateReceptor_9, "url", "pqr", blocking=True
                        , splitratio=[0.35224914715245104, 0.47693375858097758])
                except:
                    print "WARNING: failed to restore connection between GetURLFromList_8 and UpdateReceptor_9 in network Pdb2pqrWS_3.macroNetwork"
            if CheckFileFormat_6 is not None and UpdateReceptor_9 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        CheckFileFormat_6, UpdateReceptor_9, "receptor_obj", "receptor_obj", blocking=True
                        , splitratio=[0.57865377076653579, 0.45824116584600394])
                except:
                    print "WARNING: failed to restore connection between CheckFileFormat_6 and UpdateReceptor_9 in network Pdb2pqrWS_3.macroNetwork"
            input_Ports_4 = Pdb2pqrWS_3.macroNetwork.ipNode
            if input_Ports_4 is not None and CheckFileFormat_6 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        input_Ports_4, CheckFileFormat_6, "new", "value", blocking=True
                        , splitratio=[0.28291581858817416, 0.70581213384962171])
                except:
                    print "WARNING: failed to restore connection between input_Ports_4 and CheckFileFormat_6 in network Pdb2pqrWS_3.macroNetwork"
            output_Ports_5 = Pdb2pqrWS_3.macroNetwork.opNode
            if UpdateReceptor_9 is not None and output_Ports_5 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        UpdateReceptor_9, output_Ports_5, "receptor_obj", "new", blocking=True
                        , splitratio=[0.24354423773729619, 0.72115604180615911])
                except:
                    print "WARNING: failed to restore connection between UpdateReceptor_9 and output_Ports_5 in network Pdb2pqrWS_3.macroNetwork"
            if UpdateReceptor_9 is not None and output_Ports_5 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        UpdateReceptor_9, output_Ports_5, "pdb2pqr_result", "new", blocking=True
                        , splitratio=[0.31141907324539131, 0.41794097665671487])
                except:
                    print "WARNING: failed to restore connection between UpdateReceptor_9 and output_Ports_5 in network Pdb2pqrWS_3.macroNetwork"
            Pdb2pqrWS_3.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_4.outputPorts[1].configure(name='CheckFileFormat_value')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_5.inputPorts[1].configure(singleConnection='auto')
            output_Ports_5.inputPorts[2].configure(singleConnection='auto')
            output_Ports_5.inputPorts[1].configure(name='UpdateReceptor_receptor_obj')
            output_Ports_5.inputPorts[2].configure(name='UpdateReceptor_pdb2pqr_result')
            Pdb2pqrWS_3.inputPorts[0].configure(name='CheckFileFormat_value')
            Pdb2pqrWS_3.inputPorts[0].configure(datatype='receptor')
            ## configure MacroNode input ports
            Pdb2pqrWS_3.outputPorts[0].configure(name='UpdateReceptor_receptor_obj')
            Pdb2pqrWS_3.outputPorts[0].configure(datatype='receptor')
            Pdb2pqrWS_3.outputPorts[1].configure(name='UpdateReceptor_pdb2pqr_result')
            Pdb2pqrWS_3.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            Pdb2pqrWS_3.shrink()
            apply(Pdb2pqrWS_3.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore MacroNode named Pdb2pqrWS in network self.macroNetwork"
            print_exc()
            Pdb2pqrWS_3=None

        try:
            ## saving node PrepareReceptorWS ##
            from NetworkEditor.macros import MacroNode
            PrepareReceptorWS_10 = MacroNode(name='PrepareReceptorWS')
            self.macroNetwork.addNode(PrepareReceptorWS_10, 217, 140)
            input_Ports_11 = PrepareReceptorWS_10.macroNetwork.ipNode
            apply(input_Ports_11.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            input_Ports_11.move(145, 8)
            output_Ports_12 = PrepareReceptorWS_10.macroNetwork.opNode
            apply(output_Ports_12.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            output_Ports_12.move(29, 412)
            from Vision.StandardNodes import Generic
            CheckFileFormat_13 = Generic(constrkw={}, name='CheckFileFormat', library=stdlib)
            PrepareReceptorWS_10.macroNetwork.addNode(CheckFileFormat_13,46,64)
            apply(CheckFileFormat_13.addInputPort, (), {'singleConnection': True, 'name': 'value', 'cast': True, 'datatype': 'receptor', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33', 'originalDatatype': 'None'})
            apply(CheckFileFormat_13.addOutputPort, (), {'name': 'receptor_obj', 'datatype': 'receptor', 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33'})
            apply(CheckFileFormat_13.addOutputPort, (), {'name': 'receptor_url', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            apply(CheckFileFormat_13.addOutputPort, (), {'name': 'receptor_local', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            apply(CheckFileFormat_13.addOutputPort, (), {'name': 'download_loc', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            code = """def doit(self, value):
    if value.get_ext_loc('''pdbqt''') != None:
        self.outputData(receptor_obj=value)
        self.scheduleChildren(portList=[self.getOutputPortByName('''receptor_obj''')])
    else:
        pqr = value.get_ext_loc('''pqr''')
        pdb = value.get_ext_loc('''pdb''')
        download_loc = value.get_workdir() + os.sep + value.get_id() + '''.pdbqt'''

        if pqr != None:
            if value.get_ext_type('''pqr''') == '''url''':
                receptor_url = pqr
                receptor_local = ""
            else:
                receptor_url = ""
                receptor_local = pqr
        elif pdb != None:
            if value.get_ext_type('''pdb''') == '''url''':
                receptor_url = pdb
                receptor_local = ""
            else:
                receptor_url = ""
                receptor_local = pdb
        else:
            print "*** ERROR: pqr and pqr both missing from receptor object"
            print receptor_obj.ext_loc
            return '''stop'''

        self.outputData(receptor_obj=value, receptor_url=receptor_url, receptor_local=receptor_local, download_loc=download_loc)
        self.scheduleChildren(portList=[self.getOutputPortByName('''receptor_obj'''), self.getOutputPortByName('''receptor_url'''), self.getOutputPortByName('''receptor_local'''), self.getOutputPortByName('''download_loc''')])





"""
            CheckFileFormat_13.configure(function=code)
            apply(CheckFileFormat_13.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            from NetworkEditor.items import FunctionNode
            PrepareReceptorOpalService_ws_nbcr_net_14 = FunctionNode(functionOrString='PrepareReceptorOpalService_ws_nbcr_net', host="http://ws.nbcr.net/opal2", namedArgs={'C': False, 'url': '', 'o': '', 'r': '', 'v': False, 'localRun': False, 'execPath': ''}, constrkw={'functionOrString': "'PrepareReceptorOpalService_ws_nbcr_net'", 'host': '"http://ws.nbcr.net/opal2"', 'namedArgs': {'C': False, 'url': '', 'o': '', 'r': '', 'v': False, 'localRun': False, 'execPath': ''}}, name='PrepareReceptorOpalService_ws_nbcr_net', library=wslib)
            PrepareReceptorWS_10.macroNetwork.addNode(PrepareReceptorOpalService_ws_nbcr_net_14,180,128)
            apply(PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['C'].configure, (), {'defaultValue': None})
            apply(PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['url'].configure, (), {'defaultValue': None, 'required': True})
            apply(PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['r'].configure, (), {'defaultValue': None, 'required': True})
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['C'].rebindWidget()
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['C'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['C'].unbindWidget()
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['url'].rebindWidget()
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['url'].widget.set(r"", run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['url'].unbindWidget()
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['o'].widget.set(r"", run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['r'].rebindWidget()
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['r'].widget.set(r"", run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['r'].unbindWidget()
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['v'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['localRun'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['execPath'].widget.set(r"", run=False)
            apply(PrepareReceptorOpalService_ws_nbcr_net_14.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            from WebServices.VisionInterface.WSNodes import GetURLFromListNode
            GetURLFromList_15 = GetURLFromListNode(constrkw={}, name='GetURLFromList', library=wslib)
            PrepareReceptorWS_10.macroNetwork.addNode(GetURLFromList_15,180,186)
            GetURLFromList_15.inputPortByName['ext'].widget.set(r"pdbqt", run=False)
            apply(GetURLFromList_15.configure, (), {'paramPanelImmediate': 1})
            from WebServices.VisionInterface.WSNodes import DownloadToFileNode
            DownloadToFile_16 = DownloadToFileNode(constrkw={}, name='DownloadToFile', library=wslib)
            PrepareReceptorWS_10.macroNetwork.addNode(DownloadToFile_16,80,272)
            apply(DownloadToFile_16.inputPortByName['url'].configure, (), {'defaultValue': None})
            apply(DownloadToFile_16.inputPortByName['filename'].configure, (), {'defaultValue': None})
            DownloadToFile_16.inputPortByName['url'].rebindWidget()
            DownloadToFile_16.inputPortByName['url'].widget.set(r"", run=False)
            DownloadToFile_16.inputPortByName['url'].unbindWidget()
            DownloadToFile_16.inputPortByName['filename'].rebindWidget()
            DownloadToFile_16.inputPortByName['filename'].widget.set(r"", run=False)
            DownloadToFile_16.inputPortByName['filename'].unbindWidget()
            DownloadToFile_16.inputPortByName['overwrite'].widget.set(1, run=False)
            apply(DownloadToFile_16.configure, (), {'paramPanelImmediate': 1})
            from Vision.StandardNodes import Generic
            UpdateReceptor_17 = Generic(constrkw={}, name='UpdateReceptor', library=stdlib)
            PrepareReceptorWS_10.macroNetwork.addNode(UpdateReceptor_17,46,358)
            apply(UpdateReceptor_17.addInputPort, (), {'singleConnection': True, 'name': 'receptor_obj', 'cast': True, 'datatype': 'receptor', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33', 'originalDatatype': 'None'})
            apply(UpdateReceptor_17.addInputPort, (), {'singleConnection': True, 'name': 'pdbqt', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': False, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
            apply(UpdateReceptor_17.addOutputPort, (), {'name': 'receptor_prepared_obj', 'datatype': 'receptor_prepared', 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#009900'})
            apply(UpdateReceptor_17.addOutputPort, (), {'name': 'receptor_result', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            code = """def doit(self, receptor_obj, pdbqt):
        from AutoDockTools.VisionInterface.Adt.receptor_prepared import receptor_prepared
        if pdbqt != '''no data yet''':
            receptor_prepared_obj = receptor_prepared(pdbqt)
            receptor_obj.set_ext_loc(pdbqt)
            receptor_result = pdbqt
        else:
            pdbqt_org = receptor_obj.get_ext_loc('''pdbqt''')
            receptor_prepared_obj = receptor_prepared(pdbqt_org)
            receptor_result = pdbqt_org
        
        pass

        self.outputData(receptor_prepared_obj = receptor_prepared_obj, receptor_result=receptor_result)



"""
            UpdateReceptor_17.configure(function=code)
            apply(UpdateReceptor_17.configure, (), {'paramPanelImmediate': 1, 'expanded': False})

            ## saving connections for network PrepareReceptorWS ##
            PrepareReceptorWS_10.macroNetwork.freeze()
            input_Ports_11 = PrepareReceptorWS_10.macroNetwork.ipNode
            if input_Ports_11 is not None and CheckFileFormat_13 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        input_Ports_11, CheckFileFormat_13, "new", "value", blocking=True
                        , splitratio=[0.64907843562020084, 0.47057253960060474])
                except:
                    print "WARNING: failed to restore connection between input_Ports_11 and CheckFileFormat_13 in network PrepareReceptorWS_10.macroNetwork"
            if CheckFileFormat_13 is not None and PrepareReceptorOpalService_ws_nbcr_net_14 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        CheckFileFormat_13, PrepareReceptorOpalService_ws_nbcr_net_14, "receptor_url", "url", blocking=True
                        , splitratio=[0.6171192646814192, 0.42883431331137822])
                except:
                    print "WARNING: failed to restore connection between CheckFileFormat_13 and PrepareReceptorOpalService_ws_nbcr_net_14 in network PrepareReceptorWS_10.macroNetwork"
            if CheckFileFormat_13 is not None and PrepareReceptorOpalService_ws_nbcr_net_14 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        CheckFileFormat_13, PrepareReceptorOpalService_ws_nbcr_net_14, "receptor_local", "r", blocking=True
                        , splitratio=[0.66136144381723583, 0.28482114514549767])
                except:
                    print "WARNING: failed to restore connection between CheckFileFormat_13 and PrepareReceptorOpalService_ws_nbcr_net_14 in network PrepareReceptorWS_10.macroNetwork"
            if input_Ports_11 is not None and PrepareReceptorOpalService_ws_nbcr_net_14 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        input_Ports_11, PrepareReceptorOpalService_ws_nbcr_net_14, "new", "C", blocking=True
                        , splitratio=[0.53817543437956172, 0.61119702937572407])
                except:
                    print "WARNING: failed to restore connection between input_Ports_11 and PrepareReceptorOpalService_ws_nbcr_net_14 in network PrepareReceptorWS_10.macroNetwork"
            if PrepareReceptorOpalService_ws_nbcr_net_14 is not None and GetURLFromList_15 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        PrepareReceptorOpalService_ws_nbcr_net_14, GetURLFromList_15, "result", "urllist", blocking=True
                        , splitratio=[0.43369347916867251, 0.26566786648658042])
                except:
                    print "WARNING: failed to restore connection between PrepareReceptorOpalService_ws_nbcr_net_14 and GetURLFromList_15 in network PrepareReceptorWS_10.macroNetwork"
            if GetURLFromList_15 is not None and DownloadToFile_16 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        GetURLFromList_15, DownloadToFile_16, "url", "url", blocking=True
                        , splitratio=[0.70502483723033316, 0.71683158018466053])
                except:
                    print "WARNING: failed to restore connection between GetURLFromList_15 and DownloadToFile_16 in network PrepareReceptorWS_10.macroNetwork"
            if CheckFileFormat_13 is not None and DownloadToFile_16 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        CheckFileFormat_13, DownloadToFile_16, "download_loc", "filename", blocking=True
                        , splitratio=[0.60455581032885575, 0.35606890231085681])
                except:
                    print "WARNING: failed to restore connection between CheckFileFormat_13 and DownloadToFile_16 in network PrepareReceptorWS_10.macroNetwork"
            if CheckFileFormat_13 is not None and UpdateReceptor_17 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        CheckFileFormat_13, UpdateReceptor_17, "receptor_obj", "receptor_obj", blocking=True
                        , splitratio=[0.74908230670336207, 0.38226563370205602])
                except:
                    print "WARNING: failed to restore connection between CheckFileFormat_13 and UpdateReceptor_17 in network PrepareReceptorWS_10.macroNetwork"
            if DownloadToFile_16 is not None and UpdateReceptor_17 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        DownloadToFile_16, UpdateReceptor_17, "filename", "pdbqt", blocking=True
                        , splitratio=[0.38698393490575966, 0.2874426709930199])
                except:
                    print "WARNING: failed to restore connection between DownloadToFile_16 and UpdateReceptor_17 in network PrepareReceptorWS_10.macroNetwork"
            output_Ports_12 = PrepareReceptorWS_10.macroNetwork.opNode
            if UpdateReceptor_17 is not None and output_Ports_12 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        UpdateReceptor_17, output_Ports_12, "receptor_prepared_obj", "new", blocking=True
                        , splitratio=[0.69589857263374943, 0.59566078506240416])
                except:
                    print "WARNING: failed to restore connection between UpdateReceptor_17 and output_Ports_12 in network PrepareReceptorWS_10.macroNetwork"
            if UpdateReceptor_17 is not None and output_Ports_12 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        UpdateReceptor_17, output_Ports_12, "receptor_result", "new", blocking=True
                        , splitratio=[0.44926362052272689, 0.38628711158860896])
                except:
                    print "WARNING: failed to restore connection between UpdateReceptor_17 and output_Ports_12 in network PrepareReceptorWS_10.macroNetwork"
            PrepareReceptorWS_10.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_11.outputPorts[1].configure(name='CheckFileFormat_value')
            input_Ports_11.outputPorts[2].configure(name='PrepareReceptorOpalService_ws_nbcr_net_C')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_12.inputPorts[1].configure(singleConnection='auto')
            output_Ports_12.inputPorts[2].configure(singleConnection='auto')
            output_Ports_12.inputPorts[1].configure(name='UpdateReceptor_receptor_prepared_obj')
            output_Ports_12.inputPorts[2].configure(name='UpdateReceptor_receptor_result')
            PrepareReceptorWS_10.inputPorts[0].configure(name='CheckFileFormat_value')
            PrepareReceptorWS_10.inputPorts[0].configure(datatype='receptor')
            PrepareReceptorWS_10.inputPorts[1].configure(name='PrepareReceptorOpalService_ws_nbcr_net_C')
            PrepareReceptorWS_10.inputPorts[1].configure(datatype='boolean')
            ## configure MacroNode input ports
            PrepareReceptorWS_10.outputPorts[0].configure(name='UpdateReceptor_receptor_prepared_obj')
            PrepareReceptorWS_10.outputPorts[0].configure(datatype='receptor_prepared')
            PrepareReceptorWS_10.outputPorts[1].configure(name='UpdateReceptor_receptor_result')
            PrepareReceptorWS_10.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            PrepareReceptorWS_10.shrink()
            apply(PrepareReceptorWS_10.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore MacroNode named PrepareReceptorWS in network self.macroNetwork"
            print_exc()
            PrepareReceptorWS_10=None

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

        ## saving connections for network PrepareReceptor ##
        input_Ports_1 = self.macroNetwork.ipNode
        Pdb2pqrWS_3 = self.macroNetwork.nodes[2]
        if input_Ports_1 is not None and Pdb2pqrWS_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, Pdb2pqrWS_3, "new", "CheckFileFormat_value", blocking=True
                    , splitratio=[0.73531020066010289, 0.24042404972613104])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and Pdb2pqrWS_3 in network self.macroNetwork"
        PrepareReceptorWS_10 = self.macroNetwork.nodes[3]
        if Pdb2pqrWS_3 is not None and PrepareReceptorWS_10 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Pdb2pqrWS_3, PrepareReceptorWS_10, "UpdateReceptor_receptor_obj", "CheckFileFormat_value", blocking=True
                    , splitratio=[0.54479169827535734, 0.4847384502006486])
            except:
                print "WARNING: failed to restore connection between Pdb2pqrWS_3 and PrepareReceptorWS_10 in network self.macroNetwork"
        if input_Ports_1 is not None and PrepareReceptorWS_10 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, PrepareReceptorWS_10, "new", "PrepareReceptorOpalService_ws_nbcr_net_C", blocking=True
                    , splitratio=[0.37730151685222141, 0.48897820190498614])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and PrepareReceptorWS_10 in network self.macroNetwork"
        output_Ports_2 = self.macroNetwork.opNode
        if PrepareReceptorWS_10 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareReceptorWS_10, output_Ports_2, "UpdateReceptor_receptor_prepared_obj", "new", blocking=True
                    , splitratio=[0.64110508898616414, 0.45535290355389196])
            except:
                print "WARNING: failed to restore connection between PrepareReceptorWS_10 and output_Ports_2 in network self.macroNetwork"
        if PrepareReceptorWS_10 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareReceptorWS_10, output_Ports_2, "UpdateReceptor_receptor_result", "new", blocking=True
                    , splitratio=[0.45846842546122241, 0.44240009354017412])
            except:
                print "WARNING: failed to restore connection between PrepareReceptorWS_10 and output_Ports_2 in network self.macroNetwork"
        self.macroNetwork.runOnNewData.value = False

        ## modifying MacroInputNode dynamic ports
        input_Ports_1 = self.macroNetwork.ipNode
        input_Ports_1.outputPorts[1].configure(name='Pdb2pqrWS_CheckFileFormat_value')
        input_Ports_1.outputPorts[2].configure(name='PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')

        ## modifying MacroOutputNode dynamic ports
        output_Ports_2 = self.macroNetwork.opNode
        output_Ports_2.inputPorts[1].configure(singleConnection='auto')
        output_Ports_2.inputPorts[2].configure(singleConnection='auto')
        output_Ports_2.inputPorts[1].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
        output_Ports_2.inputPorts[2].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_result')
        ## configure MacroNode input ports
        PrepareReceptor_0.inputPorts[0].configure(name='Pdb2pqrWS_CheckFileFormat_value')
        PrepareReceptor_0.inputPorts[0].configure(datatype='receptor')
        PrepareReceptor_0.inputPorts[1].configure(name='PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')
        PrepareReceptor_0.inputPorts[1].configure(datatype='boolean')
        ## configure MacroNode output ports
        PrepareReceptor_0.outputPorts[0].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
        PrepareReceptor_0.outputPorts[0].configure(datatype='receptor_prepared')
        PrepareReceptor_0.outputPorts[1].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_result')
        PrepareReceptor_0.outputPorts[1].configure(datatype='string')

        PrepareReceptor_0.shrink()

        ## reset modifications ##
        PrepareReceptor_0.resetTags()
        PrepareReceptor_0.buildOriginalList()
Esempio n. 16
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 ##
        TrajQR_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://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, 405)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_2 = None

        try:
            ## saving node Make_Zip_File ##
            from Vision.StandardNodes import MakeZipFileNE
            Make_Zip_File_3 = MakeZipFileNE(constrkw={},
                                            name='Make_Zip_File',
                                            library=stdlib)
            self.macroNetwork.addNode(Make_Zip_File_3, 47, 75)
            apply(Make_Zip_File_3.inputPortByName['input_directory'].configure,
                  (), {'defaultValue': None})
            apply(
                Make_Zip_File_3.inputPortByName['output_directory'].configure,
                (), {'defaultValue': None})
            apply(Make_Zip_File_3.inputPortByName['output_name'].configure, (),
                  {'defaultValue': None})
            apply(Make_Zip_File_3.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore MakeZipFileNE named Make_Zip_File in network self.macroNetwork"
            print_exc()
            Make_Zip_File_3 = None

        try:
            ## saving node TrajQR_kryptonite_nbcr_net ##
            from NetworkEditor.items import FunctionNode
            TrajQR_kryptonite_nbcr_net_4 = FunctionNode(
                functionOrString='TrajQR_kryptonite_nbcr_net',
                host="http://kryptonite.nbcr.net/opal2",
                namedArgs={
                    'license': False,
                    'rmsd': '',
                    'qh_filename': 'qh.tre',
                    'qr_filename': 'qr.out',
                    'compressed_pdbs': '',
                    'localRun': False,
                    'execPath': ''
                },
                constrkw={
                    'functionOrString': "'TrajQR_kryptonite_nbcr_net'",
                    'host': '"http://kryptonite.nbcr.net/opal2"',
                    'namedArgs': {
                        'license': False,
                        'rmsd': '',
                        'qh_filename': 'qh.tre',
                        'qr_filename': 'qr.out',
                        'compressed_pdbs': '',
                        'localRun': False,
                        'execPath': ''
                    }
                },
                name='TrajQR_kryptonite_nbcr_net',
                library=wslib)
            self.macroNetwork.addNode(TrajQR_kryptonite_nbcr_net_4, 279, 135)
            apply(
                TrajQR_kryptonite_nbcr_net_4.inputPortByName['license'].
                configure, (), {'defaultValue': None})
            apply(
                TrajQR_kryptonite_nbcr_net_4.inputPortByName['rmsd'].configure,
                (), {
                    'defaultValue': None,
                    'required': True
                })
            apply(
                TrajQR_kryptonite_nbcr_net_4.inputPortByName['qh_filename'].
                configure, (), {'defaultValue': None})
            apply(
                TrajQR_kryptonite_nbcr_net_4.inputPortByName['qr_filename'].
                configure, (), {'defaultValue': None})
            apply(
                TrajQR_kryptonite_nbcr_net_4.
                inputPortByName['compressed_pdbs'].configure, (), {
                    'defaultValue': None,
                    'required': True
                })
            apply(
                TrajQR_kryptonite_nbcr_net_4.inputPortByName['localRun'].
                configure, (), {'defaultValue': None})
            apply(
                TrajQR_kryptonite_nbcr_net_4.inputPortByName['execPath'].
                configure, (), {'defaultValue': None})
            TrajQR_kryptonite_nbcr_net_4.inputPortByName['license'].widget.set(
                0, run=False)
            TrajQR_kryptonite_nbcr_net_4.inputPortByName['rmsd'].rebindWidget()
            TrajQR_kryptonite_nbcr_net_4.inputPortByName['rmsd'].widget.set(
                r"", run=False)
            TrajQR_kryptonite_nbcr_net_4.inputPortByName['rmsd'].unbindWidget()
            TrajQR_kryptonite_nbcr_net_4.inputPortByName[
                'qh_filename'].widget.set(r"qh.tre", run=False)
            TrajQR_kryptonite_nbcr_net_4.inputPortByName[
                'qr_filename'].widget.set(r"qr.out", run=False)
            TrajQR_kryptonite_nbcr_net_4.inputPortByName[
                'compressed_pdbs'].rebindWidget()
            TrajQR_kryptonite_nbcr_net_4.inputPortByName[
                'compressed_pdbs'].widget.set(r"", run=False)
            TrajQR_kryptonite_nbcr_net_4.inputPortByName[
                'compressed_pdbs'].unbindWidget()
            TrajQR_kryptonite_nbcr_net_4.inputPortByName[
                'localRun'].widget.set(0, run=False)
            TrajQR_kryptonite_nbcr_net_4.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            apply(TrajQR_kryptonite_nbcr_net_4.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore FunctionNode named TrajQR_kryptonite_nbcr_net in network self.macroNetwork"
            print_exc()
            TrajQR_kryptonite_nbcr_net_4 = None

        try:
            ## saving node SelectOnExtension ##
            from Vision.StandardNodes import SelectOnExtension
            SelectOnExtension_5 = SelectOnExtension(constrkw={},
                                                    name='SelectOnExtension',
                                                    library=stdlib)
            self.macroNetwork.addNode(SelectOnExtension_5, 279, 192)
            apply(SelectOnExtension_5.inputPortByName['filenames'].configure,
                  (), {'defaultValue': None})
            apply(SelectOnExtension_5.inputPortByName['extension'].configure,
                  (), {'defaultValue': None})
            SelectOnExtension_5.inputPortByName['extension'].widget.set(
                r".out", run=False)
            apply(SelectOnExtension_5.configure, (),
                  {'paramPanelImmediate': 1})
        except:
            print "WARNING: failed to restore SelectOnExtension named SelectOnExtension in network self.macroNetwork"
            print_exc()
            SelectOnExtension_5 = None

        try:
            ## saving node Index ##
            from Vision.StandardNodes import Index
            Index_6 = Index(constrkw={}, name='Index', library=stdlib)
            self.macroNetwork.addNode(Index_6, 123, 281)
            apply(
                Index_6.inputPortByName['data'].configure, (), {
                    'datatype': 'list',
                    'defaultValue': None,
                    'originalDatatype': 'None'
                })
            apply(Index_6.inputPortByName['index'].configure, (),
                  {'defaultValue': None})
            apply(Index_6.outputPortByName['data'].configure, (),
                  {'datatype': 'string'})
            apply(Index_6.inputPortByName['index'].widget.configure, (), {
                'max': 0,
                'min': -1
            })
            Index_6.inputPortByName['index'].widget.set(0, run=False)
            apply(Index_6.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore Index named Index in network self.macroNetwork"
            print_exc()
            Index_6 = None

        try:
            ## saving node GetSelectedPDBs ##
            from Vision.StandardNodes import Generic
            GetSelectedPDBs_7 = Generic(constrkw={},
                                        name='GetSelectedPDBs',
                                        library=stdlib)
            self.macroNetwork.addNode(GetSelectedPDBs_7, 200, 346)
            apply(
                GetSelectedPDBs_7.addInputPort, (), {
                    'singleConnection': True,
                    'name': 'trajqr_url',
                    'cast': True,
                    'datatype': 'string',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white',
                    'originalDatatype': 'None'
                })
            apply(
                GetSelectedPDBs_7.addInputPort, (), {
                    'singleConnection': True,
                    'name': 'pdb_in_dir',
                    'cast': True,
                    'datatype': 'string',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white',
                    'originalDatatype': 'None'
                })
            apply(
                GetSelectedPDBs_7.addInputPort, (), {
                    'singleConnection': True,
                    'name': 'pdb_out_dir',
                    'cast': True,
                    'datatype': 'string',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white',
                    'originalDatatype': 'None'
                })
            apply(
                GetSelectedPDBs_7.addOutputPort, (), {
                    'name': 'pdb_out_dir',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            code = """def doit(self, trajqr_url, pdb_in_dir, pdb_out_dir):
        pdb_in_dir = os.path.abspath(pdb_in_dir)
        pdb_out_dir = os.path.abspath(pdb_out_dir)
        import urllib
        import shutil
        pdb_list = []

        f = urllib.urlopen(trajqr_url)

        for i in f.readlines():
            pdb_file = i.strip('''
''')+'''.pdb'''
            infile = pdb_in_dir + os.sep + pdb_file
            outfile = pdb_out_dir + os.sep + pdb_file
            shutil.copyfile(infile, outfile)
        
        f.close
	pass
## to ouput data on port pdb_list use
        self.outputData(pdb_out_dir=pdb_out_dir)


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

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

        ## saving connections for network TrajQR ##
        input_Ports_1 = self.macroNetwork.ipNode
        if input_Ports_1 is not None and Make_Zip_File_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    Make_Zip_File_3,
                    "new",
                    "input_directory",
                    blocking=True,
                    splitratio=[0.67469172328672133, 0.50941480178765064])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and Make_Zip_File_3 in network self.macroNetwork"
        if input_Ports_1 is not None and TrajQR_kryptonite_nbcr_net_4 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    TrajQR_kryptonite_nbcr_net_4,
                    "new",
                    "rmsd",
                    blocking=True,
                    splitratio=[0.45681934134493246, 0.33803410340720857])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and TrajQR_kryptonite_nbcr_net_4 in network self.macroNetwork"
        if Make_Zip_File_3 is not None and TrajQR_kryptonite_nbcr_net_4 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Make_Zip_File_3,
                    TrajQR_kryptonite_nbcr_net_4,
                    "zipfile",
                    "compressed_pdbs",
                    blocking=True,
                    splitratio=[0.71081093868178202, 0.43908686250860129])
            except:
                print "WARNING: failed to restore connection between Make_Zip_File_3 and TrajQR_kryptonite_nbcr_net_4 in network self.macroNetwork"
        if TrajQR_kryptonite_nbcr_net_4 is not None and SelectOnExtension_5 is not None:
            try:
                self.macroNetwork.connectNodes(
                    TrajQR_kryptonite_nbcr_net_4,
                    SelectOnExtension_5,
                    "result",
                    "filenames",
                    blocking=True,
                    splitratio=[0.63533198718963335, 0.2560040659014205])
            except:
                print "WARNING: failed to restore connection between TrajQR_kryptonite_nbcr_net_4 and SelectOnExtension_5 in network self.macroNetwork"
        if SelectOnExtension_5 is not None and Index_6 is not None:
            try:
                self.macroNetwork.connectNodes(
                    SelectOnExtension_5,
                    Index_6,
                    "matching",
                    "data",
                    blocking=True,
                    splitratio=[0.65832290589891362, 0.21624347250969889])
            except:
                print "WARNING: failed to restore connection between SelectOnExtension_5 and Index_6 in network self.macroNetwork"
        if Index_6 is not None and GetSelectedPDBs_7 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Index_6,
                    GetSelectedPDBs_7,
                    "data",
                    "trajqr_url",
                    blocking=True,
                    splitratio=[0.51754619993986595, 0.63949220525823236])
            except:
                print "WARNING: failed to restore connection between Index_6 and GetSelectedPDBs_7 in network self.macroNetwork"
        if input_Ports_1 is not None and GetSelectedPDBs_7 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    GetSelectedPDBs_7,
                    "Make_Zip_File_input_directory",
                    "pdb_in_dir",
                    blocking=True,
                    splitratio=[0.7121964126696847, 0.42697952864467786])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and GetSelectedPDBs_7 in network self.macroNetwork"
        if input_Ports_1 is not None and GetSelectedPDBs_7 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    GetSelectedPDBs_7,
                    "new",
                    "pdb_out_dir",
                    blocking=True,
                    splitratio=[0.62460995639428174, 0.60275185701976297])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and GetSelectedPDBs_7 in network self.macroNetwork"
        output_Ports_2 = self.macroNetwork.opNode
        if GetSelectedPDBs_7 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetSelectedPDBs_7,
                    output_Ports_2,
                    "pdb_out_dir",
                    "new",
                    blocking=True,
                    splitratio=[0.7431176169343523, 0.73697976585137526])
            except:
                print "WARNING: failed to restore connection between GetSelectedPDBs_7 and output_Ports_2 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='Make_Zip_File_input_directory')
        input_Ports_1.outputPorts[2].configure(
            name='TrajQR_kryptonite_nbcr_net_rmsd')
        input_Ports_1.outputPorts[3].configure(
            name='GetSelectedPDBs_pdb_out_dir')

        ## 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='GetSelectedPDBs_pdb_out_dir')
        ## configure MacroNode input ports
        TrajQR_0.inputPorts[0].configure(name='Make_Zip_File_input_directory')
        TrajQR_0.inputPorts[0].configure(datatype='string')
        TrajQR_0.inputPorts[1].configure(
            name='TrajQR_kryptonite_nbcr_net_rmsd')
        TrajQR_0.inputPorts[1].configure(datatype='string')
        TrajQR_0.inputPorts[2].configure(name='GetSelectedPDBs_pdb_out_dir')
        TrajQR_0.inputPorts[2].configure(datatype='string')
        ## configure MacroNode output ports
        TrajQR_0.outputPorts[0].configure(name='GetSelectedPDBs_pdb_out_dir')
        TrajQR_0.outputPorts[0].configure(datatype='string')

        TrajQR_0.shrink()

        ## reset modifications ##
        TrajQR_0.resetTags()
        TrajQR_0.buildOriginalList()
Esempio n. 17
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. 18
0
 def __init__(self, constrkw={}, name='PrepareSingleLigand', **kw):
     kw['name'] = name
     MacroNode.__init__(*(self, ), **kw)
Esempio n. 19
0
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        AD3Gpf_15 = self
        from traceback import print_exc

        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        self.macroNetwork.getEditor().addLibraryInstance(
            adtlib, "AutoDockTools.VisionInterface.AdtNodes", "adtlib")

        from MolKit.VisionInterface.MolKitNodes import molkitlib
        self.macroNetwork.getEditor().addLibraryInstance(
            molkitlib, "MolKit.VisionInterface.MolKitNodes", "molkitlib")

        from Vision.StandardNodes import stdlib
        self.macroNetwork.getEditor().addLibraryInstance(
            stdlib, "Vision.StandardNodes", "stdlib")

        try:
            ## saving node input Ports ##
            input_Ports_16 = self.macroNetwork.ipNode
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_16 = None

        try:
            ## saving node output Ports ##
            output_Ports_17 = self.macroNetwork.opNode
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_17 = None

        try:
            ## saving node Grid Parameter File Browser ##
            from AutoDockTools.VisionInterface.AdtNodes import GridParameterFileBrowserNE
            Grid_Parameter_File_Browser_18 = GridParameterFileBrowserNE(
                constrkw={},
                name='Grid Parameter File Browser',
                library=adtlib)
            self.macroNetwork.addNode(Grid_Parameter_File_Browser_18, 310, 99)
            apply(
                Grid_Parameter_File_Browser_18.inputPortByName['filename'].
                configure, (), {
                    'color': 'white',
                    'cast': True,
                    'shape': 'oval'
                })
            apply(
                Grid_Parameter_File_Browser_18.outputPortByName['filename'].
                configure, (), {
                    'color': 'white',
                    'shape': 'oval'
                })
            Grid_Parameter_File_Browser_18.inputPortByName[
                'filename'].widget.set("/mgl/work4/rhuey/dev23/fri2.gpf",
                                       run=False)
        except:
            print "WARNING: failed to restore GridParameterFileBrowserNE named Grid Parameter File Browser in network self.macroNetwork"
            print_exc()
            Grid_Parameter_File_Browser_18 = None

        try:
            ## saving node Read Molecule ##
            from MolKit.VisionInterface.MolKitNodes import ReadMolecule
            Read_Molecule_19 = ReadMolecule(constrkw={},
                                            name='Read Molecule',
                                            library=molkitlib)
            self.macroNetwork.addNode(Read_Molecule_19, 156, 96)
            apply(Read_Molecule_19.inputPortByName['filename'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'oval'
            })
            apply(Read_Molecule_19.outputPortByName['MolSets'].configure, (), {
                'color': '#c64e70',
                'shape': 'oval'
            })
        except:
            print "WARNING: failed to restore ReadMolecule named Read Molecule in network self.macroNetwork"
            print_exc()
            Read_Molecule_19 = None

        try:
            ## saving node Read Molecule ##
            from MolKit.VisionInterface.MolKitNodes import ReadMolecule
            Read_Molecule_20 = ReadMolecule(constrkw={},
                                            name='Read Molecule',
                                            library=molkitlib)
            self.macroNetwork.addNode(Read_Molecule_20, 234, 98)
            apply(Read_Molecule_20.inputPortByName['filename'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'oval'
            })
            apply(Read_Molecule_20.outputPortByName['MolSets'].configure, (), {
                'color': '#c64e70',
                'shape': 'oval'
            })
        except:
            print "WARNING: failed to restore ReadMolecule named Read Molecule in network self.macroNetwork"
            print_exc()
            Read_Molecule_20 = None

        try:
            ## saving node File Browser ##
            from Vision.StandardNodes import FileBrowserNE
            File_Browser_21 = FileBrowserNE(constrkw={},
                                            name='File Browser',
                                            library=stdlib)
            self.macroNetwork.addNode(File_Browser_21, 332, 163)
            apply(File_Browser_21.inputPortByName['filename'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'oval'
            })
            apply(File_Browser_21.outputPortByName['filename'].configure, (), {
                'color': 'white',
                'shape': 'oval'
            })
        except:
            print "WARNING: failed to restore FileBrowserNE named File Browser in network self.macroNetwork"
            print_exc()
            File_Browser_21 = None

        try:
            ## saving node Prepare AD3Gpf ##
            from AutoDockTools.VisionInterface.AdtNodes import AdtPrepareGpf3
            Prepare_AD3Gpf_22 = AdtPrepareGpf3(constrkw={},
                                               name='Prepare AD3Gpf',
                                               library=adtlib)
            self.macroNetwork.addNode(Prepare_AD3Gpf_22, 217, 216)
            apply(
                Prepare_AD3Gpf_22.inputPortByName['ligand_filename'].configure,
                (), {
                    'color': 'white',
                    'cast': True,
                    'shape': 'oval'
                })
            apply(
                Prepare_AD3Gpf_22.inputPortByName['receptor_filename'].
                configure, (), {
                    'color': 'white',
                    'cast': True,
                    'shape': 'oval'
                })
            apply(Prepare_AD3Gpf_22.inputPortByName['gpf_filename'].configure,
                  (), {
                      'color': 'white',
                      'cast': True,
                      'shape': 'oval'
                  })
            apply(Prepare_AD3Gpf_22.inputPortByName['parameters'].configure,
                  (), {
                      'color': 'cyan',
                      'cast': True,
                      'shape': 'oval'
                  })
            apply(
                Prepare_AD3Gpf_22.inputPortByName['outputfilename'].configure,
                (), {
                    'color': 'white',
                    'cast': True,
                    'shape': 'oval'
                })
            apply(
                Prepare_AD3Gpf_22.outputPortByName['ag3_parameter_file'].
                configure, (), {
                    'color': 'white',
                    'shape': 'oval'
                })
        except:
            print "WARNING: failed to restore AdtPrepareGpf3 named Prepare AD3Gpf in network self.macroNetwork"
            print_exc()
            Prepare_AD3Gpf_22 = None

        self.macroNetwork.freeze()

        ## saving connections for network AD3Gpf ##
        if Read_Molecule_19 is not None and Prepare_AD3Gpf_22 is not None:
            try:
                self.macroNetwork.connectNodes(Read_Molecule_19,
                                               Prepare_AD3Gpf_22,
                                               "MolSets",
                                               "ligand_filename",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Read_Molecule_19 and Prepare_AD3Gpf_22 in network self.macroNetwork"
        if Read_Molecule_20 is not None and Prepare_AD3Gpf_22 is not None:
            try:
                self.macroNetwork.connectNodes(Read_Molecule_20,
                                               Prepare_AD3Gpf_22,
                                               "MolSets",
                                               "receptor_filename",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Read_Molecule_20 and Prepare_AD3Gpf_22 in network self.macroNetwork"
        if Grid_Parameter_File_Browser_18 is not None and Prepare_AD3Gpf_22 is not None:
            try:
                self.macroNetwork.connectNodes(Grid_Parameter_File_Browser_18,
                                               Prepare_AD3Gpf_22,
                                               "filename",
                                               "gpf_filename",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Grid_Parameter_File_Browser_18 and Prepare_AD3Gpf_22 in network self.macroNetwork"
        if File_Browser_21 is not None and Prepare_AD3Gpf_22 is not None:
            try:
                self.macroNetwork.connectNodes(File_Browser_21,
                                               Prepare_AD3Gpf_22,
                                               "filename",
                                               "outputfilename",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between File_Browser_21 and Prepare_AD3Gpf_22 in network self.macroNetwork"
        output_Ports_17 = self.macroNetwork.opNode
        if Prepare_AD3Gpf_22 is not None and output_Ports_17 is not None:
            try:
                self.macroNetwork.connectNodes(Prepare_AD3Gpf_22,
                                               output_Ports_17,
                                               "ag3_parameter_file",
                                               "new",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Prepare_AD3Gpf_22 and output_Ports_17 in network self.macroNetwork"
        self.macroNetwork.unfreeze()

        AD3Gpf_15.shrink()

        ## reset modifications ##
        AD3Gpf_15.resetTags()
        AD3Gpf_15.buildOriginalList()
Esempio n. 20
0
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        AD3Dpf_6 = self
        from traceback import print_exc

        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        self.macroNetwork.getEditor().addLibraryInstance(
            adtlib, "AutoDockTools.VisionInterface.AdtNodes", "adtlib")

        from MolKit.VisionInterface.MolKitNodes import molkitlib
        self.macroNetwork.getEditor().addLibraryInstance(
            molkitlib, "MolKit.VisionInterface.MolKitNodes", "molkitlib")

        from Vision.StandardNodes import stdlib
        self.macroNetwork.getEditor().addLibraryInstance(
            stdlib, "Vision.StandardNodes", "stdlib")

        try:
            ## saving node input Ports ##
            input_Ports_7 = self.macroNetwork.ipNode
            input_Ports_7.move(158, 4)
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_7 = None

        try:
            ## saving node output Ports ##
            output_Ports_8 = self.macroNetwork.opNode
            output_Ports_8.move(172, 322)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_8 = None

        try:
            ## saving node Docking Parameter File Browser ##
            from AutoDockTools.VisionInterface.AdtNodes import DockingParameterFileBrowserNE
            Docking_Parameter_File_Browser_9 = DockingParameterFileBrowserNE(
                constrkw={},
                name='Docking Parameter File Browser',
                library=adtlib)
            self.macroNetwork.addNode(Docking_Parameter_File_Browser_9, 204,
                                      93)
            apply(
                Docking_Parameter_File_Browser_9.inputPortByName['filename'].
                configure, (), {
                    'color': 'white',
                    'cast': True,
                    'shape': 'oval'
                })
            apply(
                Docking_Parameter_File_Browser_9.outputPortByName['filename'].
                configure, (), {
                    'color': 'white',
                    'shape': 'oval'
                })
            Docking_Parameter_File_Browser_9.inputPortByName[
                'filename'].widget.set("/mgl/work4/rhuey/dev23/NEWTEST.dpf",
                                       run=False)
        except:
            print "WARNING: failed to restore DockingParameterFileBrowserNE named Docking Parameter File Browser in network self.macroNetwork"
            print_exc()
            Docking_Parameter_File_Browser_9 = None

        try:
            ## saving node Prepare AD3Dpf ##
            from AutoDockTools.VisionInterface.AdtNodes import AdtPrepareDpf3
            Prepare_AD3Dpf_10 = AdtPrepareDpf3(constrkw={},
                                               name='Prepare AD3Dpf',
                                               library=adtlib)
            self.macroNetwork.addNode(Prepare_AD3Dpf_10, 170, 266)
            apply(
                Prepare_AD3Dpf_10.inputPortByName['ligand_filename'].configure,
                (), {
                    'color': 'white',
                    'cast': True,
                    'shape': 'oval'
                })
            apply(
                Prepare_AD3Dpf_10.inputPortByName['receptor_filename'].
                configure, (), {
                    'color': 'white',
                    'cast': True,
                    'shape': 'oval'
                })
            apply(Prepare_AD3Dpf_10.inputPortByName['dpf_filename'].configure,
                  (), {
                      'color': 'white',
                      'cast': True,
                      'shape': 'oval'
                  })
            apply(Prepare_AD3Dpf_10.inputPortByName['parameters'].configure,
                  (), {
                      'color': 'cyan',
                      'cast': True,
                      'shape': 'oval'
                  })
            apply(
                Prepare_AD3Dpf_10.inputPortByName['outputfilename'].configure,
                (), {
                    'color': 'white',
                    'cast': True,
                    'shape': 'oval'
                })
            apply(
                Prepare_AD3Dpf_10.outputPortByName['ad3_parameter_file'].
                configure, (), {
                    'color': 'white',
                    'shape': 'oval'
                })
        except:
            print "WARNING: failed to restore AdtPrepareDpf3 named Prepare AD3Dpf in network self.macroNetwork"
            print_exc()
            Prepare_AD3Dpf_10 = None

        try:
            ## saving node Read Molecule ##
            from MolKit.VisionInterface.MolKitNodes import ReadMolecule
            Read_Molecule_11 = ReadMolecule(constrkw={},
                                            name='Read Molecule',
                                            library=molkitlib)
            self.macroNetwork.addNode(Read_Molecule_11, 94, 51)
            apply(Read_Molecule_11.inputPortByName['filename'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'oval'
            })
            apply(Read_Molecule_11.outputPortByName['MolSets'].configure, (), {
                'color': '#c64e70',
                'shape': 'oval'
            })
        except:
            print "WARNING: failed to restore ReadMolecule named Read Molecule in network self.macroNetwork"
            print_exc()
            Read_Molecule_11 = None

        try:
            ## saving node Read Molecule ##
            from MolKit.VisionInterface.MolKitNodes import ReadMolecule
            Read_Molecule_12 = ReadMolecule(constrkw={},
                                            name='Read Molecule',
                                            library=molkitlib)
            self.macroNetwork.addNode(Read_Molecule_12, 187, 47)
            apply(Read_Molecule_12.inputPortByName['filename'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'oval'
            })
            apply(Read_Molecule_12.outputPortByName['MolSets'].configure, (), {
                'color': '#c64e70',
                'shape': 'oval'
            })
        except:
            print "WARNING: failed to restore ReadMolecule named Read Molecule in network self.macroNetwork"
            print_exc()
            Read_Molecule_12 = None

        try:
            ## saving node File Browser ##
            from Vision.StandardNodes import FileBrowserNE
            File_Browser_13 = FileBrowserNE(constrkw={},
                                            name='File Browser',
                                            library=stdlib)
            self.macroNetwork.addNode(File_Browser_13, 286, 143)
            apply(File_Browser_13.inputPortByName['filename'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'oval'
            })
            apply(File_Browser_13.outputPortByName['filename'].configure, (), {
                'color': 'white',
                'shape': 'oval'
            })
        except:
            print "WARNING: failed to restore FileBrowserNE named File Browser in network self.macroNetwork"
            print_exc()
            File_Browser_13 = None

        self.macroNetwork.freeze()

        ## saving connections for network AD3Dpf ##
        if Docking_Parameter_File_Browser_9 is not None and Prepare_AD3Dpf_10 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Docking_Parameter_File_Browser_9,
                    Prepare_AD3Dpf_10,
                    "filename",
                    "dpf_filename",
                    blocking=True)
            except:
                print "WARNING: failed to restore connection between Docking_Parameter_File_Browser_9 and Prepare_AD3Dpf_10 in network self.macroNetwork"
        if Read_Molecule_11 is not None and Prepare_AD3Dpf_10 is not None:
            try:
                self.macroNetwork.connectNodes(Read_Molecule_11,
                                               Prepare_AD3Dpf_10,
                                               "MolSets",
                                               "ligand_filename",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Read_Molecule_11 and Prepare_AD3Dpf_10 in network self.macroNetwork"
        if Read_Molecule_12 is not None and Prepare_AD3Dpf_10 is not None:
            try:
                self.macroNetwork.connectNodes(Read_Molecule_12,
                                               Prepare_AD3Dpf_10,
                                               "MolSets",
                                               "receptor_filename",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Read_Molecule_12 and Prepare_AD3Dpf_10 in network self.macroNetwork"
        if File_Browser_13 is not None and Prepare_AD3Dpf_10 is not None:
            try:
                self.macroNetwork.connectNodes(File_Browser_13,
                                               Prepare_AD3Dpf_10,
                                               "filename",
                                               "outputfilename",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between File_Browser_13 and Prepare_AD3Dpf_10 in network self.macroNetwork"
        output_Ports_8 = self.macroNetwork.opNode
        if Prepare_AD3Dpf_10 is not None and output_Ports_8 is not None:
            try:
                self.macroNetwork.connectNodes(Prepare_AD3Dpf_10,
                                               output_Ports_8,
                                               "ad3_parameter_file",
                                               "new",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Prepare_AD3Dpf_10 and output_Ports_8 in network self.macroNetwork"
        self.macroNetwork.unfreeze()

        AD3Dpf_6.shrink()

        ## reset modifications ##
        AD3Dpf_6.resetTags()
        AD3Dpf_6.buildOriginalList()
Esempio n. 21
0
 def __init__(self, constrkw={}, name='AutodockVsCSF', **kw):
     kw['name'] = name
     MacroNode.__init__(*(self, ), **kw)
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        ## building macro network ##
        Prepare_AD4_Ligands_11 = self
        from traceback import print_exc

        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        self.macroNetwork.getEditor().addLibraryInstance(adtlib,"AutoDockTools.VisionInterface.AdtNodes", "adtlib")

        from MolKit.VisionInterface.MolKitNodes import molkitlib
        self.macroNetwork.getEditor().addLibraryInstance(molkitlib,"MolKit.VisionInterface.MolKitNodes", "molkitlib")

        try:
            ## saving node input Ports ##
            input_Ports_12 = self.macroNetwork.ipNode
        except:
            print("WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork")
            print_exc()
            input_Ports_12=None

        try:
            ## saving node output Ports ##
            output_Ports_13 = self.macroNetwork.opNode
        except:
            print("WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork")
            print_exc()
            output_Ports_13=None

        try:
            ## saving node Manage Rotatable Bonds ##
            from AutoDockTools.VisionInterface.AdtNodes import ManageRotatableBonds
            Manage_Rotatable_Bonds_23 = ManageRotatableBonds(constrkw = {}, name='Manage Rotatable Bonds', library=adtlib)
            self.macroNetwork.addNode(Manage_Rotatable_Bonds_23,217,143)
            Manage_Rotatable_Bonds_23.inputPortByName['mols'].configure(*(), **{'color': '#c64e70', 'cast': True, 'shape': 'oval'})
            Manage_Rotatable_Bonds_23.inputPortByName['root'].configure(*(), **{'color': 'white', 'cast': True, 'shape': 'oval'})
            Manage_Rotatable_Bonds_23.inputPortByName['allowed_bonds'].configure(*(), **{'color': 'white', 'cast': True, 'shape': 'oval'})
            Manage_Rotatable_Bonds_23.inputPortByName['check_for_fragments'].configure(*(), **{'color': 'yellow', 'cast': True, 'shape': 'circle'})
            Manage_Rotatable_Bonds_23.inputPortByName['bonds_to_inactivate'].configure(*(), **{'color': 'white', 'cast': True, 'shape': 'oval'})
            Manage_Rotatable_Bonds_23.inputPortByName['limit_torsions'].configure(*(), **{'color': 'white', 'cast': True, 'shape': 'oval'})
            Manage_Rotatable_Bonds_23.outputPortByName['mols'].configure(*(), **{'color': '#c64e70', 'shape': 'oval'})
        except:
            print("WARNING: failed to restore ManageRotatableBonds named Manage Rotatable Bonds in network self.macroNetwork")
            print_exc()
            Manage_Rotatable_Bonds_23=None

        try:
            ## saving node Prepare AD4Molecule ##
            from AutoDockTools.VisionInterface.PrepareAD4Molecule import PrepareAD4Molecule
            Prepare_AD4Molecule_24 = PrepareAD4Molecule(constrkw = {}, name='Prepare AD4Molecule', library=adtlib)
            self.macroNetwork.addNode(Prepare_AD4Molecule_24,217,90)

            ## saving connections for network Prepare AD4Molecule ##
            Prepare_AD4Molecule_24.macroNetwork.freeze()
            Prepare_AD4Molecule_24.macroNetwork.unfreeze()
            Prepare_AD4Molecule_24.shrink()
        except:
            print("WARNING: failed to restore PrepareAD4Molecule named Prepare AD4Molecule in network self.macroNetwork")
            print_exc()
            Prepare_AD4Molecule_24=None

        self.macroNetwork.freeze()

        ## saving connections for network Prepare AD4 Ligands ##
        output_Ports_13 = self.macroNetwork.opNode
        if Manage_Rotatable_Bonds_23 is not None and output_Ports_13 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Manage_Rotatable_Bonds_23, output_Ports_13, "mols", "new", blocking=True)
            except:
                print("WARNING: failed to restore connection between Manage_Rotatable_Bonds_23 and output_Ports_13 in network self.macroNetwork")
        input_Ports_12 = self.macroNetwork.ipNode
        if input_Ports_12 is not None and Prepare_AD4Molecule_24 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_12, Prepare_AD4Molecule_24, "new", "Remove Water Residues_molecules", blocking=True)
            except:
                print("WARNING: failed to restore connection between input_Ports_12 and Prepare_AD4Molecule_24 in network self.macroNetwork")
        if Prepare_AD4Molecule_24 is not None and Manage_Rotatable_Bonds_23 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Prepare_AD4Molecule_24, Manage_Rotatable_Bonds_23, "AD4_typer_typed_mols", "mols", blocking=True)
            except:
                print("WARNING: failed to restore connection between Prepare_AD4Molecule_24 and Manage_Rotatable_Bonds_23 in network self.macroNetwork")
        self.macroNetwork.unfreeze()

        Prepare_AD4_Ligands_11.shrink()

        ## reset modifications ##
        Prepare_AD4_Ligands_11.resetTags()
        Prepare_AD4_Ligands_11.buildOriginalList()
Esempio n. 23
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 ##
        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
            apply(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
            apply(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)
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['num_modes'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['energy_range'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['seed'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['receptor'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['size_y'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['size_z'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['out'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['log'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['urllib'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['exhaustiveness'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['localRun'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['flex'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['center_z'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['center_x'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['center_y'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['userlib'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['size_x'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['config'].configure, (), {'defaultValue': None, 'required': True})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['filter'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['ligand_db'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['cpu'].configure, (), {'defaultValue': None})
            apply(AutodockVina_Screening_kryptonite_nbcr_net_33.inputPortByName['execPath'].configure, (), {'defaultValue': None})
            apply(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)
            apply(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()
            apply(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()
            apply(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)
            apply(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)
            apply(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)
            apply(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'})
            apply(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'})
            apply(PrepareVinaInputs_34.addOutputPort, (), {'name': 'receptor_file', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            apply(PrepareVinaInputs_34.addOutputPort, (), {'name': 'ligand_lib', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            apply(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)
            apply(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)
            apply(GetMainURLFromList_35.inputPortByName['urls'].configure, (), {'defaultValue': None})
            apply(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()
    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 __init__(self, constrkw={}, name='GromosCluster', **kw):
     kw['name'] = name
     MacroNode.__init__(*(self, ), **kw)
Esempio n. 26
0
try:
    ## saving node iterate ##
    from Vision.StandardNodes import Iterate
    iterate_4 = Iterate(constrkw={}, name='iterate', library=stdlib)
    masterNet.addNode(iterate_4, 30, 169)
    iterate_4.inputPortByName['stopOnFailure'].widget.set(1, run=False)
    apply(iterate_4.configure, (), {'paramPanelImmediate': 1})
except:
    print "WARNING: failed to restore Iterate named iterate in network masterNet"
    print_exc()
    iterate_4 = None

try:
    ## saving node SaveNAMDResults ##
    from NetworkEditor.macros import MacroNode
    SaveNAMDResults_5 = MacroNode(name='SaveNAMDResults')
    masterNet.addNode(SaveNAMDResults_5, 455, 392)
    output_Ports_7 = SaveNAMDResults_5.macroNetwork.opNode
    apply(output_Ports_7.configure, (), {
        'paramPanelImmediate': 1,
        'expanded': False
    })
    output_Ports_7.move(130, 477)
    from Vision.StandardNodes import Generic
    GetOutURLs_8 = Generic(constrkw={}, name='GetOutURLs', library=stdlib)
    SaveNAMDResults_5.macroNetwork.addNode(GetOutURLs_8, 118, 98)
    apply(
        GetOutURLs_8.addInputPort, (), {
            'singleConnection': True,
            'name': 'filename',
            'cast': True,
Esempio n. 27
0
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from MyDefaultLib import mydefaultlib
        ## building macro network ##
        sampleChirp_1 = self
        from traceback import print_exc
        ## loading libraries ##
        from MyDefaultLib import mydefaultlib
        self.macroNetwork.getEditor().addLibraryInstance(mydefaultlib,"MyDefaultLib", "mydefaultlib")

        try:
            ## saving node input Ports ##
            input_Ports_2 = self.macroNetwork.ipNode
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_2=None

        try:
            ## saving node output Ports ##
            output_Ports_3 = self.macroNetwork.opNode
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_3=None

        try:
            ## saving node linearChirp ##
            from MyDefaultLib.signal.linearChirp import linearChirp
            linearChirp_4 = linearChirp(constrkw = {}, name='linearChirp', library=mydefaultlib)
            self.macroNetwork.addNode(linearChirp_4,206,166)
            apply(linearChirp_4.inputPortByName['time'].configure, (), {'color': 'green'})
            apply(linearChirp_4.outputPortByName['y'].configure, (), {'color': 'green'})
            linearChirp_4.inputPortByName['chirpSlope'].unbindWidget()
            apply(linearChirp_4.configure, (), {'expanded': True})
        except:
            print "WARNING: failed to restore linearChirp named linearChirp in network self.macroNetwork"
            print_exc()
            linearChirp_4=None

        try:
            ## saving node timeRange ##
            from MyDefaultLib.signal.timeRange import timeRange
            timeRange_5 = timeRange(constrkw = {}, name='timeRange', library=mydefaultlib)
            self.macroNetwork.addNode(timeRange_5,195,95)
            apply(timeRange_5.outputPortByName['out0'].configure, (), {'color': 'green'})
            apply(timeRange_5.outputPortByName['fs'].configure, (), {'color': 'green'})
            timeRange_5.inputPortByName['fs'].unbindWidget()
        except:
            print "WARNING: failed to restore timeRange named timeRange in network self.macroNetwork"
            print_exc()
            timeRange_5=None

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

        ## saving connections for network sampleChirp ##
        if timeRange_5 is not None and linearChirp_4 is not None:
            try:
                self.macroNetwork.connectNodes(
                    timeRange_5, linearChirp_4, "out0", "time", blocking=True)
            except:
                print "WARNING: failed to restore connection between timeRange_5 and linearChirp_4 in network self.macroNetwork"
        output_Ports_3 = self.macroNetwork.opNode
        if linearChirp_4 is not None and output_Ports_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    linearChirp_4, output_Ports_3, "y", "new", blocking=True)
            except:
                print "WARNING: failed to restore connection between linearChirp_4 and output_Ports_3 in network self.macroNetwork"
        input_Ports_2 = self.macroNetwork.ipNode
        if input_Ports_2 is not None and timeRange_5 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_2, timeRange_5, "new", "fs", blocking=True)
            except:
                print "WARNING: failed to restore connection between input_Ports_2 and timeRange_5 in network self.macroNetwork"
        if input_Ports_2 is not None and linearChirp_4 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_2, linearChirp_4, "new", "chirpSlope", blocking=True)
            except:
                print "WARNING: failed to restore connection between input_Ports_2 and linearChirp_4 in network self.macroNetwork"
        self.macroNetwork.unfreeze()

#self.macroNetwork.run()

        #apply(sampleChirp_1.inputPortByName['linearChirp_chirpSlope'].createWidget, (), {'descr':{'initialValue': 0.0, 'labelGridCfg': {'column': 0, 'row': 0}, 'master': 'ParamPanel', 'widgetGridCfg': {'column': 1, 'labelSide': 'left', 'row': 0}, 'labelCfg': {'text': 'chirpSlope'}, 'class': 'NEThumbWheel', 'oneTurn': 10.0}})

        sampleChirp_1.shrink()

        ## reset modifications ##
        sampleChirp_1.resetTags()
        sampleChirp_1.buildOriginalList()
            self.outputData(selection=data)



"""
    ReceptorList_30.configure(function=code)
    apply(ReceptorList_30.configure, (), {'paramPanelImmediate': 1})
except:
    print "WARNING: failed to restore ScrolledListNE named ReceptorList in network masterNet"
    print_exc()
    ReceptorList_30=None

try:
    ## saving node LoadMolecule ##
    from NetworkEditor.macros import MacroNode
    LoadMolecule_31 = MacroNode(name='LoadMolecule')
    masterNet.addNode(LoadMolecule_31, 186, 608)
    output_Ports_33 = LoadMolecule_31.macroNetwork.opNode
    apply(output_Ports_33.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
    from Vision.StandardNodes import Generic
    getMolePath_34 = Generic(constrkw={}, name='getMolePath', library=stdlib)
    LoadMolecule_31.macroNetwork.addNode(getMolePath_34,217,82)
    apply(getMolePath_34.addInputPort, (), {'singleConnection': True, 'name': 'mol', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
    apply(getMolePath_34.addInputPort, (), {'singleConnection': True, 'name': 'mol_paths', 'cast': True, 'datatype': 'list', 'defaultValue': None, 'required': True, 'height': 12, 'width': 12, 'shape': 'oval', 'color': 'cyan', 'originalDatatype': 'None'})
    apply(getMolePath_34.addOutputPort, (), {'name': 'mol_path', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
    code = """def doit(self, mol, mol_paths):
    if len(mol_paths) == 1:
        self.outputData(mol_path=mol_paths[0])

    for i in mol_paths:
        if os.path.basename(i) == mol:
Esempio n. 29
0
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from Volume.VisionInterface.VolumeNodes import vollib
        from Vision.StandardNodes import stdlib
        from DejaVu.VisionInterface.DejaVuNodes import vizlib
        ## building macro network ##
        Map_Pot_On_Geom_0 = self
        from traceback import print_exc

        ## loading libraries ##
        from Volume.VisionInterface.VolumeNodes import vollib
        self.macroNetwork.getEditor().addLibraryInstance(
            vollib, "Volume.VisionInterface.VolumeNodes", "vollib")

        from Vision.StandardNodes import stdlib
        self.macroNetwork.getEditor().addLibraryInstance(
            stdlib, "Vision.StandardNodes", "stdlib")

        from DejaVu.VisionInterface.DejaVuNodes import vizlib
        self.macroNetwork.getEditor().addLibraryInstance(
            vizlib, "DejaVu.VisionInterface.DejaVuNodes", "vizlib")

        try:

            ## saving node input Ports ##
            input_Ports_1 = self.macroNetwork.ipNode
        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
            output_Ports_2.move(230, 578)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_2 = None
        try:

            ## saving node getSurfaceVFN ##
            from DejaVu.VisionInterface.DejaVuNodes import getSurfaceVFN
            getSurfaceVFN_3 = getSurfaceVFN(constrkw={},
                                            name='getSurfaceVFN',
                                            library=vizlib)
            self.macroNetwork.addNode(getSurfaceVFN_3, 55, 83)
            apply(getSurfaceVFN_3.inputPortByName['geometry'].configure, (), {
                'color': 'red',
                'cast': True,
                'shape': 'rect'
            })
            apply(getSurfaceVFN_3.outputPortByName['geom'].configure, (), {
                'color': 'red',
                'shape': 'rect'
            })
            apply(getSurfaceVFN_3.outputPortByName['vertices'].configure, (), {
                'color': 'green',
                'shape': 'rect'
            })
            apply(getSurfaceVFN_3.outputPortByName['faces'].configure, (), {
                'color': 'purple',
                'shape': 'rect'
            })
            apply(getSurfaceVFN_3.outputPortByName['normals'].configure, (), {
                'color': 'blue',
                'shape': 'rect'
            })
        except:
            print "WARNING: failed to restore getSurfaceVFN named getSurfaceVFN in network self.macroNetwork"
            print_exc()
            getSurfaceVFN_3 = None
        try:

            ## saving node mul ##
            from Vision.StandardNodes import Operator2
            mul_4 = Operator2(constrkw={}, name='mul', library=stdlib)
            self.macroNetwork.addNode(mul_4, 309, 139)
            apply(
                mul_4.inputPortByName['data1'].configure, (), {
                    'datatype': 'normals3D',
                    'cast': True,
                    'shape': 'rect',
                    'color': 'blue'
                })
            apply(
                mul_4.inputPortByName['data2'].configure, (), {
                    'datatype': 'float',
                    'cast': True,
                    'shape': 'circle',
                    'color': 'green'
                })
            apply(mul_4.inputPortByName['operation'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'diamond'
            })
            apply(mul_4.inputPortByName['applyToElements'].configure, (), {
                'color': 'yellow',
                'cast': True,
                'shape': 'circle'
            })
            apply(mul_4.outputPortByName['result'].configure, (), {
                'color': 'white',
                'shape': 'diamond'
            })
            mul_4.inputPortByName['operation'].widget.set("mul", run=False)
            mul_4.inputPortByName['applyToElements'].widget.set(1, run=False)
            apply(mul_4.configure, (), {'expanded': False})
        except:
            print "WARNING: failed to restore Operator2 named mul in network self.macroNetwork"
            print_exc()
            mul_4 = None
        try:

            ## saving node Offset ##
            from Vision.StandardNodes import DialNE
            Offset_5 = DialNE(constrkw={}, name='Offset', library=stdlib)
            self.macroNetwork.addNode(Offset_5, 390, 20)
            apply(Offset_5.inputPortByName['dial'].configure, (), {
                'color': 'green',
                'cast': True,
                'shape': 'circle'
            })
            apply(Offset_5.inputPortByName['mini'].configure, (), {
                'color': 'green',
                'cast': True,
                'shape': 'circle'
            })
            apply(Offset_5.inputPortByName['maxi'].configure, (), {
                'color': 'green',
                'cast': True,
                'shape': 'circle'
            })
            apply(Offset_5.outputPortByName['value'].configure, (), {
                'color': 'green',
                'shape': 'circle'
            })
            Offset_5.inputPortByName['dial'].widget.set(1.01, run=False)
        except:
            print "WARNING: failed to restore DialNE named Offset in network self.macroNetwork"
            print_exc()
            Offset_5 = None
        try:

            ## saving node add ##
            from Vision.StandardNodes import Operator2
            add_6 = Operator2(constrkw={}, name='add', library=stdlib)
            self.macroNetwork.addNode(add_6, 253, 183)
            apply(
                add_6.inputPortByName['data1'].configure, (), {
                    'datatype': 'coordinates3D',
                    'cast': True,
                    'shape': 'rect',
                    'color': 'green'
                })
            apply(add_6.inputPortByName['data2'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'diamond'
            })
            apply(add_6.inputPortByName['operation'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'diamond'
            })
            apply(add_6.inputPortByName['applyToElements'].configure, (), {
                'color': 'yellow',
                'cast': True,
                'shape': 'circle'
            })
            apply(add_6.outputPortByName['result'].configure, (), {
                'color': 'white',
                'shape': 'diamond'
            })
            add_6.inputPortByName['operation'].widget.set("add", run=False)
            add_6.inputPortByName['applyToElements'].widget.set(1, run=False)
            apply(add_6.configure, (), {'expanded': False})
        except:
            print "WARNING: failed to restore Operator2 named add in network self.macroNetwork"
            print_exc()
            add_6 = None
        try:

            ## saving node triInterp ##
            from Volume.VisionInterface.VolumeNodes import TriInterp
            triInterp_7 = TriInterp(constrkw={},
                                    name='triInterp',
                                    library=vollib)
            self.macroNetwork.addNode(triInterp_7, 189, 270)
            apply(triInterp_7.inputPortByName['grid'].configure, (), {
                'color': '#995699',
                'cast': True,
                'shape': 'diamond'
            })
            apply(triInterp_7.inputPortByName['points'].configure, (), {
                'datatype': 'list',
                'cast': True,
                'shape': 'oval',
                'color': 'cyan'
            })
            apply(triInterp_7.outputPortByName['data'].configure, (), {
                'color': 'cyan',
                'shape': 'oval'
            })
        except:
            print "WARNING: failed to restore TriInterp named triInterp in network self.macroNetwork"
            print_exc()
            triInterp_7 = None
        try:

            ## saving node Color Map ##
            from DejaVu.VisionInterface.DejaVuNodes import ColorMapNE
            Color_Map_9 = ColorMapNE(constrkw={},
                                     name='Color Map',
                                     library=vizlib)
            self.macroNetwork.addNode(Color_Map_9, 213, 433)
            apply(Color_Map_9.inputPortByName['colorMap'].configure, (), {
                'color': 'magenta',
                'cast': True,
                'shape': 'rect'
            })
            apply(Color_Map_9.inputPortByName['values'].configure, (), {
                'color': 'cyan',
                'cast': True,
                'shape': 'oval'
            })
            apply(Color_Map_9.inputPortByName['mini'].configure, (), {
                'color': 'green',
                'cast': True,
                'shape': 'circle'
            })
            apply(Color_Map_9.inputPortByName['maxi'].configure, (), {
                'color': 'green',
                'cast': True,
                'shape': 'circle'
            })
            apply(Color_Map_9.inputPortByName['filename'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'oval'
            })
            apply(Color_Map_9.outputPortByName['mappedColors'].configure, (), {
                'color': 'orange',
                'shape': 'rect'
            })
            apply(Color_Map_9.outputPortByName['colorMap'].configure, (), {
                'color': 'magenta',
                'shape': 'rect'
            })
            apply(Color_Map_9.outputPortByName['legend'].configure, (), {
                'color': 'red',
                'shape': 'rect'
            })
            Color_Map_9.inputPortByName['colorMap'].widget.set(
                {
                    'mini':
                    None,
                    'maxi':
                    None,
                    'ramp':
                    [[1.0, 0.0, 0.0, 1.0],
                     [1.0, 0.0060000000000000053, 0.0060000000000000053, 1.0],
                     [1.0, 0.01100000000000001, 0.01100000000000001, 1.0],
                     [1.0, 0.02300000000000002, 0.02300000000000002, 1.0],
                     [1.0, 0.029000000000000026, 0.029000000000000026, 1.0],
                     [1.0, 0.03400000000000003, 0.03400000000000003, 1.0],
                     [1.0, 0.046000000000000041, 0.046000000000000041, 1.0],
                     [1.0, 0.051000000000000045, 0.051000000000000045, 1.0],
                     [1.0, 0.057000000000000051, 0.057000000000000051, 1.0],
                     [1.0, 0.06899999999999995, 0.06899999999999995, 1.0],
                     [1.0, 0.073999999999999955, 0.073999999999999955, 1.0],
                     [1.0, 0.085999999999999965, 0.085999999999999965, 1.0],
                     [1.0, 0.09099999999999997, 0.09099999999999997, 1.0],
                     [1.0, 0.096999999999999975, 0.096999999999999975, 1.0],
                     [1.0, 0.10899999999999999, 0.10899999999999999, 1.0],
                     [1.0, 0.11399999999999999, 0.11399999999999999, 1.0],
                     [1.0, 0.12, 0.12, 1.0],
                     [1.0, 0.13100000000000001, 0.13100000000000001, 1.0],
                     [1.0, 0.13700000000000001, 0.13700000000000001, 1.0],
                     [1.0, 0.14300000000000002, 0.14300000000000002, 1.0],
                     [1.0, 0.15400000000000003, 0.15400000000000003, 1.0],
                     [1.0, 0.16000000000000003, 0.16000000000000003, 1.0],
                     [1.0, 0.17100000000000004, 0.17100000000000004, 1.0],
                     [1.0, 0.17700000000000005, 0.17700000000000005, 1.0],
                     [1.0, 0.18300000000000005, 0.18300000000000005, 1.0],
                     [1.0, 0.19399999999999995, 0.19399999999999995, 1.0],
                     [1.0, 0.19999999999999996, 0.19999999999999996, 1.0],
                     [1.0, 0.20599999999999996, 0.20599999999999996, 1.0],
                     [1.0, 0.21699999999999997, 0.21699999999999997, 1.0],
                     [1.0, 0.22299999999999998, 0.22299999999999998, 1.0],
                     [1.0, 0.23399999999999999, 0.23399999999999999, 1.0],
                     [1.0, 0.23999999999999999, 0.23999999999999999, 1.0],
                     [1.0, 0.246, 0.246, 1.0],
                     [1.0, 0.25700000000000001, 0.25700000000000001, 1.0],
                     [1.0, 0.26300000000000001, 0.26300000000000001, 1.0],
                     [1.0, 0.26900000000000002, 0.26900000000000002, 1.0],
                     [1.0, 0.28000000000000003, 0.28000000000000003, 1.0],
                     [1.0, 0.28600000000000003, 0.28600000000000003, 1.0],
                     [1.0, 0.29100000000000004, 0.29100000000000004, 1.0],
                     [1.0, 0.30300000000000005, 0.30300000000000005, 1.0],
                     [1.0, 0.30900000000000005, 0.30900000000000005, 1.0],
                     [1.0, 0.31999999999999995, 0.31999999999999995, 1.0],
                     [1.0, 0.32599999999999996, 0.32599999999999996, 1.0],
                     [1.0, 0.33099999999999996, 0.33099999999999996, 1.0],
                     [1.0, 0.34299999999999997, 0.34299999999999997, 1.0],
                     [1.0, 0.34899999999999998, 0.34899999999999998, 1.0],
                     [1.0, 0.35399999999999998, 0.35399999999999998, 1.0],
                     [1.0, 0.36599999999999999, 0.36599999999999999, 1.0],
                     [1.0, 0.371, 0.371, 1.0], [1.0, 0.377, 0.377, 1.0],
                     [1.0, 0.38900000000000001, 0.38900000000000001, 1.0],
                     [1.0, 0.39400000000000002, 0.39400000000000002, 1.0],
                     [1.0, 0.40600000000000003, 0.40600000000000003, 1.0],
                     [1.0, 0.41100000000000003, 0.41100000000000003, 1.0],
                     [1.0, 0.41700000000000004, 0.41700000000000004, 1.0],
                     [1.0, 0.42900000000000005, 0.42900000000000005, 1.0],
                     [1.0, 0.43400000000000005, 0.43400000000000005, 1.0],
                     [1.0, 0.43999999999999995, 0.43999999999999995, 1.0],
                     [1.0, 0.45099999999999996, 0.45099999999999996, 1.0],
                     [1.0, 0.45699999999999996, 0.45699999999999996, 1.0],
                     [1.0, 0.46899999999999997, 0.46899999999999997, 1.0],
                     [1.0, 0.47399999999999998, 0.47399999999999998, 1.0],
                     [1.0, 0.47999999999999998, 0.47999999999999998, 1.0],
                     [1.0, 0.49099999999999999, 0.49099999999999999, 1.0],
                     [1.0, 0.497, 0.497, 1.0], [1.0, 0.503, 0.503, 1.0],
                     [1.0, 0.51400000000000001, 0.51400000000000001, 1.0],
                     [1.0, 0.52000000000000002, 0.52000000000000002, 1.0],
                     [1.0, 0.52600000000000002, 0.52600000000000002, 1.0],
                     [1.0, 0.53699999999999992, 0.53699999999999992, 1.0],
                     [1.0, 0.54299999999999993, 0.54299999999999993, 1.0],
                     [1.0, 0.55400000000000005, 0.55400000000000005, 1.0],
                     [1.0, 0.56000000000000005, 0.56000000000000005, 1.0],
                     [1.0, 0.56600000000000006, 0.56600000000000006, 1.0],
                     [1.0, 0.57699999999999996, 0.57699999999999996, 1.0],
                     [1.0, 0.58299999999999996, 0.58299999999999996, 1.0],
                     [1.0, 0.58899999999999997, 0.58899999999999997, 1.0],
                     [1.0, 0.59999999999999998, 0.59999999999999998, 1.0],
                     [1.0, 0.60599999999999998, 0.60599999999999998, 1.0],
                     [1.0, 0.61699999999999999, 0.61699999999999999, 1.0],
                     [1.0, 0.623, 0.623, 1.0], [1.0, 0.629, 0.629, 1.0],
                     [1.0, 0.64000000000000001, 0.64000000000000001, 1.0],
                     [1.0, 0.64600000000000002, 0.64600000000000002, 1.0],
                     [1.0, 0.65100000000000002, 0.65100000000000002, 1.0],
                     [1.0, 0.66300000000000003, 0.66300000000000003, 1.0],
                     [1.0, 0.66900000000000004, 0.66900000000000004, 1.0],
                     [1.0, 0.67399999999999993, 0.67399999999999993, 1.0],
                     [1.0, 0.68599999999999994, 0.68599999999999994, 1.0],
                     [1.0, 0.69100000000000006, 0.69100000000000006, 1.0],
                     [1.0, 0.70300000000000007, 0.70300000000000007, 1.0],
                     [1.0, 0.70900000000000007, 0.70900000000000007, 1.0],
                     [1.0, 0.71399999999999997, 0.71399999999999997, 1.0],
                     [1.0, 0.72599999999999998, 0.72599999999999998, 1.0],
                     [1.0, 0.73099999999999998, 0.73099999999999998, 1.0],
                     [1.0, 0.73699999999999999, 0.73699999999999999, 1.0],
                     [1.0, 0.749, 0.749, 1.0], [1.0, 0.754, 0.754, 1.0],
                     [1.0, 0.76000000000000001, 0.76000000000000001, 1.0],
                     [1.0, 0.77100000000000002, 0.77100000000000002, 1.0],
                     [1.0, 0.77700000000000002, 0.77700000000000002, 1.0],
                     [1.0, 0.78900000000000003, 0.78900000000000003, 1.0],
                     [1.0, 0.79400000000000004, 0.79400000000000004, 1.0],
                     [1.0, 0.80000000000000004, 0.80000000000000004, 1.0],
                     [1.0, 0.81099999999999994, 0.81099999999999994, 1.0],
                     [1.0, 0.81699999999999995, 0.81699999999999995, 1.0],
                     [1.0, 0.82299999999999995, 0.82299999999999995, 1.0],
                     [1.0, 0.83399999999999996, 0.83399999999999996, 1.0],
                     [1.0, 0.83999999999999997, 0.83999999999999997, 1.0],
                     [1.0, 0.85099999999999998, 0.85099999999999998, 1.0],
                     [1.0, 0.85699999999999998, 0.85699999999999998, 1.0],
                     [1.0, 0.86299999999999999, 0.86299999999999999, 1.0],
                     [1.0, 0.874, 0.874, 1.0], [1.0, 0.88, 0.88, 1.0],
                     [1.0, 0.88600000000000001, 0.88600000000000001, 1.0],
                     [1.0, 0.89700000000000002, 0.89700000000000002, 1.0],
                     [1.0, 0.90300000000000002, 0.90300000000000002, 1.0],
                     [1.0, 0.90900000000000003, 0.90900000000000003, 1.0],
                     [1.0, 0.92000000000000004, 0.92000000000000004, 1.0],
                     [1.0, 0.92600000000000005, 0.92600000000000005, 1.0],
                     [1.0, 0.93700000000000006, 0.93700000000000006, 1.0],
                     [1.0, 0.94299999999999995, 0.94299999999999995, 1.0],
                     [1.0, 0.94899999999999995, 0.94899999999999995, 1.0],
                     [1.0, 0.95999999999999996, 0.95999999999999996, 1.0],
                     [1.0, 0.96599999999999997, 0.96599999999999997, 1.0],
                     [1.0, 0.97099999999999997, 0.97099999999999997, 1.0],
                     [1.0, 0.98299999999999998, 0.98299999999999998, 1.0],
                     [1.0, 0.98899999999999999, 0.98899999999999999, 1.0],
                     [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0],
                     [0.98902199999999996, 0.98899999999999999, 1.0, 1.0],
                     [1.0, 1.0, 1.0, 1.0],
                     [0.97105799999999998, 0.97099999999999997, 1.0, 1.0],
                     [0.96606800000000004, 0.96599999999999997, 1.0, 1.0],
                     [0.95409199999999994, 0.95399999999999996, 1.0, 1.0],
                     [0.949102, 0.94899999999999995, 1.0, 1.0],
                     [0.93712600000000013, 0.93700000000000006, 1.0, 1.0],
                     [0.93113800000000013, 0.93100000000000005, 1.0, 1.0],
                     [0.92614800000000008, 0.92600000000000005, 1.0, 1.0],
                     [0.9141720000000001, 0.91400000000000003, 1.0, 1.0],
                     [0.90918200000000005, 0.90900000000000003, 1.0, 1.0],
                     [0.90319400000000005, 0.90300000000000002, 1.0, 1.0],
                     [0.89121800000000007, 0.89100000000000001, 1.0, 1.0],
                     [0.88622800000000013, 0.88600000000000001, 1.0, 1.0],
                     [0.87425200000000003, 0.874, 1.0, 1.0],
                     [0.86926200000000009, 0.86899999999999999, 1.0, 1.0],
                     [0.8632740000000001, 0.86299999999999999, 1.0, 1.0],
                     [0.85129800000000011, 0.85099999999999998, 1.0, 1.0],
                     [0.84630800000000006, 0.84599999999999997, 1.0, 1.0],
                     [0.84032000000000007, 0.83999999999999997, 1.0, 1.0],
                     [0.82934200000000002, 0.82899999999999996, 1.0, 1.0],
                     [0.82335400000000014, 0.82299999999999995, 1.0, 1.0],
                     [0.81137800000000004, 0.81099999999999994, 1.0, 1.0],
                     [0.80638800000000022, 0.80600000000000005, 1.0, 1.0],
                     [0.80040000000000022, 0.80000000000000004, 1.0, 1.0],
                     [0.78942200000000018, 0.78900000000000003, 1.0, 1.0],
                     [0.78343400000000019, 0.78300000000000003, 1.0, 1.0],
                     [0.77744600000000019, 0.77700000000000002, 1.0, 1.0],
                     [0.76646800000000015, 0.76600000000000001, 1.0, 1.0],
                     [0.76048000000000016, 0.76000000000000001, 1.0, 1.0],
                     [0.74950200000000011, 0.749, 1.0, 1.0],
                     [0.74351400000000023, 0.74299999999999999, 1.0, 1.0],
                     [0.73752600000000013, 0.73699999999999999, 1.0, 1.0],
                     [0.72654800000000019, 0.72599999999999998, 1.0, 1.0],
                     [0.72056000000000009, 0.71999999999999997, 1.0, 1.0],
                     [0.71457200000000021, 0.71399999999999997, 1.0, 1.0],
                     [0.70359400000000027, 0.70300000000000007, 1.0, 1.0],
                     [0.69760600000000028, 0.69700000000000006, 1.0, 1.0],
                     [0.68662800000000013, 0.68599999999999994, 1.0, 1.0],
                     [0.68064000000000013, 0.67999999999999994, 1.0, 1.0],
                     [0.67465200000000014, 0.67399999999999993, 1.0, 1.0],
                     [0.66367400000000032, 0.66300000000000003, 1.0, 1.0],
                     [0.65768600000000021, 0.65700000000000003, 1.0, 1.0],
                     [0.64670800000000028, 0.64600000000000002, 1.0, 1.0],
                     [0.64072000000000018, 0.64000000000000001, 1.0, 1.0],
                     [0.6347320000000003, 0.63400000000000001, 1.0, 1.0],
                     [0.62375400000000025, 0.623, 1.0, 1.0],
                     [0.61776600000000026, 0.61699999999999999, 1.0, 1.0],
                     [0.61177800000000027, 0.61099999999999999, 1.0, 1.0],
                     [0.60080000000000022, 0.59999999999999998, 1.0, 1.0],
                     [0.59481200000000023, 0.59399999999999997, 1.0, 1.0],
                     [0.58383400000000019, 0.58299999999999996, 1.0, 1.0],
                     [0.5778460000000003, 0.57699999999999996, 1.0, 1.0],
                     [0.5718580000000002, 0.57099999999999995, 1.0, 1.0],
                     [0.56088000000000027, 0.56000000000000005, 1.0, 1.0],
                     [0.55489200000000038, 0.55400000000000005, 1.0, 1.0],
                     [0.54990200000000022, 0.54899999999999993, 1.0, 1.0],
                     [0.53792600000000024, 0.53699999999999992, 1.0, 1.0],
                     [0.53193800000000035, 0.53100000000000003, 1.0, 1.0],
                     [0.52096000000000031, 0.52000000000000002, 1.0, 1.0],
                     [0.51497200000000032, 0.51400000000000001, 1.0, 1.0],
                     [0.50998200000000038, 0.50900000000000001, 1.0, 1.0],
                     [0.49800600000000028, 0.497, 1.0, 1.0],
                     [0.49201800000000029, 0.49099999999999999, 1.0, 1.0],
                     [0.48702800000000035, 0.48599999999999999, 1.0, 1.0],
                     [0.47505200000000036, 0.47399999999999998, 1.0, 1.0],
                     [0.47006200000000031, 0.46899999999999997, 1.0, 1.0],
                     [0.45808600000000033, 0.45699999999999996, 1.0, 1.0],
                     [0.45209800000000033, 0.45099999999999996, 1.0, 1.0],
                     [0.44710800000000028, 0.44599999999999995, 1.0, 1.0],
                     [0.43513200000000041, 0.43400000000000005, 1.0, 1.0],
                     [0.43014200000000047, 0.42900000000000005, 1.0, 1.0],
                     [0.42415400000000048, 0.42300000000000004, 1.0, 1.0],
                     [0.41217800000000038, 0.41100000000000003, 1.0, 1.0],
                     [0.40718800000000044, 0.40600000000000003, 1.0, 1.0],
                     [0.39521200000000045, 0.39400000000000002, 1.0, 1.0],
                     [0.3902220000000004, 0.38900000000000001, 1.0, 1.0],
                     [0.38423400000000041, 0.38300000000000001, 1.0, 1.0],
                     [0.37225800000000042, 0.371, 1.0, 1.0],
                     [0.36726800000000037, 0.36599999999999999, 1.0, 1.0],
                     [0.36128000000000038, 0.35999999999999999, 1.0, 1.0],
                     [0.35030200000000045, 0.34899999999999998, 1.0, 1.0],
                     [0.34431400000000045, 0.34299999999999997, 1.0, 1.0],
                     [0.33233800000000036, 0.33099999999999996, 1.0, 1.0],
                     [0.32734800000000042, 0.32599999999999996, 1.0, 1.0],
                     [0.32136000000000042, 0.31999999999999995, 1.0, 1.0],
                     [0.31038200000000049, 0.30900000000000005, 1.0, 1.0],
                     [0.3043940000000005, 0.30300000000000005, 1.0, 1.0],
                     [0.29241800000000051, 0.29100000000000004, 1.0, 1.0],
                     [0.28742800000000046, 0.28600000000000003, 1.0, 1.0],
                     [0.28144000000000047, 0.28000000000000003, 1.0, 1.0],
                     [0.27046200000000054, 0.26900000000000002, 1.0, 1.0],
                     [0.26447400000000054, 0.26300000000000001, 1.0, 1.0],
                     [0.25848600000000055, 0.25700000000000001, 1.0, 1.0],
                     [0.24750800000000051, 0.246, 1.0, 1.0],
                     [0.24152000000000051, 0.23999999999999999, 1.0, 1.0],
                     [0.23054200000000047, 0.22899999999999998, 1.0, 1.0],
                     [0.22455400000000048, 0.22299999999999998, 1.0, 1.0],
                     [0.21856600000000048, 0.21699999999999997, 1.0, 1.0],
                     [0.20758800000000044, 0.20599999999999996, 1.0, 1.0],
                     [0.20160000000000045, 0.19999999999999996, 1.0, 1.0],
                     [0.19561200000000045, 0.19399999999999995, 1.0, 1.0],
                     [0.18463400000000063, 0.18300000000000005, 1.0, 1.0],
                     [0.17864600000000064, 0.17700000000000005, 1.0, 1.0],
                     [0.16766800000000059, 0.16600000000000004, 1.0, 1.0],
                     [0.1616800000000006, 0.16000000000000003, 1.0, 1.0],
                     [0.15569200000000061, 0.15400000000000003, 1.0, 1.0],
                     [0.14471400000000056, 0.14300000000000002, 1.0, 1.0],
                     [0.13872600000000057, 0.13700000000000001, 1.0, 1.0],
                     [0.13273800000000058, 0.13100000000000001, 1.0, 1.0],
                     [0.12176000000000053, 0.12, 1.0, 1.0],
                     [0.11577200000000054, 0.11399999999999999, 1.0, 1.0],
                     [0.10479400000000061, 0.10299999999999998, 1.0, 1.0],
                     [0.098806000000000616, 0.096999999999999975, 1.0, 1.0],
                     [0.092818000000000622, 0.09099999999999997, 1.0, 1.0],
                     [0.081840000000000579, 0.07999999999999996, 1.0, 1.0],
                     [0.075852000000000586, 0.073999999999999955, 1.0, 1.0],
                     [0.070862000000000536, 0.06899999999999995, 1.0, 1.0],
                     [0.05888600000000066, 0.057000000000000051, 1.0, 1.0],
                     [0.052898000000000667, 0.051000000000000045, 1.0, 1.0],
                     [0.041920000000000623, 0.040000000000000036, 1.0, 1.0],
                     [0.03593200000000063, 0.03400000000000003, 1.0, 1.0],
                     [0.030942000000000691, 0.029000000000000026, 1.0, 1.0],
                     [0.018966000000000705, 0.017000000000000015, 1.0, 1.0],
                     [0.012978000000000711, 0.01100000000000001, 1.0, 1.0],
                     [0.0020000000000006679, 0.0, 1.0, 1.0]],
                    'name':
                    'cmap'
                },
                run=False)
        except:
            print "WARNING: failed to restore ColorMap named Color Map in network self.macroNetwork"
            print_exc()
            Color_Map_9 = None
        try:

            ## saving node call method ##
            from Vision.StandardNodes import CallMethod
            call_method_10 = CallMethod(constrkw={},
                                        name='call method',
                                        library=stdlib)
            self.macroNetwork.addNode(call_method_10, 179, 501)
            apply(call_method_10.inputPortByName['objects'].configure, (), {
                'datatype': 'geom',
                'cast': True,
                'shape': 'rect',
                'color': 'red'
            })
            apply(call_method_10.inputPortByName['signature'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'oval'
            })
            apply(
                call_method_10.addInputPort, (), {
                    'name': 'materials',
                    'cast': True,
                    'datatype': 'colorfloat3or4(0)',
                    'required': False,
                    'height': 8,
                    'width': 12,
                    'shape': 'rect',
                    'color': 'orange'
                })
            apply(
                call_method_10.addInputPort, (), {
                    'name': 'inheritMaterial',
                    'cast': True,
                    'datatype': 'int',
                    'required': False,
                    'height': 12,
                    'width': 12,
                    'shape': 'circle',
                    'color': 'yellow'
                })
            apply(call_method_10.outputPortByName['objects'].configure, (), {
                'color': 'white',
                'shape': 'diamond'
            })
            apply(call_method_10.outputPortByName['results'].configure, (), {
                'color': 'white',
                'shape': 'diamond'
            })
            call_method_10.inputPortByName['signature'].widget.set(
                "Set materials inheritMaterial", run=False)
        except:
            print "WARNING: failed to restore CallMethod named call method in network self.macroNetwork"
            print_exc()
            call_method_10 = None
        try:

            ## saving node Checkbutton ##
            from Vision.StandardNodes import CheckButtonNE
            Checkbutton_11 = CheckButtonNE(constrkw={},
                                           name='Checkbutton',
                                           library=stdlib)
            self.macroNetwork.addNode(Checkbutton_11, 346, 478)
            apply(Checkbutton_11.inputPortByName['button'].configure, (), {
                'color': 'yellow',
                'cast': True,
                'shape': 'circle'
            })
            apply(Checkbutton_11.outputPortByName['value'].configure, (), {
                'color': 'yellow',
                'shape': 'circle'
            })
        except:
            print "WARNING: failed to restore CheckButtonNE named Checkbutton in network self.macroNetwork"
            print_exc()
            Checkbutton_11 = None
        try:

            ## saving node Redraw ##
            from DejaVu.VisionInterface.DejaVuNodes import Redraw
            Redraw_12 = Redraw(constrkw={}, name='Redraw', library=vizlib)
            self.macroNetwork.addNode(Redraw_12, 41, 518)
            apply(Redraw_12.inputPortByName['viewer'].configure, (), {
                'color': 'yellow',
                'cast': True,
                'shape': 'rect'
            })
            apply(Redraw_12.inputPortByName['trigger'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'diamond'
            })
        except:
            print "WARNING: failed to restore Redraw named Redraw in network self.macroNetwork"
            print_exc()
            Redraw_12 = None
        try:

            ## saving node neg ##
            from Vision.StandardNodes import Operator1
            neg_13 = Operator1(constrkw={}, name='neg', library=stdlib)
            self.macroNetwork.addNode(neg_13, 288, 321)
            apply(neg_13.inputPortByName['data'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'diamond'
            })
            apply(neg_13.inputPortByName['operation'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'diamond'
            })
            apply(neg_13.inputPortByName['applyToElements'].configure, (), {
                'color': 'yellow',
                'cast': True,
                'shape': 'circle'
            })
            apply(neg_13.outputPortByName['result'].configure, (), {
                'color': 'white',
                'shape': 'diamond'
            })
            neg_13.inputPortByName['operation'].widget.set("neg", run=False)
            apply(neg_13.configure, (), {'expanded': False})
        except:
            print "WARNING: failed to restore Operator1 named neg in network self.macroNetwork"
            print_exc()
            neg_13 = None
        try:

            ## saving node Get viewer ##
            from Vision.StandardNodes import GetAttr
            Get_viewer_14 = GetAttr(constrkw={},
                                    name='Get viewer',
                                    library=stdlib)
            self.macroNetwork.addNode(Get_viewer_14, 18, 324)
            apply(Get_viewer_14.inputPortByName['objects'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'diamond'
            })
            apply(Get_viewer_14.inputPortByName['attr'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'oval'
            })
            apply(Get_viewer_14.outputPortByName['attrs'].configure, (), {
                'color': 'cyan',
                'shape': 'oval'
            })
            apply(Get_viewer_14.inputPortByName['attr'].widget.configure, (),
                  {'choices': ('viewer', )})
            Get_viewer_14.inputPortByName['attr'].widget.set("viewer",
                                                             run=False)
        except:
            print "WARNING: failed to restore GetAttr named Get viewer in network self.macroNetwork"
            print_exc()
            Get_viewer_14 = None
        try:

            ## saving node Slice Data ##
            from Vision.StandardNodes import SliceData
            Slice_Data_15 = SliceData(constrkw={},
                                      name='Slice Data',
                                      library=stdlib)
            self.macroNetwork.addNode(Slice_Data_15, 29, 421)
            apply(Slice_Data_15.inputPortByName['data'].configure, (), {
                'datatype': 'list',
                'cast': True,
                'shape': 'oval',
                'color': 'cyan'
            })
            apply(Slice_Data_15.inputPortByName['_slice'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'diamond'
            })
            apply(Slice_Data_15.outputPortByName['data'].configure, (), {
                'color': 'white',
                'shape': 'diamond'
            })
            Slice_Data_15.inputPortByName['_slice'].widget.set("[0]",
                                                               run=False)
        except:
            print "WARNING: failed to restore SliceData named Slice Data in network self.macroNetwork"
            print_exc()
            Slice_Data_15 = None
        try:

            ## saving node stddev ##
            from Vision.StandardNodes import StdDev
            stddev_16 = StdDev(constrkw={}, name='stddev', library=stdlib)
            self.macroNetwork.addNode(stddev_16, 339, 230)
            apply(stddev_16.inputPortByName['values'].configure, (), {
                'color': 'cyan',
                'cast': True,
                'shape': 'oval'
            })
            apply(stddev_16.outputPortByName['stddev'].configure, (), {
                'color': 'green',
                'shape': 'circle'
            })
        except:
            print "WARNING: failed to restore StdDev named stddev in network self.macroNetwork"
            print_exc()
            stddev_16 = None
        try:

            ## saving node Dial ##
            from Vision.StandardNodes import DialNE
            Dial_17 = DialNE(constrkw={}, name='Dial', library=stdlib)
            self.macroNetwork.addNode(Dial_17, 412, 152)
            apply(Dial_17.inputPortByName['dial'].configure, (), {
                'color': 'green',
                'cast': True,
                'shape': 'circle'
            })
            apply(Dial_17.inputPortByName['mini'].configure, (), {
                'color': 'green',
                'cast': True,
                'shape': 'circle'
            })
            apply(Dial_17.inputPortByName['maxi'].configure, (), {
                'color': 'green',
                'cast': True,
                'shape': 'circle'
            })
            apply(Dial_17.outputPortByName['value'].configure, (), {
                'color': 'green',
                'shape': 'circle'
            })
            Dial_17.inputPortByName['dial'].widget.set(5.0, run=False)
        except:
            print "WARNING: failed to restore DialNE named Dial in network self.macroNetwork"
            print_exc()
            Dial_17 = None
        try:

            ## saving node mul ##
            from Vision.StandardNodes import Operator2
            mul_18 = Operator2(constrkw={}, name='mul', library=stdlib)
            self.macroNetwork.addNode(mul_18, 369, 347)
            apply(
                mul_18.inputPortByName['data1'].configure, (), {
                    'datatype': 'float',
                    'cast': True,
                    'shape': 'circle',
                    'color': 'green'
                })
            apply(
                mul_18.inputPortByName['data2'].configure, (), {
                    'datatype': 'float',
                    'cast': True,
                    'shape': 'circle',
                    'color': 'green'
                })
            apply(mul_18.inputPortByName['operation'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'diamond'
            })
            apply(mul_18.inputPortByName['applyToElements'].configure, (), {
                'color': 'yellow',
                'cast': True,
                'shape': 'circle'
            })
            apply(mul_18.outputPortByName['result'].configure, (), {
                'color': 'white',
                'shape': 'diamond'
            })
            mul_18.inputPortByName['operation'].widget.set("mul", run=False)
            apply(mul_18.configure, (), {'expanded': False})
        except:
            print "WARNING: failed to restore Operator2 named mul in network self.macroNetwork"
            print_exc()
            mul_18 = None
        self.macroNetwork.freeze()

        ## saving connections for network Map Pot On Geom ##
        if Offset_5 is not None and mul_4 is not None:
            self.macroNetwork.connectNodes(Offset_5,
                                           mul_4,
                                           "value",
                                           "data2",
                                           blocking=True)
        if getSurfaceVFN_3 is not None and mul_4 is not None:
            self.macroNetwork.connectNodes(getSurfaceVFN_3,
                                           mul_4,
                                           "normals",
                                           "data1",
                                           blocking=True)
        if mul_4 is not None and add_6 is not None:
            self.macroNetwork.connectNodes(mul_4,
                                           add_6,
                                           "result",
                                           "data2",
                                           blocking=True)
        if getSurfaceVFN_3 is not None and add_6 is not None:
            self.macroNetwork.connectNodes(getSurfaceVFN_3,
                                           add_6,
                                           "vertices",
                                           "data1",
                                           blocking=True)
        if add_6 is not None and triInterp_7 is not None:
            self.macroNetwork.connectNodes(add_6,
                                           triInterp_7,
                                           "result",
                                           "points",
                                           blocking=True)
        if getSurfaceVFN_3 is not None and call_method_10 is not None:
            self.macroNetwork.connectNodes(getSurfaceVFN_3,
                                           call_method_10,
                                           "geom",
                                           "objects",
                                           blocking=True)
        if Checkbutton_11 is not None and call_method_10 is not None:
            self.macroNetwork.connectNodes(Checkbutton_11,
                                           call_method_10,
                                           "value",
                                           "inheritMaterial",
                                           blocking=True)
        if call_method_10 is not None and Redraw_12 is not None:
            self.macroNetwork.connectNodes(call_method_10,
                                           Redraw_12,
                                           "objects",
                                           "trigger",
                                           blocking=True)
        input_Ports_1 = self.macroNetwork.ipNode
        if input_Ports_1 is not None and getSurfaceVFN_3 is not None:
            self.macroNetwork.connectNodes(input_Ports_1,
                                           getSurfaceVFN_3,
                                           "new",
                                           "geometry",
                                           blocking=True)
        if getSurfaceVFN_3 is not None and Get_viewer_14 is not None:
            self.macroNetwork.connectNodes(getSurfaceVFN_3,
                                           Get_viewer_14,
                                           "geom",
                                           "objects",
                                           blocking=True)
        if Get_viewer_14 is not None and Slice_Data_15 is not None:
            self.macroNetwork.connectNodes(Get_viewer_14,
                                           Slice_Data_15,
                                           "attrs",
                                           "data",
                                           blocking=True)
        if Slice_Data_15 is not None and Redraw_12 is not None:
            self.macroNetwork.connectNodes(Slice_Data_15,
                                           Redraw_12,
                                           "data",
                                           "viewer",
                                           blocking=True)
        if input_Ports_1 is not None and triInterp_7 is not None:
            self.macroNetwork.connectNodes(input_Ports_1,
                                           triInterp_7,
                                           "new",
                                           "grid",
                                           blocking=True)
        if triInterp_7 is not None and stddev_16 is not None:
            self.macroNetwork.connectNodes(triInterp_7,
                                           stddev_16,
                                           "data",
                                           "values",
                                           blocking=True)
        if neg_13 is not None and Color_Map_9 is not None:
            self.macroNetwork.connectNodes(neg_13,
                                           Color_Map_9,
                                           "result",
                                           "mini",
                                           blocking=True)
        if mul_18 is not None and neg_13 is not None:
            self.macroNetwork.connectNodes(mul_18,
                                           neg_13,
                                           "result",
                                           "data",
                                           blocking=True)
        if mul_18 is not None and Color_Map_9 is not None:
            self.macroNetwork.connectNodes(mul_18,
                                           Color_Map_9,
                                           "result",
                                           "maxi",
                                           blocking=True)
        if Dial_17 is not None and mul_18 is not None:
            self.macroNetwork.connectNodes(Dial_17,
                                           mul_18,
                                           "value",
                                           "data2",
                                           blocking=True)
        if stddev_16 is not None and mul_18 is not None:
            self.macroNetwork.connectNodes(stddev_16,
                                           mul_18,
                                           "stddev",
                                           "data1",
                                           blocking=True)
        if triInterp_7 is not None and Color_Map_9 is not None:
            self.macroNetwork.connectNodes(triInterp_7,
                                           Color_Map_9,
                                           "data",
                                           "values",
                                           blocking=True)
        if Color_Map_9 is not None and call_method_10 is not None:
            self.macroNetwork.connectNodes(Color_Map_9,
                                           call_method_10,
                                           "mappedColors",
                                           "materials",
                                           blocking=True)
        output_Ports_2 = self.macroNetwork.opNode
        if Color_Map_9 is not None and output_Ports_2 is not None:
            self.macroNetwork.connectNodes(Color_Map_9,
                                           output_Ports_2,
                                           "legend",
                                           "new",
                                           blocking=True)
        self.macroNetwork.unfreeze()

        Map_Pot_On_Geom_0.shrink()

        ## reset modifications ##
        Map_Pot_On_Geom_0.resetTags()
        Map_Pot_On_Geom_0.buildOriginalList()
Esempio n. 30
0
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        ## building macro network ##
        Prepare_AD3Receptor_16 = self
        from traceback import print_exc

        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        self.macroNetwork.getEditor().addLibraryInstance(
            adtlib, "AutoDockTools.VisionInterface.AdtNodes", "adtlib")

        from MolKit.VisionInterface.MolKitNodes import molkitlib
        self.macroNetwork.getEditor().addLibraryInstance(
            molkitlib, "MolKit.VisionInterface.MolKitNodes", "molkitlib")

        try:
            ## saving node input Ports ##
            input_Ports_17 = self.macroNetwork.ipNode
            input_Ports_17.move(165, 26)
        except:
            print(
                "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            )
            print_exc()
            input_Ports_17 = None

        try:
            ## saving node output Ports ##
            output_Ports_18 = self.macroNetwork.opNode
            output_Ports_18.move(165, 345)
        except:
            print(
                "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            )
            print_exc()
            output_Ports_18 = None

        try:
            ## saving node Add Hydrogens ##
            from MolKit.VisionInterface.MolKitNodes import AddHydrogens
            Add_Hydrogens_19 = AddHydrogens(constrkw={},
                                            name='Add Hydrogens',
                                            library=molkitlib)
            self.macroNetwork.addNode(Add_Hydrogens_19, 182, 83)
            Add_Hydrogens_19.inputPortByName['molecules'].configure(
                *(), **{
                    'color': '#c64e70',
                    'cast': True,
                    'shape': 'oval'
                })
            Add_Hydrogens_19.outputPortByName['molecules'].configure(
                *(), **{
                    'color': '#c64e70',
                    'shape': 'oval'
                })
            Add_Hydrogens_19.outputPortByName['new_h_ct'].configure(
                *(), **{
                    'color': 'yellow',
                    'shape': 'circle'
                })
        except:
            print(
                "WARNING: failed to restore AddHydrogens named Add Hydrogens in network self.macroNetwork"
            )
            print_exc()
            Add_Hydrogens_19 = None

        try:
            ## saving node Add Kollman Charges ##
            from MolKit.VisionInterface.MolKitNodes import AddKollmanCharges
            Add_Kollman_Charges_20 = AddKollmanCharges(
                constrkw={}, name='Add Kollman Charges', library=molkitlib)
            self.macroNetwork.addNode(Add_Kollman_Charges_20, 182, 135)
            Add_Kollman_Charges_20.inputPortByName['mols'].configure(
                *(), **{
                    'color': '#c64e70',
                    'cast': True,
                    'shape': 'oval'
                })
            Add_Kollman_Charges_20.outputPortByName['mols'].configure(
                *(), **{
                    'color': '#c64e70',
                    'shape': 'oval'
                })
            Add_Kollman_Charges_20.outputPortByName['charge_total'].configure(
                *(), **{
                    'color': 'green',
                    'shape': 'circle'
                })
        except:
            print(
                "WARNING: failed to restore AddKollmanCharges named Add Kollman Charges in network self.macroNetwork"
            )
            print_exc()
            Add_Kollman_Charges_20 = None

        try:
            ## saving node Add Solvation Parameters ##
            from AutoDockTools.VisionInterface.AdtNodes import Add_SolvationParameters
            Add_Solvation_Parameters_21 = Add_SolvationParameters(
                constrkw={}, name='Add Solvation Parameters', library=adtlib)
            self.macroNetwork.addNode(Add_Solvation_Parameters_21, 182, 288)
            Add_Solvation_Parameters_21.inputPortByName['mols'].configure(
                *(), **{
                    'color': '#c64e70',
                    'cast': True,
                    'shape': 'oval'
                })
            Add_Solvation_Parameters_21.outputPortByName[
                'typed_mols'].configure(
                    *(), **{
                        'color': '#c64e70',
                        'shape': 'oval'
                    })
            Add_Solvation_Parameters_21.outputPortByName['AtSolPar'].configure(
                *(), **{
                    'color': 'cyan',
                    'shape': 'oval'
                })
        except:
            print(
                "WARNING: failed to restore Add_SolvationParameters named Add Solvation Parameters in network self.macroNetwork"
            )
            print_exc()
            Add_Solvation_Parameters_21 = None

        try:
            ## saving node Merge NonPolar Hydrogens ##
            from AutoDockTools.VisionInterface.AdtNodes import MergeNonPolarHydrogens
            Merge_NonPolar_Hydrogens_22 = MergeNonPolarHydrogens(
                constrkw={}, name='Merge NonPolar Hydrogens', library=adtlib)
            self.macroNetwork.addNode(Merge_NonPolar_Hydrogens_22, 182, 236)
            Merge_NonPolar_Hydrogens_22.inputPortByName['mols'].configure(
                *(), **{
                    'color': '#c64e70',
                    'cast': True,
                    'shape': 'oval'
                })
            Merge_NonPolar_Hydrogens_22.inputPortByName['renumber'].configure(
                *(), **{
                    'color': 'yellow',
                    'cast': True,
                    'shape': 'circle'
                })
            Merge_NonPolar_Hydrogens_22.outputPortByName['mols'].configure(
                *(), **{
                    'color': '#c64e70',
                    'shape': 'oval'
                })
            Merge_NonPolar_Hydrogens_22.outputPortByName['num_nphs'].configure(
                *(), **{
                    'color': 'yellow',
                    'shape': 'circle'
                })
        except:
            print(
                "WARNING: failed to restore MergeNonPolarHydrogens named Merge NonPolar Hydrogens in network self.macroNetwork"
            )
            print_exc()
            Merge_NonPolar_Hydrogens_22 = None

        try:
            ## saving node Merge Lone Pairs ##
            from AutoDockTools.VisionInterface.AdtNodes import MergeLonePairs
            Merge_Lone_Pairs_23 = MergeLonePairs(constrkw={},
                                                 name='Merge Lone Pairs',
                                                 library=adtlib)
            self.macroNetwork.addNode(Merge_Lone_Pairs_23, 182, 184)
            Merge_Lone_Pairs_23.inputPortByName['mols'].configure(
                *(), **{
                    'color': '#c64e70',
                    'cast': True,
                    'shape': 'oval'
                })
            Merge_Lone_Pairs_23.inputPortByName['renumber'].configure(
                *(), **{
                    'color': 'yellow',
                    'cast': True,
                    'shape': 'circle'
                })
            Merge_Lone_Pairs_23.outputPortByName['mols'].configure(
                *(), **{
                    'color': '#c64e70',
                    'shape': 'oval'
                })
            Merge_Lone_Pairs_23.outputPortByName['num_lps'].configure(
                *(), **{
                    'color': 'yellow',
                    'shape': 'circle'
                })
        except:
            print(
                "WARNING: failed to restore MergeLonePairs named Merge Lone Pairs in network self.macroNetwork"
            )
            print_exc()
            Merge_Lone_Pairs_23 = None

        self.macroNetwork.freeze()

        ## saving connections for network Prepare AD3Receptor ##
        input_Ports_17 = self.macroNetwork.ipNode
        if input_Ports_17 is not None and Add_Hydrogens_19 is not None:
            try:
                self.macroNetwork.connectNodes(input_Ports_17,
                                               Add_Hydrogens_19,
                                               "new",
                                               "molecules",
                                               blocking=True)
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_17 and Add_Hydrogens_19 in network self.macroNetwork"
                )
        if Add_Hydrogens_19 is not None and Add_Kollman_Charges_20 is not None:
            try:
                self.macroNetwork.connectNodes(Add_Hydrogens_19,
                                               Add_Kollman_Charges_20,
                                               "molecules",
                                               "mols",
                                               blocking=True)
            except:
                print(
                    "WARNING: failed to restore connection between Add_Hydrogens_19 and Add_Kollman_Charges_20 in network self.macroNetwork"
                )
        if Add_Kollman_Charges_20 is not None and Merge_Lone_Pairs_23 is not None:
            try:
                self.macroNetwork.connectNodes(Add_Kollman_Charges_20,
                                               Merge_Lone_Pairs_23,
                                               "mols",
                                               "mols",
                                               blocking=True)
            except:
                print(
                    "WARNING: failed to restore connection between Add_Kollman_Charges_20 and Merge_Lone_Pairs_23 in network self.macroNetwork"
                )
        if Merge_Lone_Pairs_23 is not None and Merge_NonPolar_Hydrogens_22 is not None:
            try:
                self.macroNetwork.connectNodes(Merge_Lone_Pairs_23,
                                               Merge_NonPolar_Hydrogens_22,
                                               "mols",
                                               "mols",
                                               blocking=True)
            except:
                print(
                    "WARNING: failed to restore connection between Merge_Lone_Pairs_23 and Merge_NonPolar_Hydrogens_22 in network self.macroNetwork"
                )
        if Merge_NonPolar_Hydrogens_22 is not None and Add_Solvation_Parameters_21 is not None:
            try:
                self.macroNetwork.connectNodes(Merge_NonPolar_Hydrogens_22,
                                               Add_Solvation_Parameters_21,
                                               "mols",
                                               "mols",
                                               blocking=True)
            except:
                print(
                    "WARNING: failed to restore connection between Merge_NonPolar_Hydrogens_22 and Add_Solvation_Parameters_21 in network self.macroNetwork"
                )
        output_Ports_18 = self.macroNetwork.opNode
        if Add_Solvation_Parameters_21 is not None and output_Ports_18 is not None:
            try:
                self.macroNetwork.connectNodes(Add_Solvation_Parameters_21,
                                               output_Ports_18,
                                               "typed_mols",
                                               "new",
                                               blocking=True)
            except:
                print(
                    "WARNING: failed to restore connection between Add_Solvation_Parameters_21 and output_Ports_18 in network self.macroNetwork"
                )
        self.macroNetwork.unfreeze()

        Prepare_AD3Receptor_16.shrink()

        ## reset modifications ##
        Prepare_AD3Receptor_16.resetTags()
        Prepare_AD3Receptor_16.buildOriginalList()
 def __init__(self, constrkw={}, name='LocalLigandDirectory', **kw):
     kw['name'] = name
     MacroNode.__init__(*(self, ), **kw)
Esempio n. 32
0
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        AD3Gpf_15 = self
        from traceback import print_exc

        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        self.macroNetwork.getEditor().addLibraryInstance(adtlib,"AutoDockTools.VisionInterface.AdtNodes", "adtlib")

        from MolKit.VisionInterface.MolKitNodes import molkitlib
        self.macroNetwork.getEditor().addLibraryInstance(molkitlib,"MolKit.VisionInterface.MolKitNodes", "molkitlib")

        from Vision.StandardNodes import stdlib
        self.macroNetwork.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")

        try:
            ## saving node input Ports ##
            input_Ports_16 = self.macroNetwork.ipNode
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_16=None

        try:
            ## saving node output Ports ##
            output_Ports_17 = self.macroNetwork.opNode
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_17=None

        try:
            ## saving node Grid Parameter File Browser ##
            from AutoDockTools.VisionInterface.AdtNodes import GridParameterFileBrowserNE
            Grid_Parameter_File_Browser_18 = GridParameterFileBrowserNE(constrkw = {}, name='Grid Parameter File Browser', library=adtlib)
            self.macroNetwork.addNode(Grid_Parameter_File_Browser_18,310,99)
            apply(Grid_Parameter_File_Browser_18.inputPortByName['filename'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Grid_Parameter_File_Browser_18.outputPortByName['filename'].configure, (), {'color': 'white', 'shape': 'oval'})
            Grid_Parameter_File_Browser_18.inputPortByName['filename'].widget.set("/mgl/work4/rhuey/dev23/fri2.gpf", run=False)
        except:
            print "WARNING: failed to restore GridParameterFileBrowserNE named Grid Parameter File Browser in network self.macroNetwork"
            print_exc()
            Grid_Parameter_File_Browser_18=None

        try:
            ## saving node Read Molecule ##
            from MolKit.VisionInterface.MolKitNodes import ReadMolecule
            Read_Molecule_19 = ReadMolecule(constrkw = {}, name='Read Molecule', library=molkitlib)
            self.macroNetwork.addNode(Read_Molecule_19,156,96)
            apply(Read_Molecule_19.inputPortByName['filename'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Read_Molecule_19.outputPortByName['MolSets'].configure, (), {'color': '#c64e70', 'shape': 'oval'})
        except:
            print "WARNING: failed to restore ReadMolecule named Read Molecule in network self.macroNetwork"
            print_exc()
            Read_Molecule_19=None

        try:
            ## saving node Read Molecule ##
            from MolKit.VisionInterface.MolKitNodes import ReadMolecule
            Read_Molecule_20 = ReadMolecule(constrkw = {}, name='Read Molecule', library=molkitlib)
            self.macroNetwork.addNode(Read_Molecule_20,234,98)
            apply(Read_Molecule_20.inputPortByName['filename'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Read_Molecule_20.outputPortByName['MolSets'].configure, (), {'color': '#c64e70', 'shape': 'oval'})
        except:
            print "WARNING: failed to restore ReadMolecule named Read Molecule in network self.macroNetwork"
            print_exc()
            Read_Molecule_20=None

        try:
            ## saving node File Browser ##
            from Vision.StandardNodes import FileBrowserNE
            File_Browser_21 = FileBrowserNE(constrkw = {}, name='File Browser', library=stdlib)
            self.macroNetwork.addNode(File_Browser_21,332,163)
            apply(File_Browser_21.inputPortByName['filename'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(File_Browser_21.outputPortByName['filename'].configure, (), {'color': 'white', 'shape': 'oval'})
        except:
            print "WARNING: failed to restore FileBrowserNE named File Browser in network self.macroNetwork"
            print_exc()
            File_Browser_21=None

        try:
            ## saving node Prepare AD3Gpf ##
            from AutoDockTools.VisionInterface.AdtNodes import AdtPrepareGpf3
            Prepare_AD3Gpf_22 = AdtPrepareGpf3(constrkw = {}, name='Prepare AD3Gpf', library=adtlib)
            self.macroNetwork.addNode(Prepare_AD3Gpf_22,217,216)
            apply(Prepare_AD3Gpf_22.inputPortByName['ligand_filename'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Prepare_AD3Gpf_22.inputPortByName['receptor_filename'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Prepare_AD3Gpf_22.inputPortByName['gpf_filename'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Prepare_AD3Gpf_22.inputPortByName['parameters'].configure, (), {'color': 'cyan', 'cast': True, 'shape': 'oval'})
            apply(Prepare_AD3Gpf_22.inputPortByName['outputfilename'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Prepare_AD3Gpf_22.outputPortByName['ag3_parameter_file'].configure, (), {'color': 'white', 'shape': 'oval'})
        except:
            print "WARNING: failed to restore AdtPrepareGpf3 named Prepare AD3Gpf in network self.macroNetwork"
            print_exc()
            Prepare_AD3Gpf_22=None

        self.macroNetwork.freeze()

        ## saving connections for network AD3Gpf ##
        if Read_Molecule_19 is not None and Prepare_AD3Gpf_22 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Read_Molecule_19, Prepare_AD3Gpf_22, "MolSets", "ligand_filename", blocking=True)
            except:
                print "WARNING: failed to restore connection between Read_Molecule_19 and Prepare_AD3Gpf_22 in network self.macroNetwork"
        if Read_Molecule_20 is not None and Prepare_AD3Gpf_22 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Read_Molecule_20, Prepare_AD3Gpf_22, "MolSets", "receptor_filename", blocking=True)
            except:
                print "WARNING: failed to restore connection between Read_Molecule_20 and Prepare_AD3Gpf_22 in network self.macroNetwork"
        if Grid_Parameter_File_Browser_18 is not None and Prepare_AD3Gpf_22 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Grid_Parameter_File_Browser_18, Prepare_AD3Gpf_22, "filename", "gpf_filename", blocking=True)
            except:
                print "WARNING: failed to restore connection between Grid_Parameter_File_Browser_18 and Prepare_AD3Gpf_22 in network self.macroNetwork"
        if File_Browser_21 is not None and Prepare_AD3Gpf_22 is not None:
            try:
                self.macroNetwork.connectNodes(
                    File_Browser_21, Prepare_AD3Gpf_22, "filename", "outputfilename", blocking=True)
            except:
                print "WARNING: failed to restore connection between File_Browser_21 and Prepare_AD3Gpf_22 in network self.macroNetwork"
        output_Ports_17 = self.macroNetwork.opNode
        if Prepare_AD3Gpf_22 is not None and output_Ports_17 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Prepare_AD3Gpf_22, output_Ports_17, "ag3_parameter_file", "new", blocking=True)
            except:
                print "WARNING: failed to restore connection between Prepare_AD3Gpf_22 and output_Ports_17 in network self.macroNetwork"
        self.macroNetwork.unfreeze()

        AD3Gpf_15.shrink()

        ## reset modifications ##
        AD3Gpf_15.resetTags()
        AD3Gpf_15.buildOriginalList()
try:
    ## saving node Config File Browser ##
    from Vision.StandardNodes import FileBrowserNE
    Config_File_Browser_3 = FileBrowserNE(constrkw={}, name='Config File Browser', library=stdlib)
    masterNet.addNode(Config_File_Browser_3,67,22)
    Config_File_Browser_3.inputPortByName['filename'].widget.set(r"AMDNBCR_0.2_input/sample-aMD.conf", run=False)
    apply(Config_File_Browser_3.configure, (), {'paramPanelImmediate': 1})
except:
    print "WARNING: failed to restore FileBrowserNE named Config File Browser in network masterNet"
    print_exc()
    Config_File_Browser_3=None

try:
    ## saving node AMDws ##
    from NetworkEditor.macros import MacroNode
    AMDws_4 = MacroNode(name='AMDws')
    masterNet.addNode(AMDws_4, 357, 184)
    output_Ports_6 = AMDws_4.macroNetwork.opNode
    apply(output_Ports_6.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
    output_Ports_6.move(182, 394)
    from NetworkEditor.items import FunctionNode
    NAMD_rocce_ucsd_edu_7 = FunctionNode(functionOrString='NAMD_rocce_ucsd_edu', host="http://rocce.ucsd.edu/opal2", namedArgs={'tarball': '', 'namdarg': '', 'localRun': False, 'execPath': '', 'procs': ''}, constrkw={'functionOrString': "'NAMD_rocce_ucsd_edu'", 'host': '"http://rocce.ucsd.edu/opal2"', 'namedArgs': {'tarball': '', 'namdarg': '', 'localRun': False, 'execPath': '', 'procs': ''}}, name='NAMD_rocce_ucsd_edu', library=wslib)
    AMDws_4.macroNetwork.addNode(NAMD_rocce_ucsd_edu_7,198,293)
    apply(NAMD_rocce_ucsd_edu_7.inputPortByName['tarball'].configure, (), {'defaultValue': None})
    apply(NAMD_rocce_ucsd_edu_7.inputPortByName['namdarg'].configure, (), {'defaultValue': None})
    apply(NAMD_rocce_ucsd_edu_7.inputPortByName['procs'].configure, (), {'defaultValue': None})
    NAMD_rocce_ucsd_edu_7.inputPortByName['tarball'].rebindWidget()
    NAMD_rocce_ucsd_edu_7.inputPortByName['tarball'].widget.set(r"", run=False)
    NAMD_rocce_ucsd_edu_7.inputPortByName['tarball'].unbindWidget()
    NAMD_rocce_ucsd_edu_7.inputPortByName['namdarg'].rebindWidget()
    NAMD_rocce_ucsd_edu_7.inputPortByName['namdarg'].widget.set(r"", run=False)
Esempio n. 34
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()
Esempio n. 35
0
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from AutoDockTools.VisionInterface.Adt import Adt
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        VirtualScreening_0 = self
        from traceback import print_exc
        from AutoDockTools.VisionInterface.Adt import Adt
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        masterNet.getEditor().addLibraryInstance(
            wslib, "WebServices.VisionInterface.WSNodes", "wslib")
        from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
        try:
            addOpalServerAsCategory("http://ws.nbcr.net/opal2", replace=False)
        except:
            pass
        try:
            addOpalServerAsCategory("http://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(217, 346)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_2 = None

        try:
            ## saving node PrepareReceptor ##
            from Adt.Macro.PrepareReceptor import PrepareReceptor
            PrepareReceptor_3 = PrepareReceptor(constrkw={},
                                                name='PrepareReceptor',
                                                library=Adt)
            self.macroNetwork.addNode(PrepareReceptor_3, 96, 114)
            apply(PrepareReceptor_3.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
            Pdb2pqrWS_6 = PrepareReceptor_3.macroNetwork.nodes[2]
            Pdb2pqrOpalService_ws_nbcr_net_10 = Pdb2pqrWS_6.macroNetwork.nodes[
                3]
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'noopt'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'phi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'psi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'verbose'].widget.set(1, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'chain'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'nodebump'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'chi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'ligand'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'hbond'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'with_ph'].widget.set(r"", run=False)
            apply(
                Pdb2pqrOpalService_ws_nbcr_net_10.
                inputPortByName['forcefield'].widget.configure, (),
                {'choices': ('AMBER', 'CHARMM', 'PARSE', 'TYL06')})
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'forcefield'].widget.set(r"AMBER", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'clean'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'inId'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'apbs_input'].widget.set(0, run=False)
            apply(
                Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['ffout'].
                widget.configure, (),
                {'choices': ('AMBER', 'CHARMM', 'PARSE', 'TYL06')})
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'ffout'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'localRun'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'rama'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName[
                'assign_only'].widget.set(0, run=False)
            GetURLFromList_11 = Pdb2pqrWS_6.macroNetwork.nodes[4]
            GetURLFromList_11.inputPortByName['ext'].widget.set(r"pqr",
                                                                run=False)

            ## saving connections for network Pdb2pqrWS ##
            Pdb2pqrWS_6.macroNetwork.freeze()
            Pdb2pqrWS_6.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_7 = Pdb2pqrWS_6.macroNetwork.ipNode
            input_Ports_7.outputPorts[1].configure(
                name='CheckFileFormat_value')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_8 = Pdb2pqrWS_6.macroNetwork.opNode
            output_Ports_8.inputPorts[1].configure(singleConnection='auto')
            output_Ports_8.inputPorts[2].configure(singleConnection='auto')
            output_Ports_8.inputPorts[1].configure(
                name='UpdateReceptor_receptor_obj')
            output_Ports_8.inputPorts[2].configure(
                name='UpdateReceptor_pdb2pqr_result')
            Pdb2pqrWS_6.inputPorts[0].configure(name='CheckFileFormat_value')
            Pdb2pqrWS_6.inputPorts[0].configure(datatype='receptor')
            ## configure MacroNode input ports
            Pdb2pqrWS_6.outputPorts[0].configure(
                name='UpdateReceptor_receptor_obj')
            Pdb2pqrWS_6.outputPorts[0].configure(datatype='receptor')
            Pdb2pqrWS_6.outputPorts[1].configure(
                name='UpdateReceptor_pdb2pqr_result')
            Pdb2pqrWS_6.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            Pdb2pqrWS_6.shrink()
            PrepareReceptorWS_13 = PrepareReceptor_3.macroNetwork.nodes[3]
            PrepareReceptorOpalService_ws_nbcr_net_17 = PrepareReceptorWS_13.macroNetwork.nodes[
                3]
            PrepareReceptorOpalService_ws_nbcr_net_17.inputPortByName[
                'o'].widget.set(r"", run=False)
            PrepareReceptorOpalService_ws_nbcr_net_17.inputPortByName[
                'v'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_17.inputPortByName[
                'localRun'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_17.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            GetURLFromList_18 = PrepareReceptorWS_13.macroNetwork.nodes[4]
            GetURLFromList_18.inputPortByName['ext'].widget.set(r"pdbqt",
                                                                run=False)
            DownloadToFile_19 = PrepareReceptorWS_13.macroNetwork.nodes[5]
            DownloadToFile_19.inputPortByName['overwrite'].widget.set(
                1, run=False)

            ## saving connections for network PrepareReceptorWS ##
            PrepareReceptorWS_13.macroNetwork.freeze()
            PrepareReceptorWS_13.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_14 = PrepareReceptorWS_13.macroNetwork.ipNode
            input_Ports_14.outputPorts[1].configure(
                name='CheckFileFormat_value')
            input_Ports_14.outputPorts[2].configure(
                name='PrepareReceptorOpalService_ws_nbcr_net_C')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_15 = PrepareReceptorWS_13.macroNetwork.opNode
            output_Ports_15.inputPorts[1].configure(singleConnection='auto')
            output_Ports_15.inputPorts[2].configure(singleConnection='auto')
            output_Ports_15.inputPorts[1].configure(
                name='UpdateReceptor_receptor_prepared_obj')
            output_Ports_15.inputPorts[2].configure(
                name='UpdateReceptor_receptor_result')
            PrepareReceptorWS_13.inputPorts[0].configure(
                name='CheckFileFormat_value')
            PrepareReceptorWS_13.inputPorts[0].configure(datatype='receptor')
            PrepareReceptorWS_13.inputPorts[1].configure(
                name='PrepareReceptorOpalService_ws_nbcr_net_C')
            PrepareReceptorWS_13.inputPorts[1].configure(datatype='boolean')
            ## configure MacroNode input ports
            PrepareReceptorWS_13.outputPorts[0].configure(
                name='UpdateReceptor_receptor_prepared_obj')
            PrepareReceptorWS_13.outputPorts[0].configure(
                datatype='receptor_prepared')
            PrepareReceptorWS_13.outputPorts[1].configure(
                name='UpdateReceptor_receptor_result')
            PrepareReceptorWS_13.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            PrepareReceptorWS_13.shrink()

            ## saving connections for network PrepareReceptor ##
            PrepareReceptor_3.macroNetwork.freeze()
            PrepareReceptor_3.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_4 = PrepareReceptor_3.macroNetwork.ipNode
            input_Ports_4.outputPorts[1].configure(
                name='Pdb2pqrWS_CheckFileFormat_value')
            input_Ports_4.outputPorts[2].configure(
                name=
                'PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_5 = PrepareReceptor_3.macroNetwork.opNode
            output_Ports_5.inputPorts[1].configure(singleConnection='auto')
            output_Ports_5.inputPorts[2].configure(singleConnection='auto')
            output_Ports_5.inputPorts[1].configure(
                name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
            output_Ports_5.inputPorts[2].configure(
                name='PrepareReceptorWS_UpdateReceptor_receptor_result')
            PrepareReceptor_3.inputPorts[0].configure(
                name='Pdb2pqrWS_CheckFileFormat_value')
            PrepareReceptor_3.inputPorts[0].configure(datatype='receptor')
            PrepareReceptor_3.inputPorts[1].configure(
                name=
                'PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')
            PrepareReceptor_3.inputPorts[1].configure(datatype='boolean')
            ## configure MacroNode input ports
            PrepareReceptor_3.outputPorts[0].configure(
                name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
            PrepareReceptor_3.outputPorts[0].configure(
                datatype='receptor_prepared')
            PrepareReceptor_3.outputPorts[1].configure(
                name='PrepareReceptorWS_UpdateReceptor_receptor_result')
            PrepareReceptor_3.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            PrepareReceptor_3.shrink()
            apply(PrepareReceptor_3.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore PrepareReceptor named PrepareReceptor in network self.macroNetwork"
            print_exc()
            PrepareReceptor_3 = None

        try:
            ## saving node ComputeGrids ##
            from Adt.Macro.ComputeGrids import ComputeGrids
            ComputeGrids_21 = ComputeGrids(constrkw={},
                                           name='ComputeGrids',
                                           library=Adt)
            self.macroNetwork.addNode(ComputeGrids_21, 187, 205)
            apply(ComputeGrids_21.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
            prepareGPF_kryptonite_nbcr_net_25 = ComputeGrids_21.macroNetwork.nodes[
                3]
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName[
                'singlelib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName[
                'r_url'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName[
                'zpoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName[
                'filter_file_url'].widget.set(r"", run=False)
            apply(
                prepareGPF_kryptonite_nbcr_net_25.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_25.inputPortByName[
                'lib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName[
                'ypoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName[
                'xcenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['p'].widget.set(
                r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['o'].widget.set(
                r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName[
                'zcenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['v'].widget.set(
                0, run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName[
                'userlib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName[
                'xpoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName[
                'localRun'].widget.set(0, run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName[
                'ycenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_26 = ComputeGrids_21.macroNetwork.nodes[
                4]
            autogrid_kryptonite_nbcr_net_26.inputPortByName[
                'infile_url'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_26.inputPortByName['l'].widget.set(
                r"output.glg", run=False)
            autogrid_kryptonite_nbcr_net_26.inputPortByName['o'].widget.set(
                0, run=False)
            autogrid_kryptonite_nbcr_net_26.inputPortByName['p'].widget.set(
                r"", run=False)
            autogrid_kryptonite_nbcr_net_26.inputPortByName[
                'localRun'].widget.set(0, run=False)
            autogrid_kryptonite_nbcr_net_26.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            GetURLFromList_29 = ComputeGrids_21.macroNetwork.nodes[7]
            GetURLFromList_29.inputPortByName['ext'].widget.set(r"gpf",
                                                                run=False)

            ## saving connections for network ComputeGrids ##
            ComputeGrids_21.macroNetwork.freeze()
            ComputeGrids_21.macroNetwork.unfreeze()

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

            ## modifying MacroOutputNode dynamic ports
            output_Ports_23 = ComputeGrids_21.macroNetwork.opNode
            output_Ports_23.inputPorts[1].configure(singleConnection='auto')
            output_Ports_23.inputPorts[2].configure(singleConnection='auto')
            output_Ports_23.inputPorts[1].configure(
                name='MakeAutogridResultObj_autogrid_result_obj')
            output_Ports_23.inputPorts[2].configure(
                name='GetMainURLFromList_newurl')
            ComputeGrids_21.inputPorts[0].configure(
                name='GetComputeGridsInputs_ligands')
            ComputeGrids_21.inputPorts[0].configure(datatype='LigandDB')
            ComputeGrids_21.inputPorts[1].configure(
                name='GetComputeGridsInputs_receptor_pdbqt')
            ComputeGrids_21.inputPorts[1].configure(
                datatype='receptor_prepared')
            ComputeGrids_21.inputPorts[2].configure(
                name='GetComputeGridsInputs_gpf_obj')
            ComputeGrids_21.inputPorts[2].configure(datatype='gpf_template')
            ## configure MacroNode input ports
            ComputeGrids_21.outputPorts[0].configure(
                name='MakeAutogridResultObj_autogrid_result_obj')
            ComputeGrids_21.outputPorts[0].configure(
                datatype='autogrid_results')
            ComputeGrids_21.outputPorts[1].configure(
                name='GetMainURLFromList_newurl')
            ComputeGrids_21.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            ComputeGrids_21.shrink()
            apply(ComputeGrids_21.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore ComputeGrids named ComputeGrids in network self.macroNetwork"
            print_exc()
            ComputeGrids_21 = None

        try:
            ## saving node AutodockVS ##
            from Adt.Macro.AutodockVS import AutodockVS
            AutodockVS_30 = AutodockVS(constrkw={},
                                       name='AutodockVS',
                                       library=Adt)
            self.macroNetwork.addNode(AutodockVS_30, 234, 289)
            apply(AutodockVS_30.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
            autodock_kryptonite_nbcr_net_34 = AutodockVS_30.macroNetwork.nodes[
                3]
            autodock_kryptonite_nbcr_net_34.inputPortByName[
                'ga_run'].widget.set(r"", run=False)
            apply(
                autodock_kryptonite_nbcr_net_34.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_34.inputPortByName['lib'].widget.set(
                r"", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName[
                'filter_file_url'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName[
                'ga_num_evals'].widget.set(r"", run=False)
            apply(
                autodock_kryptonite_nbcr_net_34.inputPortByName['sched'].
                widget.configure, (), {'choices': ('SGE', 'CSF')})
            autodock_kryptonite_nbcr_net_34.inputPortByName[
                'sched'].widget.set(r"SGE", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName[
                'ga_num_generations'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName[
                'userlib'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName[
                'ga_pop_size'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName[
                'localRun'].widget.set(0, run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName[
                'email'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName[
                'execPath'].widget.set(r"", run=False)

            ## saving connections for network AutodockVS ##
            AutodockVS_30.macroNetwork.freeze()
            AutodockVS_30.macroNetwork.unfreeze()

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

            ## modifying MacroOutputNode dynamic ports
            output_Ports_32 = AutodockVS_30.macroNetwork.opNode
            output_Ports_32.inputPorts[1].configure(singleConnection='auto')
            output_Ports_32.inputPorts[1].configure(
                name='GetMainURLFromList_newurl')
            AutodockVS_30.inputPorts[0].configure(
                name='PrepareADVSInputs_ligands')
            AutodockVS_30.inputPorts[0].configure(datatype='LigandDB')
            AutodockVS_30.inputPorts[1].configure(
                name='PrepareADVSInputs_autogrid_results')
            AutodockVS_30.inputPorts[1].configure(datatype='autogrid_results')
            AutodockVS_30.inputPorts[2].configure(
                name='PrepareADVSInputs_dpf_template_obj')
            AutodockVS_30.inputPorts[2].configure(datatype='dpf_template')
            ## configure MacroNode input ports
            AutodockVS_30.outputPorts[0].configure(
                name='GetMainURLFromList_newurl')
            AutodockVS_30.outputPorts[0].configure(datatype='string')
            ## configure MacroNode output ports
            AutodockVS_30.shrink()
            apply(AutodockVS_30.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore AutodockVS named AutodockVS in network self.macroNetwork"
            print_exc()
            AutodockVS_30 = None

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

        ## saving connections for network VirtualScreening ##
        input_Ports_1 = self.macroNetwork.ipNode
        if input_Ports_1 is not None and PrepareReceptor_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    PrepareReceptor_3,
                    "new",
                    "Pdb2pqrWS_CheckFileFormat_value",
                    blocking=True,
                    splitratio=[0.73953989601548642, 0.35343455296743803])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and PrepareReceptor_3 in network self.macroNetwork"
        if input_Ports_1 is not None and ComputeGrids_21 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    ComputeGrids_21,
                    "new",
                    "GetComputeGridsInputs_ligands",
                    blocking=True,
                    splitratio=[0.46529144721861959, 0.40210922169933605])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and ComputeGrids_21 in network self.macroNetwork"
        if input_Ports_1 is not None and AutodockVS_30 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    AutodockVS_30,
                    "ComputeGrids_GetComputeGridsInputs_ligands",
                    "PrepareADVSInputs_ligands",
                    blocking=True,
                    splitratio=[0.48337865988456058, 0.41105508936996049])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and AutodockVS_30 in network self.macroNetwork"
        if PrepareReceptor_3 is not None and ComputeGrids_21 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareReceptor_3,
                    ComputeGrids_21,
                    "PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj",
                    "GetComputeGridsInputs_receptor_pdbqt",
                    blocking=True,
                    splitratio=[0.32656364590133868, 0.43316260938324158])
            except:
                print "WARNING: failed to restore connection between PrepareReceptor_3 and ComputeGrids_21 in network self.macroNetwork"
        if ComputeGrids_21 is not None and AutodockVS_30 is not None:
            try:
                self.macroNetwork.connectNodes(
                    ComputeGrids_21,
                    AutodockVS_30,
                    "MakeAutogridResultObj_autogrid_result_obj",
                    "PrepareADVSInputs_autogrid_results",
                    blocking=True,
                    splitratio=[0.25195726140883218, 0.37435524480319915])
            except:
                print "WARNING: failed to restore connection between ComputeGrids_21 and AutodockVS_30 in network self.macroNetwork"
        if input_Ports_1 is not None and ComputeGrids_21 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    ComputeGrids_21,
                    "new",
                    "GetComputeGridsInputs_gpf_obj",
                    blocking=True,
                    splitratio=[0.3610566319618409, 0.20507643166097597])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and ComputeGrids_21 in network self.macroNetwork"
        if input_Ports_1 is not None and AutodockVS_30 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    AutodockVS_30,
                    "new",
                    "PrepareADVSInputs_dpf_template_obj",
                    blocking=True,
                    splitratio=[0.41221000935616448, 0.71284031297323347])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and AutodockVS_30 in network self.macroNetwork"
        output_Ports_2 = self.macroNetwork.opNode
        if AutodockVS_30 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    AutodockVS_30,
                    output_Ports_2,
                    "GetMainURLFromList_newurl",
                    "new",
                    blocking=True,
                    splitratio=[0.28632220295352073, 0.59933112675886213])
            except:
                print "WARNING: failed to restore connection between AutodockVS_30 and output_Ports_2 in network self.macroNetwork"
        if input_Ports_1 is not None and PrepareReceptor_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    PrepareReceptor_3,
                    "new",
                    "PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C",
                    blocking=True,
                    splitratio=[0.66210822612399844, 0.69280049494960727])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and PrepareReceptor_3 in network self.macroNetwork"
        self.macroNetwork.runOnNewData.value = False

        ## modifying MacroInputNode dynamic ports
        input_Ports_1 = self.macroNetwork.ipNode
        input_Ports_1.outputPorts[1].configure(
            name='PrepareReceptor_Pdb2pqrWS_CheckFileFormat_value')
        input_Ports_1.outputPorts[2].configure(
            name='ComputeGrids_GetComputeGridsInputs_ligands')
        input_Ports_1.outputPorts[3].configure(
            name='ComputeGrids_GetComputeGridsInputs_gpf_obj')
        input_Ports_1.outputPorts[4].configure(
            name='AutodockVS_PrepareADVSInputs_dpf_template_obj')
        input_Ports_1.outputPorts[5].configure(
            name=
            'PrepareReceptor_PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C'
        )

        ## 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='AutodockVS_GetMainURLFromList_newurl')
        ## configure MacroNode input ports
        VirtualScreening_0.inputPorts[0].configure(
            name='PrepareReceptor_Pdb2pqrWS_CheckFileFormat_value')
        VirtualScreening_0.inputPorts[0].configure(datatype='receptor')
        VirtualScreening_0.inputPorts[1].configure(
            name='ComputeGrids_GetComputeGridsInputs_ligands')
        VirtualScreening_0.inputPorts[1].configure(datatype='LigandDB')
        VirtualScreening_0.inputPorts[2].configure(
            name='ComputeGrids_GetComputeGridsInputs_gpf_obj')
        VirtualScreening_0.inputPorts[2].configure(datatype='gpf_template')
        VirtualScreening_0.inputPorts[3].configure(
            name='AutodockVS_PrepareADVSInputs_dpf_template_obj')
        VirtualScreening_0.inputPorts[3].configure(datatype='dpf_template')
        VirtualScreening_0.inputPorts[4].configure(
            name=
            'PrepareReceptor_PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C'
        )
        VirtualScreening_0.inputPorts[4].configure(datatype='boolean')
        ## configure MacroNode output ports
        VirtualScreening_0.outputPorts[0].configure(
            name='AutodockVS_GetMainURLFromList_newurl')
        VirtualScreening_0.outputPorts[0].configure(datatype='string')

        VirtualScreening_0.shrink()

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



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

try:
    ## saving node LoadMolecule5 ##
    from NetworkEditor.macros import MacroNode
    LoadMolecule5_3 = MacroNode(name='LoadMolecule5')
    masterNet.addNode(LoadMolecule5_3, 451, 480)
    output_Ports_5 = LoadMolecule5_3.macroNetwork.opNode
    apply(output_Ports_5.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
    output_Ports_5.move(235, 451)
    from Vision.StandardNodes import Eval
    abs_path_6 = Eval(constrkw={}, name='abs_path', library=stdlib)
    LoadMolecule5_3.macroNetwork.addNode(abs_path_6,260,76)
    apply(abs_path_6.inputPortByName['in1'].configure, (), {'datatype': 'string', 'defaultValue': None, 'required': True, 'originalDatatype': 'None'})
    apply(abs_path_6.outputPortByName['result'].configure, (), {'datatype': 'string'})
    abs_path_6.inputPortByName['command'].widget.set(r"os.path.abspath(in1)", run=False)
    abs_path_6.inputPortByName['importString'].widget.set(r"", run=False)
    apply(abs_path_6.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
    from Vision.StandardNodes import Generic
    FindMolPath_7 = Generic(constrkw={}, name='FindMolPath', library=stdlib)
    LoadMolecule5_3.macroNetwork.addNode(FindMolPath_7,217,149)
Esempio n. 37
0
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from AutoDockTools.VisionInterface.Adt import Adt
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        VirtualScreening_0 = self
        from traceback import print_exc
        from AutoDockTools.VisionInterface.Adt import Adt
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        masterNet.getEditor().addLibraryInstance(wslib,"WebServices.VisionInterface.WSNodes", "wslib")
        from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
        try:
            addOpalServerAsCategory("http://ws.nbcr.net/opal2", replace=False)
        except:
            pass
        try:
            addOpalServerAsCategory("http://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(217, 346)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_2=None

        try:
            ## saving node PrepareReceptor ##
            from Adt.Macro.PrepareReceptor import PrepareReceptor
            PrepareReceptor_3 = PrepareReceptor(constrkw={}, name='PrepareReceptor', library=Adt)
            self.macroNetwork.addNode(PrepareReceptor_3,96,114)
            apply(PrepareReceptor_3.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            Pdb2pqrWS_6 = PrepareReceptor_3.macroNetwork.nodes[2]
            Pdb2pqrOpalService_ws_nbcr_net_10 = Pdb2pqrWS_6.macroNetwork.nodes[3]
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['noopt'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['phi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['psi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['verbose'].widget.set(1, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['chain'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['nodebump'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['chi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['ligand'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['hbond'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['with_ph'].widget.set(r"", run=False)
            apply(Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['forcefield'].widget.configure, (), {'choices': ('AMBER', 'CHARMM', 'PARSE', 'TYL06')})
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['forcefield'].widget.set(r"AMBER", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['clean'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['inId'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['apbs_input'].widget.set(0, run=False)
            apply(Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['ffout'].widget.configure, (), {'choices': ('AMBER', 'CHARMM', 'PARSE', 'TYL06')})
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['ffout'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['localRun'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['rama'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['execPath'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_10.inputPortByName['assign_only'].widget.set(0, run=False)
            GetURLFromList_11 = Pdb2pqrWS_6.macroNetwork.nodes[4]
            GetURLFromList_11.inputPortByName['ext'].widget.set(r"pqr", run=False)

            ## saving connections for network Pdb2pqrWS ##
            Pdb2pqrWS_6.macroNetwork.freeze()
            Pdb2pqrWS_6.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_7 = Pdb2pqrWS_6.macroNetwork.ipNode
            input_Ports_7.outputPorts[1].configure(name='CheckFileFormat_value')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_8 = Pdb2pqrWS_6.macroNetwork.opNode
            output_Ports_8.inputPorts[1].configure(singleConnection='auto')
            output_Ports_8.inputPorts[2].configure(singleConnection='auto')
            output_Ports_8.inputPorts[1].configure(name='UpdateReceptor_receptor_obj')
            output_Ports_8.inputPorts[2].configure(name='UpdateReceptor_pdb2pqr_result')
            Pdb2pqrWS_6.inputPorts[0].configure(name='CheckFileFormat_value')
            Pdb2pqrWS_6.inputPorts[0].configure(datatype='receptor')
            ## configure MacroNode input ports
            Pdb2pqrWS_6.outputPorts[0].configure(name='UpdateReceptor_receptor_obj')
            Pdb2pqrWS_6.outputPorts[0].configure(datatype='receptor')
            Pdb2pqrWS_6.outputPorts[1].configure(name='UpdateReceptor_pdb2pqr_result')
            Pdb2pqrWS_6.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            Pdb2pqrWS_6.shrink()
            PrepareReceptorWS_13 = PrepareReceptor_3.macroNetwork.nodes[3]
            PrepareReceptorOpalService_ws_nbcr_net_17 = PrepareReceptorWS_13.macroNetwork.nodes[3]
            PrepareReceptorOpalService_ws_nbcr_net_17.inputPortByName['o'].widget.set(r"", run=False)
            PrepareReceptorOpalService_ws_nbcr_net_17.inputPortByName['v'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_17.inputPortByName['localRun'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_17.inputPortByName['execPath'].widget.set(r"", run=False)
            GetURLFromList_18 = PrepareReceptorWS_13.macroNetwork.nodes[4]
            GetURLFromList_18.inputPortByName['ext'].widget.set(r"pdbqt", run=False)
            DownloadToFile_19 = PrepareReceptorWS_13.macroNetwork.nodes[5]
            DownloadToFile_19.inputPortByName['overwrite'].widget.set(1, run=False)

            ## saving connections for network PrepareReceptorWS ##
            PrepareReceptorWS_13.macroNetwork.freeze()
            PrepareReceptorWS_13.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_14 = PrepareReceptorWS_13.macroNetwork.ipNode
            input_Ports_14.outputPorts[1].configure(name='CheckFileFormat_value')
            input_Ports_14.outputPorts[2].configure(name='PrepareReceptorOpalService_ws_nbcr_net_C')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_15 = PrepareReceptorWS_13.macroNetwork.opNode
            output_Ports_15.inputPorts[1].configure(singleConnection='auto')
            output_Ports_15.inputPorts[2].configure(singleConnection='auto')
            output_Ports_15.inputPorts[1].configure(name='UpdateReceptor_receptor_prepared_obj')
            output_Ports_15.inputPorts[2].configure(name='UpdateReceptor_receptor_result')
            PrepareReceptorWS_13.inputPorts[0].configure(name='CheckFileFormat_value')
            PrepareReceptorWS_13.inputPorts[0].configure(datatype='receptor')
            PrepareReceptorWS_13.inputPorts[1].configure(name='PrepareReceptorOpalService_ws_nbcr_net_C')
            PrepareReceptorWS_13.inputPorts[1].configure(datatype='boolean')
            ## configure MacroNode input ports
            PrepareReceptorWS_13.outputPorts[0].configure(name='UpdateReceptor_receptor_prepared_obj')
            PrepareReceptorWS_13.outputPorts[0].configure(datatype='receptor_prepared')
            PrepareReceptorWS_13.outputPorts[1].configure(name='UpdateReceptor_receptor_result')
            PrepareReceptorWS_13.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            PrepareReceptorWS_13.shrink()

            ## saving connections for network PrepareReceptor ##
            PrepareReceptor_3.macroNetwork.freeze()
            PrepareReceptor_3.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_4 = PrepareReceptor_3.macroNetwork.ipNode
            input_Ports_4.outputPorts[1].configure(name='Pdb2pqrWS_CheckFileFormat_value')
            input_Ports_4.outputPorts[2].configure(name='PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_5 = PrepareReceptor_3.macroNetwork.opNode
            output_Ports_5.inputPorts[1].configure(singleConnection='auto')
            output_Ports_5.inputPorts[2].configure(singleConnection='auto')
            output_Ports_5.inputPorts[1].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
            output_Ports_5.inputPorts[2].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_result')
            PrepareReceptor_3.inputPorts[0].configure(name='Pdb2pqrWS_CheckFileFormat_value')
            PrepareReceptor_3.inputPorts[0].configure(datatype='receptor')
            PrepareReceptor_3.inputPorts[1].configure(name='PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')
            PrepareReceptor_3.inputPorts[1].configure(datatype='boolean')
            ## configure MacroNode input ports
            PrepareReceptor_3.outputPorts[0].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
            PrepareReceptor_3.outputPorts[0].configure(datatype='receptor_prepared')
            PrepareReceptor_3.outputPorts[1].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_result')
            PrepareReceptor_3.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            PrepareReceptor_3.shrink()
            apply(PrepareReceptor_3.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore PrepareReceptor named PrepareReceptor in network self.macroNetwork"
            print_exc()
            PrepareReceptor_3=None

        try:
            ## saving node ComputeGrids ##
            from Adt.Macro.ComputeGrids import ComputeGrids
            ComputeGrids_21 = ComputeGrids(constrkw={}, name='ComputeGrids', library=Adt)
            self.macroNetwork.addNode(ComputeGrids_21,187,205)
            apply(ComputeGrids_21.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            prepareGPF_kryptonite_nbcr_net_25 = ComputeGrids_21.macroNetwork.nodes[3]
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['singlelib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['r_url'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['zpoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['filter_file_url'].widget.set(r"", run=False)
            apply(prepareGPF_kryptonite_nbcr_net_25.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_25.inputPortByName['lib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['ypoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['xcenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['p'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['o'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['zcenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['v'].widget.set(0, run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['userlib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['xpoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['localRun'].widget.set(0, run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['ycenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_25.inputPortByName['execPath'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_26 = ComputeGrids_21.macroNetwork.nodes[4]
            autogrid_kryptonite_nbcr_net_26.inputPortByName['infile_url'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_26.inputPortByName['l'].widget.set(r"output.glg", run=False)
            autogrid_kryptonite_nbcr_net_26.inputPortByName['o'].widget.set(0, run=False)
            autogrid_kryptonite_nbcr_net_26.inputPortByName['p'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_26.inputPortByName['localRun'].widget.set(0, run=False)
            autogrid_kryptonite_nbcr_net_26.inputPortByName['execPath'].widget.set(r"", run=False)
            GetURLFromList_29 = ComputeGrids_21.macroNetwork.nodes[7]
            GetURLFromList_29.inputPortByName['ext'].widget.set(r"gpf", run=False)

            ## saving connections for network ComputeGrids ##
            ComputeGrids_21.macroNetwork.freeze()
            ComputeGrids_21.macroNetwork.unfreeze()

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

            ## modifying MacroOutputNode dynamic ports
            output_Ports_23 = ComputeGrids_21.macroNetwork.opNode
            output_Ports_23.inputPorts[1].configure(singleConnection='auto')
            output_Ports_23.inputPorts[2].configure(singleConnection='auto')
            output_Ports_23.inputPorts[1].configure(name='MakeAutogridResultObj_autogrid_result_obj')
            output_Ports_23.inputPorts[2].configure(name='GetMainURLFromList_newurl')
            ComputeGrids_21.inputPorts[0].configure(name='GetComputeGridsInputs_ligands')
            ComputeGrids_21.inputPorts[0].configure(datatype='LigandDB')
            ComputeGrids_21.inputPorts[1].configure(name='GetComputeGridsInputs_receptor_pdbqt')
            ComputeGrids_21.inputPorts[1].configure(datatype='receptor_prepared')
            ComputeGrids_21.inputPorts[2].configure(name='GetComputeGridsInputs_gpf_obj')
            ComputeGrids_21.inputPorts[2].configure(datatype='gpf_template')
            ## configure MacroNode input ports
            ComputeGrids_21.outputPorts[0].configure(name='MakeAutogridResultObj_autogrid_result_obj')
            ComputeGrids_21.outputPorts[0].configure(datatype='autogrid_results')
            ComputeGrids_21.outputPorts[1].configure(name='GetMainURLFromList_newurl')
            ComputeGrids_21.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            ComputeGrids_21.shrink()
            apply(ComputeGrids_21.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore ComputeGrids named ComputeGrids in network self.macroNetwork"
            print_exc()
            ComputeGrids_21=None

        try:
            ## saving node AutodockVS ##
            from Adt.Macro.AutodockVS import AutodockVS
            AutodockVS_30 = AutodockVS(constrkw={}, name='AutodockVS', library=Adt)
            self.macroNetwork.addNode(AutodockVS_30,234,289)
            apply(AutodockVS_30.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            autodock_kryptonite_nbcr_net_34 = AutodockVS_30.macroNetwork.nodes[3]
            autodock_kryptonite_nbcr_net_34.inputPortByName['ga_run'].widget.set(r"", run=False)
            apply(autodock_kryptonite_nbcr_net_34.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_34.inputPortByName['lib'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName['filter_file_url'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName['ga_num_evals'].widget.set(r"", run=False)
            apply(autodock_kryptonite_nbcr_net_34.inputPortByName['sched'].widget.configure, (), {'choices': ('SGE', 'CSF')})
            autodock_kryptonite_nbcr_net_34.inputPortByName['sched'].widget.set(r"SGE", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName['ga_num_generations'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName['userlib'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName['ga_pop_size'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName['localRun'].widget.set(0, run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName['email'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_34.inputPortByName['execPath'].widget.set(r"", run=False)

            ## saving connections for network AutodockVS ##
            AutodockVS_30.macroNetwork.freeze()
            AutodockVS_30.macroNetwork.unfreeze()

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

            ## modifying MacroOutputNode dynamic ports
            output_Ports_32 = AutodockVS_30.macroNetwork.opNode
            output_Ports_32.inputPorts[1].configure(singleConnection='auto')
            output_Ports_32.inputPorts[1].configure(name='GetMainURLFromList_newurl')
            AutodockVS_30.inputPorts[0].configure(name='PrepareADVSInputs_ligands')
            AutodockVS_30.inputPorts[0].configure(datatype='LigandDB')
            AutodockVS_30.inputPorts[1].configure(name='PrepareADVSInputs_autogrid_results')
            AutodockVS_30.inputPorts[1].configure(datatype='autogrid_results')
            AutodockVS_30.inputPorts[2].configure(name='PrepareADVSInputs_dpf_template_obj')
            AutodockVS_30.inputPorts[2].configure(datatype='dpf_template')
            ## configure MacroNode input ports
            AutodockVS_30.outputPorts[0].configure(name='GetMainURLFromList_newurl')
            AutodockVS_30.outputPorts[0].configure(datatype='string')
            ## configure MacroNode output ports
            AutodockVS_30.shrink()
            apply(AutodockVS_30.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore AutodockVS named AutodockVS in network self.macroNetwork"
            print_exc()
            AutodockVS_30=None

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

        ## saving connections for network VirtualScreening ##
        input_Ports_1 = self.macroNetwork.ipNode
        if input_Ports_1 is not None and PrepareReceptor_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, PrepareReceptor_3, "new", "Pdb2pqrWS_CheckFileFormat_value", blocking=True
                    , splitratio=[0.73953989601548642, 0.35343455296743803])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and PrepareReceptor_3 in network self.macroNetwork"
        if input_Ports_1 is not None and ComputeGrids_21 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, ComputeGrids_21, "new", "GetComputeGridsInputs_ligands", blocking=True
                    , splitratio=[0.46529144721861959, 0.40210922169933605])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and ComputeGrids_21 in network self.macroNetwork"
        if input_Ports_1 is not None and AutodockVS_30 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, AutodockVS_30, "ComputeGrids_GetComputeGridsInputs_ligands", "PrepareADVSInputs_ligands", blocking=True
                    , splitratio=[0.48337865988456058, 0.41105508936996049])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and AutodockVS_30 in network self.macroNetwork"
        if PrepareReceptor_3 is not None and ComputeGrids_21 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareReceptor_3, ComputeGrids_21, "PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj", "GetComputeGridsInputs_receptor_pdbqt", blocking=True
                    , splitratio=[0.32656364590133868, 0.43316260938324158])
            except:
                print "WARNING: failed to restore connection between PrepareReceptor_3 and ComputeGrids_21 in network self.macroNetwork"
        if ComputeGrids_21 is not None and AutodockVS_30 is not None:
            try:
                self.macroNetwork.connectNodes(
                    ComputeGrids_21, AutodockVS_30, "MakeAutogridResultObj_autogrid_result_obj", "PrepareADVSInputs_autogrid_results", blocking=True
                    , splitratio=[0.25195726140883218, 0.37435524480319915])
            except:
                print "WARNING: failed to restore connection between ComputeGrids_21 and AutodockVS_30 in network self.macroNetwork"
        if input_Ports_1 is not None and ComputeGrids_21 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, ComputeGrids_21, "new", "GetComputeGridsInputs_gpf_obj", blocking=True
                    , splitratio=[0.3610566319618409, 0.20507643166097597])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and ComputeGrids_21 in network self.macroNetwork"
        if input_Ports_1 is not None and AutodockVS_30 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, AutodockVS_30, "new", "PrepareADVSInputs_dpf_template_obj", blocking=True
                    , splitratio=[0.41221000935616448, 0.71284031297323347])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and AutodockVS_30 in network self.macroNetwork"
        output_Ports_2 = self.macroNetwork.opNode
        if AutodockVS_30 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    AutodockVS_30, output_Ports_2, "GetMainURLFromList_newurl", "new", blocking=True
                    , splitratio=[0.28632220295352073, 0.59933112675886213])
            except:
                print "WARNING: failed to restore connection between AutodockVS_30 and output_Ports_2 in network self.macroNetwork"
        if input_Ports_1 is not None and PrepareReceptor_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, PrepareReceptor_3, "new", "PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C", blocking=True
                    , splitratio=[0.66210822612399844, 0.69280049494960727])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and PrepareReceptor_3 in network self.macroNetwork"
        self.macroNetwork.runOnNewData.value = False

        ## modifying MacroInputNode dynamic ports
        input_Ports_1 = self.macroNetwork.ipNode
        input_Ports_1.outputPorts[1].configure(name='PrepareReceptor_Pdb2pqrWS_CheckFileFormat_value')
        input_Ports_1.outputPorts[2].configure(name='ComputeGrids_GetComputeGridsInputs_ligands')
        input_Ports_1.outputPorts[3].configure(name='ComputeGrids_GetComputeGridsInputs_gpf_obj')
        input_Ports_1.outputPorts[4].configure(name='AutodockVS_PrepareADVSInputs_dpf_template_obj')
        input_Ports_1.outputPorts[5].configure(name='PrepareReceptor_PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')

        ## 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='AutodockVS_GetMainURLFromList_newurl')
        ## configure MacroNode input ports
        VirtualScreening_0.inputPorts[0].configure(name='PrepareReceptor_Pdb2pqrWS_CheckFileFormat_value')
        VirtualScreening_0.inputPorts[0].configure(datatype='receptor')
        VirtualScreening_0.inputPorts[1].configure(name='ComputeGrids_GetComputeGridsInputs_ligands')
        VirtualScreening_0.inputPorts[1].configure(datatype='LigandDB')
        VirtualScreening_0.inputPorts[2].configure(name='ComputeGrids_GetComputeGridsInputs_gpf_obj')
        VirtualScreening_0.inputPorts[2].configure(datatype='gpf_template')
        VirtualScreening_0.inputPorts[3].configure(name='AutodockVS_PrepareADVSInputs_dpf_template_obj')
        VirtualScreening_0.inputPorts[3].configure(datatype='dpf_template')
        VirtualScreening_0.inputPorts[4].configure(name='PrepareReceptor_PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')
        VirtualScreening_0.inputPorts[4].configure(datatype='boolean')
        ## configure MacroNode output ports
        VirtualScreening_0.outputPorts[0].configure(name='AutodockVS_GetMainURLFromList_newurl')
        VirtualScreening_0.outputPorts[0].configure(datatype='string')

        VirtualScreening_0.shrink()

        ## reset modifications ##
        VirtualScreening_0.resetTags()
        VirtualScreening_0.buildOriginalList()
Esempio n. 38
0
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        recluster_11 = self
        from traceback import print_exc

        ## loading libraries ##
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        self.macroNetwork.getEditor().addLibraryInstance(
            molkitlib, "MolKit.VisionInterface.MolKitNodes", "molkitlib")

        from Vision.StandardNodes import stdlib
        self.macroNetwork.getEditor().addLibraryInstance(
            stdlib, "Vision.StandardNodes", "stdlib")

        try:
            ## saving node input Ports ##
            input_Ports_12 = self.macroNetwork.ipNode
            input_Ports_12.move(172, 137)
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_12 = None

        try:
            ## saving node output Ports ##
            output_Ports_13 = self.macroNetwork.opNode
            output_Ports_13.move(172, 479)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_13 = None

        try:
            ## saving node Docking ##
            from Vision.StandardNodes import Generic
            Docking_16 = Generic(constrkw={}, name='Docking', library=stdlib)
            self.macroNetwork.addNode(Docking_16, 189, 250)
            apply(
                Docking_16.addInputPort, (), {
                    'name': 'docking_logs',
                    'cast': True,
                    'datatype': 'list',
                    'balloon':
                    'list of docking log files to be read into as a single Docking',
                    'height': 12,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'cyan'
                })
            apply(
                Docking_16.addInputPort, (), {
                    'name': 'rmsTool',
                    'cast': True,
                    'datatype': 'None',
                    'balloon': 'rmsTool to be used for clustering',
                    'required': False,
                    'height': 8,
                    'width': 12,
                    'shape': 'diamond',
                    'color': 'white'
                })
            apply(
                Docking_16.addOutputPort, (), {
                    'name': 'docking',
                    'datatype': 'None',
                    'balloon': 'docking instance',
                    'height': 8,
                    'width': 12,
                    'shape': 'diamond',
                    'color': 'white'
                })
            code = """def doit(self, docking_logs, rmsTool):
        from AutoDockTools.Docking import Docking
        d = Docking()
        for f in docking_logs:
                d.readDlg(f)
        d.clusterer.rmsTool = rmsTool
        self.outputData(docking = d)           
                    
        
## to ouput data on port docking use
## self.outputData(docking=data)


"""
            Docking_16.configure(function=code)
        except:
            print "WARNING: failed to restore Generic named Docking in network self.macroNetwork"
            print_exc()
            Docking_16 = None

        try:
            ## saving node rmsTool ##
            from Vision.StandardNodes import Generic
            rmsTool_17 = Generic(constrkw={}, name='rmsTool', library=stdlib)
            self.macroNetwork.addNode(rmsTool_17, 206, 197)
            apply(
                rmsTool_17.addInputPort, (), {
                    'name': 'crds',
                    'cast': True,
                    'datatype': 'coordinates3D',
                    'balloon':
                    'coordinates to use as reference for rms calculation.',
                    'height': 8,
                    'width': 12,
                    'shape': 'rect',
                    'color': 'green'
                })
            apply(
                rmsTool_17.addOutputPort, (), {
                    'name': 'rmsTool',
                    'datatype': 'None',
                    'balloon': 'rmsTool created using crds as reference',
                    'height': 8,
                    'width': 12,
                    'shape': 'diamond',
                    'color': 'white'
                })
            code = """def doit(self, crds):
	from  mglutil.math.rmsd  import RMSDCalculator
	rmsTool = RMSDCalculator(crds)
	self.outputData(rmsTool = rmsTool)
	
"""
            rmsTool_17.configure(function=code)
        except:
            print "WARNING: failed to restore Generic named rmsTool in network self.macroNetwork"
            print_exc()
            rmsTool_17 = None

        try:
            ## saving node Read Molecule ##
            from MolKit.VisionInterface.MolKitNodes import ReadMolecule
            Read_Molecule_18 = ReadMolecule(constrkw={},
                                            name='Read Molecule',
                                            library=molkitlib)
            self.macroNetwork.addNode(Read_Molecule_18, 243, 16)
            apply(Read_Molecule_18.inputPortByName['filename'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'oval'
            })
            apply(Read_Molecule_18.outputPortByName['MolSets'].configure, (), {
                'color': '#c64e70',
                'shape': 'oval'
            })
            Read_Molecule_18.inputPortByName['filename'].widget.set(
                "ind.pdbqt", run=False)
        except:
            print "WARNING: failed to restore ReadMolecule named Read Molecule in network self.macroNetwork"
            print_exc()
            Read_Molecule_18 = None

        try:
            ## saving node Index ##
            from Vision.StandardNodes import Index
            Index_19 = Index(constrkw={}, name='Index', library=stdlib)
            self.macroNetwork.addNode(Index_19, 243, 66)
            apply(
                Index_19.inputPortByName['data'].configure, (), {
                    'datatype': 'MoleculeSet',
                    'cast': True,
                    'shape': 'oval',
                    'color': '#c64e70'
                })
            apply(Index_19.inputPortByName['index'].configure, (), {
                'color': 'yellow',
                'cast': True,
                'shape': 'circle'
            })
            apply(Index_19.outputPortByName['data'].configure, (), {
                'color': 'white',
                'shape': 'diamond'
            })
        except:
            print "WARNING: failed to restore Index named Index in network self.macroNetwork"
            print_exc()
            Index_19 = None

        try:
            ## saving node Get allAtoms.coords ##
            from Vision.StandardNodes import GetAttr
            Get_allAtoms_coords_20 = GetAttr(constrkw={},
                                             name='Get allAtoms.coords',
                                             library=stdlib)
            self.macroNetwork.addNode(Get_allAtoms_coords_20, 243, 115)
            apply(Get_allAtoms_coords_20.inputPortByName['objects'].configure,
                  (), {
                      'color': 'white',
                      'cast': True,
                      'shape': 'diamond'
                  })
            apply(Get_allAtoms_coords_20.inputPortByName['attr'].configure, (),
                  {
                      'color': 'white',
                      'cast': True,
                      'shape': 'oval'
                  })
            apply(Get_allAtoms_coords_20.outputPortByName['attrs'].configure,
                  (), {
                      'color': 'cyan',
                      'shape': 'oval'
                  })
            apply(
                Get_allAtoms_coords_20.inputPortByName['attr'].widget.
                configure, (), {
                    'choices':
                    ('AAradii', 'AtomRadiiPatterns', 'NodesFromName', 'ROOT',
                     'TORSDOF', '_MarkTree', '__cmp__', '__doc__', '__eq__',
                     '__hash__', '__init__', '__module__', '__ne__',
                     '__repr__', '__str__', '_atomRadius', '_copyNode',
                     '_copy_atom_attr', '_fit_atom_into_tree',
                     '_numberOfDeletedNodes', 'addBond', 'adopt', 'allAtoms',
                     'assignUniqIndex', 'atmNum', 'attach_nonbonded_fragments',
                     'bonds', 'bondsflag', 'buildBondsBhtree',
                     'buildBondsByDistance', 'buildBondsByDistanceOnAtoms',
                     'buildBrokenBonds', 'chains', 'childByName', 'children',
                     'childrenName', 'childrenSetClass', 'closerThan',
                     'compare', 'compiled_patterns', 'configureProgressBar',
                     'copy', 'defaultRadii', 'deleteSubTree', 'dump',
                     'elementType', 'findLevels', 'findType', 'full_name',
                     'get', 'getAtoms', 'getCenter', 'getNext',
                     'getParentOfType', 'getPrevious', 'getRoot',
                     'getTypeList', 'hasBonds', 'hasSS', 'isAbove', 'isBelow',
                     'levels', 'makeNameUniq', 'merge', 'mergeNPH', 'name',
                     'ndihe', 'p', 'parent', 'parser', 'read', 'remove',
                     'removeAllHydrogens', 'removeBond', 'secondaryStructure',
                     'secondaryStructureFromFile',
                     'secondaryStructureFromStride', 'setClass', 'split',
                     'subTree', 'top', 'torTree', 'updateProgressBar', 'write')
                })
            Get_allAtoms_coords_20.inputPortByName['attr'].widget.set(
                "allAtoms.coords", run=False)
            apply(Get_allAtoms_coords_20.configure, (), {'expanded': True})
        except:
            print "WARNING: failed to restore GetAttr named Get allAtoms.coords in network self.macroNetwork"
            print_exc()
            Get_allAtoms_coords_20 = None

        try:
            ## saving node Get clusterer ##
            from Vision.StandardNodes import GetAttr
            Get_clusterer_21 = GetAttr(constrkw={},
                                       name='Get clusterer',
                                       library=stdlib)
            self.macroNetwork.addNode(Get_clusterer_21, 189, 306)
            apply(Get_clusterer_21.inputPortByName['objects'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'diamond'
            })
            apply(Get_clusterer_21.inputPortByName['attr'].configure, (), {
                'color': 'white',
                'cast': True,
                'shape': 'oval'
            })
            apply(Get_clusterer_21.outputPortByName['attrs'].configure, (), {
                'color': 'cyan',
                'shape': 'oval'
            })
            apply(
                Get_clusterer_21.inputPortByName['attr'].widget.configure, (),
                {
                    'choices':
                    ('__doc__', '__init__', '__module__', 'addConformations',
                     'ch', 'clusterer', 'clusterer_dict', 'defaultParser',
                     'dlo_list', 'flex_res', 'ligMol', 'parser', 'readDlg',
                     'readEntropiaResults', 'readXMLResults', 'set_ligand',
                     'version', 'warnings', 'writeConformation',
                     'write_current_conformation')
                })
            Get_clusterer_21.inputPortByName['attr'].widget.set("clusterer",
                                                                run=False)
            apply(Get_clusterer_21.configure, (), {'expanded': True})
        except:
            print "WARNING: failed to restore GetAttr named Get clusterer in network self.macroNetwork"
            print_exc()
            Get_clusterer_21 = None

        try:
            ## saving node Index ##
            from Vision.StandardNodes import Index
            Index_22 = Index(constrkw={}, name='Index', library=stdlib)
            self.macroNetwork.addNode(Index_22, 188, 383)
            apply(Index_22.inputPortByName['data'].configure, (), {
                'datatype': 'list',
                'cast': True,
                'shape': 'oval',
                'color': 'cyan'
            })
            apply(Index_22.inputPortByName['index'].configure, (), {
                'color': 'yellow',
                'cast': True,
                'shape': 'circle'
            })
            apply(Index_22.outputPortByName['data'].configure, (), {
                'color': 'white',
                'shape': 'diamond'
            })
        except:
            print "WARNING: failed to restore Index named Index in network self.macroNetwork"
            print_exc()
            Index_22 = None

        try:
            ## saving node make clustering ##
            from Vision.StandardNodes import Generic
            make_clustering_23 = Generic(constrkw={},
                                         name='make clustering',
                                         library=stdlib)
            self.macroNetwork.addNode(make_clustering_23, 189, 432)
            apply(
                make_clustering_23.addInputPort, (), {
                    'name': 'clusterer',
                    'cast': True,
                    'datatype': 'None',
                    'balloon': 'clusterer which will make the new clustering',
                    'height': 8,
                    'width': 12,
                    'shape': 'diamond',
                    'color': 'white'
                })
            apply(
                make_clustering_23.addInputPort, (), {
                    'name': 'tolerance',
                    'cast': True,
                    'datatype': 'float',
                    'balloon': 'rms tolerance for the new clustering',
                    'height': 12,
                    'width': 12,
                    'shape': 'circle',
                    'color': 'green'
                })
            apply(
                make_clustering_23.addOutputPort, (), {
                    'name': 'clustering',
                    'datatype': 'None',
                    'balloon': 'clustering at newest rms',
                    'height': 8,
                    'width': 12,
                    'shape': 'diamond',
                    'color': 'white'
                })
            code = """def doit(self, clusterer, tolerance):
	clusterer.make_clustering(tolerance)
	self.outputData(clustering = clusterer.clustering_dict[tolerance])
"""
            make_clustering_23.configure(function=code)
        except:
            print "WARNING: failed to restore Generic named make clustering in network self.macroNetwork"
            print_exc()
            make_clustering_23 = None

        try:
            ## saving node Dial ##
            from Vision.StandardNodes import DialNE
            Dial_24 = DialNE(constrkw={}, name='Dial', library=stdlib)
            self.macroNetwork.addNode(Dial_24, 233, 380)
            apply(Dial_24.inputPortByName['dial'].configure, (), {
                'color': 'green',
                'cast': True,
                'shape': 'circle'
            })
            apply(Dial_24.inputPortByName['mini'].configure, (), {
                'color': 'green',
                'cast': True,
                'shape': 'circle'
            })
            apply(Dial_24.inputPortByName['maxi'].configure, (), {
                'color': 'green',
                'cast': True,
                'shape': 'circle'
            })
            apply(Dial_24.outputPortByName['value'].configure, (), {
                'color': 'green',
                'shape': 'circle'
            })
            Dial_24.inputPortByName['dial'].widget.set(3.0, run=False)
            apply(Dial_24.configure, (), {'expanded': False})
        except:
            print "WARNING: failed to restore DialNE named Dial in network self.macroNetwork"
            print_exc()
            Dial_24 = None

        self.macroNetwork.freeze()

        ## saving connections for network recluster ##
        if rmsTool_17 is not None and Docking_16 is not None:
            try:
                self.macroNetwork.connectNodes(rmsTool_17,
                                               Docking_16,
                                               "rmsTool",
                                               "rmsTool",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between rmsTool_17 and Docking_16 in network self.macroNetwork"
        if Read_Molecule_18 is not None and Index_19 is not None:
            try:
                self.macroNetwork.connectNodes(Read_Molecule_18,
                                               Index_19,
                                               "MolSets",
                                               "data",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Read_Molecule_18 and Index_19 in network self.macroNetwork"
        if Index_19 is not None and Get_allAtoms_coords_20 is not None:
            try:
                self.macroNetwork.connectNodes(Index_19,
                                               Get_allAtoms_coords_20,
                                               "data",
                                               "objects",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Index_19 and Get_allAtoms_coords_20 in network self.macroNetwork"
        if Get_allAtoms_coords_20 is not None and rmsTool_17 is not None:
            try:
                self.macroNetwork.connectNodes(Get_allAtoms_coords_20,
                                               rmsTool_17,
                                               "attrs",
                                               "crds",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Get_allAtoms_coords_20 and rmsTool_17 in network self.macroNetwork"
        if Docking_16 is not None and Get_clusterer_21 is not None:
            try:
                self.macroNetwork.connectNodes(Docking_16,
                                               Get_clusterer_21,
                                               "docking",
                                               "objects",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Docking_16 and Get_clusterer_21 in network self.macroNetwork"
        if Get_clusterer_21 is not None and Index_22 is not None:
            try:
                self.macroNetwork.connectNodes(Get_clusterer_21,
                                               Index_22,
                                               "attrs",
                                               "data",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Get_clusterer_21 and Index_22 in network self.macroNetwork"
        if Index_22 is not None and make_clustering_23 is not None:
            try:
                self.macroNetwork.connectNodes(Index_22,
                                               make_clustering_23,
                                               "data",
                                               "clusterer",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Index_22 and make_clustering_23 in network self.macroNetwork"
        if Dial_24 is not None and make_clustering_23 is not None:
            try:
                self.macroNetwork.connectNodes(Dial_24,
                                               make_clustering_23,
                                               "value",
                                               "tolerance",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Dial_24 and make_clustering_23 in network self.macroNetwork"
        output_Ports_13 = self.macroNetwork.opNode
        if make_clustering_23 is not None and output_Ports_13 is not None:
            try:
                self.macroNetwork.connectNodes(make_clustering_23,
                                               output_Ports_13,
                                               "clustering",
                                               "new",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between make_clustering_23 and output_Ports_13 in network self.macroNetwork"
        input_Ports_12 = self.macroNetwork.ipNode
        if input_Ports_12 is not None and Docking_16 is not None:
            try:
                self.macroNetwork.connectNodes(input_Ports_12,
                                               Docking_16,
                                               "new",
                                               "docking_logs",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between input_Ports_12 and Docking_16 in network self.macroNetwork"
        self.macroNetwork.unfreeze()

        recluster_11.shrink()

        ## reset modifications ##
        recluster_11.resetTags()
        recluster_11.buildOriginalList()
Esempio n. 39
0
 def __init__(self, constrkw={}, name='AD3Gpf', **kw):
     kw['name'] = name
     MacroNode.__init__(*(self, ), **kw)
    PrepareReceptor_2.outputPorts[0].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
    PrepareReceptor_2.outputPorts[0].configure(datatype='receptor_prepared')
    PrepareReceptor_2.outputPorts[1].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_result')
    PrepareReceptor_2.outputPorts[1].configure(datatype='string')
    ## configure MacroNode output ports
    PrepareReceptor_2.shrink()
    apply(PrepareReceptor_2.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
except:
    print "WARNING: failed to restore PrepareReceptor named PrepareReceptor in network masterNet"
    print_exc()
    PrepareReceptor_2=None

try:
    ## saving node Vina ##
    from NetworkEditor.macros import MacroNode
    Vina_20 = MacroNode(name='Vina')
    masterNet.addNode(Vina_20, 350, 259)
    output_Ports_22 = Vina_20.macroNetwork.opNode
    apply(output_Ports_22.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
    from NetworkEditor.items import FunctionNode
    AutodockVina_Screening_kryptonite_nbcr_net_23 = 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)
    Vina_20.macroNetwork.addNode(AutodockVina_Screening_kryptonite_nbcr_net_23,217,185)
    apply(AutodockVina_Screening_kryptonite_nbcr_net_23.inputPortByName['receptor'].configure, (), {'defaultValue': None})
    apply(AutodockVina_Screening_kryptonite_nbcr_net_23.inputPortByName['urllib'].configure, (), {'defaultValue': None})
    apply(AutodockVina_Screening_kryptonite_nbcr_net_23.inputPortByName['userlib'].configure, (), {'defaultValue': None})
    apply(AutodockVina_Screening_kryptonite_nbcr_net_23.inputPortByName['config'].configure, (), {'defaultValue': None, 'required': True})
    apply(AutodockVina_Screening_kryptonite_nbcr_net_23.inputPortByName['filter'].configure, (), {'defaultValue': None})
    apply(AutodockVina_Screening_kryptonite_nbcr_net_23.inputPortByName['num_modes'].widget.configure, (), {'choices': ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10')})
    AutodockVina_Screening_kryptonite_nbcr_net_23.inputPortByName['num_modes'].widget.set(r"", run=False)
    apply(AutodockVina_Screening_kryptonite_nbcr_net_23.inputPortByName['energy_range'].widget.configure, (), {'choices': ('1', '2', '3')})
    AutodockVina_Screening_kryptonite_nbcr_net_23.inputPortByName['energy_range'].widget.set(r"", run=False)
Esempio n. 41
0
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from Vision.matplotlibNodes import matplotliblib
        from MyDefaultLib import mydefaultlib
        ## building macro network ##
        plotdb10FFT_0 = self
        from traceback import print_exc
        ## loading libraries ##
        from Vision.matplotlibNodes import matplotliblib
        self.macroNetwork.getEditor().addLibraryInstance(matplotliblib,"Vision.matplotlibNodes", "matplotliblib")

        from MyDefaultLib import mydefaultlib
        self.macroNetwork.getEditor().addLibraryInstance(mydefaultlib,"MyDefaultLib", "mydefaultlib")

        try:
            ## saving node input Ports ##
            input_Ports_1 = self.macroNetwork.ipNode
        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
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_2=None

        try:
            ## saving node Plot ##
            from Vision.matplotlibNodes import PlotNE
            Plot_3 = PlotNE(constrkw = {}, name='Plot', library=matplotliblib)
            self.macroNetwork.addNode(Plot_3,220,210)
        except:
            print "WARNING: failed to restore PlotNE named Plot in network self.macroNetwork"
            print_exc()
            Plot_3=None

        try:
            ## saving node db10FFT ##
            from MyDefaultLib.signal.db10FFT import db10FFT
            db10FFT_4 = db10FFT(constrkw = {}, name='db10FFT', library=mydefaultlib)
            self.macroNetwork.addNode(db10FFT_4,202,122)
            apply(db10FFT_4.inputPortByName['data'].configure, (), {'color': 'white'})
            apply(db10FFT_4.inputPortByName['fs'].configure, (), {'color': 'white'})
            apply(db10FFT_4.inputPortByName['nfft'].configure, (), {'color': 'white', 'shape': 'diamond'})
        except:
            print "WARNING: failed to restore db10FFT named db10FFT in network self.macroNetwork"
            print_exc()
            db10FFT_4=None

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

        ## saving connections for network plotdb10FFT ##
        if db10FFT_4 is not None and Plot_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    db10FFT_4, Plot_3, "out0", "y", blocking=True)
            except:
                print "WARNING: failed to restore connection between db10FFT_4 and Plot_3 in network self.macroNetwork"
        if db10FFT_4 is not None and Plot_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    db10FFT_4, Plot_3, "freqs", "x", blocking=True)
            except:
                print "WARNING: failed to restore connection between db10FFT_4 and Plot_3 in network self.macroNetwork"
        input_Ports_1 = self.macroNetwork.ipNode
        if input_Ports_1 is not None and db10FFT_4 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, db10FFT_4, "new", "data", blocking=True)
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and db10FFT_4 in network self.macroNetwork"
        if input_Ports_1 is not None and db10FFT_4 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, db10FFT_4, "new", "fs", blocking=True)
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and db10FFT_4 in network self.macroNetwork"
        output_Ports_2 = self.macroNetwork.opNode
        if Plot_3 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Plot_3, output_Ports_2, "plot", "new", blocking=True)
            except:
                print "WARNING: failed to restore connection between Plot_3 and output_Ports_2 in network self.macroNetwork"
        self.macroNetwork.unfreeze()

#self.macroNetwork.run()

        plotdb10FFT_0.shrink()

        ## reset modifications ##
        plotdb10FFT_0.resetTags()
        plotdb10FFT_0.buildOriginalList()
Esempio n. 42
0
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        recluster_11 = self
        from traceback import print_exc

        ## loading libraries ##
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        self.macroNetwork.getEditor().addLibraryInstance(molkitlib,"MolKit.VisionInterface.MolKitNodes", "molkitlib")

        from Vision.StandardNodes import stdlib
        self.macroNetwork.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")

        try:
            ## saving node input Ports ##
            input_Ports_12 = self.macroNetwork.ipNode
            input_Ports_12.move(172, 137)
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_12=None

        try:
            ## saving node output Ports ##
            output_Ports_13 = self.macroNetwork.opNode
            output_Ports_13.move(172, 479)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_13=None

        try:
            ## saving node Docking ##
            from Vision.StandardNodes import Generic
            Docking_16 = Generic(constrkw = {}, name='Docking', library=stdlib)
            self.macroNetwork.addNode(Docking_16,189,250)
            apply(Docking_16.addInputPort, (), {'name': 'docking_logs', 'cast': True, 'datatype': 'list', 'balloon': 'list of docking log files to be read into as a single Docking', 'height': 12, 'width': 12, 'shape': 'oval', 'color': 'cyan'})
            apply(Docking_16.addInputPort, (), {'name': 'rmsTool', 'cast': True, 'datatype': 'None', 'balloon': 'rmsTool to be used for clustering', 'required': False, 'height': 8, 'width': 12, 'shape': 'diamond', 'color': 'white'})
            apply(Docking_16.addOutputPort, (), {'name': 'docking', 'datatype': 'None', 'balloon': 'docking instance', 'height': 8, 'width': 12, 'shape': 'diamond', 'color': 'white'})
            code = """def doit(self, docking_logs, rmsTool):
        from AutoDockTools.Docking import Docking
        d = Docking()
        for f in docking_logs:
                d.readDlg(f)
        d.clusterer.rmsTool = rmsTool
        self.outputData(docking = d)           
                    
        
## to ouput data on port docking use
## self.outputData(docking=data)


"""
            Docking_16.configure(function=code)
        except:
            print "WARNING: failed to restore Generic named Docking in network self.macroNetwork"
            print_exc()
            Docking_16=None

        try:
            ## saving node rmsTool ##
            from Vision.StandardNodes import Generic
            rmsTool_17 = Generic(constrkw = {}, name='rmsTool', library=stdlib)
            self.macroNetwork.addNode(rmsTool_17,206,197)
            apply(rmsTool_17.addInputPort, (), {'name': 'crds', 'cast': True, 'datatype': 'coordinates3D', 'balloon': 'coordinates to use as reference for rms calculation.', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'green'})
            apply(rmsTool_17.addOutputPort, (), {'name': 'rmsTool', 'datatype': 'None', 'balloon': 'rmsTool created using crds as reference', 'height': 8, 'width': 12, 'shape': 'diamond', 'color': 'white'})
            code = """def doit(self, crds):
	from  mglutil.math.rmsd  import RMSDCalculator
	rmsTool = RMSDCalculator(crds)
	self.outputData(rmsTool = rmsTool)
	
"""
            rmsTool_17.configure(function=code)
        except:
            print "WARNING: failed to restore Generic named rmsTool in network self.macroNetwork"
            print_exc()
            rmsTool_17=None

        try:
            ## saving node Read Molecule ##
            from MolKit.VisionInterface.MolKitNodes import ReadMolecule
            Read_Molecule_18 = ReadMolecule(constrkw = {}, name='Read Molecule', library=molkitlib)
            self.macroNetwork.addNode(Read_Molecule_18,243,16)
            apply(Read_Molecule_18.inputPortByName['filename'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Read_Molecule_18.outputPortByName['MolSets'].configure, (), {'color': '#c64e70', 'shape': 'oval'})
            Read_Molecule_18.inputPortByName['filename'].widget.set("ind.pdbqt", run=False)
        except:
            print "WARNING: failed to restore ReadMolecule named Read Molecule in network self.macroNetwork"
            print_exc()
            Read_Molecule_18=None

        try:
            ## saving node Index ##
            from Vision.StandardNodes import Index
            Index_19 = Index(constrkw = {}, name='Index', library=stdlib)
            self.macroNetwork.addNode(Index_19,243,66)
            apply(Index_19.inputPortByName['data'].configure, (), {'datatype': 'MoleculeSet', 'cast': True, 'shape': 'oval', 'color': '#c64e70'})
            apply(Index_19.inputPortByName['index'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(Index_19.outputPortByName['data'].configure, (), {'color': 'white', 'shape': 'diamond'})
        except:
            print "WARNING: failed to restore Index named Index in network self.macroNetwork"
            print_exc()
            Index_19=None

        try:
            ## saving node Get allAtoms.coords ##
            from Vision.StandardNodes import GetAttr
            Get_allAtoms_coords_20 = GetAttr(constrkw = {}, name='Get allAtoms.coords', library=stdlib)
            self.macroNetwork.addNode(Get_allAtoms_coords_20,243,115)
            apply(Get_allAtoms_coords_20.inputPortByName['objects'].configure, (), {'color': 'white', 'cast': True, 'shape': 'diamond'})
            apply(Get_allAtoms_coords_20.inputPortByName['attr'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Get_allAtoms_coords_20.outputPortByName['attrs'].configure, (), {'color': 'cyan', 'shape': 'oval'})
            apply(Get_allAtoms_coords_20.inputPortByName['attr'].widget.configure, (), {'choices': ('AAradii', 'AtomRadiiPatterns', 'NodesFromName', 'ROOT', 'TORSDOF', '_MarkTree', '__cmp__', '__doc__', '__eq__', '__hash__', '__init__', '__module__', '__ne__', '__repr__', '__str__', '_atomRadius', '_copyNode', '_copy_atom_attr', '_fit_atom_into_tree', '_numberOfDeletedNodes', 'addBond', 'adopt', 'allAtoms', 'assignUniqIndex', 'atmNum', 'attach_nonbonded_fragments', 'bonds', 'bondsflag', 'buildBondsBhtree', 'buildBondsByDistance', 'buildBondsByDistanceOnAtoms', 'buildBrokenBonds', 'chains', 'childByName', 'children', 'childrenName', 'childrenSetClass', 'closerThan', 'compare', 'compiled_patterns', 'configureProgressBar', 'copy', 'defaultRadii', 'deleteSubTree', 'dump', 'elementType', 'findLevels', 'findType', 'full_name', 'get', 'getAtoms', 'getCenter', 'getNext', 'getParentOfType', 'getPrevious', 'getRoot', 'getTypeList', 'hasBonds', 'hasSS', 'isAbove', 'isBelow', 'levels', 'makeNameUniq', 'merge', 'mergeNPH', 'name', 'ndihe', 'p', 'parent', 'parser', 'read', 'remove', 'removeAllHydrogens', 'removeBond', 'secondaryStructure', 'secondaryStructureFromFile', 'secondaryStructureFromStride', 'setClass', 'split', 'subTree', 'top', 'torTree', 'updateProgressBar', 'write')})
            Get_allAtoms_coords_20.inputPortByName['attr'].widget.set("allAtoms.coords", run=False)
            apply(Get_allAtoms_coords_20.configure, (), {'expanded': True})
        except:
            print "WARNING: failed to restore GetAttr named Get allAtoms.coords in network self.macroNetwork"
            print_exc()
            Get_allAtoms_coords_20=None

        try:
            ## saving node Get clusterer ##
            from Vision.StandardNodes import GetAttr
            Get_clusterer_21 = GetAttr(constrkw = {}, name='Get clusterer', library=stdlib)
            self.macroNetwork.addNode(Get_clusterer_21,189,306)
            apply(Get_clusterer_21.inputPortByName['objects'].configure, (), {'color': 'white', 'cast': True, 'shape': 'diamond'})
            apply(Get_clusterer_21.inputPortByName['attr'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Get_clusterer_21.outputPortByName['attrs'].configure, (), {'color': 'cyan', 'shape': 'oval'})
            apply(Get_clusterer_21.inputPortByName['attr'].widget.configure, (), {'choices': ('__doc__', '__init__', '__module__', 'addConformations', 'ch', 'clusterer', 'clusterer_dict', 'defaultParser', 'dlo_list', 'flex_res', 'ligMol', 'parser', 'readDlg', 'readEntropiaResults', 'readXMLResults', 'set_ligand', 'version', 'warnings', 'writeConformation', 'write_current_conformation')})
            Get_clusterer_21.inputPortByName['attr'].widget.set("clusterer", run=False)
            apply(Get_clusterer_21.configure, (), {'expanded': True})
        except:
            print "WARNING: failed to restore GetAttr named Get clusterer in network self.macroNetwork"
            print_exc()
            Get_clusterer_21=None

        try:
            ## saving node Index ##
            from Vision.StandardNodes import Index
            Index_22 = Index(constrkw = {}, name='Index', library=stdlib)
            self.macroNetwork.addNode(Index_22,188,383)
            apply(Index_22.inputPortByName['data'].configure, (), {'datatype': 'list', 'cast': True, 'shape': 'oval', 'color': 'cyan'})
            apply(Index_22.inputPortByName['index'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(Index_22.outputPortByName['data'].configure, (), {'color': 'white', 'shape': 'diamond'})
        except:
            print "WARNING: failed to restore Index named Index in network self.macroNetwork"
            print_exc()
            Index_22=None

        try:
            ## saving node make clustering ##
            from Vision.StandardNodes import Generic
            make_clustering_23 = Generic(constrkw = {}, name='make clustering', library=stdlib)
            self.macroNetwork.addNode(make_clustering_23,189,432)
            apply(make_clustering_23.addInputPort, (), {'name': 'clusterer', 'cast': True, 'datatype': 'None', 'balloon': 'clusterer which will make the new clustering', 'height': 8, 'width': 12, 'shape': 'diamond', 'color': 'white'})
            apply(make_clustering_23.addInputPort, (), {'name': 'tolerance', 'cast': True, 'datatype': 'float', 'balloon': 'rms tolerance for the new clustering', 'height': 12, 'width': 12, 'shape': 'circle', 'color': 'green'})
            apply(make_clustering_23.addOutputPort, (), {'name': 'clustering', 'datatype': 'None', 'balloon': 'clustering at newest rms', 'height': 8, 'width': 12, 'shape': 'diamond', 'color': 'white'})
            code = """def doit(self, clusterer, tolerance):
	clusterer.make_clustering(tolerance)
	self.outputData(clustering = clusterer.clustering_dict[tolerance])
"""
            make_clustering_23.configure(function=code)
        except:
            print "WARNING: failed to restore Generic named make clustering in network self.macroNetwork"
            print_exc()
            make_clustering_23=None

        try:
            ## saving node Dial ##
            from Vision.StandardNodes import DialNE
            Dial_24 = DialNE(constrkw = {}, name='Dial', library=stdlib)
            self.macroNetwork.addNode(Dial_24,233,380)
            apply(Dial_24.inputPortByName['dial'].configure, (), {'color': 'green', 'cast': True, 'shape': 'circle'})
            apply(Dial_24.inputPortByName['mini'].configure, (), {'color': 'green', 'cast': True, 'shape': 'circle'})
            apply(Dial_24.inputPortByName['maxi'].configure, (), {'color': 'green', 'cast': True, 'shape': 'circle'})
            apply(Dial_24.outputPortByName['value'].configure, (), {'color': 'green', 'shape': 'circle'})
            Dial_24.inputPortByName['dial'].widget.set(3.0, run=False)
            apply(Dial_24.configure, (), {'expanded': False})
        except:
            print "WARNING: failed to restore DialNE named Dial in network self.macroNetwork"
            print_exc()
            Dial_24=None

        self.macroNetwork.freeze()

        ## saving connections for network recluster ##
        if rmsTool_17 is not None and Docking_16 is not None:
            try:
                self.macroNetwork.connectNodes(
                    rmsTool_17, Docking_16, "rmsTool", "rmsTool", blocking=True)
            except:
                print "WARNING: failed to restore connection between rmsTool_17 and Docking_16 in network self.macroNetwork"
        if Read_Molecule_18 is not None and Index_19 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Read_Molecule_18, Index_19, "MolSets", "data", blocking=True)
            except:
                print "WARNING: failed to restore connection between Read_Molecule_18 and Index_19 in network self.macroNetwork"
        if Index_19 is not None and Get_allAtoms_coords_20 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Index_19, Get_allAtoms_coords_20, "data", "objects", blocking=True)
            except:
                print "WARNING: failed to restore connection between Index_19 and Get_allAtoms_coords_20 in network self.macroNetwork"
        if Get_allAtoms_coords_20 is not None and rmsTool_17 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Get_allAtoms_coords_20, rmsTool_17, "attrs", "crds", blocking=True)
            except:
                print "WARNING: failed to restore connection between Get_allAtoms_coords_20 and rmsTool_17 in network self.macroNetwork"
        if Docking_16 is not None and Get_clusterer_21 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Docking_16, Get_clusterer_21, "docking", "objects", blocking=True)
            except:
                print "WARNING: failed to restore connection between Docking_16 and Get_clusterer_21 in network self.macroNetwork"
        if Get_clusterer_21 is not None and Index_22 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Get_clusterer_21, Index_22, "attrs", "data", blocking=True)
            except:
                print "WARNING: failed to restore connection between Get_clusterer_21 and Index_22 in network self.macroNetwork"
        if Index_22 is not None and make_clustering_23 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Index_22, make_clustering_23, "data", "clusterer", blocking=True)
            except:
                print "WARNING: failed to restore connection between Index_22 and make_clustering_23 in network self.macroNetwork"
        if Dial_24 is not None and make_clustering_23 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Dial_24, make_clustering_23, "value", "tolerance", blocking=True)
            except:
                print "WARNING: failed to restore connection between Dial_24 and make_clustering_23 in network self.macroNetwork"
        output_Ports_13 = self.macroNetwork.opNode
        if make_clustering_23 is not None and output_Ports_13 is not None:
            try:
                self.macroNetwork.connectNodes(
                    make_clustering_23, output_Ports_13, "clustering", "new", blocking=True)
            except:
                print "WARNING: failed to restore connection between make_clustering_23 and output_Ports_13 in network self.macroNetwork"
        input_Ports_12 = self.macroNetwork.ipNode
        if input_Ports_12 is not None and Docking_16 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_12, Docking_16, "new", "docking_logs", blocking=True)
            except:
                print "WARNING: failed to restore connection between input_Ports_12 and Docking_16 in network self.macroNetwork"
        self.macroNetwork.unfreeze()

        recluster_11.shrink()

        ## reset modifications ##
        recluster_11.resetTags()
        recluster_11.buildOriginalList()
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode

        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        from MolKit.VisionInterface.MolKitNodes import molkitlib

        ## building macro network ##
        Prepare_AD3Receptor_16 = self
        from traceback import print_exc

        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib

        self.macroNetwork.getEditor().addLibraryInstance(adtlib, "AutoDockTools.VisionInterface.AdtNodes", "adtlib")

        from MolKit.VisionInterface.MolKitNodes import molkitlib

        self.macroNetwork.getEditor().addLibraryInstance(molkitlib, "MolKit.VisionInterface.MolKitNodes", "molkitlib")

        try:
            ## saving node input Ports ##
            input_Ports_17 = self.macroNetwork.ipNode
            input_Ports_17.move(165, 26)
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_17 = None

        try:
            ## saving node output Ports ##
            output_Ports_18 = self.macroNetwork.opNode
            output_Ports_18.move(165, 345)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_18 = None

        try:
            ## saving node Add Hydrogens ##
            from MolKit.VisionInterface.MolKitNodes import AddHydrogens

            Add_Hydrogens_19 = AddHydrogens(constrkw={}, name="Add Hydrogens", library=molkitlib)
            self.macroNetwork.addNode(Add_Hydrogens_19, 182, 83)
            apply(
                Add_Hydrogens_19.inputPortByName["molecules"].configure,
                (),
                {"color": "#c64e70", "cast": True, "shape": "oval"},
            )
            apply(Add_Hydrogens_19.outputPortByName["molecules"].configure, (), {"color": "#c64e70", "shape": "oval"})
            apply(Add_Hydrogens_19.outputPortByName["new_h_ct"].configure, (), {"color": "yellow", "shape": "circle"})
        except:
            print "WARNING: failed to restore AddHydrogens named Add Hydrogens in network self.macroNetwork"
            print_exc()
            Add_Hydrogens_19 = None

        try:
            ## saving node Add Kollman Charges ##
            from MolKit.VisionInterface.MolKitNodes import AddKollmanCharges

            Add_Kollman_Charges_20 = AddKollmanCharges(constrkw={}, name="Add Kollman Charges", library=molkitlib)
            self.macroNetwork.addNode(Add_Kollman_Charges_20, 182, 135)
            apply(
                Add_Kollman_Charges_20.inputPortByName["mols"].configure,
                (),
                {"color": "#c64e70", "cast": True, "shape": "oval"},
            )
            apply(Add_Kollman_Charges_20.outputPortByName["mols"].configure, (), {"color": "#c64e70", "shape": "oval"})
            apply(
                Add_Kollman_Charges_20.outputPortByName["charge_total"].configure,
                (),
                {"color": "green", "shape": "circle"},
            )
        except:
            print "WARNING: failed to restore AddKollmanCharges named Add Kollman Charges in network self.macroNetwork"
            print_exc()
            Add_Kollman_Charges_20 = None

        try:
            ## saving node Add Solvation Parameters ##
            from AutoDockTools.VisionInterface.AdtNodes import Add_SolvationParameters

            Add_Solvation_Parameters_21 = Add_SolvationParameters(
                constrkw={}, name="Add Solvation Parameters", library=adtlib
            )
            self.macroNetwork.addNode(Add_Solvation_Parameters_21, 182, 288)
            apply(
                Add_Solvation_Parameters_21.inputPortByName["mols"].configure,
                (),
                {"color": "#c64e70", "cast": True, "shape": "oval"},
            )
            apply(
                Add_Solvation_Parameters_21.outputPortByName["typed_mols"].configure,
                (),
                {"color": "#c64e70", "shape": "oval"},
            )
            apply(
                Add_Solvation_Parameters_21.outputPortByName["AtSolPar"].configure,
                (),
                {"color": "cyan", "shape": "oval"},
            )
        except:
            print "WARNING: failed to restore Add_SolvationParameters named Add Solvation Parameters in network self.macroNetwork"
            print_exc()
            Add_Solvation_Parameters_21 = None

        try:
            ## saving node Merge NonPolar Hydrogens ##
            from AutoDockTools.VisionInterface.AdtNodes import MergeNonPolarHydrogens

            Merge_NonPolar_Hydrogens_22 = MergeNonPolarHydrogens(
                constrkw={}, name="Merge NonPolar Hydrogens", library=adtlib
            )
            self.macroNetwork.addNode(Merge_NonPolar_Hydrogens_22, 182, 236)
            apply(
                Merge_NonPolar_Hydrogens_22.inputPortByName["mols"].configure,
                (),
                {"color": "#c64e70", "cast": True, "shape": "oval"},
            )
            apply(
                Merge_NonPolar_Hydrogens_22.inputPortByName["renumber"].configure,
                (),
                {"color": "yellow", "cast": True, "shape": "circle"},
            )
            apply(
                Merge_NonPolar_Hydrogens_22.outputPortByName["mols"].configure,
                (),
                {"color": "#c64e70", "shape": "oval"},
            )
            apply(
                Merge_NonPolar_Hydrogens_22.outputPortByName["num_nphs"].configure,
                (),
                {"color": "yellow", "shape": "circle"},
            )
        except:
            print "WARNING: failed to restore MergeNonPolarHydrogens named Merge NonPolar Hydrogens in network self.macroNetwork"
            print_exc()
            Merge_NonPolar_Hydrogens_22 = None

        try:
            ## saving node Merge Lone Pairs ##
            from AutoDockTools.VisionInterface.AdtNodes import MergeLonePairs

            Merge_Lone_Pairs_23 = MergeLonePairs(constrkw={}, name="Merge Lone Pairs", library=adtlib)
            self.macroNetwork.addNode(Merge_Lone_Pairs_23, 182, 184)
            apply(
                Merge_Lone_Pairs_23.inputPortByName["mols"].configure,
                (),
                {"color": "#c64e70", "cast": True, "shape": "oval"},
            )
            apply(
                Merge_Lone_Pairs_23.inputPortByName["renumber"].configure,
                (),
                {"color": "yellow", "cast": True, "shape": "circle"},
            )
            apply(Merge_Lone_Pairs_23.outputPortByName["mols"].configure, (), {"color": "#c64e70", "shape": "oval"})
            apply(Merge_Lone_Pairs_23.outputPortByName["num_lps"].configure, (), {"color": "yellow", "shape": "circle"})
        except:
            print "WARNING: failed to restore MergeLonePairs named Merge Lone Pairs in network self.macroNetwork"
            print_exc()
            Merge_Lone_Pairs_23 = None

        self.macroNetwork.freeze()

        ## saving connections for network Prepare AD3Receptor ##
        input_Ports_17 = self.macroNetwork.ipNode
        if input_Ports_17 is not None and Add_Hydrogens_19 is not None:
            try:
                self.macroNetwork.connectNodes(input_Ports_17, Add_Hydrogens_19, "new", "molecules", blocking=True)
            except:
                print "WARNING: failed to restore connection between input_Ports_17 and Add_Hydrogens_19 in network self.macroNetwork"
        if Add_Hydrogens_19 is not None and Add_Kollman_Charges_20 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Add_Hydrogens_19, Add_Kollman_Charges_20, "molecules", "mols", blocking=True
                )
            except:
                print "WARNING: failed to restore connection between Add_Hydrogens_19 and Add_Kollman_Charges_20 in network self.macroNetwork"
        if Add_Kollman_Charges_20 is not None and Merge_Lone_Pairs_23 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Add_Kollman_Charges_20, Merge_Lone_Pairs_23, "mols", "mols", blocking=True
                )
            except:
                print "WARNING: failed to restore connection between Add_Kollman_Charges_20 and Merge_Lone_Pairs_23 in network self.macroNetwork"
        if Merge_Lone_Pairs_23 is not None and Merge_NonPolar_Hydrogens_22 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Merge_Lone_Pairs_23, Merge_NonPolar_Hydrogens_22, "mols", "mols", blocking=True
                )
            except:
                print "WARNING: failed to restore connection between Merge_Lone_Pairs_23 and Merge_NonPolar_Hydrogens_22 in network self.macroNetwork"
        if Merge_NonPolar_Hydrogens_22 is not None and Add_Solvation_Parameters_21 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Merge_NonPolar_Hydrogens_22, Add_Solvation_Parameters_21, "mols", "mols", blocking=True
                )
            except:
                print "WARNING: failed to restore connection between Merge_NonPolar_Hydrogens_22 and Add_Solvation_Parameters_21 in network self.macroNetwork"
        output_Ports_18 = self.macroNetwork.opNode
        if Add_Solvation_Parameters_21 is not None and output_Ports_18 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Add_Solvation_Parameters_21, output_Ports_18, "typed_mols", "new", blocking=True
                )
            except:
                print "WARNING: failed to restore connection between Add_Solvation_Parameters_21 and output_Ports_18 in network self.macroNetwork"
        self.macroNetwork.unfreeze()

        Prepare_AD3Receptor_16.shrink()

        ## reset modifications ##
        Prepare_AD3Receptor_16.resetTags()
        Prepare_AD3Receptor_16.buildOriginalList()
Esempio n. 44
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()
try:
    ## saving node iterate ##
    from Vision.StandardNodes import Iterate
    iterate_4 = Iterate(constrkw={}, name='iterate', library=stdlib)
    masterNet.addNode(iterate_4,30,169)
    iterate_4.inputPortByName['stopOnFailure'].widget.set(1, run=False)
    apply(iterate_4.configure, (), {'paramPanelImmediate': 1})
except:
    print "WARNING: failed to restore Iterate named iterate in network masterNet"
    print_exc()
    iterate_4=None

try:
    ## saving node SaveNAMDResults ##
    from NetworkEditor.macros import MacroNode
    SaveNAMDResults_5 = MacroNode(name='SaveNAMDResults')
    masterNet.addNode(SaveNAMDResults_5, 455, 392)
    output_Ports_7 = SaveNAMDResults_5.macroNetwork.opNode
    apply(output_Ports_7.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
    output_Ports_7.move(130, 477)
    from Vision.StandardNodes import Generic
    GetOutURLs_8 = Generic(constrkw={}, name='GetOutURLs', library=stdlib)
    SaveNAMDResults_5.macroNetwork.addNode(GetOutURLs_8,118,98)
    apply(GetOutURLs_8.addInputPort, (), {'singleConnection': True, 'name': 'filename', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
    apply(GetOutURLs_8.addInputPort, (), {'singleConnection': True, 'name': 'url', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
    apply(GetOutURLs_8.addOutputPort, (), {'name': 'outfile_list', 'datatype': 'list', 'height': 12, 'width': 12, 'shape': 'oval', 'color': 'cyan'})
    apply(GetOutURLs_8.addOutputPort, (), {'name': 'run_name', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
    code = """def doit(self, filename, url):
        import urllib
        ofilelist = []
        ofw = []
    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 ##
        LocalLigandDirectory_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://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(294, 448)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_2=None

        try:
            ## saving node Make Zip File ##
            from Vision.StandardNodes import MakeZipFileNE
            Make_Zip_File_3 = MakeZipFileNE(constrkw={}, name='Make Zip File', library=stdlib)
            self.macroNetwork.addNode(Make_Zip_File_3,136,158)
            apply(Make_Zip_File_3.inputPortByName['input_directory'].configure, (), {'defaultValue': None})
            apply(Make_Zip_File_3.inputPortByName['output_directory'].configure, (), {'defaultValue': None})
            apply(Make_Zip_File_3.inputPortByName['output_name'].configure, (), {'defaultValue': None})
            apply(Make_Zip_File_3.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore MakeZipFileNE named Make Zip File in network self.macroNetwork"
            print_exc()
            Make_Zip_File_3=None

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

        try:
            ## saving node LigandDBUpload_kryptonite_nbcr_net ##
            from NetworkEditor.items import FunctionNode
            LigandDBUpload_kryptonite_nbcr_net_5 = FunctionNode(functionOrString='LigandDBUpload_kryptonite_nbcr_net', host="http://kryptonite.nbcr.net/opal2", namedArgs={'username': '', 'userlib': '', 'password': '', 'localRun': False, 'execPath': '', 'desc': ''}, constrkw={'functionOrString': "'LigandDBUpload_kryptonite_nbcr_net'", 'host': '"http://kryptonite.nbcr.net/opal2"', 'namedArgs': {'username': '', 'userlib': '', 'password': '', 'localRun': False, 'execPath': '', 'desc': ''}}, name='LigandDBUpload_kryptonite_nbcr_net', library=wslib)
            self.macroNetwork.addNode(LigandDBUpload_kryptonite_nbcr_net_5,136,216)
            apply(LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['username'].configure, (), {'defaultValue': None})
            apply(LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['userlib'].configure, (), {'defaultValue': None})
            apply(LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['password'].configure, (), {'defaultValue': None})
            apply(LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['localRun'].configure, (), {'defaultValue': None})
            apply(LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['execPath'].configure, (), {'defaultValue': None})
            apply(LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['desc'].configure, (), {'defaultValue': None})
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['username'].widget.set(r"", run=False)
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['userlib'].rebindWidget()
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['userlib'].widget.set(r"", run=False)
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['userlib'].unbindWidget()
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['password'].widget.set(r"", run=False)
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['localRun'].widget.set(0, run=False)
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['execPath'].widget.set(r"", run=False)
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName['desc'].widget.set(r"", run=False)
            apply(LigandDBUpload_kryptonite_nbcr_net_5.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore FunctionNode named LigandDBUpload_kryptonite_nbcr_net in network self.macroNetwork"
            print_exc()
            LigandDBUpload_kryptonite_nbcr_net_5=None

        try:
            ## saving node Index ##
            from Vision.StandardNodes import Index
            Index_6 = Index(constrkw={}, name='Index', library=stdlib)
            self.macroNetwork.addNode(Index_6,136,273)
            apply(Index_6.inputPortByName['data'].configure, (), {'defaultValue': None})
            apply(Index_6.inputPortByName['index'].configure, (), {'defaultValue': None})
            apply(Index_6.outputPortByName['data'].configure, (), {'datatype': 'string'})
            apply(Index_6.inputPortByName['index'].widget.configure, (), {'max': 7, 'min': -8})
            Index_6.inputPortByName['index'].widget.set(0, run=False)
            apply(Index_6.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore Index named Index in network self.macroNetwork"
            print_exc()
            Index_6=None

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

        try:
            ## saving node CreateLigandDBObj ##
            from Vision.StandardNodes import Generic
            CreateLigandDBObj_8 = Generic(constrkw={}, name='CreateLigandDBObj', library=stdlib)
            self.macroNetwork.addNode(CreateLigandDBObj_8,217,385)
            apply(CreateLigandDBObj_8.addInputPort, (), {'singleConnection': True, 'name': 'ligand_lib_url', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
            apply(CreateLigandDBObj_8.addInputPort, (), {'singleConnection': True, 'name': 'log_file', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': False, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
            apply(CreateLigandDBObj_8.addOutputPort, (), {'name': 'ligand_db_obj', 'datatype': 'LigandDB', 'height': 8, 'width': 12, 'shape': 'rect', 'color': '#FFCCFF'})
            code = """def doit(self, ligand_lib_url, log_file):
        if log_file == None:
            log_file = "ligand_lib_uploads.log"

        log_file = os.path.abspath(log_file)

        if log_file != None:
            from time import strftime
            now = strftime("%Y-%m-%d %H:%M:%S")
            
            log_str = '''On ''' + now + ''', you uploaded a ligand library to: \n'''
            log_str = log_str + ligand_lib_url + '''\n\n'''

            f = open(log_file, '''a''')
            f.write(log_str)
            print "This ligand library upload has been recorded in " + log_file

        from AutoDockTools.VisionInterface.Adt.LigandDB import LigandDB
        ligand_db_obj = LigandDB(url_lib=ligand_lib_url)
	pass
## to ouput data on port ligand_db_obj use
        self.outputData(ligand_db_obj=ligand_db_obj)






















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

        try:
            ## saving node get_paths ##
            from Vision.StandardNodes import Generic
            get_paths_9 = Generic(constrkw={}, name='get_paths', library=stdlib)
            self.macroNetwork.addNode(get_paths_9,136,105)
            apply(get_paths_9.addInputPort, (), {'singleConnection': True, 'name': 'directory', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
            apply(get_paths_9.addInputPort, (), {'singleConnection': True, 'name': 'zip_name', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
            apply(get_paths_9.addOutputPort, (), {'name': 'input_directory', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            apply(get_paths_9.addOutputPort, (), {'name': 'output_directory', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            apply(get_paths_9.addOutputPort, (), {'name': 'output_name', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            apply(get_paths_9.addOutputPort, (), {'name': 'output_basedir', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            code = """def doit(self, directory, zip_name):
        input_directory = os.path.abspath(directory)

        if not(os.path.exists(input_directory)):
            print "ERROR: ligand input directory " + input_directory + " does not exist"
            return '''stop'''

        output_directory = os.path.abspath('''.''')
        output_name = zip_name
        output_basedir = zip_name.rstrip('''.zip''')
	pass
        self.outputData(input_directory=input_directory, output_directory=output_directory, output_name=zip_name, output_basedir=output_basedir)
## to ouput data on port input_directory use
## self.outputData(input_directory=data)
## to ouput data on port output_directory use
## self.outputData(output_directory=data)


## to ouput data on port output_name use
## self.outputData(output_name=data)

## to ouput data on port output_basedir use
## self.outputData(output_basedir=data)

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

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

        ## saving connections for network LocalLigandDirectory ##
        if Make_Zip_File_3 is not None and LigandDBUpload_kryptonite_nbcr_net_5 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Make_Zip_File_3, LigandDBUpload_kryptonite_nbcr_net_5, "zipfile", "userlib", blocking=True
                    , splitratio=[0.67700056401206909, 0.41786522052018427])
            except:
                print "WARNING: failed to restore connection between Make_Zip_File_3 and LigandDBUpload_kryptonite_nbcr_net_5 in network self.macroNetwork"
        if LigandDBUpload_kryptonite_nbcr_net_5 is not None and Index_6 is not None:
            try:
                self.macroNetwork.connectNodes(
                    LigandDBUpload_kryptonite_nbcr_net_5, Index_6, "result", "data", blocking=True
                    , splitratio=[0.27868065815947218, 0.69101010116597561])
            except:
                print "WARNING: failed to restore connection between LigandDBUpload_kryptonite_nbcr_net_5 and Index_6 in network self.macroNetwork"
        if Index_6 is not None and ReplaceURL_7 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Index_6, ReplaceURL_7, "data", "url", blocking=True
                    , splitratio=[0.0, 0.50910496731074983])
            except:
                print "WARNING: failed to restore connection between Index_6 and ReplaceURL_7 in network self.macroNetwork"
        if ReplaceURL_7 is not None and CreateLigandDBObj_8 is not None:
            try:
                self.macroNetwork.connectNodes(
                    ReplaceURL_7, CreateLigandDBObj_8, "newurl", "ligand_lib_url", blocking=True
                    , splitratio=[0.7375258387145982, 0.34433018843468416])
            except:
                print "WARNING: failed to restore connection between ReplaceURL_7 and CreateLigandDBObj_8 in network self.macroNetwork"
        output_Ports_2 = self.macroNetwork.opNode
        if CreateLigandDBObj_8 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    CreateLigandDBObj_8, output_Ports_2, "ligand_db_obj", "new", blocking=True
                    , splitratio=[0.25450332220506922, 0.49254602433654382])
            except:
                print "WARNING: failed to restore connection between CreateLigandDBObj_8 and output_Ports_2 in network self.macroNetwork"
        input_Ports_1 = self.macroNetwork.ipNode
        if input_Ports_1 is not None and get_paths_9 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, get_paths_9, "new", "directory", blocking=True
                    , splitratio=[0.73592256661833422, 0.40050624233195609])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and get_paths_9 in network self.macroNetwork"
        if Entry_4 is not None and get_paths_9 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Entry_4, get_paths_9, "string", "zip_name", blocking=True
                    , splitratio=[0.74641701362897139, 0.56047721560743557])
            except:
                print "WARNING: failed to restore connection between Entry_4 and get_paths_9 in network self.macroNetwork"
        if get_paths_9 is not None and Make_Zip_File_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    get_paths_9, Make_Zip_File_3, "input_directory", "input_directory", blocking=True
                    , splitratio=[0.24975092021298884, 0.59053364249853169])
            except:
                print "WARNING: failed to restore connection between get_paths_9 and Make_Zip_File_3 in network self.macroNetwork"
        if get_paths_9 is not None and Make_Zip_File_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    get_paths_9, Make_Zip_File_3, "output_name", "output_name", blocking=True
                    , splitratio=[0.44934886807300634, 0.5145630699734256])
            except:
                print "WARNING: failed to restore connection between get_paths_9 and Make_Zip_File_3 in network self.macroNetwork"
        if get_paths_9 is not None and Make_Zip_File_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    get_paths_9, Make_Zip_File_3, "output_directory", "output_directory", blocking=True
                    , splitratio=[0.65054191214838031, 0.31030412383438832])
            except:
                print "WARNING: failed to restore connection between get_paths_9 and Make_Zip_File_3 in network self.macroNetwork"
        if get_paths_9 is not None and ReplaceURL_7 is not None:
            try:
                self.macroNetwork.connectNodes(
                    get_paths_9, ReplaceURL_7, "output_basedir", "newfilename", blocking=True
                    , splitratio=[0.5380996717918376, 0.39023381726820411])
            except:
                print "WARNING: failed to restore connection between get_paths_9 and ReplaceURL_7 in network self.macroNetwork"
        if input_Ports_1 is not None and CreateLigandDBObj_8 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, CreateLigandDBObj_8, "new", "log_file", blocking=True
                    , splitratio=[0.49268182912115838, 0.67412763774649975])
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and CreateLigandDBObj_8 in network self.macroNetwork"
        if ReplaceURL_7 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    ReplaceURL_7, output_Ports_2, "newurl", "new", blocking=True
                    , splitratio=[0.67446600768034171, 0.74989471765767979])
            except:
                print "WARNING: failed to restore connection between ReplaceURL_7 and output_Ports_2 in network self.macroNetwork"
        self.macroNetwork.runOnNewData.value = False

        ## modifying MacroInputNode dynamic ports
        input_Ports_1 = self.macroNetwork.ipNode
        input_Ports_1.outputPorts[1].configure(name='Make_Zip_File_input_directory')
        input_Ports_1.outputPorts[2].configure(name='CreateLigandDBObj_log_file')

        ## modifying MacroOutputNode dynamic ports
        output_Ports_2 = self.macroNetwork.opNode
        output_Ports_2.inputPorts[1].configure(singleConnection='auto')
        output_Ports_2.inputPorts[2].configure(singleConnection='auto')
        output_Ports_2.inputPorts[1].configure(name='CreateLigandDBObj_ligand_db_obj')
        output_Ports_2.inputPorts[2].configure(name='ReplaceURL_newurl')
        ## configure MacroNode input ports
        LocalLigandDirectory_0.inputPorts[0].configure(name='Make_Zip_File_input_directory')
        LocalLigandDirectory_0.inputPorts[0].configure(datatype='string')
        LocalLigandDirectory_0.inputPorts[1].configure(name='CreateLigandDBObj_log_file')
        LocalLigandDirectory_0.inputPorts[1].configure(datatype='string')
        ## configure MacroNode output ports
        LocalLigandDirectory_0.outputPorts[0].configure(name='CreateLigandDBObj_ligand_db_obj')
        LocalLigandDirectory_0.outputPorts[0].configure(datatype='LigandDB')
        LocalLigandDirectory_0.outputPorts[1].configure(name='ReplaceURL_newurl')
        LocalLigandDirectory_0.outputPorts[1].configure(datatype='string')

        LocalLigandDirectory_0.shrink()

        ## reset modifications ##
        LocalLigandDirectory_0.resetTags()
        LocalLigandDirectory_0.buildOriginalList()
Esempio n. 47
0
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        ## building macro network ##
        Prepare_AD3_Ligand_0 = self
        from traceback import print_exc

        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        self.macroNetwork.getEditor().addLibraryInstance(
            adtlib, "AutoDockTools.VisionInterface.AdtNodes", "adtlib")

        from MolKit.VisionInterface.MolKitNodes import molkitlib
        self.macroNetwork.getEditor().addLibraryInstance(
            molkitlib, "MolKit.VisionInterface.MolKitNodes", "molkitlib")

        try:
            ## saving node input Ports ##
            input_Ports_1 = self.macroNetwork.ipNode
            input_Ports_1.move(183, 27)
        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
            output_Ports_2.move(181, 338)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_2 = None

        try:
            ## saving node Calculate Gasteiger Charges ##
            from MolKit.VisionInterface.MolKitNodes import CalculateGasteigerCharges
            Calculate_Gasteiger_Charges_3 = CalculateGasteigerCharges(
                constrkw={},
                name='Calculate Gasteiger Charges',
                library=molkitlib)
            self.macroNetwork.addNode(Calculate_Gasteiger_Charges_3, 200, 131)
            apply(
                Calculate_Gasteiger_Charges_3.inputPortByName['mols'].
                configure, (), {
                    'color': '#c64e70',
                    'cast': True,
                    'shape': 'oval'
                })
            apply(
                Calculate_Gasteiger_Charges_3.outputPortByName['mols'].
                configure, (), {
                    'color': '#c64e70',
                    'shape': 'oval'
                })
            apply(
                Calculate_Gasteiger_Charges_3.outputPortByName['charge_total'].
                configure, (), {
                    'color': 'green',
                    'shape': 'circle'
                })
        except:
            print "WARNING: failed to restore CalculateGasteigerCharges named Calculate Gasteiger Charges in network self.macroNetwork"
            print_exc()
            Calculate_Gasteiger_Charges_3 = None

        try:
            ## saving node Add Hydrogens ##
            from MolKit.VisionInterface.MolKitNodes import AddHydrogens
            Add_Hydrogens_4 = AddHydrogens(constrkw={},
                                           name='Add Hydrogens',
                                           library=molkitlib)
            self.macroNetwork.addNode(Add_Hydrogens_4, 200, 80)
            apply(Add_Hydrogens_4.inputPortByName['molecules'].configure, (), {
                'color': '#c64e70',
                'cast': True,
                'shape': 'oval'
            })
            apply(Add_Hydrogens_4.outputPortByName['molecules'].configure, (),
                  {
                      'color': '#c64e70',
                      'shape': 'oval'
                  })
            apply(Add_Hydrogens_4.outputPortByName['new_h_ct'].configure, (), {
                'color': 'yellow',
                'shape': 'circle'
            })
        except:
            print "WARNING: failed to restore AddHydrogens named Add Hydrogens in network self.macroNetwork"
            print_exc()
            Add_Hydrogens_4 = None

        try:
            ## saving node Merge NonPolar Hydrogens ##
            from AutoDockTools.VisionInterface.AdtNodes import MergeNonPolarHydrogens
            Merge_NonPolar_Hydrogens_5 = MergeNonPolarHydrogens(
                constrkw={}, name='Merge NonPolar Hydrogens', library=adtlib)
            self.macroNetwork.addNode(Merge_NonPolar_Hydrogens_5, 200, 182)
            apply(Merge_NonPolar_Hydrogens_5.inputPortByName['mols'].configure,
                  (), {
                      'color': '#c64e70',
                      'cast': True,
                      'shape': 'oval'
                  })
            apply(
                Merge_NonPolar_Hydrogens_5.inputPortByName['renumber'].
                configure, (), {
                    'color': 'yellow',
                    'cast': True,
                    'shape': 'circle'
                })
            apply(
                Merge_NonPolar_Hydrogens_5.outputPortByName['mols'].configure,
                (), {
                    'color': '#c64e70',
                    'shape': 'oval'
                })
            apply(
                Merge_NonPolar_Hydrogens_5.outputPortByName['num_nphs'].
                configure, (), {
                    'color': 'yellow',
                    'shape': 'circle'
                })
        except:
            print "WARNING: failed to restore MergeNonPolarHydrogens named Merge NonPolar Hydrogens in network self.macroNetwork"
            print_exc()
            Merge_NonPolar_Hydrogens_5 = None

        try:
            ## saving node Manage Rotatable Bonds ##
            from AutoDockTools.VisionInterface.AdtNodes import ManageRotatableBonds
            Manage_Rotatable_Bonds_6 = ManageRotatableBonds(
                constrkw={}, name='Manage Rotatable Bonds', library=adtlib)
            self.macroNetwork.addNode(Manage_Rotatable_Bonds_6, 200, 235)
            apply(Manage_Rotatable_Bonds_6.inputPortByName['mols'].configure,
                  (), {
                      'color': '#c64e70',
                      'cast': True,
                      'shape': 'oval'
                  })
            apply(Manage_Rotatable_Bonds_6.inputPortByName['root'].configure,
                  (), {
                      'color': 'white',
                      'cast': True,
                      'shape': 'oval'
                  })
            apply(
                Manage_Rotatable_Bonds_6.inputPortByName['allowed_bonds'].
                configure, (), {
                    'color': 'white',
                    'cast': True,
                    'shape': 'oval'
                })
            apply(
                Manage_Rotatable_Bonds_6.
                inputPortByName['check_for_fragments'].configure, (), {
                    'color': 'yellow',
                    'cast': True,
                    'shape': 'circle'
                })
            apply(
                Manage_Rotatable_Bonds_6.
                inputPortByName['bonds_to_inactivate'].configure, (), {
                    'color': 'white',
                    'cast': True,
                    'shape': 'oval'
                })
            apply(
                Manage_Rotatable_Bonds_6.inputPortByName['limit_torsions'].
                configure, (), {
                    'color': 'white',
                    'cast': True,
                    'shape': 'oval'
                })
            apply(Manage_Rotatable_Bonds_6.outputPortByName['mol'].configure,
                  (), {
                      'color': '#c64e70',
                      'shape': 'oval'
                  })
        except:
            print "WARNING: failed to restore ManageRotatableBonds named Manage Rotatable Bonds in network self.macroNetwork"
            print_exc()
            Manage_Rotatable_Bonds_6 = None

        try:
            ## saving node AD4_typer ##
            from AutoDockTools.VisionInterface.AdtNodes import Assign_AD4Types
            AD4_typer_7 = Assign_AD4Types(constrkw={},
                                          name='AD4_typer',
                                          library=adtlib)
            self.macroNetwork.addNode(AD4_typer_7, 198, 288)
            apply(AD4_typer_7.inputPortByName['mols'].configure, (), {
                'color': '#c64e70',
                'cast': True,
                'shape': 'oval'
            })
            apply(AD4_typer_7.inputPortByName['renameAtoms'].configure, (), {
                'color': 'yellow',
                'cast': True,
                'shape': 'circle'
            })
            apply(
                AD4_typer_7.inputPortByName['set_aromatic_carbons'].configure,
                (), {
                    'color': 'yellow',
                    'cast': True,
                    'shape': 'circle'
                })
            apply(AD4_typer_7.inputPortByName['reassign'].configure, (), {
                'color': 'yellow',
                'cast': True,
                'shape': 'circle'
            })
            apply(AD4_typer_7.outputPortByName['typed_mols'].configure, (), {
                'color': '#c64e70',
                'shape': 'oval'
            })
        except:
            print "WARNING: failed to restore Assign_AD4Types named AD4_typer in network self.macroNetwork"
            print_exc()
            AD4_typer_7 = None

        self.macroNetwork.freeze()

        ## saving connections for network Prepare AD3 Ligand ##
        input_Ports_1 = self.macroNetwork.ipNode
        if input_Ports_1 is not None and Add_Hydrogens_4 is not None:
            try:
                self.macroNetwork.connectNodes(input_Ports_1,
                                               Add_Hydrogens_4,
                                               "new",
                                               "molecules",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and Add_Hydrogens_4 in network self.macroNetwork"
        if Add_Hydrogens_4 is not None and Calculate_Gasteiger_Charges_3 is not None:
            try:
                self.macroNetwork.connectNodes(Add_Hydrogens_4,
                                               Calculate_Gasteiger_Charges_3,
                                               "molecules",
                                               "mols",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Add_Hydrogens_4 and Calculate_Gasteiger_Charges_3 in network self.macroNetwork"
        if Calculate_Gasteiger_Charges_3 is not None and Merge_NonPolar_Hydrogens_5 is not None:
            try:
                self.macroNetwork.connectNodes(Calculate_Gasteiger_Charges_3,
                                               Merge_NonPolar_Hydrogens_5,
                                               "mols",
                                               "mols",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Calculate_Gasteiger_Charges_3 and Merge_NonPolar_Hydrogens_5 in network self.macroNetwork"
        if Merge_NonPolar_Hydrogens_5 is not None and Manage_Rotatable_Bonds_6 is not None:
            try:
                self.macroNetwork.connectNodes(Merge_NonPolar_Hydrogens_5,
                                               Manage_Rotatable_Bonds_6,
                                               "mols",
                                               "mols",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Merge_NonPolar_Hydrogens_5 and Manage_Rotatable_Bonds_6 in network self.macroNetwork"
        if Manage_Rotatable_Bonds_6 is not None and AD4_typer_7 is not None:
            try:
                self.macroNetwork.connectNodes(Manage_Rotatable_Bonds_6,
                                               AD4_typer_7,
                                               "mol",
                                               "mols",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Manage_Rotatable_Bonds_6 and AD4_typer_7 in network self.macroNetwork"
        output_Ports_2 = self.macroNetwork.opNode
        if AD4_typer_7 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(AD4_typer_7,
                                               output_Ports_2,
                                               "typed_mols",
                                               "new",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between AD4_typer_7 and output_Ports_2 in network self.macroNetwork"
        self.macroNetwork.unfreeze()

        Prepare_AD3_Ligand_0.shrink()

        ## reset modifications ##
        Prepare_AD3_Ligand_0.resetTags()
        Prepare_AD3_Ligand_0.buildOriginalList()
Esempio n. 48
0
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        ## building macro network ##
        Prepare_AD3_Ligand_0 = self
        from traceback import print_exc

        ## loading libraries ##
        from AutoDockTools.VisionInterface.AdtNodes import adtlib
        self.macroNetwork.getEditor().addLibraryInstance(adtlib,"AutoDockTools.VisionInterface.AdtNodes", "adtlib")

        from MolKit.VisionInterface.MolKitNodes import molkitlib
        self.macroNetwork.getEditor().addLibraryInstance(molkitlib,"MolKit.VisionInterface.MolKitNodes", "molkitlib")

        try:
            ## saving node input Ports ##
            input_Ports_1 = self.macroNetwork.ipNode
            input_Ports_1.move(183, 27)
        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
            output_Ports_2.move(181, 338)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_2=None

        try:
            ## saving node Calculate Gasteiger Charges ##
            from MolKit.VisionInterface.MolKitNodes import CalculateGasteigerCharges
            Calculate_Gasteiger_Charges_3 = CalculateGasteigerCharges(constrkw = {}, name='Calculate Gasteiger Charges', library=molkitlib)
            self.macroNetwork.addNode(Calculate_Gasteiger_Charges_3,200,131)
            apply(Calculate_Gasteiger_Charges_3.inputPortByName['mols'].configure, (), {'color': '#c64e70', 'cast': True, 'shape': 'oval'})
            apply(Calculate_Gasteiger_Charges_3.outputPortByName['mols'].configure, (), {'color': '#c64e70', 'shape': 'oval'})
            apply(Calculate_Gasteiger_Charges_3.outputPortByName['charge_total'].configure, (), {'color': 'green', 'shape': 'circle'})
        except:
            print "WARNING: failed to restore CalculateGasteigerCharges named Calculate Gasteiger Charges in network self.macroNetwork"
            print_exc()
            Calculate_Gasteiger_Charges_3=None

        try:
            ## saving node Add Hydrogens ##
            from MolKit.VisionInterface.MolKitNodes import AddHydrogens
            Add_Hydrogens_4 = AddHydrogens(constrkw = {}, name='Add Hydrogens', library=molkitlib)
            self.macroNetwork.addNode(Add_Hydrogens_4,200,80)
            apply(Add_Hydrogens_4.inputPortByName['molecules'].configure, (), {'color': '#c64e70', 'cast': True, 'shape': 'oval'})
            apply(Add_Hydrogens_4.outputPortByName['molecules'].configure, (), {'color': '#c64e70', 'shape': 'oval'})
            apply(Add_Hydrogens_4.outputPortByName['new_h_ct'].configure, (), {'color': 'yellow', 'shape': 'circle'})
        except:
            print "WARNING: failed to restore AddHydrogens named Add Hydrogens in network self.macroNetwork"
            print_exc()
            Add_Hydrogens_4=None

        try:
            ## saving node Merge NonPolar Hydrogens ##
            from AutoDockTools.VisionInterface.AdtNodes import MergeNonPolarHydrogens
            Merge_NonPolar_Hydrogens_5 = MergeNonPolarHydrogens(constrkw = {}, name='Merge NonPolar Hydrogens', library=adtlib)
            self.macroNetwork.addNode(Merge_NonPolar_Hydrogens_5,200,182)
            apply(Merge_NonPolar_Hydrogens_5.inputPortByName['mols'].configure, (), {'color': '#c64e70', 'cast': True, 'shape': 'oval'})
            apply(Merge_NonPolar_Hydrogens_5.inputPortByName['renumber'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(Merge_NonPolar_Hydrogens_5.outputPortByName['mols'].configure, (), {'color': '#c64e70', 'shape': 'oval'})
            apply(Merge_NonPolar_Hydrogens_5.outputPortByName['num_nphs'].configure, (), {'color': 'yellow', 'shape': 'circle'})
        except:
            print "WARNING: failed to restore MergeNonPolarHydrogens named Merge NonPolar Hydrogens in network self.macroNetwork"
            print_exc()
            Merge_NonPolar_Hydrogens_5=None

        try:
            ## saving node Manage Rotatable Bonds ##
            from AutoDockTools.VisionInterface.AdtNodes import ManageRotatableBonds
            Manage_Rotatable_Bonds_6 = ManageRotatableBonds(constrkw = {}, name='Manage Rotatable Bonds', library=adtlib)
            self.macroNetwork.addNode(Manage_Rotatable_Bonds_6,200,235)
            apply(Manage_Rotatable_Bonds_6.inputPortByName['mols'].configure, (), {'color': '#c64e70', 'cast': True, 'shape': 'oval'})
            apply(Manage_Rotatable_Bonds_6.inputPortByName['root'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Manage_Rotatable_Bonds_6.inputPortByName['allowed_bonds'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Manage_Rotatable_Bonds_6.inputPortByName['check_for_fragments'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(Manage_Rotatable_Bonds_6.inputPortByName['bonds_to_inactivate'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Manage_Rotatable_Bonds_6.inputPortByName['limit_torsions'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Manage_Rotatable_Bonds_6.outputPortByName['mol'].configure, (), {'color': '#c64e70', 'shape': 'oval'})
        except:
            print "WARNING: failed to restore ManageRotatableBonds named Manage Rotatable Bonds in network self.macroNetwork"
            print_exc()
            Manage_Rotatable_Bonds_6=None

        try:
            ## saving node AD4_typer ##
            from AutoDockTools.VisionInterface.AdtNodes import Assign_AD4Types
            AD4_typer_7 = Assign_AD4Types(constrkw = {}, name='AD4_typer', library=adtlib)
            self.macroNetwork.addNode(AD4_typer_7,198,288)
            apply(AD4_typer_7.inputPortByName['mols'].configure, (), {'color': '#c64e70', 'cast': True, 'shape': 'oval'})
            apply(AD4_typer_7.inputPortByName['renameAtoms'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(AD4_typer_7.inputPortByName['set_aromatic_carbons'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(AD4_typer_7.inputPortByName['reassign'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(AD4_typer_7.outputPortByName['typed_mols'].configure, (), {'color': '#c64e70', 'shape': 'oval'})
        except:
            print "WARNING: failed to restore Assign_AD4Types named AD4_typer in network self.macroNetwork"
            print_exc()
            AD4_typer_7=None

        self.macroNetwork.freeze()

        ## saving connections for network Prepare AD3 Ligand ##
        input_Ports_1 = self.macroNetwork.ipNode
        if input_Ports_1 is not None and Add_Hydrogens_4 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, Add_Hydrogens_4, "new", "molecules", blocking=True)
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and Add_Hydrogens_4 in network self.macroNetwork"
        if Add_Hydrogens_4 is not None and Calculate_Gasteiger_Charges_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Add_Hydrogens_4, Calculate_Gasteiger_Charges_3, "molecules", "mols", blocking=True)
            except:
                print "WARNING: failed to restore connection between Add_Hydrogens_4 and Calculate_Gasteiger_Charges_3 in network self.macroNetwork"
        if Calculate_Gasteiger_Charges_3 is not None and Merge_NonPolar_Hydrogens_5 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Calculate_Gasteiger_Charges_3, Merge_NonPolar_Hydrogens_5, "mols", "mols", blocking=True)
            except:
                print "WARNING: failed to restore connection between Calculate_Gasteiger_Charges_3 and Merge_NonPolar_Hydrogens_5 in network self.macroNetwork"
        if Merge_NonPolar_Hydrogens_5 is not None and Manage_Rotatable_Bonds_6 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Merge_NonPolar_Hydrogens_5, Manage_Rotatable_Bonds_6, "mols", "mols", blocking=True)
            except:
                print "WARNING: failed to restore connection between Merge_NonPolar_Hydrogens_5 and Manage_Rotatable_Bonds_6 in network self.macroNetwork"
        if Manage_Rotatable_Bonds_6 is not None and AD4_typer_7 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Manage_Rotatable_Bonds_6, AD4_typer_7, "mol", "mols", blocking=True)
            except:
                print "WARNING: failed to restore connection between Manage_Rotatable_Bonds_6 and AD4_typer_7 in network self.macroNetwork"
        output_Ports_2 = self.macroNetwork.opNode
        if AD4_typer_7 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    AD4_typer_7, output_Ports_2, "typed_mols", "new", blocking=True)
            except:
                print "WARNING: failed to restore connection between AD4_typer_7 and output_Ports_2 in network self.macroNetwork"
        self.macroNetwork.unfreeze()

        Prepare_AD3_Ligand_0.shrink()

        ## reset modifications ##
        Prepare_AD3_Ligand_0.resetTags()
        Prepare_AD3_Ligand_0.buildOriginalList()
Esempio n. 49
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
            apply(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
            apply(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)
            apply(
                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",
                },
            )
            apply(
                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",
                },
            )
            apply(
                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",
                },
            )
            apply(
                PrepareADVSInputs_12.addOutputPort,
                (),
                {
                    "name": "filter_file",
                    "datatype": "string",
                    "height": 8,
                    "width": 12,
                    "shape": "oval",
                    "color": "white",
                },
            )
            apply(
                PrepareADVSInputs_12.addOutputPort,
                (),
                {
                    "name": "ligand_lib",
                    "datatype": "string",
                    "height": 8,
                    "width": 12,
                    "shape": "oval",
                    "color": "white",
                },
            )
            apply(
                PrepareADVSInputs_12.addOutputPort,
                (),
                {
                    "name": "dpf_template_file",
                    "datatype": "string",
                    "height": 8,
                    "width": 12,
                    "shape": "oval",
                    "color": "white",
                },
            )
            apply(
                PrepareADVSInputs_12.addOutputPort,
                (),
                {
                    "name": "autogrid_res_url",
                    "datatype": "string",
                    "height": 8,
                    "width": 12,
                    "shape": "oval",
                    "color": "white",
                },
            )
            apply(
                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)
            apply(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)
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["ga_run"].configure, (), {"defaultValue": None})
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["lib"].configure, (), {"defaultValue": None})
            apply(
                autodock_kryptonite_nbcr_net_13.inputPortByName["filter_file_url"].configure, (), {"defaultValue": None}
            )
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["ga_num_evals"].configure, (), {"defaultValue": None})
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["filter_file"].configure, (), {"defaultValue": None})
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["sched"].configure, (), {"defaultValue": None})
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["urllib"].configure, (), {"defaultValue": None})
            apply(
                autodock_kryptonite_nbcr_net_13.inputPortByName["ga_num_generations"].configure,
                (),
                {"defaultValue": None},
            )
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["dpf"].configure, (), {"defaultValue": None})
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["u"].configure, (), {"defaultValue": None})
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["utar"].configure, (), {"defaultValue": None})
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["userlib"].configure, (), {"defaultValue": None})
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["ga_pop_size"].configure, (), {"defaultValue": None})
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["localRun"].configure, (), {"defaultValue": None})
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["email"].configure, (), {"defaultValue": None})
            apply(autodock_kryptonite_nbcr_net_13.inputPortByName["execPath"].configure, (), {"defaultValue": None})
            autodock_kryptonite_nbcr_net_13.inputPortByName["ga_run"].widget.set(r"", run=False)
            apply(
                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()
            apply(
                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)
            apply(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)
            apply(GetMainURLFromList_14.inputPortByName["urls"].configure, (), {"defaultValue": None})
            apply(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()
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from Volume.VisionInterface.VolumeNodes import vollib
        from Vision.StandardNodes import stdlib
        from DejaVu.VisionInterface.DejaVuNodes import vizlib
        ## building macro network ##
        Map_Pot_On_Geom_0 = self
        from traceback import print_exc

        ## loading libraries ##
        from Volume.VisionInterface.VolumeNodes import vollib
        self.macroNetwork.getEditor().addLibraryInstance(vollib,"Volume.VisionInterface.VolumeNodes", "vollib")

        from Vision.StandardNodes import stdlib
        self.macroNetwork.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")

        from DejaVu.VisionInterface.DejaVuNodes import vizlib
        self.macroNetwork.getEditor().addLibraryInstance(vizlib,"DejaVu.VisionInterface.DejaVuNodes", "vizlib")

        try:

            ## saving node input Ports ##
            input_Ports_1 = self.macroNetwork.ipNode
        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
            output_Ports_2.move(230, 578)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_2=None
        try:

            ## saving node getSurfaceVFN ##
            from DejaVu.VisionInterface.DejaVuNodes import getSurfaceVFN
            getSurfaceVFN_3 = getSurfaceVFN(constrkw = {}, name='getSurfaceVFN', library=vizlib)
            self.macroNetwork.addNode(getSurfaceVFN_3,55,83)
            apply(getSurfaceVFN_3.inputPortByName['geometry'].configure, (), {'color': 'red', 'cast': True, 'shape': 'rect'})
            apply(getSurfaceVFN_3.outputPortByName['geom'].configure, (), {'color': 'red', 'shape': 'rect'})
            apply(getSurfaceVFN_3.outputPortByName['vertices'].configure, (), {'color': 'green', 'shape': 'rect'})
            apply(getSurfaceVFN_3.outputPortByName['faces'].configure, (), {'color': 'purple', 'shape': 'rect'})
            apply(getSurfaceVFN_3.outputPortByName['normals'].configure, (), {'color': 'blue', 'shape': 'rect'})
        except:
            print "WARNING: failed to restore getSurfaceVFN named getSurfaceVFN in network self.macroNetwork"
            print_exc()
            getSurfaceVFN_3=None
        try:

            ## saving node mul ##
            from Vision.StandardNodes import Operator2
            mul_4 = Operator2(constrkw = {}, name='mul', library=stdlib)
            self.macroNetwork.addNode(mul_4,309,139)
            apply(mul_4.inputPortByName['data1'].configure, (), {'datatype': 'normals3D', 'cast': True, 'shape': 'rect', 'color': 'blue'})
            apply(mul_4.inputPortByName['data2'].configure, (), {'datatype': 'float', 'cast': True, 'shape': 'circle', 'color': 'green'})
            apply(mul_4.inputPortByName['operation'].configure, (), {'color': 'white', 'cast': True, 'shape': 'diamond'})
            apply(mul_4.inputPortByName['applyToElements'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(mul_4.outputPortByName['result'].configure, (), {'color': 'white', 'shape': 'diamond'})
            mul_4.inputPortByName['operation'].widget.set("mul", run=False)
            mul_4.inputPortByName['applyToElements'].widget.set(1, run=False)
            apply(mul_4.configure, (), {'expanded': False})
        except:
            print "WARNING: failed to restore Operator2 named mul in network self.macroNetwork"
            print_exc()
            mul_4=None
        try:

            ## saving node Offset ##
            from Vision.StandardNodes import DialNE
            Offset_5 = DialNE(constrkw = {}, name='Offset', library=stdlib)
            self.macroNetwork.addNode(Offset_5,390,20)
            apply(Offset_5.inputPortByName['dial'].configure, (), {'color': 'green', 'cast': True, 'shape': 'circle'})
            apply(Offset_5.inputPortByName['mini'].configure, (), {'color': 'green', 'cast': True, 'shape': 'circle'})
            apply(Offset_5.inputPortByName['maxi'].configure, (), {'color': 'green', 'cast': True, 'shape': 'circle'})
            apply(Offset_5.outputPortByName['value'].configure, (), {'color': 'green', 'shape': 'circle'})
            Offset_5.inputPortByName['dial'].widget.set(1.01, run=False)
        except:
            print "WARNING: failed to restore DialNE named Offset in network self.macroNetwork"
            print_exc()
            Offset_5=None
        try:

            ## saving node add ##
            from Vision.StandardNodes import Operator2
            add_6 = Operator2(constrkw = {}, name='add', library=stdlib)
            self.macroNetwork.addNode(add_6,253,183)
            apply(add_6.inputPortByName['data1'].configure, (), {'datatype': 'coordinates3D', 'cast': True, 'shape': 'rect', 'color': 'green'})
            apply(add_6.inputPortByName['data2'].configure, (), {'color': 'white', 'cast': True, 'shape': 'diamond'})
            apply(add_6.inputPortByName['operation'].configure, (), {'color': 'white', 'cast': True, 'shape': 'diamond'})
            apply(add_6.inputPortByName['applyToElements'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(add_6.outputPortByName['result'].configure, (), {'color': 'white', 'shape': 'diamond'})
            add_6.inputPortByName['operation'].widget.set("add", run=False)
            add_6.inputPortByName['applyToElements'].widget.set(1, run=False)
            apply(add_6.configure, (), {'expanded': False})
        except:
            print "WARNING: failed to restore Operator2 named add in network self.macroNetwork"
            print_exc()
            add_6=None
        try:

            ## saving node triInterp ##
            from Volume.VisionInterface.VolumeNodes import TriInterp
            triInterp_7 = TriInterp(constrkw = {}, name='triInterp', library=vollib)
            self.macroNetwork.addNode(triInterp_7,189,270)
            apply(triInterp_7.inputPortByName['grid'].configure, (), {'color': '#995699', 'cast': True, 'shape': 'diamond'})
            apply(triInterp_7.inputPortByName['points'].configure, (), {'datatype': 'list', 'cast': True, 'shape': 'oval', 'color': 'cyan'})
            apply(triInterp_7.outputPortByName['data'].configure, (), {'color': 'cyan', 'shape': 'oval'})
        except:
            print "WARNING: failed to restore TriInterp named triInterp in network self.macroNetwork"
            print_exc()
            triInterp_7=None
        try:

            ## saving node Color Map ##
            from DejaVu.VisionInterface.DejaVuNodes import ColorMapNE
            Color_Map_9 = ColorMapNE(constrkw = {}, name='Color Map', library=vizlib)
            self.macroNetwork.addNode(Color_Map_9,213,433)
            apply(Color_Map_9.inputPortByName['colorMap'].configure, (), {'color': 'magenta', 'cast': True, 'shape': 'rect'})
            apply(Color_Map_9.inputPortByName['values'].configure, (), {'color': 'cyan', 'cast': True, 'shape': 'oval'})
            apply(Color_Map_9.inputPortByName['mini'].configure, (), {'color': 'green', 'cast': True, 'shape': 'circle'})
            apply(Color_Map_9.inputPortByName['maxi'].configure, (), {'color': 'green', 'cast': True, 'shape': 'circle'})
            apply(Color_Map_9.inputPortByName['filename'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Color_Map_9.outputPortByName['mappedColors'].configure, (), {'color': 'orange', 'shape': 'rect'})
            apply(Color_Map_9.outputPortByName['colorMap'].configure, (), {'color': 'magenta', 'shape': 'rect'})
            apply(Color_Map_9.outputPortByName['legend'].configure, (), {'color': 'red', 'shape': 'rect'})
            Color_Map_9.inputPortByName['colorMap'].widget.set({'mini': None, 'maxi': None, 'ramp': [[1.0, 0.0, 0.0, 1.0], [1.0, 0.0060000000000000053, 0.0060000000000000053, 1.0], [1.0, 0.01100000000000001, 0.01100000000000001, 1.0], [1.0, 0.02300000000000002, 0.02300000000000002, 1.0], [1.0, 0.029000000000000026, 0.029000000000000026, 1.0], [1.0, 0.03400000000000003, 0.03400000000000003, 1.0], [1.0, 0.046000000000000041, 0.046000000000000041, 1.0], [1.0, 0.051000000000000045, 0.051000000000000045, 1.0], [1.0, 0.057000000000000051, 0.057000000000000051, 1.0], [1.0, 0.06899999999999995, 0.06899999999999995, 1.0], [1.0, 0.073999999999999955, 0.073999999999999955, 1.0], [1.0, 0.085999999999999965, 0.085999999999999965, 1.0], [1.0, 0.09099999999999997, 0.09099999999999997, 1.0], [1.0, 0.096999999999999975, 0.096999999999999975, 1.0], [1.0, 0.10899999999999999, 0.10899999999999999, 1.0], [1.0, 0.11399999999999999, 0.11399999999999999, 1.0], [1.0, 0.12, 0.12, 1.0], [1.0, 0.13100000000000001, 0.13100000000000001, 1.0], [1.0, 0.13700000000000001, 0.13700000000000001, 1.0], [1.0, 0.14300000000000002, 0.14300000000000002, 1.0], [1.0, 0.15400000000000003, 0.15400000000000003, 1.0], [1.0, 0.16000000000000003, 0.16000000000000003, 1.0], [1.0, 0.17100000000000004, 0.17100000000000004, 1.0], [1.0, 0.17700000000000005, 0.17700000000000005, 1.0], [1.0, 0.18300000000000005, 0.18300000000000005, 1.0], [1.0, 0.19399999999999995, 0.19399999999999995, 1.0], [1.0, 0.19999999999999996, 0.19999999999999996, 1.0], [1.0, 0.20599999999999996, 0.20599999999999996, 1.0], [1.0, 0.21699999999999997, 0.21699999999999997, 1.0], [1.0, 0.22299999999999998, 0.22299999999999998, 1.0], [1.0, 0.23399999999999999, 0.23399999999999999, 1.0], [1.0, 0.23999999999999999, 0.23999999999999999, 1.0], [1.0, 0.246, 0.246, 1.0], [1.0, 0.25700000000000001, 0.25700000000000001, 1.0], [1.0, 0.26300000000000001, 0.26300000000000001, 1.0], [1.0, 0.26900000000000002, 0.26900000000000002, 1.0], [1.0, 0.28000000000000003, 0.28000000000000003, 1.0], [1.0, 0.28600000000000003, 0.28600000000000003, 1.0], [1.0, 0.29100000000000004, 0.29100000000000004, 1.0], [1.0, 0.30300000000000005, 0.30300000000000005, 1.0], [1.0, 0.30900000000000005, 0.30900000000000005, 1.0], [1.0, 0.31999999999999995, 0.31999999999999995, 1.0], [1.0, 0.32599999999999996, 0.32599999999999996, 1.0], [1.0, 0.33099999999999996, 0.33099999999999996, 1.0], [1.0, 0.34299999999999997, 0.34299999999999997, 1.0], [1.0, 0.34899999999999998, 0.34899999999999998, 1.0], [1.0, 0.35399999999999998, 0.35399999999999998, 1.0], [1.0, 0.36599999999999999, 0.36599999999999999, 1.0], [1.0, 0.371, 0.371, 1.0], [1.0, 0.377, 0.377, 1.0], [1.0, 0.38900000000000001, 0.38900000000000001, 1.0], [1.0, 0.39400000000000002, 0.39400000000000002, 1.0], [1.0, 0.40600000000000003, 0.40600000000000003, 1.0], [1.0, 0.41100000000000003, 0.41100000000000003, 1.0], [1.0, 0.41700000000000004, 0.41700000000000004, 1.0], [1.0, 0.42900000000000005, 0.42900000000000005, 1.0], [1.0, 0.43400000000000005, 0.43400000000000005, 1.0], [1.0, 0.43999999999999995, 0.43999999999999995, 1.0], [1.0, 0.45099999999999996, 0.45099999999999996, 1.0], [1.0, 0.45699999999999996, 0.45699999999999996, 1.0], [1.0, 0.46899999999999997, 0.46899999999999997, 1.0], [1.0, 0.47399999999999998, 0.47399999999999998, 1.0], [1.0, 0.47999999999999998, 0.47999999999999998, 1.0], [1.0, 0.49099999999999999, 0.49099999999999999, 1.0], [1.0, 0.497, 0.497, 1.0], [1.0, 0.503, 0.503, 1.0], [1.0, 0.51400000000000001, 0.51400000000000001, 1.0], [1.0, 0.52000000000000002, 0.52000000000000002, 1.0], [1.0, 0.52600000000000002, 0.52600000000000002, 1.0], [1.0, 0.53699999999999992, 0.53699999999999992, 1.0], [1.0, 0.54299999999999993, 0.54299999999999993, 1.0], [1.0, 0.55400000000000005, 0.55400000000000005, 1.0], [1.0, 0.56000000000000005, 0.56000000000000005, 1.0], [1.0, 0.56600000000000006, 0.56600000000000006, 1.0], [1.0, 0.57699999999999996, 0.57699999999999996, 1.0], [1.0, 0.58299999999999996, 0.58299999999999996, 1.0], [1.0, 0.58899999999999997, 0.58899999999999997, 1.0], [1.0, 0.59999999999999998, 0.59999999999999998, 1.0], [1.0, 0.60599999999999998, 0.60599999999999998, 1.0], [1.0, 0.61699999999999999, 0.61699999999999999, 1.0], [1.0, 0.623, 0.623, 1.0], [1.0, 0.629, 0.629, 1.0], [1.0, 0.64000000000000001, 0.64000000000000001, 1.0], [1.0, 0.64600000000000002, 0.64600000000000002, 1.0], [1.0, 0.65100000000000002, 0.65100000000000002, 1.0], [1.0, 0.66300000000000003, 0.66300000000000003, 1.0], [1.0, 0.66900000000000004, 0.66900000000000004, 1.0], [1.0, 0.67399999999999993, 0.67399999999999993, 1.0], [1.0, 0.68599999999999994, 0.68599999999999994, 1.0], [1.0, 0.69100000000000006, 0.69100000000000006, 1.0], [1.0, 0.70300000000000007, 0.70300000000000007, 1.0], [1.0, 0.70900000000000007, 0.70900000000000007, 1.0], [1.0, 0.71399999999999997, 0.71399999999999997, 1.0], [1.0, 0.72599999999999998, 0.72599999999999998, 1.0], [1.0, 0.73099999999999998, 0.73099999999999998, 1.0], [1.0, 0.73699999999999999, 0.73699999999999999, 1.0], [1.0, 0.749, 0.749, 1.0], [1.0, 0.754, 0.754, 1.0], [1.0, 0.76000000000000001, 0.76000000000000001, 1.0], [1.0, 0.77100000000000002, 0.77100000000000002, 1.0], [1.0, 0.77700000000000002, 0.77700000000000002, 1.0], [1.0, 0.78900000000000003, 0.78900000000000003, 1.0], [1.0, 0.79400000000000004, 0.79400000000000004, 1.0], [1.0, 0.80000000000000004, 0.80000000000000004, 1.0], [1.0, 0.81099999999999994, 0.81099999999999994, 1.0], [1.0, 0.81699999999999995, 0.81699999999999995, 1.0], [1.0, 0.82299999999999995, 0.82299999999999995, 1.0], [1.0, 0.83399999999999996, 0.83399999999999996, 1.0], [1.0, 0.83999999999999997, 0.83999999999999997, 1.0], [1.0, 0.85099999999999998, 0.85099999999999998, 1.0], [1.0, 0.85699999999999998, 0.85699999999999998, 1.0], [1.0, 0.86299999999999999, 0.86299999999999999, 1.0], [1.0, 0.874, 0.874, 1.0], [1.0, 0.88, 0.88, 1.0], [1.0, 0.88600000000000001, 0.88600000000000001, 1.0], [1.0, 0.89700000000000002, 0.89700000000000002, 1.0], [1.0, 0.90300000000000002, 0.90300000000000002, 1.0], [1.0, 0.90900000000000003, 0.90900000000000003, 1.0], [1.0, 0.92000000000000004, 0.92000000000000004, 1.0], [1.0, 0.92600000000000005, 0.92600000000000005, 1.0], [1.0, 0.93700000000000006, 0.93700000000000006, 1.0], [1.0, 0.94299999999999995, 0.94299999999999995, 1.0], [1.0, 0.94899999999999995, 0.94899999999999995, 1.0], [1.0, 0.95999999999999996, 0.95999999999999996, 1.0], [1.0, 0.96599999999999997, 0.96599999999999997, 1.0], [1.0, 0.97099999999999997, 0.97099999999999997, 1.0], [1.0, 0.98299999999999998, 0.98299999999999998, 1.0], [1.0, 0.98899999999999999, 0.98899999999999999, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [0.98902199999999996, 0.98899999999999999, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [0.97105799999999998, 0.97099999999999997, 1.0, 1.0], [0.96606800000000004, 0.96599999999999997, 1.0, 1.0], [0.95409199999999994, 0.95399999999999996, 1.0, 1.0], [0.949102, 0.94899999999999995, 1.0, 1.0], [0.93712600000000013, 0.93700000000000006, 1.0, 1.0], [0.93113800000000013, 0.93100000000000005, 1.0, 1.0], [0.92614800000000008, 0.92600000000000005, 1.0, 1.0], [0.9141720000000001, 0.91400000000000003, 1.0, 1.0], [0.90918200000000005, 0.90900000000000003, 1.0, 1.0], [0.90319400000000005, 0.90300000000000002, 1.0, 1.0], [0.89121800000000007, 0.89100000000000001, 1.0, 1.0], [0.88622800000000013, 0.88600000000000001, 1.0, 1.0], [0.87425200000000003, 0.874, 1.0, 1.0], [0.86926200000000009, 0.86899999999999999, 1.0, 1.0], [0.8632740000000001, 0.86299999999999999, 1.0, 1.0], [0.85129800000000011, 0.85099999999999998, 1.0, 1.0], [0.84630800000000006, 0.84599999999999997, 1.0, 1.0], [0.84032000000000007, 0.83999999999999997, 1.0, 1.0], [0.82934200000000002, 0.82899999999999996, 1.0, 1.0], [0.82335400000000014, 0.82299999999999995, 1.0, 1.0], [0.81137800000000004, 0.81099999999999994, 1.0, 1.0], [0.80638800000000022, 0.80600000000000005, 1.0, 1.0], [0.80040000000000022, 0.80000000000000004, 1.0, 1.0], [0.78942200000000018, 0.78900000000000003, 1.0, 1.0], [0.78343400000000019, 0.78300000000000003, 1.0, 1.0], [0.77744600000000019, 0.77700000000000002, 1.0, 1.0], [0.76646800000000015, 0.76600000000000001, 1.0, 1.0], [0.76048000000000016, 0.76000000000000001, 1.0, 1.0], [0.74950200000000011, 0.749, 1.0, 1.0], [0.74351400000000023, 0.74299999999999999, 1.0, 1.0], [0.73752600000000013, 0.73699999999999999, 1.0, 1.0], [0.72654800000000019, 0.72599999999999998, 1.0, 1.0], [0.72056000000000009, 0.71999999999999997, 1.0, 1.0], [0.71457200000000021, 0.71399999999999997, 1.0, 1.0], [0.70359400000000027, 0.70300000000000007, 1.0, 1.0], [0.69760600000000028, 0.69700000000000006, 1.0, 1.0], [0.68662800000000013, 0.68599999999999994, 1.0, 1.0], [0.68064000000000013, 0.67999999999999994, 1.0, 1.0], [0.67465200000000014, 0.67399999999999993, 1.0, 1.0], [0.66367400000000032, 0.66300000000000003, 1.0, 1.0], [0.65768600000000021, 0.65700000000000003, 1.0, 1.0], [0.64670800000000028, 0.64600000000000002, 1.0, 1.0], [0.64072000000000018, 0.64000000000000001, 1.0, 1.0], [0.6347320000000003, 0.63400000000000001, 1.0, 1.0], [0.62375400000000025, 0.623, 1.0, 1.0], [0.61776600000000026, 0.61699999999999999, 1.0, 1.0], [0.61177800000000027, 0.61099999999999999, 1.0, 1.0], [0.60080000000000022, 0.59999999999999998, 1.0, 1.0], [0.59481200000000023, 0.59399999999999997, 1.0, 1.0], [0.58383400000000019, 0.58299999999999996, 1.0, 1.0], [0.5778460000000003, 0.57699999999999996, 1.0, 1.0], [0.5718580000000002, 0.57099999999999995, 1.0, 1.0], [0.56088000000000027, 0.56000000000000005, 1.0, 1.0], [0.55489200000000038, 0.55400000000000005, 1.0, 1.0], [0.54990200000000022, 0.54899999999999993, 1.0, 1.0], [0.53792600000000024, 0.53699999999999992, 1.0, 1.0], [0.53193800000000035, 0.53100000000000003, 1.0, 1.0], [0.52096000000000031, 0.52000000000000002, 1.0, 1.0], [0.51497200000000032, 0.51400000000000001, 1.0, 1.0], [0.50998200000000038, 0.50900000000000001, 1.0, 1.0], [0.49800600000000028, 0.497, 1.0, 1.0], [0.49201800000000029, 0.49099999999999999, 1.0, 1.0], [0.48702800000000035, 0.48599999999999999, 1.0, 1.0], [0.47505200000000036, 0.47399999999999998, 1.0, 1.0], [0.47006200000000031, 0.46899999999999997, 1.0, 1.0], [0.45808600000000033, 0.45699999999999996, 1.0, 1.0], [0.45209800000000033, 0.45099999999999996, 1.0, 1.0], [0.44710800000000028, 0.44599999999999995, 1.0, 1.0], [0.43513200000000041, 0.43400000000000005, 1.0, 1.0], [0.43014200000000047, 0.42900000000000005, 1.0, 1.0], [0.42415400000000048, 0.42300000000000004, 1.0, 1.0], [0.41217800000000038, 0.41100000000000003, 1.0, 1.0], [0.40718800000000044, 0.40600000000000003, 1.0, 1.0], [0.39521200000000045, 0.39400000000000002, 1.0, 1.0], [0.3902220000000004, 0.38900000000000001, 1.0, 1.0], [0.38423400000000041, 0.38300000000000001, 1.0, 1.0], [0.37225800000000042, 0.371, 1.0, 1.0], [0.36726800000000037, 0.36599999999999999, 1.0, 1.0], [0.36128000000000038, 0.35999999999999999, 1.0, 1.0], [0.35030200000000045, 0.34899999999999998, 1.0, 1.0], [0.34431400000000045, 0.34299999999999997, 1.0, 1.0], [0.33233800000000036, 0.33099999999999996, 1.0, 1.0], [0.32734800000000042, 0.32599999999999996, 1.0, 1.0], [0.32136000000000042, 0.31999999999999995, 1.0, 1.0], [0.31038200000000049, 0.30900000000000005, 1.0, 1.0], [0.3043940000000005, 0.30300000000000005, 1.0, 1.0], [0.29241800000000051, 0.29100000000000004, 1.0, 1.0], [0.28742800000000046, 0.28600000000000003, 1.0, 1.0], [0.28144000000000047, 0.28000000000000003, 1.0, 1.0], [0.27046200000000054, 0.26900000000000002, 1.0, 1.0], [0.26447400000000054, 0.26300000000000001, 1.0, 1.0], [0.25848600000000055, 0.25700000000000001, 1.0, 1.0], [0.24750800000000051, 0.246, 1.0, 1.0], [0.24152000000000051, 0.23999999999999999, 1.0, 1.0], [0.23054200000000047, 0.22899999999999998, 1.0, 1.0], [0.22455400000000048, 0.22299999999999998, 1.0, 1.0], [0.21856600000000048, 0.21699999999999997, 1.0, 1.0], [0.20758800000000044, 0.20599999999999996, 1.0, 1.0], [0.20160000000000045, 0.19999999999999996, 1.0, 1.0], [0.19561200000000045, 0.19399999999999995, 1.0, 1.0], [0.18463400000000063, 0.18300000000000005, 1.0, 1.0], [0.17864600000000064, 0.17700000000000005, 1.0, 1.0], [0.16766800000000059, 0.16600000000000004, 1.0, 1.0], [0.1616800000000006, 0.16000000000000003, 1.0, 1.0], [0.15569200000000061, 0.15400000000000003, 1.0, 1.0], [0.14471400000000056, 0.14300000000000002, 1.0, 1.0], [0.13872600000000057, 0.13700000000000001, 1.0, 1.0], [0.13273800000000058, 0.13100000000000001, 1.0, 1.0], [0.12176000000000053, 0.12, 1.0, 1.0], [0.11577200000000054, 0.11399999999999999, 1.0, 1.0], [0.10479400000000061, 0.10299999999999998, 1.0, 1.0], [0.098806000000000616, 0.096999999999999975, 1.0, 1.0], [0.092818000000000622, 0.09099999999999997, 1.0, 1.0], [0.081840000000000579, 0.07999999999999996, 1.0, 1.0], [0.075852000000000586, 0.073999999999999955, 1.0, 1.0], [0.070862000000000536, 0.06899999999999995, 1.0, 1.0], [0.05888600000000066, 0.057000000000000051, 1.0, 1.0], [0.052898000000000667, 0.051000000000000045, 1.0, 1.0], [0.041920000000000623, 0.040000000000000036, 1.0, 1.0], [0.03593200000000063, 0.03400000000000003, 1.0, 1.0], [0.030942000000000691, 0.029000000000000026, 1.0, 1.0], [0.018966000000000705, 0.017000000000000015, 1.0, 1.0], [0.012978000000000711, 0.01100000000000001, 1.0, 1.0], [0.0020000000000006679, 0.0, 1.0, 1.0]], 'name': 'cmap'}, run=False)
        except:
            print "WARNING: failed to restore ColorMap named Color Map in network self.macroNetwork"
            print_exc()
            Color_Map_9=None
        try:

            ## saving node call method ##
            from Vision.StandardNodes import CallMethod
            call_method_10 = CallMethod(constrkw = {}, name='call method', library=stdlib)
            self.macroNetwork.addNode(call_method_10,179,501)
            apply(call_method_10.inputPortByName['objects'].configure, (), {'datatype': 'geom', 'cast': True, 'shape': 'rect', 'color': 'red'})
            apply(call_method_10.inputPortByName['signature'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(call_method_10.addInputPort, (), {'name': 'materials', 'cast': True, 'datatype': 'colorfloat3or4(0)', 'required': False, 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'orange'})
            apply(call_method_10.addInputPort, (), {'name': 'inheritMaterial', 'cast': True, 'datatype': 'int', 'required': False, 'height': 12, 'width': 12, 'shape': 'circle', 'color': 'yellow'})
            apply(call_method_10.outputPortByName['objects'].configure, (), {'color': 'white', 'shape': 'diamond'})
            apply(call_method_10.outputPortByName['results'].configure, (), {'color': 'white', 'shape': 'diamond'})
            call_method_10.inputPortByName['signature'].widget.set("Set materials inheritMaterial", run=False)
        except:
            print "WARNING: failed to restore CallMethod named call method in network self.macroNetwork"
            print_exc()
            call_method_10=None
        try:

            ## saving node Checkbutton ##
            from Vision.StandardNodes import CheckButtonNE
            Checkbutton_11 = CheckButtonNE(constrkw = {}, name='Checkbutton', library=stdlib)
            self.macroNetwork.addNode(Checkbutton_11,346,478)
            apply(Checkbutton_11.inputPortByName['button'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(Checkbutton_11.outputPortByName['value'].configure, (), {'color': 'yellow', 'shape': 'circle'})
        except:
            print "WARNING: failed to restore CheckButtonNE named Checkbutton in network self.macroNetwork"
            print_exc()
            Checkbutton_11=None
        try:

            ## saving node Redraw ##
            from DejaVu.VisionInterface.DejaVuNodes import Redraw
            Redraw_12 = Redraw(constrkw = {}, name='Redraw', library=vizlib)
            self.macroNetwork.addNode(Redraw_12,41,518)
            apply(Redraw_12.inputPortByName['viewer'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'rect'})
            apply(Redraw_12.inputPortByName['trigger'].configure, (), {'color': 'white', 'cast': True, 'shape': 'diamond'})
        except:
            print "WARNING: failed to restore Redraw named Redraw in network self.macroNetwork"
            print_exc()
            Redraw_12=None
        try:

            ## saving node neg ##
            from Vision.StandardNodes import Operator1
            neg_13 = Operator1(constrkw = {}, name='neg', library=stdlib)
            self.macroNetwork.addNode(neg_13,288,321)
            apply(neg_13.inputPortByName['data'].configure, (), {'color': 'white', 'cast': True, 'shape': 'diamond'})
            apply(neg_13.inputPortByName['operation'].configure, (), {'color': 'white', 'cast': True, 'shape': 'diamond'})
            apply(neg_13.inputPortByName['applyToElements'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(neg_13.outputPortByName['result'].configure, (), {'color': 'white', 'shape': 'diamond'})
            neg_13.inputPortByName['operation'].widget.set("neg", run=False)
            apply(neg_13.configure, (), {'expanded': False})
        except:
            print "WARNING: failed to restore Operator1 named neg in network self.macroNetwork"
            print_exc()
            neg_13=None
        try:

            ## saving node Get viewer ##
            from Vision.StandardNodes import GetAttr
            Get_viewer_14 = GetAttr(constrkw = {}, name='Get viewer', library=stdlib)
            self.macroNetwork.addNode(Get_viewer_14,18,324)
            apply(Get_viewer_14.inputPortByName['objects'].configure, (), {'color': 'white', 'cast': True, 'shape': 'diamond'})
            apply(Get_viewer_14.inputPortByName['attr'].configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Get_viewer_14.outputPortByName['attrs'].configure, (), {'color': 'cyan', 'shape': 'oval'})
            apply(Get_viewer_14.inputPortByName['attr'].widget.configure, (), {'choices': ('viewer',)})
            Get_viewer_14.inputPortByName['attr'].widget.set("viewer", run=False)
        except:
            print "WARNING: failed to restore GetAttr named Get viewer in network self.macroNetwork"
            print_exc()
            Get_viewer_14=None
        try:

            ## saving node Slice Data ##
            from Vision.StandardNodes import SliceData
            Slice_Data_15 = SliceData(constrkw = {}, name='Slice Data', library=stdlib)
            self.macroNetwork.addNode(Slice_Data_15,29,421)
            apply(Slice_Data_15.inputPortByName['data'].configure, (), {'datatype': 'list', 'cast': True, 'shape': 'oval', 'color': 'cyan'})
            apply(Slice_Data_15.inputPortByName['_slice'].configure, (), {'color': 'white', 'cast': True, 'shape': 'diamond'})
            apply(Slice_Data_15.outputPortByName['data'].configure, (), {'color': 'white', 'shape': 'diamond'})
            Slice_Data_15.inputPortByName['_slice'].widget.set("[0]", run=False)
        except:
            print "WARNING: failed to restore SliceData named Slice Data in network self.macroNetwork"
            print_exc()
            Slice_Data_15=None
        try:

            ## saving node stddev ##
            from Vision.StandardNodes import StdDev
            stddev_16 = StdDev(constrkw = {}, name='stddev', library=stdlib)
            self.macroNetwork.addNode(stddev_16,339,230)
            apply(stddev_16.inputPortByName['values'].configure, (), {'color': 'cyan', 'cast': True, 'shape': 'oval'})
            apply(stddev_16.outputPortByName['stddev'].configure, (), {'color': 'green', 'shape': 'circle'})
        except:
            print "WARNING: failed to restore StdDev named stddev in network self.macroNetwork"
            print_exc()
            stddev_16=None
        try:

            ## saving node Dial ##
            from Vision.StandardNodes import DialNE
            Dial_17 = DialNE(constrkw = {}, name='Dial', library=stdlib)
            self.macroNetwork.addNode(Dial_17,412,152)
            apply(Dial_17.inputPortByName['dial'].configure, (), {'color': 'green', 'cast': True, 'shape': 'circle'})
            apply(Dial_17.inputPortByName['mini'].configure, (), {'color': 'green', 'cast': True, 'shape': 'circle'})
            apply(Dial_17.inputPortByName['maxi'].configure, (), {'color': 'green', 'cast': True, 'shape': 'circle'})
            apply(Dial_17.outputPortByName['value'].configure, (), {'color': 'green', 'shape': 'circle'})
            Dial_17.inputPortByName['dial'].widget.set(5.0, run=False)
        except:
            print "WARNING: failed to restore DialNE named Dial in network self.macroNetwork"
            print_exc()
            Dial_17=None
        try:

            ## saving node mul ##
            from Vision.StandardNodes import Operator2
            mul_18 = Operator2(constrkw = {}, name='mul', library=stdlib)
            self.macroNetwork.addNode(mul_18,369,347)
            apply(mul_18.inputPortByName['data1'].configure, (), {'datatype': 'float', 'cast': True, 'shape': 'circle', 'color': 'green'})
            apply(mul_18.inputPortByName['data2'].configure, (), {'datatype': 'float', 'cast': True, 'shape': 'circle', 'color': 'green'})
            apply(mul_18.inputPortByName['operation'].configure, (), {'color': 'white', 'cast': True, 'shape': 'diamond'})
            apply(mul_18.inputPortByName['applyToElements'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(mul_18.outputPortByName['result'].configure, (), {'color': 'white', 'shape': 'diamond'})
            mul_18.inputPortByName['operation'].widget.set("mul", run=False)
            apply(mul_18.configure, (), {'expanded': False})
        except:
            print "WARNING: failed to restore Operator2 named mul in network self.macroNetwork"
            print_exc()
            mul_18=None
        self.macroNetwork.freeze()

        ## saving connections for network Map Pot On Geom ##
        if Offset_5 is not None and mul_4 is not None:
            self.macroNetwork.connectNodes(
                Offset_5, mul_4, "value", "data2", blocking=True)
        if getSurfaceVFN_3 is not None and mul_4 is not None:
            self.macroNetwork.connectNodes(
                getSurfaceVFN_3, mul_4, "normals", "data1", blocking=True)
        if mul_4 is not None and add_6 is not None:
            self.macroNetwork.connectNodes(
                mul_4, add_6, "result", "data2", blocking=True)
        if getSurfaceVFN_3 is not None and add_6 is not None:
            self.macroNetwork.connectNodes(
                getSurfaceVFN_3, add_6, "vertices", "data1", blocking=True)
        if add_6 is not None and triInterp_7 is not None:
            self.macroNetwork.connectNodes(
                add_6, triInterp_7, "result", "points", blocking=True)
        if getSurfaceVFN_3 is not None and call_method_10 is not None:
            self.macroNetwork.connectNodes(
                getSurfaceVFN_3, call_method_10, "geom", "objects", blocking=True)
        if Checkbutton_11 is not None and call_method_10 is not None:
            self.macroNetwork.connectNodes(
                Checkbutton_11, call_method_10, "value", "inheritMaterial", blocking=True)
        if call_method_10 is not None and Redraw_12 is not None:
            self.macroNetwork.connectNodes(
                call_method_10, Redraw_12, "objects", "trigger", blocking=True)
        input_Ports_1 = self.macroNetwork.ipNode
        if input_Ports_1 is not None and getSurfaceVFN_3 is not None:
            self.macroNetwork.connectNodes(
                input_Ports_1, getSurfaceVFN_3, "new", "geometry", blocking=True)
        if getSurfaceVFN_3 is not None and Get_viewer_14 is not None:
            self.macroNetwork.connectNodes(
                getSurfaceVFN_3, Get_viewer_14, "geom", "objects", blocking=True)
        if Get_viewer_14 is not None and Slice_Data_15 is not None:
            self.macroNetwork.connectNodes(
                Get_viewer_14, Slice_Data_15, "attrs", "data", blocking=True)
        if Slice_Data_15 is not None and Redraw_12 is not None:
            self.macroNetwork.connectNodes(
                Slice_Data_15, Redraw_12, "data", "viewer", blocking=True)
        if input_Ports_1 is not None and triInterp_7 is not None:
            self.macroNetwork.connectNodes(
                input_Ports_1, triInterp_7, "new", "grid", blocking=True)
        if triInterp_7 is not None and stddev_16 is not None:
            self.macroNetwork.connectNodes(
                triInterp_7, stddev_16, "data", "values", blocking=True)
        if neg_13 is not None and Color_Map_9 is not None:
            self.macroNetwork.connectNodes(
                neg_13, Color_Map_9, "result", "mini", blocking=True)
        if mul_18 is not None and neg_13 is not None:
            self.macroNetwork.connectNodes(
                mul_18, neg_13, "result", "data", blocking=True)
        if mul_18 is not None and Color_Map_9 is not None:
            self.macroNetwork.connectNodes(
                mul_18, Color_Map_9, "result", "maxi", blocking=True)
        if Dial_17 is not None and mul_18 is not None:
            self.macroNetwork.connectNodes(
                Dial_17, mul_18, "value", "data2", blocking=True)
        if stddev_16 is not None and mul_18 is not None:
            self.macroNetwork.connectNodes(
                stddev_16, mul_18, "stddev", "data1", blocking=True)
        if triInterp_7 is not None and Color_Map_9 is not None:
            self.macroNetwork.connectNodes(
                triInterp_7, Color_Map_9, "data", "values", blocking=True)
        if Color_Map_9 is not None and call_method_10 is not None:
            self.macroNetwork.connectNodes(
                Color_Map_9, call_method_10, "mappedColors", "materials", blocking=True)
        output_Ports_2 = self.macroNetwork.opNode
        if Color_Map_9 is not None and output_Ports_2 is not None:
            self.macroNetwork.connectNodes(
                Color_Map_9, output_Ports_2, "legend", "new", blocking=True)
        self.macroNetwork.unfreeze()

        Map_Pot_On_Geom_0.shrink()

        ## reset modifications ##
        Map_Pot_On_Geom_0.resetTags()
        Map_Pot_On_Geom_0.buildOriginalList()
    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 ##
        LocalLigandDirectory_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://kryptonite.nbcr.net/opal2",
                                    replace=False)
        except:
            pass
        try:
            ## saving node input Ports ##
            input_Ports_1 = self.macroNetwork.ipNode
            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
            output_Ports_2.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
            output_Ports_2.move(294, 448)
        except:
            print(
                "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            )
            print_exc()
            output_Ports_2 = None

        try:
            ## saving node Make Zip File ##
            from Vision.StandardNodes import MakeZipFileNE
            Make_Zip_File_3 = MakeZipFileNE(constrkw={},
                                            name='Make Zip File',
                                            library=stdlib)
            self.macroNetwork.addNode(Make_Zip_File_3, 136, 158)
            Make_Zip_File_3.inputPortByName['input_directory'].configure(
                *(), **{'defaultValue': None})
            Make_Zip_File_3.inputPortByName['output_directory'].configure(
                *(), **{'defaultValue': None})
            Make_Zip_File_3.inputPortByName['output_name'].configure(
                *(), **{'defaultValue': None})
            Make_Zip_File_3.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore MakeZipFileNE named Make Zip File in network self.macroNetwork"
            )
            print_exc()
            Make_Zip_File_3 = None

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

        try:
            ## saving node LigandDBUpload_kryptonite_nbcr_net ##
            from NetworkEditor.items import FunctionNode
            LigandDBUpload_kryptonite_nbcr_net_5 = FunctionNode(
                functionOrString='LigandDBUpload_kryptonite_nbcr_net',
                host="http://kryptonite.nbcr.net/opal2",
                namedArgs={
                    'username': '',
                    'userlib': '',
                    'password': '',
                    'localRun': False,
                    'execPath': '',
                    'desc': ''
                },
                constrkw={
                    'functionOrString': "'LigandDBUpload_kryptonite_nbcr_net'",
                    'host': '"http://kryptonite.nbcr.net/opal2"',
                    'namedArgs': {
                        'username': '',
                        'userlib': '',
                        'password': '',
                        'localRun': False,
                        'execPath': '',
                        'desc': ''
                    }
                },
                name='LigandDBUpload_kryptonite_nbcr_net',
                library=wslib)
            self.macroNetwork.addNode(LigandDBUpload_kryptonite_nbcr_net_5,
                                      136, 216)
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'username'].configure(*(), **{'defaultValue': None})
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'userlib'].configure(*(), **{'defaultValue': None})
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'password'].configure(*(), **{'defaultValue': None})
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'localRun'].configure(*(), **{'defaultValue': None})
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'execPath'].configure(*(), **{'defaultValue': None})
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'desc'].configure(*(), **{'defaultValue': None})
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'username'].widget.set(r"", run=False)
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'userlib'].rebindWidget()
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'userlib'].widget.set(r"", run=False)
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'userlib'].unbindWidget()
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'password'].widget.set(r"", run=False)
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'localRun'].widget.set(0, run=False)
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            LigandDBUpload_kryptonite_nbcr_net_5.inputPortByName[
                'desc'].widget.set(r"", run=False)
            LigandDBUpload_kryptonite_nbcr_net_5.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore FunctionNode named LigandDBUpload_kryptonite_nbcr_net in network self.macroNetwork"
            )
            print_exc()
            LigandDBUpload_kryptonite_nbcr_net_5 = None

        try:
            ## saving node Index ##
            from Vision.StandardNodes import Index
            Index_6 = Index(constrkw={}, name='Index', library=stdlib)
            self.macroNetwork.addNode(Index_6, 136, 273)
            Index_6.inputPortByName['data'].configure(*(),
                                                      **{'defaultValue': None})
            Index_6.inputPortByName['index'].configure(
                *(), **{'defaultValue': None})
            Index_6.outputPortByName['data'].configure(
                *(), **{'datatype': 'string'})
            Index_6.inputPortByName['index'].widget.configure(
                *(), **{
                    'max': 7,
                    'min': -8
                })
            Index_6.inputPortByName['index'].widget.set(0, run=False)
            Index_6.configure(*(), **{
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print(
                "WARNING: failed to restore Index named Index in network self.macroNetwork"
            )
            print_exc()
            Index_6 = None

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

        try:
            ## saving node CreateLigandDBObj ##
            from Vision.StandardNodes import Generic
            CreateLigandDBObj_8 = Generic(constrkw={},
                                          name='CreateLigandDBObj',
                                          library=stdlib)
            self.macroNetwork.addNode(CreateLigandDBObj_8, 217, 385)
            CreateLigandDBObj_8.addInputPort(
                *(), **{
                    'singleConnection': True,
                    'name': 'ligand_lib_url',
                    'cast': True,
                    'datatype': 'string',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white',
                    'originalDatatype': 'None'
                })
            CreateLigandDBObj_8.addInputPort(
                *(), **{
                    'singleConnection': True,
                    'name': 'log_file',
                    'cast': True,
                    'datatype': 'string',
                    'defaultValue': None,
                    'required': False,
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white',
                    'originalDatatype': 'None'
                })
            CreateLigandDBObj_8.addOutputPort(
                *(), **{
                    'name': 'ligand_db_obj',
                    'datatype': 'LigandDB',
                    'height': 8,
                    'width': 12,
                    'shape': 'rect',
                    'color': '#FFCCFF'
                })
            code = """def doit(self, ligand_lib_url, log_file):
        if log_file == None:
            log_file = "ligand_lib_uploads.log"

        log_file = os.path.abspath(log_file)

        if log_file != None:
            from time import strftime
            now = strftime("%Y-%m-%d %H:%M:%S")
            
            log_str = '''On ''' + now + ''', you uploaded a ligand library to: \n'''
            log_str = log_str + ligand_lib_url + '''\n\n'''

            f = open(log_file, '''a''')
            f.write(log_str)
            print "This ligand library upload has been recorded in " + log_file

        from AutoDockTools.VisionInterface.Adt.LigandDB import LigandDB
        ligand_db_obj = LigandDB(url_lib=ligand_lib_url)
	pass
## to ouput data on port ligand_db_obj use
        self.outputData(ligand_db_obj=ligand_db_obj)






















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

        try:
            ## saving node get_paths ##
            from Vision.StandardNodes import Generic
            get_paths_9 = Generic(constrkw={},
                                  name='get_paths',
                                  library=stdlib)
            self.macroNetwork.addNode(get_paths_9, 136, 105)
            get_paths_9.addInputPort(
                *(), **{
                    'singleConnection': True,
                    'name': 'directory',
                    'cast': True,
                    'datatype': 'string',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white',
                    'originalDatatype': 'None'
                })
            get_paths_9.addInputPort(
                *(), **{
                    'singleConnection': True,
                    'name': 'zip_name',
                    'cast': True,
                    'datatype': 'string',
                    'defaultValue': None,
                    'required': True,
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white',
                    'originalDatatype': 'None'
                })
            get_paths_9.addOutputPort(
                *(), **{
                    'name': 'input_directory',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            get_paths_9.addOutputPort(
                *(), **{
                    'name': 'output_directory',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            get_paths_9.addOutputPort(
                *(), **{
                    'name': 'output_name',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            get_paths_9.addOutputPort(
                *(), **{
                    'name': 'output_basedir',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            code = """def doit(self, directory, zip_name):
        input_directory = os.path.abspath(directory)

        if not(os.path.exists(input_directory)):
            print "ERROR: ligand input directory " + input_directory + " does not exist"
            return '''stop'''

        output_directory = os.path.abspath('''.''')
        output_name = zip_name
        output_basedir = zip_name.rstrip('''.zip''')
	pass
        self.outputData(input_directory=input_directory, output_directory=output_directory, output_name=zip_name, output_basedir=output_basedir)
## to ouput data on port input_directory use
## self.outputData(input_directory=data)
## to ouput data on port output_directory use
## self.outputData(output_directory=data)


## to ouput data on port output_name use
## self.outputData(output_name=data)

## to ouput data on port output_basedir use
## self.outputData(output_basedir=data)

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

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

        ## saving connections for network LocalLigandDirectory ##
        if Make_Zip_File_3 is not None and LigandDBUpload_kryptonite_nbcr_net_5 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Make_Zip_File_3,
                    LigandDBUpload_kryptonite_nbcr_net_5,
                    "zipfile",
                    "userlib",
                    blocking=True,
                    splitratio=[0.67700056401206909, 0.41786522052018427])
            except:
                print(
                    "WARNING: failed to restore connection between Make_Zip_File_3 and LigandDBUpload_kryptonite_nbcr_net_5 in network self.macroNetwork"
                )
        if LigandDBUpload_kryptonite_nbcr_net_5 is not None and Index_6 is not None:
            try:
                self.macroNetwork.connectNodes(
                    LigandDBUpload_kryptonite_nbcr_net_5,
                    Index_6,
                    "result",
                    "data",
                    blocking=True,
                    splitratio=[0.27868065815947218, 0.69101010116597561])
            except:
                print(
                    "WARNING: failed to restore connection between LigandDBUpload_kryptonite_nbcr_net_5 and Index_6 in network self.macroNetwork"
                )
        if Index_6 is not None and ReplaceURL_7 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Index_6,
                    ReplaceURL_7,
                    "data",
                    "url",
                    blocking=True,
                    splitratio=[0.0, 0.50910496731074983])
            except:
                print(
                    "WARNING: failed to restore connection between Index_6 and ReplaceURL_7 in network self.macroNetwork"
                )
        if ReplaceURL_7 is not None and CreateLigandDBObj_8 is not None:
            try:
                self.macroNetwork.connectNodes(
                    ReplaceURL_7,
                    CreateLigandDBObj_8,
                    "newurl",
                    "ligand_lib_url",
                    blocking=True,
                    splitratio=[0.7375258387145982, 0.34433018843468416])
            except:
                print(
                    "WARNING: failed to restore connection between ReplaceURL_7 and CreateLigandDBObj_8 in network self.macroNetwork"
                )
        output_Ports_2 = self.macroNetwork.opNode
        if CreateLigandDBObj_8 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    CreateLigandDBObj_8,
                    output_Ports_2,
                    "ligand_db_obj",
                    "new",
                    blocking=True,
                    splitratio=[0.25450332220506922, 0.49254602433654382])
            except:
                print(
                    "WARNING: failed to restore connection between CreateLigandDBObj_8 and output_Ports_2 in network self.macroNetwork"
                )
        input_Ports_1 = self.macroNetwork.ipNode
        if input_Ports_1 is not None and get_paths_9 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    get_paths_9,
                    "new",
                    "directory",
                    blocking=True,
                    splitratio=[0.73592256661833422, 0.40050624233195609])
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_1 and get_paths_9 in network self.macroNetwork"
                )
        if Entry_4 is not None and get_paths_9 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Entry_4,
                    get_paths_9,
                    "string",
                    "zip_name",
                    blocking=True,
                    splitratio=[0.74641701362897139, 0.56047721560743557])
            except:
                print(
                    "WARNING: failed to restore connection between Entry_4 and get_paths_9 in network self.macroNetwork"
                )
        if get_paths_9 is not None and Make_Zip_File_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    get_paths_9,
                    Make_Zip_File_3,
                    "input_directory",
                    "input_directory",
                    blocking=True,
                    splitratio=[0.24975092021298884, 0.59053364249853169])
            except:
                print(
                    "WARNING: failed to restore connection between get_paths_9 and Make_Zip_File_3 in network self.macroNetwork"
                )
        if get_paths_9 is not None and Make_Zip_File_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    get_paths_9,
                    Make_Zip_File_3,
                    "output_name",
                    "output_name",
                    blocking=True,
                    splitratio=[0.44934886807300634, 0.5145630699734256])
            except:
                print(
                    "WARNING: failed to restore connection between get_paths_9 and Make_Zip_File_3 in network self.macroNetwork"
                )
        if get_paths_9 is not None and Make_Zip_File_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    get_paths_9,
                    Make_Zip_File_3,
                    "output_directory",
                    "output_directory",
                    blocking=True,
                    splitratio=[0.65054191214838031, 0.31030412383438832])
            except:
                print(
                    "WARNING: failed to restore connection between get_paths_9 and Make_Zip_File_3 in network self.macroNetwork"
                )
        if get_paths_9 is not None and ReplaceURL_7 is not None:
            try:
                self.macroNetwork.connectNodes(
                    get_paths_9,
                    ReplaceURL_7,
                    "output_basedir",
                    "newfilename",
                    blocking=True,
                    splitratio=[0.5380996717918376, 0.39023381726820411])
            except:
                print(
                    "WARNING: failed to restore connection between get_paths_9 and ReplaceURL_7 in network self.macroNetwork"
                )
        if input_Ports_1 is not None and CreateLigandDBObj_8 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1,
                    CreateLigandDBObj_8,
                    "new",
                    "log_file",
                    blocking=True,
                    splitratio=[0.49268182912115838, 0.67412763774649975])
            except:
                print(
                    "WARNING: failed to restore connection between input_Ports_1 and CreateLigandDBObj_8 in network self.macroNetwork"
                )
        if ReplaceURL_7 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    ReplaceURL_7,
                    output_Ports_2,
                    "newurl",
                    "new",
                    blocking=True,
                    splitratio=[0.67446600768034171, 0.74989471765767979])
            except:
                print(
                    "WARNING: failed to restore connection between ReplaceURL_7 and output_Ports_2 in network self.macroNetwork"
                )
        self.macroNetwork.runOnNewData.value = False

        ## modifying MacroInputNode dynamic ports
        input_Ports_1 = self.macroNetwork.ipNode
        input_Ports_1.outputPorts[1].configure(
            name='Make_Zip_File_input_directory')
        input_Ports_1.outputPorts[2].configure(
            name='CreateLigandDBObj_log_file')

        ## modifying MacroOutputNode dynamic ports
        output_Ports_2 = self.macroNetwork.opNode
        output_Ports_2.inputPorts[1].configure(singleConnection='auto')
        output_Ports_2.inputPorts[2].configure(singleConnection='auto')
        output_Ports_2.inputPorts[1].configure(
            name='CreateLigandDBObj_ligand_db_obj')
        output_Ports_2.inputPorts[2].configure(name='ReplaceURL_newurl')
        ## configure MacroNode input ports
        LocalLigandDirectory_0.inputPorts[0].configure(
            name='Make_Zip_File_input_directory')
        LocalLigandDirectory_0.inputPorts[0].configure(datatype='string')
        LocalLigandDirectory_0.inputPorts[1].configure(
            name='CreateLigandDBObj_log_file')
        LocalLigandDirectory_0.inputPorts[1].configure(datatype='string')
        ## configure MacroNode output ports
        LocalLigandDirectory_0.outputPorts[0].configure(
            name='CreateLigandDBObj_ligand_db_obj')
        LocalLigandDirectory_0.outputPorts[0].configure(datatype='LigandDB')
        LocalLigandDirectory_0.outputPorts[1].configure(
            name='ReplaceURL_newurl')
        LocalLigandDirectory_0.outputPorts[1].configure(datatype='string')

        LocalLigandDirectory_0.shrink()

        ## reset modifications ##
        LocalLigandDirectory_0.resetTags()
        LocalLigandDirectory_0.buildOriginalList()
Esempio n. 52
0
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        from DejaVu.VisionInterface.DejaVuNodes import vizlib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        WebMSMS = self
        from traceback import print_exc

        ## loading libraries ##
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        self.macroNetwork.getEditor().addLibraryInstance(molkitlib,"MolKit.VisionInterface.MolKitNodes", "molkitlib")

        from DejaVu.VisionInterface.DejaVuNodes import vizlib
        self.macroNetwork.getEditor().addLibraryInstance(vizlib,"DejaVu.VisionInterface.DejaVuNodes", "vizlib")

        from Vision.StandardNodes import stdlib
        self.macroNetwork.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")

        try:

            ## saving node input Ports ##
            input_Ports = self.macroNetwork.ipNode
            input_Ports.move(13, 4)
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports=None
        try:

            ## saving node output Ports ##
            output_Ports = self.macroNetwork.opNode
            output_Ports.move(256, 220)
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports=None
        try:

            ## saving node Assign Radii ##
            from MolKit.VisionInterface.MolKitNodes import AssignRadii
            Assign_Radii = AssignRadii(constrkw = {}, name='Assign Radii', library=molkitlib)
            self.macroNetwork.addNode(Assign_Radii,30,68)
            apply(Assign_Radii.getInputPortByName('molecules').configure, (), {'color': '#c64e70', 'cast': True, 'shape': 'oval'})
            apply(Assign_Radii.getInputPortByName('united').configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(Assign_Radii.getOutputPortByName('molecules').configure, (), {'color': '#c64e70', 'shape': 'oval'})
            apply(Assign_Radii.getOutputPortByName('radii').configure, (), {'color': 'cyan', 'shape': 'oval'})
        except:
            print "WARNING: failed to restore AssignRadii named Assign Radii in network self.macroNetwork"
            print_exc()
            Assign_Radii=None
        try:

            ## saving node Select Nodes ##
            from MolKit.VisionInterface.MolKitNodes import NodeSelector
            Select_Nodes = NodeSelector(constrkw = {}, name='Select Nodes', library=molkitlib)
            self.macroNetwork.addNode(Select_Nodes,29,135)
            apply(Select_Nodes.getInputPortByName('nodes').configure, (), {'color': '#c64e70', 'cast': True, 'shape': 'oval'})
            apply(Select_Nodes.getInputPortByName('nodeType').configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Select_Nodes.getInputPortByName('selectionString').configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(Select_Nodes.getOutputPortByName('nodes').configure, (), {'color': '#fe92a0', 'shape': 'oval'})
            Select_Nodes.getInputPortByName("selectionString").widget.set(".*")
        except:
            print "WARNING: failed to restore NodeSelector named Select Nodes in network self.macroNetwork"
            print_exc()
            Select_Nodes=None
        try:

            ## saving node Get xyzr ##
            from Vision.StandardNodes import Generic
            Get_xyzr = Generic(constrkw = {}, name='Get xyzr', library=stdlib)
            self.macroNetwork.addNode(Get_xyzr,30,194)
            apply(Get_xyzr.addInputPort, (), {'name': 'atoms', 'cast': True, 'datatype': 'AtomSet', 'height': 8, 'width': 12, 'shape': 'oval', 'color': '#fe92a0'})
            apply(Get_xyzr.addOutputPort, (), {'name': 'output', 'datatype': 'string', 'height': 12, 'width': 12, 'shape': 'oval', 'color': 'white'})
            code = """def doit(self, atoms):
    lines = ''
    for atom in atoms:
        lines += str(atom.coords[0]) + ' ' + str(atom.coords[1]) + ' ' + str(atom.coords[2]) + ' '+ str(atom.radius)
        lines += "\\n"
    self.outputData(output=lines)
"""

            Get_xyzr.configure(function=code)
        except:
            print "WARNING: failed to restore Generic named Get xyzr in network self.macroNetwork"
            print_exc()
            Get_xyzr=None
        try:

            ## saving node IndexedPolygons ##
            from DejaVu.VisionInterface.GeometryNode import IndexedPolygonsNE
            IndexedPolygons = IndexedPolygonsNE(constrkw = {}, name='IndexedPolygons', library=vizlib)
            self.macroNetwork.addNode(IndexedPolygons,273,147)
            apply(IndexedPolygons.getInputPortByName('coords').configure, (), {'color': 'purple', 'cast': True, 'shape': 'circle'})
            apply(IndexedPolygons.getInputPortByName('indices').configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'})
            apply(IndexedPolygons.getInputPortByName('vnormals').configure, (), {'cast': True, 'shape': 'circle'})
            apply(IndexedPolygons.getInputPortByName('colors').configure, (), {'cast': True, 'shape': 'circle'})
            apply(IndexedPolygons.getInputPortByName('name').configure, (), {'color': 'white', 'cast': True, 'shape': 'oval'})
            apply(IndexedPolygons.getInputPortByName('instanceMatrices').configure, (), {'cast': True})
            apply(IndexedPolygons.getInputPortByName('geomOptions').configure, (), {'color': 'cyan', 'cast': True, 'shape': 'oval'})
            apply(IndexedPolygons.getInputPortByName('parent').configure, (), {'color': 'red', 'cast': True, 'shape': 'rect'})
            apply(IndexedPolygons.getOutputPortByName('indexedPolygons').configure, (), {'color': 'red', 'shape': 'rect'})
            apply(IndexedPolygons.getOutputPortByName('allGeometries').configure, (), {'color': 'red', 'shape': 'rect'})
        except:
            print "WARNING: failed to restore IndexedPolygonsNE named IndexedPolygons in network self.macroNetwork"
            print_exc()
            IndexedPolygons=None
        try:

            ## saving node MSMS WS ##
            from Vision.StandardNodes import Generic
            MSMS_WS = Generic(constrkw = {}, name='MSMS WS', library=stdlib)            

            self.macroNetwork.addNode(MSMS_WS,273,37)
            apply(MSMS_WS.addInputPort, (), {'name': 'input_str', 'cast': True, 
                   'datatype': 'string', 'height': 12, 'width': 12, 'shape': 'oval', 'color': 'white'})
            apply(MSMS_WS.addInputPort, (), {'name': 'density', 'datatype': 'float', 'required':False})
            apply(MSMS_WS.getInputPortByName('density').createWidget, (), 
                   {'descr':{'initialValue': 1.0, 'increment':0.1, 'type':'float', 
                     'master': 'ParamPanel', 'oneTurn':10, 'min':1.0, 'labelCfg': {'text': 'density'}, 'class': 'NEDial'}})
            apply(MSMS_WS.addInputPort, (), {'name': 'probe_radius', 'datatype': 'float', 'required':False})
            apply(MSMS_WS.getInputPortByName('probe_radius').createWidget, (), 
                   {'descr':{'initialValue': 1.5, 'increment':0.1, 'type':'float', 
                     'master': 'ParamPanel', 'oneTurn':10, 'min':0.5, 'labelCfg': {'text': 'probe radius'}, 'class': 'NEDial'}})
            apply(MSMS_WS.addInputPort, (), {'name': 'allComp', 'datatype': 'int', 'required':False})
            apply(MSMS_WS.getInputPortByName('allComp').createWidget, (), 
                   {'descr':{'initialValue': 0, 'master': 'ParamPanel', 'labelCfg': 
                       {'text': 'all components'}, 'class': 'NECheckButton'}})
            apply(MSMS_WS.addInputPort, (), {'name': 'getfile', 'datatype': 'boolean'})
            apply(MSMS_WS.getInputPortByName('getfile').createWidget, (), 
                   {'descr':{'master': 'ParamPanel', 'labelCfg': {'text': 'upload output'}, 'class': 'NECheckButton', 'initialValue':True }})


            apply(MSMS_WS.addOutputPort, (), {'name': 'vertices', 'datatype': 'coordinates3D', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'green'})
            apply(MSMS_WS.addOutputPort, (), {'name': 'indices', 'datatype': 'faceIndices', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'purple'})
            apply(MSMS_WS.addOutputPort, (), {'name': 'vnormals', 'datatype': 'normals3D', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'blue'})
            MSMS_WS.host = self.host
            MSMS_WS.opal_service = self.opal_service
            
            code = """def doit(self, input_str, probe_radius, density, allComp, getfile):
    self.opal_service.inputFile.Set_name('msms.xyzr')
    self.opal_service.inputFile.Set_contents(input_str)
    options = '-if msms.xyzr -of ws_out '
    options += '-probe_radius ' + str(probe_radius)
    options += ' -density ' + str(density)
    if allComp:
        options += ' -all_components'
    self.opal_service.req._argList = options
    inputFiles = []
    inputFiles.append(self.opal_service.inputFile)
    self.opal_service.req._inputFile = inputFiles
    resp = self.opal_service.run('msmsServicePort')
    if resp:
        for files in resp._outputFile:
            if files._url.split('/')[-1] == 'ws_out.face':
                face_file = files._url
            if files._url.split('/')[-1] == 'ws_out.vert':
                vert_file = files._url
        if getfile:           
            from Pmv.msmsParser import MSMSParser
            msmsParser = MSMSParser()
            import urllib
            opener = urllib.FancyURLopener({})
            in_file = opener.open(face_file)
            msmsParser.getFaces(in_file.readlines())
            in_file = opener.open(vert_file)
            msmsParser.getVert(in_file.readlines())
            self.outputData(vertices = msmsParser.vertices, indices = msmsParser.faces,
                          vnormals = msmsParser.normals)
        else:
            self.outputData(vertices = vert_file, indices = face_file,
                          vnormals = None)
"""
            MSMS_WS.configure(function=code)
        except:
            print "WARNING: failed to restore Generic named MSMS WS in network self.macroNetwork"
            print_exc()
            MSMS_WS=None
        self.macroNetwork.freeze()

        ## saving connections for network WebMSMS ##
        if Assign_Radii is not None and Select_Nodes is not None:
            self.macroNetwork.connectNodes(
                Assign_Radii, Select_Nodes, "molecules", "nodes", blocking=True)
        if Select_Nodes is not None and Get_xyzr is not None:
            self.macroNetwork.connectNodes(
                Select_Nodes, Get_xyzr, "nodes", "atoms", blocking=True)
        if Get_xyzr is not None and MSMS_WS is not None:
            self.macroNetwork.connectNodes(
                Get_xyzr, MSMS_WS, "output", "input_str", blocking=True)
        if MSMS_WS is not None and IndexedPolygons is not None:
            self.macroNetwork.connectNodes(
                MSMS_WS, IndexedPolygons, "vertices", "coords", blocking=True)
        if MSMS_WS is not None and IndexedPolygons is not None:
            self.macroNetwork.connectNodes(
                MSMS_WS, IndexedPolygons, "indices", "indices", blocking=True)
        if MSMS_WS is not None and IndexedPolygons is not None:
            self.macroNetwork.connectNodes(
                MSMS_WS, IndexedPolygons, "vnormals", "vnormals", blocking=True)
        output_Ports = self.macroNetwork.opNode
        if IndexedPolygons is not None and output_Ports is not None:
            self.macroNetwork.connectNodes(
                IndexedPolygons, output_Ports, "indexedPolygons", "new", blocking=True)
        input_Ports = self.macroNetwork.ipNode
        if input_Ports is not None and Assign_Radii is not None:
            self.macroNetwork.connectNodes(
                input_Ports, Assign_Radii, "new", "molecules", blocking=True)
        self.macroNetwork.unfreeze()

        WebMSMS.shrink()

        ## reset modifications ##
        WebMSMS.resetTags()
        WebMSMS.buildOriginalList()
Esempio n. 53
0
 def __init__(self, constrkw={}, name='PrepareReceptor', **kw):
     kw['name'] = name
     MacroNode.__init__(*(self,), **kw)
Esempio n. 54
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. 55
0
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from WebServices.VisionInterface.WSNodes import wslib
        ## building macro network ##
        PrepareSingleLigand_18 = self
        from traceback import print_exc
        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_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
            })
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_20 = None

        try:
            ## saving node PrepareLigandSingle_kryptonite_nbcr_net ##
            from NetworkEditor.items import FunctionNode
            PrepareLigandSingle_kryptonite_nbcr_net_21 = FunctionNode(
                functionOrString='PrepareLigandSingle_kryptonite_nbcr_net',
                host="http://kryptonite.nbcr.net/opal2",
                namedArgs={
                    'A': '',
                    'C': False,
                    'B': '',
                    'ligand': '',
                    'g': False,
                    'F': False,
                    'I': '',
                    'M': False,
                    'p': '',
                    'R': '',
                    'U': '',
                    'v': False,
                    'Z': False,
                    'localRun': False,
                    'execPath': '',
                    'd': ''
                },
                constrkw={
                    'functionOrString':
                    "'PrepareLigandSingle_kryptonite_nbcr_net'",
                    'host': '"http://kryptonite.nbcr.net/opal2"',
                    'namedArgs': {
                        'A': '',
                        'C': False,
                        'B': '',
                        'ligand': '',
                        'g': False,
                        'F': False,
                        'I': '',
                        'M': False,
                        'p': '',
                        'R': '',
                        'U': '',
                        'v': False,
                        'Z': False,
                        'localRun': False,
                        'execPath': '',
                        'd': ''
                    }
                },
                name='PrepareLigandSingle_kryptonite_nbcr_net',
                library=wslib)
            self.macroNetwork.addNode(
                PrepareLigandSingle_kryptonite_nbcr_net_21, 217, 92)
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['A'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['C'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['B'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['ligand'].configure, (), {
                    'defaultValue': None,
                    'required': True
                })
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['g'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['F'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['I'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['M'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['p'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['R'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['U'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['v'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['Z'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['localRun'].configure, (),
                {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['execPath'].configure, (),
                {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['d'].configure, (), {'defaultValue': None})
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['A'].widget.configure, (),
                {'choices': ('bonds_hydrogens', 'bonds', 'hydrogens')})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'A'].widget.set(r"", run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'C'].widget.set(0, run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'B'].widget.set(r"", run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'ligand'].rebindWidget()
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'ligand'].widget.set(r"", run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'ligand'].unbindWidget()
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'g'].widget.set(0, run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'F'].widget.set(0, run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'I'].widget.set(r"", run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'M'].widget.set(0, run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'p'].widget.set(r"", run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'R'].widget.set(r"", run=False)
            apply(
                PrepareLigandSingle_kryptonite_nbcr_net_21.
                inputPortByName['U'].widget.configure, (),
                {'choices': ('nphs_lps', 'nphs', 'lps')})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'U'].widget.set(r"", run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'v'].widget.set(0, run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'Z'].widget.set(0, run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'localRun'].widget.set(0, run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'execPath'].widget.set(r"", run=False)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'd'].widget.set(r"", run=False)
            apply(PrepareLigandSingle_kryptonite_nbcr_net_21.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore FunctionNode named PrepareLigandSingle_kryptonite_nbcr_net in network self.macroNetwork"
            print_exc()
            PrepareLigandSingle_kryptonite_nbcr_net_21 = None

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

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

        ## saving connections for network PrepareSingleLigand ##
        if PrepareLigandSingle_kryptonite_nbcr_net_21 is not None and GetURLFromList_22 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareLigandSingle_kryptonite_nbcr_net_21,
                    GetURLFromList_22,
                    "result",
                    "urllist",
                    blocking=True,
                    splitratio=[0.32868238447942777, 0.66102005033481848])
            except:
                print "WARNING: failed to restore connection between PrepareLigandSingle_kryptonite_nbcr_net_21 and GetURLFromList_22 in network self.macroNetwork"
        output_Ports_20 = self.macroNetwork.opNode
        if GetURLFromList_22 is not None and output_Ports_20 is not None:
            try:
                self.macroNetwork.connectNodes(
                    GetURLFromList_22,
                    output_Ports_20,
                    "url",
                    "new",
                    blocking=True,
                    splitratio=[0.24357139972148803, 0.60352121442381113])
            except:
                print "WARNING: failed to restore connection between GetURLFromList_22 and output_Ports_20 in network self.macroNetwork"
        input_Ports_19 = self.macroNetwork.ipNode
        if input_Ports_19 is not None and PrepareLigandSingle_kryptonite_nbcr_net_21 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_19,
                    PrepareLigandSingle_kryptonite_nbcr_net_21,
                    "new",
                    "ligand",
                    blocking=True,
                    splitratio=[0.58130558930809739, 0.62673128127582967])
            except:
                print "WARNING: failed to restore connection between input_Ports_19 and PrepareLigandSingle_kryptonite_nbcr_net_21 in network self.macroNetwork"
        self.macroNetwork.runOnNewData.value = True

        ## modifying MacroInputNode dynamic ports
        input_Ports_19 = self.macroNetwork.ipNode
        input_Ports_19.outputPorts[1].configure(
            name='PrepareLigandSingle_kryptonite_nbcr_net_ligand')

        ## modifying MacroOutputNode dynamic ports
        output_Ports_20 = self.macroNetwork.opNode
        output_Ports_20.inputPorts[1].configure(singleConnection='auto')
        output_Ports_20.inputPorts[1].configure(name='GetURLFromList_url')
        ## configure MacroNode input ports
        PrepareSingleLigand_18.inputPorts[0].configure(
            name='PrepareLigandSingle_kryptonite_nbcr_net_ligand')
        PrepareSingleLigand_18.inputPorts[0].configure(datatype='string')
        ## configure MacroNode output ports
        PrepareSingleLigand_18.outputPorts[0].configure(
            name='GetURLFromList_url')
        PrepareSingleLigand_18.outputPorts[0].configure(datatype='string')

        PrepareSingleLigand_18.shrink()

        ## reset modifications ##
        PrepareSingleLigand_18.resetTags()
        PrepareSingleLigand_18.buildOriginalList()
Esempio n. 56
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 ##
        PrepareReceptor_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://ws.nbcr.net/opal2", replace=False)
        except:
            pass
        try:
            ## saving node input Ports ##
            input_Ports_1 = self.macroNetwork.ipNode
            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
            output_Ports_2.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})
        except:
            print("WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork")
            print_exc()
            output_Ports_2=None

        try:
            ## saving node Pdb2pqrWS ##
            from NetworkEditor.macros import MacroNode
            Pdb2pqrWS_3 = MacroNode(name='Pdb2pqrWS')
            self.macroNetwork.addNode(Pdb2pqrWS_3, 153, 86)
            input_Ports_4 = Pdb2pqrWS_3.macroNetwork.ipNode
            input_Ports_4.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})
            input_Ports_4.move(65, 10)
            output_Ports_5 = Pdb2pqrWS_3.macroNetwork.opNode
            output_Ports_5.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})
            output_Ports_5.move(65, 310)
            from Vision.StandardNodes import Generic
            CheckFileFormat_6 = Generic(constrkw={}, name='CheckFileFormat', library=stdlib)
            Pdb2pqrWS_3.macroNetwork.addNode(CheckFileFormat_6,82,62)
            CheckFileFormat_6.addInputPort(*(), **{'singleConnection': True, 'name': 'value', 'cast': True, 'datatype': 'receptor', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33', 'originalDatatype': 'None'})
            CheckFileFormat_6.addOutputPort(*(), **{'name': 'receptor_obj', 'datatype': 'receptor', 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33'})
            CheckFileFormat_6.addOutputPort(*(), **{'name': 'pqr_name', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            CheckFileFormat_6.addOutputPort(*(), **{'name': 'pdb_path', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            code = """def doit(self, value):
    if value.get_ext_loc('''pqr''') != None or value.get_ext_loc('''pdbqt''') != None:
        self.outputData(receptor_obj=value)
        self.scheduleChildren(portList=[self.getOutputPortByName('''receptor_obj''')])
    else:
        pqr_name = value.get_id() + '''.pqr'''
        pdb_path = value.get_ext_loc('''pdb''')

        self.outputData(receptor_obj=value, pqr_name=pqr_name, pdb_path=pdb_path)
        self.scheduleChildren(portList=[self.getOutputPortByName('''receptor_obj'''), self.getOutputPortByName('''pqr_name'''), self.getOutputPortByName('''pdb_path''')])

"""
            CheckFileFormat_6.configure(function=code)
            CheckFileFormat_6.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})
            from NetworkEditor.items import FunctionNode
            Pdb2pqrOpalService_ws_nbcr_net_7 = FunctionNode(functionOrString='Pdb2pqrOpalService_ws_nbcr_net', host="http://ws.nbcr.net/opal2", namedArgs={'noopt': False, 'phi': False, 'psi': False, 'verbose': True, 'chain': False, 'nodebump': False, 'chi': False, 'output_file': '', 'ligand': '', 'hbond': False, 'inFile': '', 'with_ph': '', 'forcefield': 'AMBER', 'clean': False, 'inId': '', 'apbs_input': False, 'ffout': '', 'localRun': False, 'rama': False, 'execPath': '', 'assign_only': False}, constrkw={'functionOrString': "'Pdb2pqrOpalService_ws_nbcr_net'", 'host': '"http://ws.nbcr.net/opal2"', 'namedArgs': {'noopt': False, 'phi': False, 'psi': False, 'verbose': True, 'chain': False, 'nodebump': False, 'chi': False, 'output_file': '', 'ligand': '', 'hbond': False, 'inFile': '', 'with_ph': '', 'forcefield': 'AMBER', 'clean': False, 'inId': '', 'apbs_input': False, 'ffout': '', 'localRun': False, 'rama': False, 'execPath': '', 'assign_only': False}}, name='Pdb2pqrOpalService_ws_nbcr_net', library=wslib)
            Pdb2pqrWS_3.macroNetwork.addNode(Pdb2pqrOpalService_ws_nbcr_net_7,99,115)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['output_file'].configure(*(), **{'defaultValue': None, 'required': True})
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['inFile'].configure(*(), **{'defaultValue': None, 'required': True})
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['noopt'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['phi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['psi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['verbose'].widget.set(1, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['chain'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['nodebump'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['chi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['output_file'].rebindWidget()
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['output_file'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['output_file'].unbindWidget()
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['ligand'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['hbond'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['inFile'].rebindWidget()
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['inFile'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['inFile'].unbindWidget()
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['with_ph'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['forcefield'].widget.configure(*(), **{'choices': ('AMBER', 'CHARMM', 'PARSE', 'TYL06')})
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['forcefield'].widget.set(r"AMBER", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['clean'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['inId'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['apbs_input'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['ffout'].widget.configure(*(), **{'choices': ('AMBER', 'CHARMM', 'PARSE', 'TYL06')})
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['ffout'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['localRun'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['rama'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['execPath'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.inputPortByName['assign_only'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_7.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})
            from WebServices.VisionInterface.WSNodes import GetURLFromListNode
            GetURLFromList_8 = GetURLFromListNode(constrkw={}, name='GetURLFromList', library=wslib)
            Pdb2pqrWS_3.macroNetwork.addNode(GetURLFromList_8,117,169)
            GetURLFromList_8.inputPortByName['ext'].widget.set(r"pqr", run=False)
            GetURLFromList_8.configure(*(), **{'paramPanelImmediate': 1})
            from Vision.StandardNodes import Generic
            UpdateReceptor_9 = Generic(constrkw={}, name='UpdateReceptor', library=stdlib)
            Pdb2pqrWS_3.macroNetwork.addNode(UpdateReceptor_9,82,256)
            UpdateReceptor_9.addInputPort(*(), **{'singleConnection': True, 'name': 'receptor_obj', 'cast': True, 'datatype': 'receptor', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33', 'originalDatatype': 'None'})
            UpdateReceptor_9.addInputPort(*(), **{'singleConnection': True, 'name': 'pqr', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': False, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
            UpdateReceptor_9.addOutputPort(*(), **{'name': 'receptor_obj', 'datatype': 'receptor', 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33'})
            UpdateReceptor_9.addOutputPort(*(), **{'name': 'pdb2pqr_result', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            code = """def doit(self, receptor_obj, pqr):
        if pqr != '''no data yet''':
            pdb2pqr_result = pqr
            receptor_obj.set_ext_loc(pqr)
        else:
            pdbqt = receptor_obj.get_ext_loc('''pdbqt''')
            pqr = receptor_obj.get_ext_loc('''pqr''')

            if pdbqt != None:
                pdb2pqr_result = pdbqt
            elif pqr != None:
                pdb2pqr_result = pqr

        pass
        self.outputData(receptor_obj=receptor_obj, pdb2pqr_result=pdb2pqr_result)





"""
            UpdateReceptor_9.configure(function=code)
            UpdateReceptor_9.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})

            ## saving connections for network Pdb2pqrWS ##
            Pdb2pqrWS_3.macroNetwork.freeze()
            if CheckFileFormat_6 is not None and Pdb2pqrOpalService_ws_nbcr_net_7 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        CheckFileFormat_6, Pdb2pqrOpalService_ws_nbcr_net_7, "pqr_name", "output_file", blocking=True
                        , splitratio=[0.43278717885693868, 0.65281492247209427])
                except:
                    print("WARNING: failed to restore connection between CheckFileFormat_6 and Pdb2pqrOpalService_ws_nbcr_net_7 in network Pdb2pqrWS_3.macroNetwork")
            if CheckFileFormat_6 is not None and Pdb2pqrOpalService_ws_nbcr_net_7 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        CheckFileFormat_6, Pdb2pqrOpalService_ws_nbcr_net_7, "pdb_path", "inFile", blocking=True
                        , splitratio=[0.61978340673276544, 0.69977512898866912])
                except:
                    print("WARNING: failed to restore connection between CheckFileFormat_6 and Pdb2pqrOpalService_ws_nbcr_net_7 in network Pdb2pqrWS_3.macroNetwork")
            if Pdb2pqrOpalService_ws_nbcr_net_7 is not None and GetURLFromList_8 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        Pdb2pqrOpalService_ws_nbcr_net_7, GetURLFromList_8, "result", "urllist", blocking=True
                        , splitratio=[0.73247388879852338, 0.69014271703344965])
                except:
                    print("WARNING: failed to restore connection between Pdb2pqrOpalService_ws_nbcr_net_7 and GetURLFromList_8 in network Pdb2pqrWS_3.macroNetwork")
            if GetURLFromList_8 is not None and UpdateReceptor_9 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        GetURLFromList_8, UpdateReceptor_9, "url", "pqr", blocking=True
                        , splitratio=[0.35224914715245104, 0.47693375858097758])
                except:
                    print("WARNING: failed to restore connection between GetURLFromList_8 and UpdateReceptor_9 in network Pdb2pqrWS_3.macroNetwork")
            if CheckFileFormat_6 is not None and UpdateReceptor_9 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        CheckFileFormat_6, UpdateReceptor_9, "receptor_obj", "receptor_obj", blocking=True
                        , splitratio=[0.57865377076653579, 0.45824116584600394])
                except:
                    print("WARNING: failed to restore connection between CheckFileFormat_6 and UpdateReceptor_9 in network Pdb2pqrWS_3.macroNetwork")
            input_Ports_4 = Pdb2pqrWS_3.macroNetwork.ipNode
            if input_Ports_4 is not None and CheckFileFormat_6 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        input_Ports_4, CheckFileFormat_6, "new", "value", blocking=True
                        , splitratio=[0.28291581858817416, 0.70581213384962171])
                except:
                    print("WARNING: failed to restore connection between input_Ports_4 and CheckFileFormat_6 in network Pdb2pqrWS_3.macroNetwork")
            output_Ports_5 = Pdb2pqrWS_3.macroNetwork.opNode
            if UpdateReceptor_9 is not None and output_Ports_5 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        UpdateReceptor_9, output_Ports_5, "receptor_obj", "new", blocking=True
                        , splitratio=[0.24354423773729619, 0.72115604180615911])
                except:
                    print("WARNING: failed to restore connection between UpdateReceptor_9 and output_Ports_5 in network Pdb2pqrWS_3.macroNetwork")
            if UpdateReceptor_9 is not None and output_Ports_5 is not None:
                try:
                    Pdb2pqrWS_3.macroNetwork.connectNodes(
                        UpdateReceptor_9, output_Ports_5, "pdb2pqr_result", "new", blocking=True
                        , splitratio=[0.31141907324539131, 0.41794097665671487])
                except:
                    print("WARNING: failed to restore connection between UpdateReceptor_9 and output_Ports_5 in network Pdb2pqrWS_3.macroNetwork")
            Pdb2pqrWS_3.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_4.outputPorts[1].configure(name='CheckFileFormat_value')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_5.inputPorts[1].configure(singleConnection='auto')
            output_Ports_5.inputPorts[2].configure(singleConnection='auto')
            output_Ports_5.inputPorts[1].configure(name='UpdateReceptor_receptor_obj')
            output_Ports_5.inputPorts[2].configure(name='UpdateReceptor_pdb2pqr_result')
            Pdb2pqrWS_3.inputPorts[0].configure(name='CheckFileFormat_value')
            Pdb2pqrWS_3.inputPorts[0].configure(datatype='receptor')
            ## configure MacroNode input ports
            Pdb2pqrWS_3.outputPorts[0].configure(name='UpdateReceptor_receptor_obj')
            Pdb2pqrWS_3.outputPorts[0].configure(datatype='receptor')
            Pdb2pqrWS_3.outputPorts[1].configure(name='UpdateReceptor_pdb2pqr_result')
            Pdb2pqrWS_3.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            Pdb2pqrWS_3.shrink()
            Pdb2pqrWS_3.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})
        except:
            print("WARNING: failed to restore MacroNode named Pdb2pqrWS in network self.macroNetwork")
            print_exc()
            Pdb2pqrWS_3=None

        try:
            ## saving node PrepareReceptorWS ##
            from NetworkEditor.macros import MacroNode
            PrepareReceptorWS_10 = MacroNode(name='PrepareReceptorWS')
            self.macroNetwork.addNode(PrepareReceptorWS_10, 217, 140)
            input_Ports_11 = PrepareReceptorWS_10.macroNetwork.ipNode
            input_Ports_11.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})
            input_Ports_11.move(145, 8)
            output_Ports_12 = PrepareReceptorWS_10.macroNetwork.opNode
            output_Ports_12.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})
            output_Ports_12.move(29, 412)
            from Vision.StandardNodes import Generic
            CheckFileFormat_13 = Generic(constrkw={}, name='CheckFileFormat', library=stdlib)
            PrepareReceptorWS_10.macroNetwork.addNode(CheckFileFormat_13,46,64)
            CheckFileFormat_13.addInputPort(*(), **{'singleConnection': True, 'name': 'value', 'cast': True, 'datatype': 'receptor', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33', 'originalDatatype': 'None'})
            CheckFileFormat_13.addOutputPort(*(), **{'name': 'receptor_obj', 'datatype': 'receptor', 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33'})
            CheckFileFormat_13.addOutputPort(*(), **{'name': 'receptor_url', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            CheckFileFormat_13.addOutputPort(*(), **{'name': 'receptor_local', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            CheckFileFormat_13.addOutputPort(*(), **{'name': 'download_loc', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            code = """def doit(self, value):
    if value.get_ext_loc('''pdbqt''') != None:
        self.outputData(receptor_obj=value)
        self.scheduleChildren(portList=[self.getOutputPortByName('''receptor_obj''')])
    else:
        pqr = value.get_ext_loc('''pqr''')
        pdb = value.get_ext_loc('''pdb''')
        download_loc = value.get_workdir() + os.sep + value.get_id() + '''.pdbqt'''

        if pqr != None:
            if value.get_ext_type('''pqr''') == '''url''':
                receptor_url = pqr
                receptor_local = ""
            else:
                receptor_url = ""
                receptor_local = pqr
        elif pdb != None:
            if value.get_ext_type('''pdb''') == '''url''':
                receptor_url = pdb
                receptor_local = ""
            else:
                receptor_url = ""
                receptor_local = pdb
        else:
            print "*** ERROR: pqr and pqr both missing from receptor object"
            print receptor_obj.ext_loc
            return '''stop'''

        self.outputData(receptor_obj=value, receptor_url=receptor_url, receptor_local=receptor_local, download_loc=download_loc)
        self.scheduleChildren(portList=[self.getOutputPortByName('''receptor_obj'''), self.getOutputPortByName('''receptor_url'''), self.getOutputPortByName('''receptor_local'''), self.getOutputPortByName('''download_loc''')])





"""
            CheckFileFormat_13.configure(function=code)
            CheckFileFormat_13.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})
            from NetworkEditor.items import FunctionNode
            PrepareReceptorOpalService_ws_nbcr_net_14 = FunctionNode(functionOrString='PrepareReceptorOpalService_ws_nbcr_net', host="http://ws.nbcr.net/opal2", namedArgs={'C': False, 'url': '', 'o': '', 'r': '', 'v': False, 'localRun': False, 'execPath': ''}, constrkw={'functionOrString': "'PrepareReceptorOpalService_ws_nbcr_net'", 'host': '"http://ws.nbcr.net/opal2"', 'namedArgs': {'C': False, 'url': '', 'o': '', 'r': '', 'v': False, 'localRun': False, 'execPath': ''}}, name='PrepareReceptorOpalService_ws_nbcr_net', library=wslib)
            PrepareReceptorWS_10.macroNetwork.addNode(PrepareReceptorOpalService_ws_nbcr_net_14,180,128)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['C'].configure(*(), **{'defaultValue': None})
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['url'].configure(*(), **{'defaultValue': None, 'required': True})
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['r'].configure(*(), **{'defaultValue': None, 'required': True})
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['C'].rebindWidget()
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['C'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['C'].unbindWidget()
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['url'].rebindWidget()
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['url'].widget.set(r"", run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['url'].unbindWidget()
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['o'].widget.set(r"", run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['r'].rebindWidget()
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['r'].widget.set(r"", run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['r'].unbindWidget()
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['v'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['localRun'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.inputPortByName['execPath'].widget.set(r"", run=False)
            PrepareReceptorOpalService_ws_nbcr_net_14.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})
            from WebServices.VisionInterface.WSNodes import GetURLFromListNode
            GetURLFromList_15 = GetURLFromListNode(constrkw={}, name='GetURLFromList', library=wslib)
            PrepareReceptorWS_10.macroNetwork.addNode(GetURLFromList_15,180,186)
            GetURLFromList_15.inputPortByName['ext'].widget.set(r"pdbqt", run=False)
            GetURLFromList_15.configure(*(), **{'paramPanelImmediate': 1})
            from WebServices.VisionInterface.WSNodes import DownloadToFileNode
            DownloadToFile_16 = DownloadToFileNode(constrkw={}, name='DownloadToFile', library=wslib)
            PrepareReceptorWS_10.macroNetwork.addNode(DownloadToFile_16,80,272)
            DownloadToFile_16.inputPortByName['url'].configure(*(), **{'defaultValue': None})
            DownloadToFile_16.inputPortByName['filename'].configure(*(), **{'defaultValue': None})
            DownloadToFile_16.inputPortByName['url'].rebindWidget()
            DownloadToFile_16.inputPortByName['url'].widget.set(r"", run=False)
            DownloadToFile_16.inputPortByName['url'].unbindWidget()
            DownloadToFile_16.inputPortByName['filename'].rebindWidget()
            DownloadToFile_16.inputPortByName['filename'].widget.set(r"", run=False)
            DownloadToFile_16.inputPortByName['filename'].unbindWidget()
            DownloadToFile_16.inputPortByName['overwrite'].widget.set(1, run=False)
            DownloadToFile_16.configure(*(), **{'paramPanelImmediate': 1})
            from Vision.StandardNodes import Generic
            UpdateReceptor_17 = Generic(constrkw={}, name='UpdateReceptor', library=stdlib)
            PrepareReceptorWS_10.macroNetwork.addNode(UpdateReceptor_17,46,358)
            UpdateReceptor_17.addInputPort(*(), **{'singleConnection': True, 'name': 'receptor_obj', 'cast': True, 'datatype': 'receptor', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#99FF33', 'originalDatatype': 'None'})
            UpdateReceptor_17.addInputPort(*(), **{'singleConnection': True, 'name': 'pdbqt', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': False, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
            UpdateReceptor_17.addOutputPort(*(), **{'name': 'receptor_prepared_obj', 'datatype': 'receptor_prepared', 'height': 8, 'width': 12, 'shape': 'triangle', 'color': '#009900'})
            UpdateReceptor_17.addOutputPort(*(), **{'name': 'receptor_result', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
            code = """def doit(self, receptor_obj, pdbqt):
        from AutoDockTools.VisionInterface.Adt.receptor_prepared import receptor_prepared
        if pdbqt != '''no data yet''':
            receptor_prepared_obj = receptor_prepared(pdbqt)
            receptor_obj.set_ext_loc(pdbqt)
            receptor_result = pdbqt
        else:
            pdbqt_org = receptor_obj.get_ext_loc('''pdbqt''')
            receptor_prepared_obj = receptor_prepared(pdbqt_org)
            receptor_result = pdbqt_org
        
        pass

        self.outputData(receptor_prepared_obj = receptor_prepared_obj, receptor_result=receptor_result)



"""
            UpdateReceptor_17.configure(function=code)
            UpdateReceptor_17.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})

            ## saving connections for network PrepareReceptorWS ##
            PrepareReceptorWS_10.macroNetwork.freeze()
            input_Ports_11 = PrepareReceptorWS_10.macroNetwork.ipNode
            if input_Ports_11 is not None and CheckFileFormat_13 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        input_Ports_11, CheckFileFormat_13, "new", "value", blocking=True
                        , splitratio=[0.64907843562020084, 0.47057253960060474])
                except:
                    print("WARNING: failed to restore connection between input_Ports_11 and CheckFileFormat_13 in network PrepareReceptorWS_10.macroNetwork")
            if CheckFileFormat_13 is not None and PrepareReceptorOpalService_ws_nbcr_net_14 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        CheckFileFormat_13, PrepareReceptorOpalService_ws_nbcr_net_14, "receptor_url", "url", blocking=True
                        , splitratio=[0.6171192646814192, 0.42883431331137822])
                except:
                    print("WARNING: failed to restore connection between CheckFileFormat_13 and PrepareReceptorOpalService_ws_nbcr_net_14 in network PrepareReceptorWS_10.macroNetwork")
            if CheckFileFormat_13 is not None and PrepareReceptorOpalService_ws_nbcr_net_14 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        CheckFileFormat_13, PrepareReceptorOpalService_ws_nbcr_net_14, "receptor_local", "r", blocking=True
                        , splitratio=[0.66136144381723583, 0.28482114514549767])
                except:
                    print("WARNING: failed to restore connection between CheckFileFormat_13 and PrepareReceptorOpalService_ws_nbcr_net_14 in network PrepareReceptorWS_10.macroNetwork")
            if input_Ports_11 is not None and PrepareReceptorOpalService_ws_nbcr_net_14 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        input_Ports_11, PrepareReceptorOpalService_ws_nbcr_net_14, "new", "C", blocking=True
                        , splitratio=[0.53817543437956172, 0.61119702937572407])
                except:
                    print("WARNING: failed to restore connection between input_Ports_11 and PrepareReceptorOpalService_ws_nbcr_net_14 in network PrepareReceptorWS_10.macroNetwork")
            if PrepareReceptorOpalService_ws_nbcr_net_14 is not None and GetURLFromList_15 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        PrepareReceptorOpalService_ws_nbcr_net_14, GetURLFromList_15, "result", "urllist", blocking=True
                        , splitratio=[0.43369347916867251, 0.26566786648658042])
                except:
                    print("WARNING: failed to restore connection between PrepareReceptorOpalService_ws_nbcr_net_14 and GetURLFromList_15 in network PrepareReceptorWS_10.macroNetwork")
            if GetURLFromList_15 is not None and DownloadToFile_16 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        GetURLFromList_15, DownloadToFile_16, "url", "url", blocking=True
                        , splitratio=[0.70502483723033316, 0.71683158018466053])
                except:
                    print("WARNING: failed to restore connection between GetURLFromList_15 and DownloadToFile_16 in network PrepareReceptorWS_10.macroNetwork")
            if CheckFileFormat_13 is not None and DownloadToFile_16 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        CheckFileFormat_13, DownloadToFile_16, "download_loc", "filename", blocking=True
                        , splitratio=[0.60455581032885575, 0.35606890231085681])
                except:
                    print("WARNING: failed to restore connection between CheckFileFormat_13 and DownloadToFile_16 in network PrepareReceptorWS_10.macroNetwork")
            if CheckFileFormat_13 is not None and UpdateReceptor_17 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        CheckFileFormat_13, UpdateReceptor_17, "receptor_obj", "receptor_obj", blocking=True
                        , splitratio=[0.74908230670336207, 0.38226563370205602])
                except:
                    print("WARNING: failed to restore connection between CheckFileFormat_13 and UpdateReceptor_17 in network PrepareReceptorWS_10.macroNetwork")
            if DownloadToFile_16 is not None and UpdateReceptor_17 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        DownloadToFile_16, UpdateReceptor_17, "filename", "pdbqt", blocking=True
                        , splitratio=[0.38698393490575966, 0.2874426709930199])
                except:
                    print("WARNING: failed to restore connection between DownloadToFile_16 and UpdateReceptor_17 in network PrepareReceptorWS_10.macroNetwork")
            output_Ports_12 = PrepareReceptorWS_10.macroNetwork.opNode
            if UpdateReceptor_17 is not None and output_Ports_12 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        UpdateReceptor_17, output_Ports_12, "receptor_prepared_obj", "new", blocking=True
                        , splitratio=[0.69589857263374943, 0.59566078506240416])
                except:
                    print("WARNING: failed to restore connection between UpdateReceptor_17 and output_Ports_12 in network PrepareReceptorWS_10.macroNetwork")
            if UpdateReceptor_17 is not None and output_Ports_12 is not None:
                try:
                    PrepareReceptorWS_10.macroNetwork.connectNodes(
                        UpdateReceptor_17, output_Ports_12, "receptor_result", "new", blocking=True
                        , splitratio=[0.44926362052272689, 0.38628711158860896])
                except:
                    print("WARNING: failed to restore connection between UpdateReceptor_17 and output_Ports_12 in network PrepareReceptorWS_10.macroNetwork")
            PrepareReceptorWS_10.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_11.outputPorts[1].configure(name='CheckFileFormat_value')
            input_Ports_11.outputPorts[2].configure(name='PrepareReceptorOpalService_ws_nbcr_net_C')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_12.inputPorts[1].configure(singleConnection='auto')
            output_Ports_12.inputPorts[2].configure(singleConnection='auto')
            output_Ports_12.inputPorts[1].configure(name='UpdateReceptor_receptor_prepared_obj')
            output_Ports_12.inputPorts[2].configure(name='UpdateReceptor_receptor_result')
            PrepareReceptorWS_10.inputPorts[0].configure(name='CheckFileFormat_value')
            PrepareReceptorWS_10.inputPorts[0].configure(datatype='receptor')
            PrepareReceptorWS_10.inputPorts[1].configure(name='PrepareReceptorOpalService_ws_nbcr_net_C')
            PrepareReceptorWS_10.inputPorts[1].configure(datatype='boolean')
            ## configure MacroNode input ports
            PrepareReceptorWS_10.outputPorts[0].configure(name='UpdateReceptor_receptor_prepared_obj')
            PrepareReceptorWS_10.outputPorts[0].configure(datatype='receptor_prepared')
            PrepareReceptorWS_10.outputPorts[1].configure(name='UpdateReceptor_receptor_result')
            PrepareReceptorWS_10.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            PrepareReceptorWS_10.shrink()
            PrepareReceptorWS_10.configure(*(), **{'paramPanelImmediate': 1, 'expanded': False})
        except:
            print("WARNING: failed to restore MacroNode named PrepareReceptorWS in network self.macroNetwork")
            print_exc()
            PrepareReceptorWS_10=None

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

        ## saving connections for network PrepareReceptor ##
        input_Ports_1 = self.macroNetwork.ipNode
        Pdb2pqrWS_3 = self.macroNetwork.nodes[2]
        if input_Ports_1 is not None and Pdb2pqrWS_3 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, Pdb2pqrWS_3, "new", "CheckFileFormat_value", blocking=True
                    , splitratio=[0.73531020066010289, 0.24042404972613104])
            except:
                print("WARNING: failed to restore connection between input_Ports_1 and Pdb2pqrWS_3 in network self.macroNetwork")
        PrepareReceptorWS_10 = self.macroNetwork.nodes[3]
        if Pdb2pqrWS_3 is not None and PrepareReceptorWS_10 is not None:
            try:
                self.macroNetwork.connectNodes(
                    Pdb2pqrWS_3, PrepareReceptorWS_10, "UpdateReceptor_receptor_obj", "CheckFileFormat_value", blocking=True
                    , splitratio=[0.54479169827535734, 0.4847384502006486])
            except:
                print("WARNING: failed to restore connection between Pdb2pqrWS_3 and PrepareReceptorWS_10 in network self.macroNetwork")
        if input_Ports_1 is not None and PrepareReceptorWS_10 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_1, PrepareReceptorWS_10, "new", "PrepareReceptorOpalService_ws_nbcr_net_C", blocking=True
                    , splitratio=[0.37730151685222141, 0.48897820190498614])
            except:
                print("WARNING: failed to restore connection between input_Ports_1 and PrepareReceptorWS_10 in network self.macroNetwork")
        output_Ports_2 = self.macroNetwork.opNode
        if PrepareReceptorWS_10 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareReceptorWS_10, output_Ports_2, "UpdateReceptor_receptor_prepared_obj", "new", blocking=True
                    , splitratio=[0.64110508898616414, 0.45535290355389196])
            except:
                print("WARNING: failed to restore connection between PrepareReceptorWS_10 and output_Ports_2 in network self.macroNetwork")
        if PrepareReceptorWS_10 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareReceptorWS_10, output_Ports_2, "UpdateReceptor_receptor_result", "new", blocking=True
                    , splitratio=[0.45846842546122241, 0.44240009354017412])
            except:
                print("WARNING: failed to restore connection between PrepareReceptorWS_10 and output_Ports_2 in network self.macroNetwork")
        self.macroNetwork.runOnNewData.value = False

        ## modifying MacroInputNode dynamic ports
        input_Ports_1 = self.macroNetwork.ipNode
        input_Ports_1.outputPorts[1].configure(name='Pdb2pqrWS_CheckFileFormat_value')
        input_Ports_1.outputPorts[2].configure(name='PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')

        ## modifying MacroOutputNode dynamic ports
        output_Ports_2 = self.macroNetwork.opNode
        output_Ports_2.inputPorts[1].configure(singleConnection='auto')
        output_Ports_2.inputPorts[2].configure(singleConnection='auto')
        output_Ports_2.inputPorts[1].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
        output_Ports_2.inputPorts[2].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_result')
        ## configure MacroNode input ports
        PrepareReceptor_0.inputPorts[0].configure(name='Pdb2pqrWS_CheckFileFormat_value')
        PrepareReceptor_0.inputPorts[0].configure(datatype='receptor')
        PrepareReceptor_0.inputPorts[1].configure(name='PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')
        PrepareReceptor_0.inputPorts[1].configure(datatype='boolean')
        ## configure MacroNode output ports
        PrepareReceptor_0.outputPorts[0].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
        PrepareReceptor_0.outputPorts[0].configure(datatype='receptor_prepared')
        PrepareReceptor_0.outputPorts[1].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_result')
        PrepareReceptor_0.outputPorts[1].configure(datatype='string')

        PrepareReceptor_0.shrink()

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

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

        try:
            ## saving node PrepareReceptor ##
            from Adt.Macro.PrepareReceptor import PrepareReceptor
            PrepareReceptor_141 = PrepareReceptor(constrkw={}, name='PrepareReceptor', library=Adt)
            self.macroNetwork.addNode(PrepareReceptor_141,115,96)
            apply(PrepareReceptor_141.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            Pdb2pqrWS_144 = PrepareReceptor_141.macroNetwork.nodes[2]
            Pdb2pqrOpalService_ws_nbcr_net_148 = Pdb2pqrWS_144.macroNetwork.nodes[3]
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['noopt'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['phi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['psi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['verbose'].widget.set(1, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['chain'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['nodebump'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['chi'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['ligand'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['hbond'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['with_ph'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['forcefield'].widget.set(r"AMBER", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['clean'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['inId'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['apbs_input'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['ffout'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['localRun'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['rama'].widget.set(0, run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['execPath'].widget.set(r"", run=False)
            Pdb2pqrOpalService_ws_nbcr_net_148.inputPortByName['assign_only'].widget.set(0, run=False)
            GetURLFromList_149 = Pdb2pqrWS_144.macroNetwork.nodes[4]
            GetURLFromList_149.inputPortByName['ext'].widget.set(r"pqr", run=False)

            ## saving connections for network Pdb2pqrWS ##
            Pdb2pqrWS_144.macroNetwork.freeze()
            Pdb2pqrWS_144.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_145 = Pdb2pqrWS_144.macroNetwork.ipNode
            input_Ports_145.outputPorts[1].configure(name='CheckFileFormat_value')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_146 = Pdb2pqrWS_144.macroNetwork.opNode
            output_Ports_146.inputPorts[1].configure(singleConnection='auto')
            output_Ports_146.inputPorts[2].configure(singleConnection='auto')
            output_Ports_146.inputPorts[1].configure(name='UpdateReceptor_receptor_obj')
            output_Ports_146.inputPorts[2].configure(name='UpdateReceptor_pdb2pqr_result')
            Pdb2pqrWS_144.inputPorts[0].configure(name='CheckFileFormat_value')
            Pdb2pqrWS_144.inputPorts[0].configure(datatype='receptor')
            ## configure MacroNode input ports
            Pdb2pqrWS_144.outputPorts[0].configure(name='UpdateReceptor_receptor_obj')
            Pdb2pqrWS_144.outputPorts[0].configure(datatype='receptor')
            Pdb2pqrWS_144.outputPorts[1].configure(name='UpdateReceptor_pdb2pqr_result')
            Pdb2pqrWS_144.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            Pdb2pqrWS_144.shrink()
            PrepareReceptorWS_151 = PrepareReceptor_141.macroNetwork.nodes[3]
            PrepareReceptorOpalService_ws_nbcr_net_155 = PrepareReceptorWS_151.macroNetwork.nodes[3]
            PrepareReceptorOpalService_ws_nbcr_net_155.inputPortByName['o'].widget.set(r"", run=False)
            PrepareReceptorOpalService_ws_nbcr_net_155.inputPortByName['v'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_155.inputPortByName['localRun'].widget.set(0, run=False)
            PrepareReceptorOpalService_ws_nbcr_net_155.inputPortByName['execPath'].widget.set(r"", run=False)
            GetURLFromList_156 = PrepareReceptorWS_151.macroNetwork.nodes[4]
            GetURLFromList_156.inputPortByName['ext'].widget.set(r"pdbqt", run=False)
            DownloadToFile_157 = PrepareReceptorWS_151.macroNetwork.nodes[5]
            DownloadToFile_157.inputPortByName['overwrite'].widget.set(1, run=False)

            ## saving connections for network PrepareReceptorWS ##
            PrepareReceptorWS_151.macroNetwork.freeze()
            PrepareReceptorWS_151.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_152 = PrepareReceptorWS_151.macroNetwork.ipNode
            input_Ports_152.outputPorts[1].configure(name='CheckFileFormat_value')
            input_Ports_152.outputPorts[2].configure(name='PrepareReceptorOpalService_ws_nbcr_net_C')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_153 = PrepareReceptorWS_151.macroNetwork.opNode
            output_Ports_153.inputPorts[1].configure(singleConnection='auto')
            output_Ports_153.inputPorts[2].configure(singleConnection='auto')
            output_Ports_153.inputPorts[1].configure(name='UpdateReceptor_receptor_prepared_obj')
            output_Ports_153.inputPorts[2].configure(name='UpdateReceptor_receptor_result')
            PrepareReceptorWS_151.inputPorts[0].configure(name='CheckFileFormat_value')
            PrepareReceptorWS_151.inputPorts[0].configure(datatype='receptor')
            PrepareReceptorWS_151.inputPorts[1].configure(name='PrepareReceptorOpalService_ws_nbcr_net_C')
            PrepareReceptorWS_151.inputPorts[1].configure(datatype='boolean')
            ## configure MacroNode input ports
            PrepareReceptorWS_151.outputPorts[0].configure(name='UpdateReceptor_receptor_prepared_obj')
            PrepareReceptorWS_151.outputPorts[0].configure(datatype='receptor_prepared')
            PrepareReceptorWS_151.outputPorts[1].configure(name='UpdateReceptor_receptor_result')
            PrepareReceptorWS_151.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            PrepareReceptorWS_151.shrink()

            ## saving connections for network PrepareReceptor ##
            PrepareReceptor_141.macroNetwork.freeze()
            PrepareReceptor_141.macroNetwork.unfreeze()

            ## modifying MacroInputNode dynamic ports
            input_Ports_142 = PrepareReceptor_141.macroNetwork.ipNode
            input_Ports_142.outputPorts[1].configure(name='Pdb2pqrWS_CheckFileFormat_value')
            input_Ports_142.outputPorts[2].configure(name='PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')

            ## modifying MacroOutputNode dynamic ports
            output_Ports_143 = PrepareReceptor_141.macroNetwork.opNode
            output_Ports_143.inputPorts[1].configure(singleConnection='auto')
            output_Ports_143.inputPorts[2].configure(singleConnection='auto')
            output_Ports_143.inputPorts[1].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
            output_Ports_143.inputPorts[2].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_result')
            PrepareReceptor_141.inputPorts[0].configure(name='Pdb2pqrWS_CheckFileFormat_value')
            PrepareReceptor_141.inputPorts[0].configure(datatype='receptor')
            PrepareReceptor_141.inputPorts[1].configure(name='PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')
            PrepareReceptor_141.inputPorts[1].configure(datatype='boolean')
            ## configure MacroNode input ports
            PrepareReceptor_141.outputPorts[0].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj')
            PrepareReceptor_141.outputPorts[0].configure(datatype='receptor_prepared')
            PrepareReceptor_141.outputPorts[1].configure(name='PrepareReceptorWS_UpdateReceptor_receptor_result')
            PrepareReceptor_141.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            PrepareReceptor_141.shrink()
            apply(PrepareReceptor_141.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore PrepareReceptor named PrepareReceptor in network self.macroNetwork"
            print_exc()
            PrepareReceptor_141=None

        try:
            ## saving node ComputeGrids ##
            from Adt.Macro.ComputeGrids import ComputeGrids
            ComputeGrids_159 = ComputeGrids(constrkw={}, name='ComputeGrids', library=Adt)
            self.macroNetwork.addNode(ComputeGrids_159,136,207)
            apply(ComputeGrids_159.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            prepareGPF_kryptonite_nbcr_net_163 = ComputeGrids_159.macroNetwork.nodes[3]
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['singlelib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['r_url'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['zpoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['filter_file_url'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['lib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['ypoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['xcenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['p'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['o'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['zcenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['v'].widget.set(0, run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['userlib'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['xpoints'].widget.set(r"", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['localRun'].widget.set(0, run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['ycenter'].widget.set(r"auto", run=False)
            prepareGPF_kryptonite_nbcr_net_163.inputPortByName['execPath'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_164 = ComputeGrids_159.macroNetwork.nodes[4]
            autogrid_kryptonite_nbcr_net_164.inputPortByName['infile_url'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_164.inputPortByName['l'].widget.set(r"output.glg", run=False)
            autogrid_kryptonite_nbcr_net_164.inputPortByName['o'].widget.set(0, run=False)
            autogrid_kryptonite_nbcr_net_164.inputPortByName['p'].widget.set(r"", run=False)
            autogrid_kryptonite_nbcr_net_164.inputPortByName['localRun'].widget.set(0, run=False)
            autogrid_kryptonite_nbcr_net_164.inputPortByName['execPath'].widget.set(r"", run=False)
            GetURLFromList_167 = ComputeGrids_159.macroNetwork.nodes[7]
            GetURLFromList_167.inputPortByName['ext'].widget.set(r"gpf", run=False)

            ## saving connections for network ComputeGrids ##
            ComputeGrids_159.macroNetwork.freeze()
            ComputeGrids_159.macroNetwork.unfreeze()

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

            ## modifying MacroOutputNode dynamic ports
            output_Ports_161 = ComputeGrids_159.macroNetwork.opNode
            output_Ports_161.inputPorts[1].configure(singleConnection='auto')
            output_Ports_161.inputPorts[2].configure(singleConnection='auto')
            output_Ports_161.inputPorts[1].configure(name='MakeAutogridResultObj_autogrid_result_obj')
            output_Ports_161.inputPorts[2].configure(name='GetMainURLFromList_newurl')
            ComputeGrids_159.inputPorts[0].configure(name='GetComputeGridsInputs_ligands')
            ComputeGrids_159.inputPorts[0].configure(datatype='LigandDB')
            ComputeGrids_159.inputPorts[1].configure(name='GetComputeGridsInputs_receptor_pdbqt')
            ComputeGrids_159.inputPorts[1].configure(datatype='receptor_prepared')
            ComputeGrids_159.inputPorts[2].configure(name='GetComputeGridsInputs_gpf_obj')
            ComputeGrids_159.inputPorts[2].configure(datatype='gpf_template')
            ## configure MacroNode input ports
            ComputeGrids_159.outputPorts[0].configure(name='MakeAutogridResultObj_autogrid_result_obj')
            ComputeGrids_159.outputPorts[0].configure(datatype='autogrid_results')
            ComputeGrids_159.outputPorts[1].configure(name='GetMainURLFromList_newurl')
            ComputeGrids_159.outputPorts[1].configure(datatype='string')
            ## configure MacroNode output ports
            ComputeGrids_159.shrink()
            apply(ComputeGrids_159.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore ComputeGrids named ComputeGrids in network self.macroNetwork"
            print_exc()
            ComputeGrids_159=None

        try:
            ## saving node AutodockVsCSF ##
            from Adt.Macro.AutodockVsCSF import AutodockVsCSF
            AutodockVsCSF_168 = AutodockVsCSF(constrkw={}, name='AutodockVsCSF', library=Adt)
            self.macroNetwork.addNode(AutodockVsCSF_168,234,272)
            apply(AutodockVsCSF_168.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
            autodock_kryptonite_nbcr_net_172 = AutodockVsCSF_168.macroNetwork.nodes[3]
            autodock_kryptonite_nbcr_net_172.inputPortByName['ga_run'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['lib'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['filter_file_url'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['ga_num_evals'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['sched'].widget.set(r"CSF", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['ga_num_generations'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['userlib'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['ga_pop_size'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['localRun'].widget.set(0, run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['email'].widget.set(r"", run=False)
            autodock_kryptonite_nbcr_net_172.inputPortByName['execPath'].widget.set(r"", run=False)
            AutodockSlice_oolitevm_calit2_optiputer_net_175 = AutodockVsCSF_168.macroNetwork.nodes[6]
            AutodockSlice_oolitevm_calit2_optiputer_net_175.inputPortByName['execPath'].widget.set(r"", run=False)
            AutodockSlice_oolitevm_calit2_optiputer_net_175.inputPortByName['localRun'].widget.set(0, run=False)
            AutodockSlice_oolitevm_calit2_optiputer_net_175.inputPortByName['divisor'].widget.set(r"", run=False)

            ## saving connections for network AutodockVsCSF ##
            AutodockVsCSF_168.macroNetwork.freeze()
            AutodockVsCSF_168.macroNetwork.unfreeze()

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

            ## modifying MacroOutputNode dynamic ports
            output_Ports_170 = AutodockVsCSF_168.macroNetwork.opNode
            output_Ports_170.inputPorts[1].configure(singleConnection='auto')
            output_Ports_170.inputPorts[1].configure(name='GetMainURLFromList_newurl')
            AutodockVsCSF_168.inputPorts[0].configure(name='PrepareADVSInputs_ligands')
            AutodockVsCSF_168.inputPorts[0].configure(datatype='LigandDB')
            AutodockVsCSF_168.inputPorts[1].configure(name='PrepareADVSInputs_autogrid_results')
            AutodockVsCSF_168.inputPorts[1].configure(datatype='autogrid_results')
            AutodockVsCSF_168.inputPorts[2].configure(name='PrepareADVSInputs_dpf_template_obj')
            AutodockVsCSF_168.inputPorts[2].configure(datatype='dpf_template')
            ## configure MacroNode input ports
            AutodockVsCSF_168.outputPorts[0].configure(name='GetMainURLFromList_newurl')
            AutodockVsCSF_168.outputPorts[0].configure(datatype='string')
            ## configure MacroNode output ports
            AutodockVsCSF_168.shrink()
            apply(AutodockVsCSF_168.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
        except:
            print "WARNING: failed to restore AutodockVsCSF named AutodockVsCSF in network self.macroNetwork"
            print_exc()
            AutodockVsCSF_168=None

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

        ## saving connections for network VirtualScreeningCSF ##
        input_Ports_121 = self.macroNetwork.ipNode
        if input_Ports_121 is not None and PrepareReceptor_141 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_121, PrepareReceptor_141, "new", "Pdb2pqrWS_CheckFileFormat_value", blocking=True
                    , splitratio=[0.70852617526621731, 0.39749336046566702])
            except:
                print "WARNING: failed to restore connection between input_Ports_121 and PrepareReceptor_141 in network self.macroNetwork"
        if PrepareReceptor_141 is not None and ComputeGrids_159 is not None:
            try:
                self.macroNetwork.connectNodes(
                    PrepareReceptor_141, ComputeGrids_159, "PrepareReceptorWS_UpdateReceptor_receptor_prepared_obj", "GetComputeGridsInputs_receptor_pdbqt", blocking=True
                    , splitratio=[0.35807693100671723, 0.50862337251735745])
            except:
                print "WARNING: failed to restore connection between PrepareReceptor_141 and ComputeGrids_159 in network self.macroNetwork"
        if input_Ports_121 is not None and ComputeGrids_159 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_121, ComputeGrids_159, "new", "GetComputeGridsInputs_ligands", blocking=True
                    , splitratio=[0.40102167589221782, 0.6253111040879471])
            except:
                print "WARNING: failed to restore connection between input_Ports_121 and ComputeGrids_159 in network self.macroNetwork"
        if input_Ports_121 is not None and AutodockVsCSF_168 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_121, AutodockVsCSF_168, "ComputeGrids_GetComputeGridsInputs_ligands", "PrepareADVSInputs_ligands", blocking=True
                    , splitratio=[0.65260935115862417, 0.64296744661832661])
            except:
                print "WARNING: failed to restore connection between input_Ports_121 and AutodockVsCSF_168 in network self.macroNetwork"
        if ComputeGrids_159 is not None and AutodockVsCSF_168 is not None:
            try:
                self.macroNetwork.connectNodes(
                    ComputeGrids_159, AutodockVsCSF_168, "MakeAutogridResultObj_autogrid_result_obj", "PrepareADVSInputs_autogrid_results", blocking=True
                    , splitratio=[0.50054097826587762, 0.55954672420260165])
            except:
                print "WARNING: failed to restore connection between ComputeGrids_159 and AutodockVsCSF_168 in network self.macroNetwork"
        if input_Ports_121 is not None and ComputeGrids_159 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_121, ComputeGrids_159, "new", "GetComputeGridsInputs_gpf_obj", blocking=True
                    , splitratio=[0.73607423731241384, 0.54225043834950515])
            except:
                print "WARNING: failed to restore connection between input_Ports_121 and ComputeGrids_159 in network self.macroNetwork"
        if input_Ports_121 is not None and AutodockVsCSF_168 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_121, AutodockVsCSF_168, "new", "PrepareADVSInputs_dpf_template_obj", blocking=True
                    , splitratio=[0.24404719659126095, 0.41822006352735946])
            except:
                print "WARNING: failed to restore connection between input_Ports_121 and AutodockVsCSF_168 in network self.macroNetwork"
        if input_Ports_121 is not None and PrepareReceptor_141 is not None:
            try:
                self.macroNetwork.connectNodes(
                    input_Ports_121, PrepareReceptor_141, "new", "PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C", blocking=True
                    , splitratio=[0.73098254809437191, 0.23999050334763958])
            except:
                print "WARNING: failed to restore connection between input_Ports_121 and PrepareReceptor_141 in network self.macroNetwork"
        output_Ports_122 = self.macroNetwork.opNode
        if AutodockVsCSF_168 is not None and output_Ports_122 is not None:
            try:
                self.macroNetwork.connectNodes(
                    AutodockVsCSF_168, output_Ports_122, "GetMainURLFromList_newurl", "new", blocking=True
                    , splitratio=[0.55528494083678659, 0.33476142488031579])
            except:
                print "WARNING: failed to restore connection between AutodockVsCSF_168 and output_Ports_122 in network self.macroNetwork"
        self.macroNetwork.runOnNewData.value = False

        ## modifying MacroInputNode dynamic ports
        input_Ports_121 = self.macroNetwork.ipNode
        input_Ports_121.outputPorts[1].configure(name='PrepareReceptor_Pdb2pqrWS_CheckFileFormat_value')
        input_Ports_121.outputPorts[2].configure(name='ComputeGrids_GetComputeGridsInputs_ligands')
        input_Ports_121.outputPorts[3].configure(name='ComputeGrids_GetComputeGridsInputs_gpf_obj')
        input_Ports_121.outputPorts[4].configure(name='AutodockVsCSF_PrepareADVSInputs_dpf_template_obj')
        input_Ports_121.outputPorts[5].configure(name='PrepareReceptor_PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')

        ## modifying MacroOutputNode dynamic ports
        output_Ports_122 = self.macroNetwork.opNode
        output_Ports_122.inputPorts[1].configure(singleConnection='auto')
        output_Ports_122.inputPorts[1].configure(name='AutodockVsCSF_GetMainURLFromList_newurl')
        ## configure MacroNode input ports
        VirtualScreeningCSF_120.inputPorts[0].configure(name='PrepareReceptor_Pdb2pqrWS_CheckFileFormat_value')
        VirtualScreeningCSF_120.inputPorts[0].configure(datatype='receptor')
        VirtualScreeningCSF_120.inputPorts[1].configure(name='ComputeGrids_GetComputeGridsInputs_ligands')
        VirtualScreeningCSF_120.inputPorts[1].configure(datatype='LigandDB')
        VirtualScreeningCSF_120.inputPorts[2].configure(name='ComputeGrids_GetComputeGridsInputs_gpf_obj')
        VirtualScreeningCSF_120.inputPorts[2].configure(datatype='gpf_template')
        VirtualScreeningCSF_120.inputPorts[3].configure(name='AutodockVsCSF_PrepareADVSInputs_dpf_template_obj')
        VirtualScreeningCSF_120.inputPorts[3].configure(datatype='dpf_template')
        VirtualScreeningCSF_120.inputPorts[4].configure(name='PrepareReceptor_PrepareReceptorWS_PrepareReceptorOpalService_ws_nbcr_net_C')
        VirtualScreeningCSF_120.inputPorts[4].configure(datatype='boolean')
        ## configure MacroNode output ports
        VirtualScreeningCSF_120.outputPorts[0].configure(name='AutodockVsCSF_GetMainURLFromList_newurl')
        VirtualScreeningCSF_120.outputPorts[0].configure(datatype='string')

        VirtualScreeningCSF_120.shrink()

        ## reset modifications ##
        VirtualScreeningCSF_120.resetTags()
        VirtualScreeningCSF_120.buildOriginalList()
try:
    ## saving node iterate ##
    from Vision.StandardNodes import Iterate
    iterate_91 = Iterate(constrkw={}, name='iterate', library=stdlib)
    masterNet.addNode(iterate_91,30,169)
    iterate_91.inputPortByName['stopOnFailure'].widget.set(1, run=False)
    apply(iterate_91.configure, (), {'paramPanelImmediate': 1})
except:
    print "WARNING: failed to restore Iterate named iterate in network masterNet"
    print_exc()
    iterate_91=None

try:
    ## saving node SaveNAMDResults ##
    from NetworkEditor.macros import MacroNode
    SaveNAMDResults_92 = MacroNode(name='SaveNAMDResults')
    masterNet.addNode(SaveNAMDResults_92, 455, 366)
    output_Ports_94 = SaveNAMDResults_92.macroNetwork.opNode
    apply(output_Ports_94.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
    output_Ports_94.move(130, 477)
    from Vision.StandardNodes import Generic
    GetOutURLs_95 = Generic(constrkw={}, name='GetOutURLs', library=stdlib)
    SaveNAMDResults_92.macroNetwork.addNode(GetOutURLs_95,118,98)
    apply(GetOutURLs_95.addInputPort, (), {'singleConnection': True, 'name': 'filename', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
    apply(GetOutURLs_95.addInputPort, (), {'singleConnection': True, 'name': 'url', 'cast': True, 'datatype': 'string', 'defaultValue': None, 'required': True, 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white', 'originalDatatype': 'None'})
    apply(GetOutURLs_95.addOutputPort, (), {'name': 'outfile_list', 'datatype': 'list', 'height': 12, 'width': 12, 'shape': 'oval', 'color': 'cyan'})
    apply(GetOutURLs_95.addOutputPort, (), {'name': 'run_name', 'datatype': 'string', 'height': 8, 'width': 12, 'shape': 'oval', 'color': 'white'})
    code = """def doit(self, filename, url):
        import urllib
        ofilelist = []
        ofw = []