本文整理汇总了Python中JobManager.queueJob方法的典型用法代码示例。如果您正苦于以下问题:Python JobManager.queueJob方法的具体用法?Python JobManager.queueJob怎么用?Python JobManager.queueJob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JobManager
的用法示例。
在下文中一共展示了JobManager.queueJob方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [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 queueJob [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: run
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [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
示例4: enumerate
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [as 别名]
#for i, exp in enumerate(pert_baseline.experiments):
## For each experiment, replace the value with the diff between base
## and dex data
#pert = pert_data.experiments[i]
#for gene1 in pert_baseline.gene_list:
#baseval = exp.ratios[gene1]
#pertval = pert.ratios[gene1]
#pert.ratios[gene1] = pertval-baseval
#print gene1, baseval, pertval, pert.ratios[gene1]
genie3job = GENIE3()
genie3job.setup(ko_pert_data["combined"], settings, "Genie3_KO_Mult")
jobman.queueJob(genie3job)
both_genie3 = genie3job
genie3job = GENIE3()
genie3job.setup(pert_data["multifactorial_data"], settings, "Genie3_Mult_Only")
jobman.queueJob(genie3job)
pert_genie3 = genie3job
genie3job = GENIE3()
genie3job.setup(pert_data["knockout_data"], settings, "Genie3_KO_Only")
jobman.queueJob(genie3job)
ko_genie3 = genie3job
mczjob = MCZ()
mczjob.setup(ko_pert_data["knockout_data"], ko_pert_data["ss_data"], settings, None, ko_pert_data["multifactorial_data"], "MCZ-KO_Mult")
jobman.queueJob(mczjob)
示例5: Network
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [as 别名]
settings["global"]["experiment_name"] + "-" + t + "/"
os.mkdir(settings["global"]["output_dir"])
# Read in the gold standard network
# Read in the gold standard network
goldnet = Network()
#goldnet.read_goldstd(settings["global"]["large_network_goldnet_file"])
ko_file, kd_file, ts_file, wt_file, mf_file, goldnet = get_example_data_files(sys.argv[1], settings)
# 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")
# Setup job manager
jobman = JobManager(settings)
clusterjob = Cmonkey()
clusterjob.setup(knockout_storage, settings)
jobman.queueJob(clusterjob)
jobman.runQueue()
jobman.waitToClear()
示例6: ReadData
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [as 别名]
ts_file = settings["global"]["dream4100_network_timeseries_file"].split()
wt_file = settings["global"]["dream4100_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")
# Setup job manager
jobman = JobManager(settings)
# Make NIR jobs
min_restk = max(len(knockout_storage.gene_list) / 5, 3)
max_restk = len(knockout_storage.gene_list) / 2 + 1
rest_list = list(set([3,5,20,21] + [i for i in range(min_restk, max_restk)]))
rest_list = [3,5,10,15,12,20,21]
for i in rest_list:
nirjob = NIR()
nirjob.setup(knockout_storage, settings, "NIR_K="+str(i), 5, i)
jobman.queueJob(nirjob)
print jobman.queue
jobman.runQueue()
jobman.waitToClear()
SaveResults(jobman.finished, goldnet, settings, "Overall", 4)
示例7: ReadData
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [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
# 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
示例8: ReadData
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [as 别名]
goldnet.read_goldstd("algorithms/genenetweaver/InSilicoSize10-Ecoli1_goldstandard.tsv")
# Read data into program
# Where the format is "FILENAME" "DATATYPE"
knockout_storage = ReadData(ko_file, "knockout")
knockdown_storage = ReadData(kd_file, "knockdown")
timeseries_storage = ReadData(ts_file, "timeseries")
wildtype_storage = ReadData(wt_file, "wildtype")
# Setup job manager
jobman = JobManager(settings)
# Make MCZ job
mczjob = MCZ()
mczjob.setup(knockout_storage, wildtype_storage, settings, timeseries_storage, knockdown_storage, "MCZ")
jobman.queueJob(mczjob)
print jobman.queue
jobman.runQueue()
jobman.waitToClear()
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")
SaveResults(jobman.finished, goldnet, settings)
示例9: get_example_data_files
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [as 别名]
# Gather networks
ko_file, kd_file, ts_file, wt_file, mf_file, goldnet = get_example_data_files(sys.argv[1], settings)
# 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 = []
示例10: ReadData
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [as 别名]
#knockout_storage = ReadData(ko_file[0], "knockout")
knockout_storage = None
#knockdown_storage = ReadData(kd_file[0], "knockdown")
knockdown_storage = None
timeseries_storage = ReadData(ts_file[0], "timeseries")
wildtype_storage = ReadData(wt_file[0], "wildtype")
# Setup job manager
jobman = JobManager(settings)
# Make BANJO jobs
tlclrjob = TLCLR()
tlclrjob.setup(knockout_storage, wildtype_storage, settings, timeseries_storage, knockdown_storage, "TLCLR_All_Data")
jobman.queueJob(tlclrjob)
tlclrjob = TLCLR()
tlclrjob.setup(knockout_storage, wildtype_storage, settings, timeseries_storage, None, "TLCLR_No_KD")
jobman.queueJob(tlclrjob)
#tlclrjob = TLCLR()
#tlclrjob.setup(None, wildtype_storage, settings, timeseries_storage, knockdown_storage, "TLCLR_No_KO")
#jobman.queueJob(tlclrjob)
#tlclrjob = TLCLR()
#tlclrjob.setup(None, wildtype_storage, settings, timeseries_storage, None, "TLCLR_No_KO_or_KD")
#jobman.queueJob(tlclrjob)
print jobman.queue
示例11: ReadData
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [as 别名]
# 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")
mf_storage = ReadData(mf_file[0], "multifactorial")
# Setup job manager
jobman = JobManager(settings)
# Make BANJO jobs
mczjob = MCZ()
mczjob.setup(knockout_storage, wildtype_storage, settings, timeseries_storage, knockdown_storage, "MCZ_Alone")
jobman.queueJob(mczjob)
clrjob = CLR()
clrjob.setup(knockout_storage, settings, "clr_" + t + "_Bins-" + str(6), "plos", 6)
jobman.queueJob(clrjob)
#cojob = ConvexOptimization()
#cojob.setup(knockout_storage, settings, "ConvOpt_T-Plos",None, None, 0.04)
#jobman.queueJob(cojob)
mf_storage.combine(knockout_storage)
mf_storage.combine(wildtype_storage)
mf_storage.combine(knockdown_storage)
genie3job = GENIE3()
genie3job.setup(mf_storage, settings, "MF_KO_WT_KD")
jobman.queueJob(genie3job)
示例12: ReadConfig
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [as 别名]
os.mkdir(settings["global"]["output_dir"])
# Get config file for Banjo
settings = ReadConfig(settings, "./config/default_values/banjo.cfg")
#settings = ReadConfig(settings, settings["banjo"]["config"])
# Setup job manager
jobman = JobManager(settings)
# Make BANJO jobs
settings["banjo"]["discretization_policy"] = "q4"
settings["banjo"]["max_time"] = "1"
bjob = Banjo()
bjob.setup(timeseries_storage, settings, "banjo_" + settings["banjo"]["discretization_policy"] )
jobman.queueJob(bjob)
settings["banjo"]["discretization_policy"] = "q3"
bjob = Banjo()
bjob.setup(timeseries_storage, settings, "banjo_" + settings["banjo"]["discretization_policy"] )
jobman.queueJob(bjob)
settings["banjo"]["discretization_policy"] = "q2"
bjob = Banjo()
bjob.setup(timeseries_storage, settings, "banjo_" + settings["banjo"]["discretization_policy"] )
jobman.queueJob(bjob)
settings["banjo"]["discretization_policy"] = "q5"
bjob = Banjo()
bjob.setup(timeseries_storage, settings, "banjo_" + settings["banjo"]["discretization_policy"] )
jobman.queueJob(bjob)
示例13: MCZ
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [as 别名]
# Make BANJO jobs
#mczjob = MCZ()
#mczjob.setup(knockout_storage, wildtype_storage, settings, timeseries_storage, knockdown_storage, "mcz-test-run-1")
#jobman.queueJob(mczjob)
#print jobman.queue
#jobman.runQueue()
#jobman.waitToClear()
accs = []
precs = []
cojob = ConvexOptimization()
cojob.setup(knockout_storage, settings, "ConvOpt_Baseline")
jobman.queueJob(cojob)
#accs.append("MCZ:")
#for job in jobman.finished:
##threshnet = job.alg.network.copy()
##threshnet.network = threshnet.apply_threshold(0)
##accs.append((job.alg.name, threshnet.calculateAccuracy(goldnet)))
##pre, rec, area = GeneratePR(job.alg.network, goldnet, True, False, job.alg.name)
##precs.append((job.alg.name, area))
##for i in range(8, 10):
##for i in [15,20,25,30,35,5,3,1,2,50]:
#num_edge_list = [x for x in range(21)]
##num_edge_list += [ 25, 30, 45, 50, 55, 60, 65, 70 ]
#num_edge_list = [70, 80, 50, 10]
#for i in num_edge_list:
示例14: ReadData
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [as 别名]
if sys.argv[1] == "dream4100":
goldnet.read_goldstd(settings["global"]["dream4100_network_goldnet_file"])
#Get a list of the knockout files
ko_file = settings["global"]["dream4100_network_knockout_file"].split()
kd_file = settings["global"]["dream4100_network_knockdown_file"].split()
ts_file = settings["global"]["dream4100_network_timeseries_file"].split()
wt_file = settings["global"]["dream4100_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")
# Setup job manager
jobman = JobManager(settings)
# Make clr jobs
for t in ['normal', 'rayleigh', 'beta', 'plos', 'kde']:
for n in range(5,15):
clrjob = CLR()
clrjob.setup(knockout_storage, settings, "clr_" + t + "_Bins-" + str(n), t, n)
jobman.queueJob(clrjob)
print jobman.queue
jobman.runQueue()
jobman.waitToClear()
accs, precs, rocs = SaveResults(jobman.finished, goldnet, settings, "Overall", 4)
示例15: Generate_Grid
# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import queueJob [as 别名]
grid = Generate_Grid("dfg4grn", None, settings, ["eta_z", "lambda_w", "tau"], 5).test_list
jobman = JobManager(settings)
dfg = DFG4GRN()
settings["dfg4grn"]["eta_z"] = 0.1
settings["dfg4grn"]["lambda_w"] = 0.01
settings["dfg4grn"]["tau"] = 3.5
dfg.setup(
timeseries_storage,
TFList(timeseries_storage[0].gene_list),
settings,
"EtaZ-{0}_LamdaW-{1}_Tau-{2}".format(0.1, 0.01, 3.5),
20,
)
jobman.queueJob(dfg)
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,
"EtaZ-{0}_LamdaW-{1}_Tau-{2}".format(0.01, 0.001, 3),
20,
)
jobman.queueJob(dfg)
for i, p in enumerate(grid):
settings["dfg4grn"]["eta_z"] = p[0]