Beispiel #1
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
            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
            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)
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'A'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'C'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'B'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'ligand'].configure(*(), **{
                    'defaultValue': None,
                    'required': True
                })
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'g'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'F'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'I'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'M'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'p'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'R'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'U'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'v'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'Z'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'localRun'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'execPath'].configure(*(), **{'defaultValue': None})
            PrepareLigandSingle_kryptonite_nbcr_net_21.inputPortByName[
                'd'].configure(*(), **{'defaultValue': None})
            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)
            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)
            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)
            GetURLFromList_22.inputPortByName['urllist'].configure(
                *(), **{'defaultValue': None})
            GetURLFromList_22.inputPortByName['ext'].configure(
                *(), **{'defaultValue': None})
            GetURLFromList_22.inputPortByName['ext'].widget.set(r"pdbqt",
                                                                run=False)
            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()
    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()
Beispiel #3
0
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        AutodockVsCSF_0 = self
        from traceback import print_exc
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        masterNet.getEditor().addLibraryInstance(
            wslib, "WebServices.VisionInterface.WSNodes", "wslib")
        from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
        try:
            addOpalServerAsCategory(
                "http://oolitevm.calit2.optiputer.net/opal2", replace=False)
        except:
            pass
        try:
            addOpalServerAsCategory("http://kryptonite.nbcr.net/opal2",
                                    replace=False)
        except:
            pass
        try:
            ## saving node input Ports ##
            input_Ports_1 = self.macroNetwork.ipNode
            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(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)
            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'
                })
            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'
                })
            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'
                })
            PrepareADVSInputs_3.addOutputPort(
                *(), **{
                    'name': 'filter_file',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            PrepareADVSInputs_3.addOutputPort(
                *(), **{
                    'name': 'ligand_lib',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            PrepareADVSInputs_3.addOutputPort(
                *(), **{
                    'name': 'dpf_template_file',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            PrepareADVSInputs_3.addOutputPort(
                *(), **{
                    'name': 'autogrid_res_url',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            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)
            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)
            autodock_kryptonite_nbcr_net_4.inputPortByName['ga_run'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName['lib'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'filter_file_url'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'ga_num_evals'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'filter_file'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName['sched'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName['urllib'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'ga_num_generations'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName['dpf'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName['u'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName['utar'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'userlib'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'ga_pop_size'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'localRun'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName['email'].configure(
                *(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'execPath'].configure(*(), **{'defaultValue': None})
            autodock_kryptonite_nbcr_net_4.inputPortByName[
                'ga_run'].widget.set(r"", run=False)
            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()
            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)
            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)
            GetMainURLFromList_5.inputPortByName['urls'].configure(
                *(), **{'defaultValue': None})
            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)
            GetMainURLFromList_7.inputPortByName['urls'].configure(
                *(), **{'defaultValue': None})
            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)
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'execPath'].configure(*(), **{'defaultValue': None})
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'localRun'].configure(*(), **{'defaultValue': None})
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'divisor'].configure(*(), **{'defaultValue': None})
            AutodockSlice_oolitevm_calit2_optiputer_net_8.inputPortByName[
                'lib'].configure(*(), **{'defaultValue': None})
            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()
            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()
Beispiel #4
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 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
            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(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)
            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 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)
            TrajQR_kryptonite_nbcr_net_4.inputPortByName['license'].configure(
                *(), **{'defaultValue': None})
            TrajQR_kryptonite_nbcr_net_4.inputPortByName['rmsd'].configure(
                *(), **{
                    'defaultValue': None,
                    'required': True
                })
            TrajQR_kryptonite_nbcr_net_4.inputPortByName[
                'qh_filename'].configure(*(), **{'defaultValue': None})
            TrajQR_kryptonite_nbcr_net_4.inputPortByName[
                'qr_filename'].configure(*(), **{'defaultValue': None})
            TrajQR_kryptonite_nbcr_net_4.inputPortByName[
                'compressed_pdbs'].configure(
                    *(), **{
                        'defaultValue': None,
                        'required': True
                    })
            TrajQR_kryptonite_nbcr_net_4.inputPortByName['localRun'].configure(
                *(), **{'defaultValue': None})
            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)
            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)
            SelectOnExtension_5.inputPortByName['filenames'].configure(
                *(), **{'defaultValue': None})
            SelectOnExtension_5.inputPortByName['extension'].configure(
                *(), **{'defaultValue': None})
            SelectOnExtension_5.inputPortByName['extension'].widget.set(
                r".out", run=False)
            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)
            Index_6.inputPortByName['data'].configure(
                *(), **{
                    'datatype': 'list',
                    'defaultValue': None,
                    'originalDatatype': 'None'
                })
            Index_6.inputPortByName['index'].configure(
                *(), **{'defaultValue': None})
            Index_6.outputPortByName['data'].configure(
                *(), **{'datatype': 'string'})
            Index_6.inputPortByName['index'].widget.configure(
                *(), **{
                    'max': 0,
                    'min': -1
                })
            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 GetSelectedPDBs ##
            from Vision.StandardNodes import Generic
            GetSelectedPDBs_7 = Generic(constrkw={},
                                        name='GetSelectedPDBs',
                                        library=stdlib)
            self.macroNetwork.addNode(GetSelectedPDBs_7, 200, 346)
            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'
                })
            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'
                })
            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'
                })
            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)
            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()
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from Vision.StandardNodes import stdlib
        from WebServices.VisionInterface.WSNodes import wslib
        ## building macro network ##
        GromosCluster_33 = self
        from traceback import print_exc
        from Vision.StandardNodes import stdlib
        from WebServices.VisionInterface.WSNodes import wslib
        masterNet.getEditor().addLibraryInstance(
            wslib, "WebServices.VisionInterface.WSNodes", "wslib")
        from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
        try:
            addOpalServerAsCategory("http://kryptonite.nbcr.net/opal2",
                                    replace=False)
        except:
            pass
        try:
            ## saving node input Ports ##
            input_Ports_34 = self.macroNetwork.ipNode
            input_Ports_34.configure(
                *(), **{
                    'paramPanelImmediate': 1,
                    'expanded': False
                })
        except:
            print(
                "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            )
            print_exc()
            input_Ports_34 = None

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

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

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

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

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

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

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

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

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

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

        GromosCluster_33.shrink()

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

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

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

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

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






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

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

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

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

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

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

        Vina_30.shrink()

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

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

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

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

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

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









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

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

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

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

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

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

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

        AutodockVS_9.shrink()

        ## reset modifications ##
        AutodockVS_9.resetTags()
        AutodockVS_9.buildOriginalList()
Beispiel #9
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
            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
            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)
            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'
                })
            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'
                })
            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'
                })
            GetComputeGridsInputs_21.addOutputPort(
                *(), **{
                    'name': 'gpf_template_path',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            GetComputeGridsInputs_21.addOutputPort(
                *(), **{
                    'name': 'filter_file',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            GetComputeGridsInputs_21.addOutputPort(
                *(), **{
                    'name': 'ligand_lib',
                    'datatype': 'string',
                    'height': 8,
                    'width': 12,
                    'shape': 'oval',
                    'color': 'white'
                })
            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)
            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)
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'singlelib'].configure(*(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'r_url'].configure(*(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'zpoints'].configure(*(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'filter_file_url'].configure(*(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName['lib'].configure(
                *(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'ypoints'].configure(*(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'filter_file'].configure(*(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName['gpf'].configure(
                *(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'xcenter'].configure(*(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'urllib'].configure(*(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName['p'].configure(
                *(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName['r'].configure(
                *(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName['o'].configure(
                *(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'zcenter'].configure(*(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName['v'].configure(
                *(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'userlib'].configure(*(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'xpoints'].configure(*(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'localRun'].configure(*(), **{'defaultValue': None})
            prepareGPF_kryptonite_nbcr_net_22.inputPortByName[
                'ycenter'].configure(*(), **{'defaultValue': None})
            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)
            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)
            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)
            autogrid_kryptonite_nbcr_net_23.inputPortByName['p_url'].configure(
                *(), **{'defaultValue': None})
            autogrid_kryptonite_nbcr_net_23.inputPortByName[
                'infile_url'].configure(*(), **{'defaultValue': None})
            autogrid_kryptonite_nbcr_net_23.inputPortByName['l'].configure(
                *(), **{'defaultValue': None})
            autogrid_kryptonite_nbcr_net_23.inputPortByName['o'].configure(
                *(), **{'defaultValue': None})
            autogrid_kryptonite_nbcr_net_23.inputPortByName['p'].configure(
                *(), **{'defaultValue': None})
            autogrid_kryptonite_nbcr_net_23.inputPortByName[
                'localRun'].configure(*(), **{'defaultValue': None})
            autogrid_kryptonite_nbcr_net_23.inputPortByName[
                'inFile'].configure(*(), **{'defaultValue': None})
            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)
            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)
            GetMainURLFromList_24.inputPortByName['urls'].configure(
                *(), **{'defaultValue': None})
            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)
            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'
                })
            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)
            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)
            GetURLFromList_26.inputPortByName['urllist'].configure(
                *(), **{'defaultValue': None})
            GetURLFromList_26.inputPortByName['ext'].configure(
                *(), **{'defaultValue': None})
            GetURLFromList_26.inputPortByName['ext'].widget.set(r"gpf",
                                                                run=False)
            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()