本文整理汇总了Python中gc3libs.Application.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Application.__init__方法的具体用法?Python Application.__init__怎么用?Python Application.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gc3libs.Application
的用法示例。
在下文中一共展示了Application.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, input_table_filename, **extra_args):
# setup output references
# self.result_dir = result_dir
self.output_dir = extra_args['output_dir']
self.output_filename = 'result-%s.Rdata' % extra_args['index_chunk']
self.output_file = os.path.join(self.output_dir,self.output_filename)
outputs = [("./output.Rdata",self.output_filename)]
# setup input references
inputs = dict()
inputs[input_table_filename] = "./input.txt"
arguments = "Rscript --vanilla "
# check the optional inputs
if extra_args.has_key('driver_script'):
inputs[extra_args['driver_script']] = "./run.R"
arguments += "run.R "
arguments += "input.txt output.Rdata"
Application.__init__(
self,
arguments = arguments,
inputs = inputs,
outputs = outputs,
stdout = 'gbugs.log',
join=True,
**extra_args)
示例2: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, parameter_string, **extra_args):
executables = []
inputs = dict()
outputs = dict()
if 'binary' in extra_args:
binary_name = os.path.basename(extra_args['binary'])
arguments = "./%s" % binary_name
inputs[extra_args['binary']] = binary_name
executables.append(binary_name)
else:
arguments = DEFAULT_EPICELL_BINARY
for param in parameter_string.strip().split(','):
arguments += " %s " % param
# Set output
outputs[DEFAULT_REMOTE_OUTPUT_FOLDER] = os.path.basename(DEFAULT_REMOTE_OUTPUT_FOLDER)
arguments += DEFAULT_REMOTE_OUTPUT_FOLDER
gc3libs.log.debug("Creating application for executing: %s",
arguments)
Application.__init__(
self,
arguments = arguments,
inputs = inputs,
outputs = gc3libs.ANY_OUTPUT,
stdout = 'gepecell.log',
join=True,
executables = executables,
**extra_args)
示例3: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, subject, input_data_folder, **extra_args):
self.output_dir = extra_args['output_dir']
self.result_dir = extra_args['result_dir']
inputs = dict()
outputs = dict()
executables = []
# execution wrapper needs to be added anyway
gkjpd_wrapper_sh = resource_filename(Requirement.parse("gc3pie"),
"gc3libs/etc/gkjpd.sh")
inputs[gkjpd_wrapper_sh] = os.path.basename(gkjpd_wrapper_sh)
inputs[input_data_folder] = './input'
_command = "./%s ./input %s " % (os.path.basename(gkjpd_wrapper_sh),
subject)
# arguments = "matlab -nodesktop -nosplash -nodisplay -nodesktop "\
# "-r \"addpath(\'/home/gc3-user/spm12\'); addpath(\'./input\'); preprocessing_s3it(\'./input\',\'%s\'); quit\""\
# % subject
# Set output
Application.__init__(
self,
arguments = _command,
inputs = inputs,
outputs = gc3libs.ANY_OUTPUT,
stdout = 'gkjpd.log',
join=True,
executables = "./%s" % os.path.basename(gkjpd_wrapper_sh),
**extra_args)
示例4: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, input_data, **extra_args):
# setup input references
inputs = dict()
inputs[input_data] = "./input.txt"
# adding wrapper main script
gnlp_wrapper_sh = resource_filename(Requirement.parse("gc3pie"), "gc3libs/etc/gnlp_wrapper.py")
inputs[gnlp_wrapper_sh] = "./wrapper.py"
arguments = "./wrapper.py ./input.txt ./output.txt"
outputs = dict()
outputs["./output.txt"] = extra_args["output_file"]
Application.__init__(
self,
arguments=arguments,
inputs=inputs,
outputs=outputs,
stdout="gnlp.log",
stderr="gnlp.err",
executables="./wrapper.py",
**extra_args
)
示例5: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, hunting, **extra_args):
"""
Remote execution: ABM [value]
"""
inputs = dict()
outputs = dict()
executables = list()
if 'binary' in extra_args:
remote_bin = os.path.basename(extra_args['binary'])
arguments = "./%s " % remote_bin
inputs[extra_args['binary']] = remote_bin
executables.append(remote_bin)
else:
arguments = DEFAULT_REMOTE_BIN
arguments += " %d " % hunting
Application.__init__(
self,
arguments = arguments,
inputs = inputs,
outputs = gc3libs.ANY_OUTPUT,
stdout = 'gabm.log',
join=True,
executables = executables,
**extra_args)
示例6: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, bids_sub, dwi_folder, fs_folder_list, dmrirc_sub_file, **extra_args):
inputs = dict()
outputs = dict()
self.output_dir = extra_args['output_dir']
# List of folders to copy to remote
inputs[dwi_folder] = DEFAULT_REMOTE_DWI_FOLDER
for fs in fs_folder_list:
inputs[fs] = os.path.join(DEFAULT_REMOTE_FS_FOLDER, os.path.basename(fs))
inputs[dmrirc_sub_file] = DEFAULT_REMOTE_DMRIRC_FILE
wrapper = resource_filename(Requirement.parse("gc3pie"), "gc3libs/etc/gtraclong_wrapper.py")
inputs[wrapper] = os.path.basename(wrapper)
arguments = "./%s %s" % (
inputs[wrapper], os.path.join(DEFAULT_REMOTE_INPUT_FOLDER, os.path.basename(dmrirc_sub_file)))
# check if requested memory and walltime is lower than recommended by default
self._check_requests(bids_sub, extra_args)
Application.__init__(
self,
arguments=arguments,
inputs=inputs,
outputs=[DEFAULT_REMOTE_OUTPUT_FOLDER],
stdout='gtraclong.log',
join=True,
**extra_args)
示例7: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, input_function, input_dataSet, **extra_args):
self.output_dir = extra_args['output_dir']
self.input_function = input_function
#
inputs = dict()
# outputs = dict()
#
# gtree_wrapper_sh = resource_filename(Requirement.parse("gc3pie"),
# "gc3libs/etc/gtree_wrapper.sh")
gtree_wrapper_sh = resource_filename(Requirement.parse("gc3pie"),
"gc3libs/etc/gtree_wrapper.sh")
#
inputs[gtree_wrapper_sh] = os.path.basename(gtree_wrapper_sh)
# inputs['foo'] = 'foo'
#
inputs[input_function] = "%s" % os.path.basename(input_function)
inputs[input_dataSet] = "%s" % os.path.basename(input_dataSet)
#
arguments = "./%s %s %s" % (inputs[gtree_wrapper_sh], inputs[input_function], inputs[input_dataSet])
# print 'hello'
Application.__init__(
self,
arguments = arguments,
inputs = inputs,
outputs = ["./results"],
stdout = 'gtree.log',
join=True,
executables = "./%s" % os.path.basename(input_function),
**extra_args)
示例8: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, network_data_path, benchmark_name, benchmark_file, **extra_args):
self.output_dir = extra_args['output_dir']
inputs = dict()
inputs[network_data_path] = './network_data/'
inputs[benchmark_file] = os.path.basename(benchmark_file)
# adding wrapper main script
gbenchmark_wrapper = resource_filename(Requirement.parse("gc3pie"),
"gc3libs/etc/gbenchmark_wrapper_allinone.py")
inputs[gbenchmark_wrapper] = "gbenchmark_wrapper.py"
arguments = "python gbenchmark_wrapper.py %s %s " % (inputs[benchmark_file], inputs[network_data_path])
# Take full node from 'benchmark' flavor
extra_args['requested_cores'] = 8
Application.__init__(
self,
arguments = arguments,
inputs = inputs,
outputs = ["./results"],
stdout = 'gbenchmark.log',
join=True,
executables = ['gbenchmark_wrapper.py', inputs[benchmark_file]],
**extra_args)
示例9: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, param_file, data_file, **extra_args):
self.output_dir = extra_args['output_dir']
self.result_dir = extra_args['result_dir']
inputs = dict()
outputs = dict()
executables = []
# Check if binary to be executed is provided as part of input arguments
if 'run_binary' in extra_args:
inputs[os.path.abspath(extra_args["run_binary"])] = "estimate_DCM.m"
arguments = "matlab -nodesktop -nosplash -nodisplay -r \"estimate_DCM " \
"%s %s results;quit;\"" % (os.path.basename(param_file),
os.path.basename(data_file))
inputs[param_file] = os.path.basename(param_file)
inputs[data_file] = os.path.basename(data_file)
# Set output
outputs['results/'] = 'results/'
Application.__init__(
self,
arguments = arguments,
inputs = inputs,
outputs = outputs,
stdout = 'gscr.log',
join=True,
executables = executables,
**extra_args)
示例10: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, docking_file, docking_index, **extra_args):
self.output_dir = extra_args['output_dir']
self.docking_index = docking_index
inputs = dict()
outputs = dict()
grdock_wrapper_sh = resource_filename(Requirement.parse("gc3pie"),
"gc3libs/etc/grdock_wrapper.sh")
inputs[grdock_wrapper_sh] = os.path.basename(grdock_wrapper_sh)
inputs[docking_file] = os.path.basename(docking_file)
if extra_args['data_folder']:
for element in os.listdir(extra_args['data_folder']):
inputs[os.path.abspath(os.path.join(extra_args['data_folder'],
element))] = os.path.basename(element)
arguments = "./%s -n %s -o Docked%s %s results" % (inputs[grdock_wrapper_sh],
extra_args['rbdock_iterations'],
self.docking_index,
os.path.basename(docking_file))
Application.__init__(
self,
arguments = arguments,
inputs = inputs,
outputs = ["results/"],
stdout = 'grdock.log',
join=True,
**extra_args)
示例11: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, vcf_list, **extra_args):
self.S2_output = extra_args['S2_output']
extra_args['requested_memory'] = extra_args['S2_memory']
inputs = dict()
outputs = dict()
executables = []
# execution wrapper needs to be added anyway
gatks2_wrapper_sh = resource_filename(Requirement.parse("gc3pie"),
"gc3libs/etc/gatks2.sh")
inputs[gatks2_wrapper_sh] = os.path.basename(gatks2_wrapper_sh)
arguments = "./%s ./input -m %s " % (os.path.basename(gatks2_wrapper_sh),
str(extra_args['requested_memory'].amount(conv=int)))
for vcf in vcf_list:
inputs[vcf] = os.path.join('./input',os.path.basename(vcf))
# Set output
self.vcf_output = os.path.join(self.S2_output,
'genotyped.gvcf.vcf')
outputs['genotyped.gvcf.vcf'] = self.vcf_output
Application.__init__(
self,
arguments = arguments,
inputs = inputs,
outputs = outputs,
stdout = 'gatks2.log',
join=True,
executables = os.path.basename(gatks2_wrapper_sh),
**extra_args)
示例12: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, events, matlab_file, case_file, **extra_args):
executables = []
inputs = dict()
outputs = dict()
inputs[matlab_file] = os.path.basename(matlab_file)
matlab_function = inputs[matlab_file].split(".")[0]
inputs[case_file] = os.path.basename(case_file)
arguments = MATLAB_CMD.format(
main_function=matlab_function,
events=events,
case_file=os.path.basename(case_file),
output_file=DEFAULT_REMOTE_OUTPUT_FILE,
)
# Set output
outputs[DEFAULT_REMOTE_OUTPUT_FILE] = DEFAULT_REMOTE_OUTPUT_FILE
gc3libs.log.debug("Creating application for executing: %s", arguments)
Application.__init__(
self,
arguments=arguments,
inputs=inputs,
outputs=outputs,
stdout="gbraunian.log",
join=True,
executables=executables,
**extra_args
)
示例13: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, input_folder, **extra_args):
self.output_dir = extra_args['output_dir']
self.input_folder = input_folder
inputs = dict()
outputs = dict()
gndn_wrapper_sh = resource_filename(Requirement.parse("gc3pie"),
"gc3libs/etc/gndn_wrapper.sh")
inputs[gndn_wrapper_sh] = os.path.basename(gndn_wrapper_sh)
inputs[input_folder] = "%s/" % os.path.basename(input_folder)
outputs[os.path.join(os.path.basename(input_folder),"results")] = "results/"
arguments = "./%s %s" % (inputs[gndn_wrapper_sh],inputs[input_folder])
Application.__init__(
self,
arguments = arguments,
inputs = inputs,
outputs = outputs,
stdout = 'gndn.log',
join=True,
executables = "./%s" % os.path.basename(input_folder),
**extra_args)
示例14: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, input_phenotype, input_chromosom, **extra_args):
inputs = dict()
outputs = dict()
output_dir = "./results"
outputs[output_dir] = output_dir
# execution wrapper needs to be added anyway
gcombi_wrapper_sh = resource_filename(Requirement.parse("gc3pie"),
"gc3libs/etc/gcombi.sh")
inputs[gcombi_wrapper_sh] = os.path.basename(gcombi_wrapper_sh)
inputs[input_phenotype] = os.path.basename(input_phenotype)
inputs[input_chromosom] = os.path.basename(input_chromosom)
command = "./%s ./%s ./%s" % (os.path.basename(gcombi_wrapper_sh), os.path.basename(input_phenotype), os.path.basename(input_chromosom))
Application.__init__(
self,
arguments = command,
inputs = inputs,
outputs = outputs,
stdout = 'gcombi.log',
join=True,
executables = "./%s" % os.path.basename(gcombi_wrapper_sh),
**extra_args)
示例15: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import __init__ [as 别名]
def __init__(self, input_file, **extra_args):
inputs = dict()
inputs[input_file] = "./input.csv"
self.output_folder = "./results"
# arguments = "./MCSpecs ./input.csv"
# $ arguments = "matlab -nodesktop -nodisplay -nosplash -r \'Main_loop input.csv results; quit()\'"
gwrappermc_wrapper_sh = resource_filename(Requirement.parse("gc3pie"),
"gc3libs/etc/gwrappermc_wrapper.sh")
inputs[gwrappermc_wrapper_sh] = os.path.basename(gwrappermc_wrapper_sh)
arguments = "./%s " % inputs[gwrappermc_wrapper_sh]
if 'main_loop_folder' in extra_args:
inputs[extra_args['main_loop_folder']] = './data/'
arguments += "-m ./data "
arguments += " -i %s " % extra_args['index_chunk']
arguments += "input.csv results"
Application.__init__(
self,
arguments = arguments,
inputs = inputs,
outputs = ['results/'],
stdout = 'gwrappermc.log',
join=True,
executables = "./%s " % inputs[gwrappermc_wrapper_sh],
**extra_args)