当前位置: 首页>>代码示例>>Python>>正文


Python gc3libs.Application类代码示例

本文整理汇总了Python中gc3libs.Application的典型用法代码示例。如果您正苦于以下问题:Python Application类的具体用法?Python Application怎么用?Python Application使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Application类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    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)
开发者ID:arcimboldo,项目名称:gc3pie,代码行数:29,代码来源:gbugs.py

示例2: __init__

    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)
开发者ID:fliem,项目名称:gc3pie,代码行数:32,代码来源:gepecell.py

示例3: __init__

    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)
开发者ID:arcimboldo,项目名称:gc3pie,代码行数:34,代码来源:gkjpd.py

示例4: test_io_spec_to_dict_unicode

def test_io_spec_to_dict_unicode():
    import gc3libs.url
    Application._io_spec_to_dict(
        gc3libs.url.UrlKeyDict, {
            u'/tmp/\u0246': u'\u0246',
            '/tmp/b/': 'b'},
        True)
开发者ID:arcimboldo,项目名称:gc3pie,代码行数:7,代码来源:test_Application.py

示例5: __init__

    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)        
开发者ID:fliem,项目名称:gc3pie,代码行数:28,代码来源:gabm.py

示例6: __init__

    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)
开发者ID:fliem,项目名称:gc3pie,代码行数:29,代码来源:gtraclong.py

示例7: __init__

    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)
开发者ID:eydrian,项目名称:gc3pie,代码行数:31,代码来源:gtree.py

示例8: __init__

    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)
开发者ID:arcimboldo,项目名称:gc3pie,代码行数:29,代码来源:gbenchmarkallinone.py

示例9: __init__

    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)
开发者ID:ewiger,项目名称:gc3pie,代码行数:32,代码来源:gscr.py

示例10: __init__

    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)        
开发者ID:ewiger,项目名称:gc3pie,代码行数:33,代码来源:grdock.py

示例11: __init__

    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)
开发者ID:arcimboldo,项目名称:gc3pie,代码行数:26,代码来源:gcombi.py

示例12: __init__

    def __init__(self, network_data_file, run_script, **extra_args):

        self.output_dir = extra_args['output_dir']

        inputs = dict()

        network_data_filename = os.path.basename(network_data_file)
        inputs[network_data_file] = network_data_filename
        inputs[run_script] = os.path.basename(run_script)

        # adding wrapper main script
        gbenchmark_wrapper_sh = resource_filename(Requirement.parse("gc3pie"),
                                                  "gc3libs/etc/gbenchmark_wrapper.sh")

        inputs[gbenchmark_wrapper_sh] = "gbenchmark_wrapper.sh"

        arguments = "./gbenchmark_wrapper.sh -d -b %s -r %s ./%s " % (extra_args["benchmark_type"], os.path.basename(run_script), network_data_filename)

        extra_args['requested_cores'] = 8

        Application.__init__(
            self,
            arguments = arguments,
            inputs = inputs,
            outputs = ["./results"],
            stdout = 'gbenchmark.log',
            join=True,
            executables = ['wrapper.sh'],
            **extra_args)
开发者ID:arcimboldo,项目名称:gc3pie,代码行数:29,代码来源:gbenchmark.py

示例13: __init__

    def __init__(self, parameter, **extra_args):

        inputs = dict()
        outputs = dict()

        # execution wrapper needs to be added anyway
        gsceuafish_wrapper_sh = resource_filename(Requirement.parse("gc3pie"),
                                              "gc3libs/etc/gsceuafish.sh")
        inputs[gsceuafish_wrapper_sh] = os.path.basename(gsceuafish_wrapper_sh)

        _command = "./%s %s " % (os.path.basename(gsceuafish_wrapper_sh),
                                 ' '.join(str(x) for x in parameter))

        if "main_loop_folder" in extra_args:
            inputs[extra_args['main_loop_folder']] = './data/'
        
        Application.__init__(
            self,
            arguments = _command,
            inputs = inputs,
            outputs = gc3libs.ANY_OUTPUT,
            stdout = 'gsceuafish.log',
            join=True,
            executables = "./%s" % os.path.basename(gsceuafish_wrapper_sh),
            **extra_args)
开发者ID:TissueMAPS,项目名称:gc3pie,代码行数:25,代码来源:gsceuafish.py

示例14: __init__

    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
        )
开发者ID:ewiger,项目名称:gc3pie,代码行数:27,代码来源:gnlp.py

示例15: __init__

    def __init__(self, input_file, **extra_args):

        # setup output references
        self.output_dir = extra_args['output_dir']

        # setup input references

        inputs = dict()

        gmodis_wrapper_sh = resource_filename(Requirement.parse("gc3pie"),
                                              "gc3libs/etc/gmodis_wrapper.sh")
        inputs[gmodis_wrapper_sh] = os.path.basename(gmodis_wrapper_sh)

        _command = []

        _command.append("./%s" % os.path.basename(gmodis_wrapper_sh))

        # Add denug info
        _command.append("-d")

        if extra_args.has_key('fsc_dir'):
            inputs.update(dict((os.path.join(extra_args['fsc_dir'],v),
                            os.path.join(
                                os.path.basename(extra_args['fsc_dir']),
                                         v))
                           for v in os.listdir(extra_args['fsc_dir'])))


            

            _command.append("-f ./%s " % os.path.basename(extra_args['fsc_dir']))

        if extra_args.has_key('gmodis_funct'):
            # e.g. ('/home/data/matlab/gmodis','~/bin/gmodis')
            inputs[extra_args['gmodis_funct']] = os.path.basename(extra_args['gmodis_funct'])

            _command.append("-x ./%s " % os.path.basename(extra_args['gmodis_funct']))

        if extra_args.has_key('matlab_driver'):
            inputs[extra_args['matlab_driver']] = os.path.basename(extra_args['matlab_driver'])

            _command.append("-s ./%s " % os.path.basename(extra_args['matlab_driver']))

        inputs[input_file] = os.path.basename(input_file)
        _command.append(os.path.basename(input_file))

        outputs =  gc3libs.ANY_OUTPUT

        # Add memory requirement
        extra_args['requested_memory'] = 16*GB

        Application.__init__(
            self,
            arguments = _command,
            executables = "./%s" % os.path.basename(gmodis_wrapper_sh),
            inputs = inputs,
            outputs = outputs,
            stdout = 'gmodis.log',
            join=True,
            **extra_args)
开发者ID:TissueMAPS,项目名称:gc3pie,代码行数:60,代码来源:gmodis.py


注:本文中的gc3libs.Application类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。