def run(self, name, datafiles, goldnet_file): import numpy os.chdir(os.environ["gene_path"]) datastore = ReadData(datafiles[0], "steadystate") for file in datafiles[1:]: datastore.combine(ReadData(file, "steadystate")) datastore.normalize() settings = {} settings = ReadConfig(settings) # TODO: CHANGE ME settings["global"]["working_dir"] = os.getcwd() + '/' # Setup job manager print "Starting new job manager" jobman = JobManager(settings) # Make GENIE3 jobs genie3 = GENIE3() genie3.setup(datastore, settings, name) print "Queuing job..." jobman.queueJob(genie3) print jobman.queue print "Running queue..." jobman.runQueue() jobman.waitToClear() print "Queue finished" job = jobman.finished[0] print job.alg.gene_list print job.alg.read_output(settings) jobnet = job.alg.network print "PREDICTED NETWORK:" print job.alg.network.network print jobnet.original_network if goldnet_file != None: goldnet = Network() goldnet.read_goldstd(goldnet_file) print "GOLD NETWORK:" print goldnet.network print jobnet.analyzeMotifs(goldnet).ToString() print jobnet.calculateAccuracy(goldnet) return jobnet.original_network
def run(self, ko_file, wt_file, ts_file=None, kd_file=None, name=None): import numpy os.chdir(os.environ["gene_path"]) print "Reading in knockout data" knockout_storage = ReadData(ko_file, "knockout") knockout_storage.normalize() wildtype_storage = ReadData(wt_file, "wildtype") wildtype_storage.normalize() knockdown_storage = ReadData(kd_file, "knockdown") knockdown_storage.normalize() wildtype_storage.combine(knockdown_storage) timeseries_storage = None if ts_file != None: timeseries_storage = ReadData(ts_file, "timeseries") for ts in timeseries_storage: ts.normalize() settings = {} settings = ReadConfig(settings) # TODO: CHANGE ME settings["global"]["working_dir"] = os.getcwd() + '/' # Setup job manager print "Starting new job manager" jobman = JobManager(settings) # Make MCZ jobs mczjob = MCZ() mczjob.setup(knockout_storage, wildtype_storage, settings, timeseries_storage, name) print "Queuing job..." jobman.queueJob(mczjob) print jobman.queue print "Running queue..." jobman.runQueue() jobman.waitToClear() print "Queue finished" job = jobman.finished[0] print job.alg.gene_list print job.alg.read_output(settings) jobnet = job.alg.network print "PREDICTED NETWORK:" print job.alg.network.network print jobnet.original_network return jobnet.original_network
dexcombined.combine(dex_storage2) no3_storage = no3_1_storage no3_storage.combine(no3_2_storage) no3_storage.combine(no3_3_storage) cnlo_no3_storage.combine(no3_storage) #all_storage.combine(cnlo_no3_storage) #dex_storage.combine(cnlo_storage) #dex_storage.combine(no3_storage) #dex_storage.normalize() no3_storage.normalize() cnlo_storage.normalize() cnlo_no3_storage.normalize() #all_storage.normalize() ts_storage = [kno3_1, kno3_2, kno3_3, kno3_4] #for s in ts_storage: #s.normalize() # Setup job manager jobman = JobManager(settings) # Make BANJO jobs #mczjob = MCZ() #mczjob.setup(knockout_storage, wildtype_storage, settings, timeseries_storage, knockdown_storage, "MCZ") #jobman.queueJob(mczjob)
#kd_file = settings["global"]["large_network_knockdown_file"].split() #ts_file = settings["global"]["large_network_timeseries_file"].split() #wt_file = settings["global"]["large_network_wildtype_file"].split() # Read data into program # Where the format is "FILENAME" "DATATYPE" knockout_storage = ReadData(ko_file[0], "knockout") knockdown_storage = ReadData(kd_file[0], "knockdown") timeseries_storage = ReadData(ts_file[0], "timeseries") wildtype_storage = ReadData(wt_file[0], "wildtype") wildtype_storage.combine(knockout_storage) wildtype_storage.combine(knockdown_storage) wildtype_storage.combine(timeseries_storage) wildtype_storage.normalize() knockout_storage.normalize() # Setup job manager jobman = JobManager(settings) # Make BANJO jobs mczjob = MCZ() mczjob.setup(knockout_storage, wildtype_storage, settings, None, "mcz-test-run-1") jobman.queueJob(mczjob) print jobman.queue jobman.runQueue() jobman.waitToClear()