本文整理汇总了Python中JobManager.waitToClear方法的典型用法代码示例。如果您正苦于以下问题:Python JobManager.waitToClear方法的具体用法?Python JobManager.waitToClear怎么用?Python JobManager.waitToClear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JobManager
的用法示例。
在下文中一共展示了JobManager.waitToClear方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import waitToClear [as 别名]
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
示例2: run
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import waitToClear [as 别名]
def run(self, ts_file, name=None, delta_t=30):
os.chdir(os.environ["gene_path"])
print "Reading in knockout data"
timeseries_storage = ReadData(ts_file, "timeseries")
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 Banjo jobs
banjojob = Banjo()
if delta_t != None:
settings["global"]["time_series_delta_t"] = int(delta_t)
else:
settings["global"]["time_series_delta_t"] = 30
if name != None:
banjojob.setup(timeseries_storage, settings, name)
else:
banjojob.setup(timeseries_storage, settings)
print "Queuing job..."
jobman.queueJob(banjojob)
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
示例3: ReadData
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import waitToClear [as 别名]
combined = ReadData(exp_data_directory + '/' + name + '/' + timeseries_filename, "timeseries")[0]
for ts in timeseries_as_steady_state[name][1:11]:
combined.combine(ts)
#combined.combine(knockouts[name])
combined.combine(multifactorials[name])
genie3job = GENIE3()
genie3job.setup(combined, settings, "Genie3_TimeSeries_{0}_{1}".format(name, i))
jobman.queueJob(genie3job)
genie3nets[name] = genie3job
genie3job.goldnet = goldnets[name]
jobman.runQueue()
jobman.waitToClear()
for job in jobman.finished:
job.alg.network.normalize()
#tprs, fprs, rocs = GenerateMultiROC(jobman.finished, goldnet, False, settings["global"]["output_dir"] + "/OverallROC.pdf")
#ps, rs, precs = GenerateMultiPR(jobman.finished, goldnet, False, settings["global"]["output_dir"] + "/OverallPR.pdf")
#for job in jobman.finished:
#tprs, fprs, rocs = GenerateMultiROC([job], job.alg.goldnet, False, settings["global"]["output_dir"] + "/" + job.alg.name + ".pdf")
#ps, rs, precs = GenerateMultiPR([job], job.alg.goldnet, False, settings["global"]["output_dir"] + "/" + job.alg.name + ".pdf")
accs, precs, rocs = SaveResults(jobman.finished, goldnet, settings)
high_noise = []
示例4: get_network_results
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import waitToClear [as 别名]
def get_network_results(name, settings, cache):
print "STARTING", name
if name in cache.keys():
print "CACHE HIT"
return cache[name]
ko_file, kd_file, ts_file, wt_file, mf_file, goldnet = get_example_data_files(name, settings)
# Create date string to append to output_dir
t = datetime.now().strftime("%Y-%m-%d_%H.%M.%S")
settings["global"]["output_dir"] = settings["global"]["output_dir_save"] + "/" + \
settings["global"]["experiment_name"] + "-" + t + "-" + name + "/"
os.mkdir(settings["global"]["output_dir"])
# Get a list of the multifactorial files
# Read data into program
# Where the format is "FILENAME" "DATATYPE"
mf_storage = ReadData(mf_file[0], "multifactorial")
knockout_storage = ReadData(ko_file[0], "knockout")
knockdown_storage = ReadData(kd_file[0], "knockdown")
wildtype_storage = ReadData(wt_file[0], "wildtype")
timeseries_storage = ReadData(ts_file[0], "timeseries")
gene_list = knockout_storage.gene_list
# Setup job manager
jobman = JobManager(settings)
# MCZ
mczjob = MCZ()
mczjob.setup(knockout_storage, wildtype_storage, settings, timeseries_storage, knockdown_storage, "MCZ")
jobman.queueJob(mczjob)
# CLR
clrjob = CLR()
clrjob.setup(knockout_storage, settings, "CLR", "plos", 6)
jobman.queueJob(clrjob)
# GENIE3
mf_storage.combine(knockout_storage)
mf_storage.combine(wildtype_storage)
mf_storage.combine(knockdown_storage)
genie3job = GENIE3()
genie3job.setup(mf_storage, settings, "GENIE3")
jobman.queueJob(genie3job)
## TLCLR
tlclrjob = TLCLR()
tlclrjob.setup(knockout_storage, wildtype_storage, settings, timeseries_storage, knockdown_storage, "TLCLR")
jobman.queueJob(tlclrjob)
#if sys.argv[1] != "dream4100":
#cojob = ConvexOptimization()
#cojob.setup(knockout_storage, settings, "ConvOpt_T-"+ str(0.01),None, None, 0.01)
#jobman.queueJob(cojob)
### DFG4GRN
dfg = DFG4GRN()
settings["dfg4grn"]["eta_z"] = 0.01
settings["dfg4grn"]["lambda_w"] = 0.001
settings["dfg4grn"]["tau"] = 3
dfg.setup(timeseries_storage, TFList(timeseries_storage[0].gene_list), settings, "DFG", 20)
jobman.queueJob(dfg)
### Inferelator
### NIR
nirjob = NIR()
nirjob.setup(knockout_storage, settings, "NIR", 5, 5)
jobman.queueJob(nirjob)
#### TDARACNE
settings = ReadConfig(settings, "./config/default_values/tdaracne.cfg")
bjob = tdaracne()
settings["tdaracne"]["num_bins"] = 4
bjob.setup(timeseries_storage, settings, "TDARACNE")
jobman.queueJob(bjob)
print jobman.queue
jobman.runQueue()
jobman.waitToClear(name)
SaveResults(jobman.finished, goldnet, settings, name)
cache[name] = jobman.finished[:]
return cache[name]
示例5: ReadData
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import waitToClear [as 别名]
# Read data into program
# Where the format is "FILENAME" "DATATYPE"
mf_storage = ReadData(mf_file[0], "multifactorial")
knockout_storage = ReadData(ko_file[0], "knockout")
knockdown_storage = ReadData(kd_file[0], "knockdown")
wildtype_storage = ReadData(wt_file[0], "wildtype")
timeseries_storage = ReadData(ts_file[0], "timeseries")
gene_list = knockout_storage.gene_list
votejob = MCZ()
votejob.setup(knockout_storage, wildtype_storage, settings, timeseries_storage, knockdown_storage, "SimAnnealing")
jobman = JobManager(settings)
jobman.queueJob(votejob)
votejob = jobman.queue[0]
jobman.runQueue()
jobman.waitToClear("VotingJob")
# Send to voting algorithm
dream410 = ["dream410","dream410_2","dream410_3","dream410_4","dream410_5"]
#dream410 = ["dream410","dream410_2"]
dream4100 = ["dream4100","dream4100_2","dream4100_3","dream4100_4","dream4100_5"]
if sys.argv[1] == "dream410":
networks = dream410
elif sys.argv[1] == "dream4100":
networks = dream4100
else:
networks = [sys.argv[1]]
results = []
cache = {}
for test_net in networks:
示例6: run
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import waitToClear [as 别名]
def run(self, kofile, tsfile, wtfile, datafiles, name, goldnet_file, normalize=False):
os.chdir(os.environ["gene_path"])
knockout_storage = ReadData(kofile, "knockout")
print "Reading in knockout data"
wildtype_storage = ReadData(wtfile, "steadystate")
if datafiles == []:
other_storage = None
else:
other_storage = ReadData(datafiles[0], "steadystate")
for file in datafiles[1:]:
other_storage.combine(ReadData(file, "steadystate"))
timeseries_storage = None
if tsfile != None:
timeseries_storage = ReadData(tsfile, "timeseries")
#for ts in timeseries_storage:
#ts.normalize()
#if normalize:
#knockout_storage.normalize()
#wildtype_storage.normalize()
#other_storage.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 inferelator jobs
inferelatorjob = inferelator()
inferelatorjob.setup(knockout_storage, wildtype_storage, settings, timeseries_storage, other_storage, name)
print "Queuing job..."
jobman.queueJob(inferelatorjob)
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)
import AnalyzeResults
tprs, fprs, rocs = AnalyzeResults.GenerateMultiROC(jobman.finished, goldnet )
ps, rs, precs = AnalyzeResults.GenerateMultiPR(jobman.finished, goldnet)
print "Area Under ROC"
print rocs
print "Area Under PR"
print precs
return jobnet.original_network
示例7: NIR
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import waitToClear [as 别名]
### NIR
nirjob = NIR()
nirjob.setup(knockout_storage, settings, "NIR", 5, 5)
jobman.queueJob(nirjob)
#### TDARACNE
#settings = ReadConfig(settings, "./config/default_values/tdaracne.cfg")
#bjob = tdaracne()
#settings["tdaracne"]["num_bins"] = 4
#bjob.setup(timeseries_storage, settings, "TDARACNE")
#jobman.queueJob(bjob)
print jobman.queue
jobman.runQueue()
jobman.waitToClear(sys.argv[1])
# Gather networks
# Send to voting algorithm
for job in jobman.finished:
if "mcz" in job.alg.name.lower():
mczjob = job
SaveResults(jobman.finished, goldnet, settings)
votejob = MCZ()
votejob.setup(knockout_storage, wildtype_storage, settings, timeseries_storage, knockdown_storage, "Voting")
jobman.queueJob(votejob)
votejob = jobman.queue[0]