本文整理汇总了Python中metapipe.parser.Parser类的典型用法代码示例。如果您正苦于以下问题:Python Parser类的具体用法?Python Parser怎么用?Python Parser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Parser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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')
示例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)
示例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)
示例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')
示例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)
示例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')
示例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)
示例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)