Beispiel #1
0
    from Vision.StandardNodes import ReadTable
    ReadTable_157 = ReadTable(constrkw={}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_157, 253, 35)
    ReadTable_157.inputPortByName['filename'].widget.set(
        "Data/table_data_string.dat", run=False)
    ReadTable_157.inputPortByName['sep'].widget.set(",", run=False)
    apply(ReadTable_157.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_157 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_158 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_158, 146, 200)
    apply(Index_158.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_158 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_159 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_159, 295, 202)
    apply(Index_159.inputPortByName['index'].widget.configure, (), {'max': 1})
    Index_159.inputPortByName['index'].widget.set(1, run=False)
    apply(Index_159.configure, (), {'expanded': True})
Beispiel #2
0
    ## saving node Set Matplotlib options ##
    from Vision.matplotlibNodes import MatPlotLibOptions
    Set_Matplotlib_options_50 = MatPlotLibOptions(
        constrkw={}, name='Set Matplotlib options', library=matplotliblib)
    masterNet.addNode(Set_Matplotlib_options_50, 360, 233)
    Set_Matplotlib_options_50.inputPortByName['matplotlibOptions'].widget.set(
        {'gridOn': 1}, run=False)
except:
    print "WARNING: failed to restore MatPlotLibOptions named Set Matplotlib options in network masterNet"
    print_exc()
    Set_Matplotlib_options_50 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_51 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_51, 29, 202)
    apply(Index_51.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_51 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_52 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_52, 209, 201)
    apply(Index_52.inputPortByName['index'].widget.configure, (), {'max': 1})
    Index_52.inputPortByName['index'].widget.set(1, run=False)
    apply(Index_52.configure, (), {'expanded': True})
Beispiel #3
0
    ReadTable_31 = ReadTable(constrkw={}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_31, 22, 5)
    ReadTable_31.inputPortByName['filename'].widget.set(
        "Data/histogram_data.dat", run=False)
    ReadTable_31.inputPortByName['sep'].widget.set(",", run=False)
    ReadTable_31.inputPortByName['datatype'].widget.set("float", run=False)
    apply(ReadTable_31.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_31 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_32 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_32, 255, 234)
    apply(Index_32.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_32 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_33 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_33, 439, 233)
    apply(Index_33.inputPortByName['index'].widget.configure, (), {'max': 1})
    Index_33.inputPortByName['index'].widget.set(1, run=False)
    apply(Index_33.configure, (), {'expanded': True})
Beispiel #4
0
    ReadTable_10 = ReadTable(constrkw={}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_10, 73, 7)
    ReadTable_10.inputPortByName['filename'].widget.set(
        "Data/histogram_data_1.dat", run=False)
    ReadTable_10.inputPortByName['sep'].widget.set(",", run=False)
    ReadTable_10.inputPortByName['datatype'].widget.set("float", run=False)
    apply(ReadTable_10.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_10 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_11 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_11, 12, 208)
    apply(Index_11.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_11 = None

try:
    ## saving node Plot ##
    from Vision.matplotlibNodes import PlotNE
    Plot_12 = PlotNE(constrkw={}, name='Plot', library=matplotliblib)
    masterNet.addNode(Plot_12, 287, 332)
    Plot_12.inputPortByName['lineStyle'].widget.set("dashed", run=False)
    Plot_12.inputPortByName['color'].widget.set("red", run=False)
    apply(Plot_12.configure, (), {'expanded': True})
    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 #6
0
try:
    ## saving node ErrorBar ##
    from Vision.matplotlibNodes import ErrorBarNE
    ErrorBar_39 = ErrorBarNE(constrkw = {}, name='ErrorBar', library=matplotliblib)
    masterNet.addNode(ErrorBar_39,190,338)
    ErrorBar_39.inputPortByName['format'].widget.set("o", run=False)
except:
    print "WARNING: failed to restore ErrorBarNE named ErrorBar in network masterNet"
    print_exc()
    ErrorBar_39=None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_40 = Index(constrkw = {}, name='Index', library=stdlib)
    masterNet.addNode(Index_40,4,199)
    apply(Index_40.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_40=None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_41 = Index(constrkw = {}, name='Index', library=stdlib)
    masterNet.addNode(Index_41,143,197)
    apply(Index_41.inputPortByName['index'].widget.configure, (), {'max': 3})
    Index_41.inputPortByName['index'].widget.set(1, run=False)
    apply(Index_41.configure, (), {'expanded': True})
Beispiel #7
0
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        TrajQR_0 = self
        from traceback import print_exc
        from WebServices.VisionInterface.WSNodes import wslib
        from Vision.StandardNodes import stdlib
        masterNet.getEditor().addLibraryInstance(
            wslib, "WebServices.VisionInterface.WSNodes", "wslib")
        from WebServices.VisionInterface.WSNodes import addOpalServerAsCategory
        try:
            addOpalServerAsCategory("http://kryptonite.nbcr.net/opal2",
                                    replace=False)
        except:
            pass
        try:
            ## saving node input Ports ##
            input_Ports_1 = self.macroNetwork.ipNode
            apply(input_Ports_1.configure, (), {
                'paramPanelImmediate': 1,
                'expanded': False
            })
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_1 = None

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

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

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

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

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

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

        f = urllib.urlopen(trajqr_url)

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


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

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

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

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

        ## modifying MacroOutputNode dynamic ports
        output_Ports_2 = self.macroNetwork.opNode
        output_Ports_2.inputPorts[1].configure(singleConnection='auto')
        output_Ports_2.inputPorts[1].configure(
            name='GetSelectedPDBs_pdb_out_dir')
        ## configure MacroNode input ports
        TrajQR_0.inputPorts[0].configure(name='Make_Zip_File_input_directory')
        TrajQR_0.inputPorts[0].configure(datatype='string')
        TrajQR_0.inputPorts[1].configure(
            name='TrajQR_kryptonite_nbcr_net_rmsd')
        TrajQR_0.inputPorts[1].configure(datatype='string')
        TrajQR_0.inputPorts[2].configure(name='GetSelectedPDBs_pdb_out_dir')
        TrajQR_0.inputPorts[2].configure(datatype='string')
        ## configure MacroNode output ports
        TrajQR_0.outputPorts[0].configure(name='GetSelectedPDBs_pdb_out_dir')
        TrajQR_0.outputPorts[0].configure(datatype='string')

        TrajQR_0.shrink()

        ## reset modifications ##
        TrajQR_0.resetTags()
        TrajQR_0.buildOriginalList()
Beispiel #8
0
    ReadTable_180 = None

try:
    ## saving node Vline ##
    from Vision.matplotlibNodes import VlineNE
    Vline_181 = VlineNE(constrkw={}, name='Vline', library=matplotliblib)
    masterNet.addNode(Vline_181, 117, 358)
except:
    print "WARNING: failed to restore VlineNE named Vline in network masterNet"
    print_exc()
    Vline_181 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_182 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_182, 12, 187)
    apply(Index_182.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_182 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_183 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_183, 161, 188)
    apply(Index_183.inputPortByName['index'].widget.configure, (), {'max': 2})
    Index_183.inputPortByName['index'].widget.set(1, run=False)
    apply(Index_183.configure, (), {'expanded': True})
Beispiel #9
0
    def afterAddingToNetwork(self):
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from MolKit.VisionInterface.MolKitNodes import molkitlib
        from Vision.StandardNodes import stdlib
        ## building macro network ##
        recluster_11 = self
        from traceback import print_exc

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

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

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

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

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


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

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

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

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

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

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

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

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

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

        self.macroNetwork.freeze()

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

        recluster_11.shrink()

        ## reset modifications ##
        recluster_11.resetTags()
        recluster_11.buildOriginalList()
Beispiel #10
0
try:
    ## saving node Plot ##
    from Vision.matplotlibNodes import PlotNE
    Plot_57 = PlotNE(constrkw = {}, name='Plot', library=matplotliblib)
    masterNet.addNode(Plot_57,31,351)
    Plot_57.inputPortByName['lineStyle'].widget.set("dotted", run=False)
    apply(Plot_57.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore PlotNE named Plot in network masterNet"
    print_exc()
    Plot_57=None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_58 = Index(constrkw = {}, name='Index', library=stdlib)
    masterNet.addNode(Index_58,215,173)
    apply(Index_58.inputPortByName['index'].widget.configure, (), {'max': 4})
    Index_58.inputPortByName['index'].widget.set(2, run=False)
    apply(Index_58.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_58=None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_59 = Index(constrkw = {}, name='Index', library=stdlib)
    masterNet.addNode(Index_59,379,173)
    apply(Index_59.inputPortByName['index'].widget.configure, (), {'max': 4})
Beispiel #11
0
                                  library=matplotliblib)
    masterNet.addNode(Draw_Area_114, 352, 158)
    Draw_Area_114.inputPortByName['title'].widget.set(
        "About as simple  as it gets, folks", run=False)
    Draw_Area_114.inputPortByName['xlabel'].widget.set("time(s)", run=False)
    Draw_Area_114.inputPortByName['ylabel'].widget.set("voltage(mV)",
                                                       run=False)
except:
    print "WARNING: failed to restore MPLDrawAreaNE named Draw Area in network masterNet"
    print_exc()
    Draw_Area_114 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_115 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_115, 4, 189)
    apply(Index_115.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_115 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_116 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_116, 175, 188)
    apply(Index_116.inputPortByName['index'].widget.configure, (), {'max': 1})
    Index_116.inputPortByName['index'].widget.set(1, run=False)
    apply(Index_116.configure, (), {'expanded': True})
Beispiel #12
0
    ReadTable_108 = ReadTable(constrkw={}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_108, 39, 7)
    ReadTable_108.inputPortByName['filename'].widget.set("Data/pie_data.dat",
                                                         run=False)
    ReadTable_108.inputPortByName['sep'].widget.set(",", run=False)
    ReadTable_108.inputPortByName['datatype'].widget.set("float", run=False)
    apply(ReadTable_108.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_108 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_109 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_109, 81, 177)
    apply(Index_109.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_109 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_110 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_110, 250, 175)
    apply(Index_110.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    apply(
        ReadTable_5.inputPortByName['numOfBottomLinesToJump'].widget.configure,
        (), {'oneTurn': 10.0})
    ReadTable_5.inputPortByName['numOfBottomLinesToJump'].widget.set(0,
                                                                     run=False)
    ReadTable_5.inputPortByName['sep'].widget.set(r",", run=False)
    ReadTable_5.inputPortByName['datatype'].widget.set(r"float", run=False)
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_5 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_6 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_6, 32, 189)
    Index_6.inputPortByName['index'].widget.set(0, run=False)
    apply(Index_6.configure, (), {'paramPanelImmediate': 1, 'expanded': False})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_6 = None

#masterNet.run()
masterNet.freeze()

## saving connections for network ImageFigure ##
if Draw_Area_1 is not None and Histogram_0 is not None:
    try:
        masterNet.connectNodes(
Beispiel #14
0
        constrkw={}, name='Set Matplotlib options', library=matplotliblib)
    masterNet.addNode(Set_Matplotlib_options_23, 148, 330)
    Set_Matplotlib_options_23.inputPortByName['matplotlibOptions'].widget.set(
        {
            'gridOn': 1,
            'whichgrid': 'major'
        }, run=False)
except:
    print "WARNING: failed to restore MatPlotLibOptions named Set Matplotlib options in network masterNet"
    print_exc()
    Set_Matplotlib_options_23 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_24 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_24, 28, 182)
    apply(Index_24.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_24 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_25 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_25, 178, 174)
    apply(Index_25.inputPortByName['index'].widget.configure, (), {'max': 3})
    Index_25.inputPortByName['index'].widget.set(1, run=False)
    apply(Index_25.configure, (), {'expanded': True})
