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()
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()