• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python parser.Parser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_one_step_pipeline

def test_one_step_pipeline():
    parser = Parser(one_step_pipeline)
    cmds = parser.consume()

    vals = ["cut", "somefile", ">", "anotherfile"]
    for i, part in enumerate(cmds[0].parts):
        vals[i].should.equal(part)
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:7,代码来源:test_command_template_factory.py


示例2: test_run_11

def test_run_11():
    parser = Parser(overall)
    cmds = parser.consume()[:11]

    pipeline = Runtime(cmds, ReportingJobQueue, JOB_TYPES, 'mock', sleep_time=0.01)
    iters = pipeline.run()
    iters.should.be.greater_than(15)
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:7,代码来源:test_runtime.py


示例3: test_another_sample_pipeline

def test_another_sample_pipeline():
    parser = Parser(another_sample)

    templates = parser.consume()

    vals = [
        CommentToken(["#", " Trimmomatic"]),
        "java",
        "-jar",
        PathToken("trimmomatic", "Trimmomatic-0.35/trimmomatic-0.35.jar>"),
        "PE",
        Input("1"),
        Input("2"),
        Output("1.1-1", "metapipe.1.output"),
        Output("1.1-2", "metapipe.1.output"),
        Output("1.1-3", "metapipe.1.output"),
        Output("1.1-4", "metapipe.1.output"),
        "ILLUMINACLIP:Trimmomatic-0.35/adapters/TruSeq3-PE.fa:2:30:10:2:true",
        "LEADING:3",
        "TRAILING:3",
    ]

    cmd = templates[0].eval()[0]
    for i, part in enumerate(cmd.parts):
        vals[i].should.equal(part)
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:25,代码来源:test_command_template.py


示例4: test_full_sample_pipeline

def test_full_sample_pipeline():
    parser = Parser(full_sample_pipeline)

    cmds = parser.consume()

    vals = [
        CommentToken(["#", " Trimmomatic"]),
        "java",
        "-jar",
        PathToken("trimmomatic", "Trimmomatic-0.35/trimmomatic-0.35.jar>"),
        "PE",
        [[Input("*R1_001.fastq.gz")]],
        [[Input("*R2_001.fastq.gz")]],
        Output("1", "metapipe.1.output"),
        Output("1", "metapipe.1.output"),
        Output("1", "metapipe.1.output"),
        Output("1", "metapipe.1.output"),
        PathToken(
            "illuminaclip",
            "ILLUMINACLIP:/gpfs/home/bhuvan/Programs/Trimmomatic-0.32/adapters/TruSeq3-PE.fa:2:30:10:2:true",
        ),
        "LEADING:3",
        "TRAILING:3",
    ]

    for i, part in enumerate(cmds[0].parts):
        vals[i].should.equal(part)
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:27,代码来源:test_command_template_factory.py


示例5: test_run_1

def test_run_1():
    parser = Parser(overall)
    cmds = parser.consume()[:1]
    
    pipeline = Runtime(cmds, JOB_TYPES, 'mock', sleep_time=0.01)
    iters = pipeline.run()
    iters.should.equal(1)
开发者ID:alaindomissy,项目名称:metapipe,代码行数:7,代码来源:test_runtime.py


示例6: test_get_new_commands_9

def test_get_new_commands_9():
    parser = Parser(overall)
    cmds = parser.consume()[:9]

    pipeline = Runtime(cmds, ReportingJobQueue, JOB_TYPES, 'mock')
    new = pipeline.queue.queue
    new.should.have.length_of(9)
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:7,代码来源:test_runtime.py


示例7: test_max_concurrent_jobs

def test_max_concurrent_jobs():
    parser = Parser(concurrent)
    cmds = parser.consume()

    pipeline = Runtime(cmds, ReportingJobQueue, { 'local': MockJob }, 'local', sleep_time=0.01)
    iters = pipeline.run()
    iters.should.be.greater_than(30)
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:7,代码来源:test_runtime.py


示例8: test_consume_full_sample_pipeline

def test_consume_full_sample_pipeline():
    parser = Parser(full_sample_pipeline)
    res = parser.consume()

    res[0].alias.should.equal('1')
    res[0].parts[0].should.equal(CommentToken(['#', ' Trimmomatic']))
    res[0].parts[1].should.equal('java')
开发者ID:Sonictherocketman,项目名称:metapipe,代码行数:7,代码来源:test_parser.py


示例9: test_run_10

def test_run_10():
    parser = Parser(overall)
    cmds = parser.consume()[:10]

    pipeline = Runtime(cmds, ReportingJobQueue, JOB_TYPES, 'mock', sleep_time=0.01)
    iters = pipeline.run()
    iters.should.equal(23)
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:7,代码来源:test_runtime.py


示例10: test_get_new_commands_8