Beispiel #15
0
        constrkw={}, name='Set Matplotlib options', library=matplotliblib)
    masterNet.addNode(Set_Matplotlib_options_201, 212, 363)
    Set_Matplotlib_options_201.inputPortByName['matplotlibOptions'].widget.set(
        {
            'gridOn': 1,
            'whichgrid': 'major'
        }, run=False)
except:
    print "WARNING: failed to restore MatPlotLibOptions named Set Matplotlib options in network masterNet"
    print_exc()
    Set_Matplotlib_options_201 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_202 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_202, 28, 182)
    apply(Index_202.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_202 = None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_203 = Index(constrkw={}, name='Index', library=stdlib)
    masterNet.addNode(Index_203, 178, 174)
    apply(Index_203.inputPortByName['index'].widget.configure, (), {'max': 3})
    Index_203.inputPortByName['index'].widget.set(1, run=False)
    apply(Index_203.configure, (), {'expanded': True})
Beispiel #16
0
    from Vision.StandardNodes import ReadTable
    ReadTable_163 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_163,135,21)
    ReadTable_163.inputPortByName['filename'].widget.set("Data/text_align_data.dat", run=False)
    ReadTable_163.inputPortByName['sep'].widget.set(",", run=False)
    ReadTable_163.inputPortByName['datatype'].widget.set("float", run=False)
    apply(ReadTable_163.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_163=None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_164 = Index(constrkw = {}, name='Index', library=stdlib)
    masterNet.addNode(Index_164,4,168)
    apply(Index_164.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_164=None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_165 = Index(constrkw = {}, name='Index', library=stdlib)
    masterNet.addNode(Index_165,139,171)
    apply(Index_165.inputPortByName['index'].widget.configure, (), {'max': 3})
    Index_165.inputPortByName['index'].widget.set(1, run=False)
    apply(Index_165.configure, (), {'expanded': True})