def test_get_new_commands_8():
    parser = Parser(overall)
    cmds = parser.consume()[:8]

    pipeline = Runtime(cmds, JOB_TYPES, 'mock')
    new = pipeline._get_new_commands()
    print(new)
    new.should.have.length_of(11)    
开发者ID:alaindomissy,项目名称:metapipe,代码行数:8,代码来源:test_runtime.py


示例11: test_consume_files

def test_consume_files():
    parser = Parser(overall)
    res = parser.consume()

    parser.files[0].alias.should.equal('1')
    parser.files[0].filename.should.equal('somefile.1')
    parser.files[1].alias.should.equal('2')
    parser.files[1].filename.should.equal('somefile.2')
开发者ID:Sonictherocketman,项目名称:metapipe,代码行数:8,代码来源:test_parser.py


示例12: test_eval_magic_input

def test_eval_magic_input():
    parser = Parser(magic_inputs)

    templates = parser.consume()

    vals = ["bash", "somescript", Input("*.counts", "somefile.1"), ">", Output("1.1", "metapipe.1.1.output")]
    cmd = templates[0].eval()[0]
    for i, part in enumerate(cmd.parts):
        vals[i].should.equal(part)
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:9,代码来源:test_command_template.py


示例13: test_multiple_outputs1

def test_multiple_outputs1():
    parser = Parser(multiple_outputs)
    cmds = parser.consume()
    old_commands = []

    cmd = cmds[0].eval()[0]
    cmd.update_dependent_files(old_commands)
    cmd.eval().should.equal('bash somescript somefile.1 --log'
        ' mp.1.1-1.output -r mp.1.1-2.output')
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:9,代码来源:test_command.py


示例14: test_consume_commands_9

def test_consume_commands_9():
    parser = Parser(overall)
    res = parser.consume()

    res[8].alias.should.equal('9')
    res[8].parts[4].should.equal('cat')
    res[8].parts[5][0][0].should.equal(Input('*.bam',
                                filename='*.bam'))
    res[8]._dependencies.should.have.length_of(1)
开发者ID:Sonictherocketman,项目名称:metapipe,代码行数:9,代码来源:test_parser.py


示例15: test_magical_glob

def test_magical_glob():
    parser = Parser(magical_glob2)
    templates = parser.consume()

    vals = ["cat", Input("1.*", ""), ">", Output("2.1", "mp.2.1.output")]

    cmd = templates[1].eval()[0]
    for i, part in enumerate(cmd.parts):
        vals[i].should.equal(part)
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:9,代码来源:test_command_template.py


示例16: test_eval_2

def test_eval_2():
    parser = Parser(overall)
    cmds = parser.consume()

    cmds[0].eval()[1].eval().should.equal('#PBS_O_WORKDIR=~/someuser\nset -e;'
        '\nmodule load python\n# do something\n'
        '/usr/bin/python somescript.py -i '
        'somefile.4 somefile.5 somefile.6 -o mp.1.2.output '
        '-fgh somefile.txt')
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:9,代码来源:test_command.py


示例17: test_long_running_2

def test_long_running_2():
    parser = Parser(long_running)

    cmds = parser.consume()

    vals = ["cat", [[Input("1.1")], [Input("1.2")]], "&&", "sleep", "1"]

    for i, part in enumerate(cmds[1].parts):
        vals[i].should.equal(part)
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:9,代码来源:test_command_template_factory.py


示例18: test_long_running_2

def test_long_running_2():
    parser = Parser(long_running)

    templates = parser.consume()

    vals = ["cat", Input("1.1", "metapipe.1.1.output"), "&&", "sleep", "1"]

    cmd = templates[1].eval()[0]
    for i, part in enumerate(cmd.parts):
        vals[i].should.equal(part)
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:10,代码来源:test_command_template.py


示例19: test_eval_16_deps

def test_eval_16_deps():
    parser = Parser(overall)
    cmds = parser.consume()
    old_commands = []
    for cmd in cmds[0:8]:
        old_commands.extend(cmd.eval())

    cmd = cmds[8].eval()[0]
    cmd.update_dependent_files(old_commands)
    cmd.depends_on.should.have.length_of(1)
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:10,代码来源:test_command.py


示例20: test_eval_multiple_inputs

def test_eval_multiple_inputs():
    parser = Parser(multiple_inputs)
    cmds = parser.consume()
    old_commands = []

    cmd = cmds[0].eval()[0]
    print(cmd)
    cmd.update_dependent_files(old_commands)
    cmd.eval().should.equal('bash somescript somefile.1 --conf somefile.4 > '
        'mp.1.1.output')
开发者ID:TorkamaniLab,项目名称:metapipe,代码行数:10,代码来源:test_command.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python default.MetarDecoderDefault类代码示例发布时间:2022-05-27
下一篇:
Python api.eval_object函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap