本文整理汇总了Python中seqan.app_tests.runTest函数的典型用法代码示例。如果您正苦于以下问题:Python runTest函数的具体用法?Python runTest怎么用?Python runTest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了runTest函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: main
#.........这里部分代码省略.........
# Build Gold Standard
# ============================================================
conf = app_tests.TestConf(
program=path_to_build,
redir_stdout=ph.outFile('gold-adeno-hamming-08.stdout'),
args=['--distance-metric', 'hamming', '-e', '8',
'-o', ph.outFile('gold-adeno-hamming-08.gsi'),
'--reference', ph.outFile('adeno-genome.fa'),
'--in-sam', ph.inFile('gold-adeno-hamming-08.by_coordinate.sam')],
to_diff=[(ph.inFile('gold-adeno-hamming-08.stdout'),
ph.outFile('gold-adeno-hamming-08.stdout')),
(ph.inFile('gold-adeno-hamming-08.gsi'),
ph.outFile('gold-adeno-hamming-08.gsi'))])
conf_list.append(conf)
conf = app_tests.TestConf(
program=path_to_build,
redir_stdout=ph.outFile('gold-adeno-edit-08.stdout'),
args=['--distance-metric', 'edit', '-e', '8',
'-o', ph.outFile('gold-adeno-edit-08.gsi'),
'--reference', ph.outFile('adeno-genome.fa'),
'--in-sam', ph.inFile('gold-adeno-edit-08.by_coordinate.sam')],
to_diff=[(ph.inFile('gold-adeno-edit-08.stdout'),
ph.outFile('gold-adeno-edit-08.stdout')),
(ph.inFile('gold-adeno-edit-08.gsi'),
ph.outFile('gold-adeno-edit-08.gsi'))])
conf_list.append(conf)
# ============================================================
# Compare.
# ============================================================
conf = app_tests.TestConf(
program=path_to_evaluate,
redir_stdout=ph.outFile('razers2-adeno-hamming-08.stdout'),
args=['--distance-metric', 'hamming', '-e', '8',
'--reference', ph.outFile('adeno-genome.fa'),
'--in-sam', ph.inFile('razers2-adeno-hamming-08.sam'),
'--in-gsi', ph.inFile('gold-adeno-hamming-08.gsi')],
to_diff=[(ph.inFile('razers2-adeno-hamming-08.stdout'),
ph.outFile('razers2-adeno-hamming-08.stdout'))])
conf_list.append(conf)
conf = app_tests.TestConf(
program=path_to_evaluate,
redir_stdout=ph.outFile('razers2-adeno-hamming-04.stdout'),
args=['--distance-metric', 'hamming', '-e', '8',
'--reference', ph.outFile('adeno-genome.fa'),
'--in-sam', ph.inFile('razers2-adeno-hamming-04.sam'),
'--in-gsi', ph.inFile('gold-adeno-hamming-08.gsi')],
to_diff=[(ph.inFile('razers2-adeno-hamming-04.stdout'),
ph.outFile('razers2-adeno-hamming-04.stdout'))])
conf_list.append(conf)
conf = app_tests.TestConf(
program=path_to_evaluate,
redir_stdout=ph.outFile('razers2-adeno-edit-08.stdout'),
args=['--distance-metric', 'edit', '-e', '8',
'--reference', ph.outFile('adeno-genome.fa'),
'--in-sam', ph.inFile('razers2-adeno-edit-08.sam'),
'--in-gsi', ph.inFile('gold-adeno-edit-08.gsi')],
to_diff=[(ph.inFile('razers2-adeno-edit-08.stdout'),
ph.outFile('razers2-adeno-edit-08.stdout'))])
conf_list.append(conf)
conf = app_tests.TestConf(
program=path_to_evaluate,
redir_stdout=ph.outFile('razers2-adeno-edit-04.stdout'),
args=['--distance-metric', 'edit', '-e', '8',
'--reference', ph.outFile('adeno-genome.fa'),
'--in-sam', ph.inFile('razers2-adeno-edit-04.sam'),
'--in-gsi', ph.inFile('gold-adeno-edit-08.gsi')],
to_diff=[(ph.inFile('razers2-adeno-edit-04.stdout'),
ph.outFile('razers2-adeno-edit-04.stdout'))])
conf_list.append(conf)
# Execute the tests.
failures = 0
for conf in conf_list:
res = app_tests.runTest(conf)
# Output to the user.
print ' '.join([os.path.basename(conf.program)] + conf.args),
if res:
print 'OK'
else:
failures += 1
print 'FAILED'
# Cleanup.
ph.deleteTempDir()
print '=============================='
print ' total tests: %d' % len(conf_list)
print ' failed tests: %d' % failures
print 'successful tests: %d' % (len(conf_list) - failures)
print '=============================='
# Compute and return return code.
return failures != 0
开发者ID:CVroland,项目名称:seqan,代码行数:101,代码来源:run_tests.py
示例2: main
#.........这里部分代码省略.........
conf_list.append(conf)
# test 2
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('snp_store_realign.stdout'),
args=[ph.inFile('human-chr22-inf2.fa'),
ph.inFile('human-reads2.sam'),
'-re',
'-o', ph.outFile('snps_realign.vcf'),
'-id', ph.outFile('indels_realign.gff')],
to_diff=[(ph.inFile('snp_store_realign.stdout'),
ph.outFile('snp_store_realign.stdout')),
(ph.inFile('snps_realign.vcf'),
ph.outFile('snps_realign.vcf'),
transforms),
(ph.inFile('indels_realign.gff'),
ph.outFile('indels_realign.gff'))])
conf_list.append(conf)
# test 3
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('snp_store_realign_m1mp1oa.stdout'),
args=[ph.inFile('human-chr22-inf2.fa'),
ph.inFile('human-reads2.sam'),
'-it', str(1), '-re', '-oa', '-mp', str(1), '-m', 'maq', '-hq',
'-o', ph.outFile('snps_realign_m1mp1oa.vcf'),
'-id', ph.outFile('indels_realign_m1mp1oa.gff')],
to_diff=[(ph.inFile('snp_store_realign_m1mp1oa.stdout'),
ph.outFile('snp_store_realign_m1mp1oa.stdout')),
(ph.inFile('snps_realign_m1mp1oa.vcf'),
ph.outFile('snps_realign_m1mp1oa.vcf'),
transforms),
(ph.inFile('indels_realign_m1mp1oa.gff'),
ph.outFile('indels_realign_m1mp1oa.gff'))])
conf_list.append(conf)
# test 4
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('snp_store_realign_m0mp1oa.stdout'),
args=[ph.inFile('human-chr22-inf2.fa'),
ph.inFile('human-reads2.gff'),
'-it', str(2), '-re', '-oa', '-mp', str(1), '-hq',
'-o', ph.outFile('snps_realign_m0mp1oa.vcf'),
'-id', ph.outFile('indels_realign_m0mp1oa.gff')],
to_diff=[(ph.inFile('snp_store_realign_m0mp1oa.stdout'),
ph.outFile('snp_store_realign_m0mp1oa.stdout')),
(ph.inFile('snps_realign_m0mp1oa.vcf'),
ph.outFile('snps_realign_m0mp1oa.vcf'),
transforms),
(ph.inFile('indels_realign_m0mp1oa.gff'),
ph.outFile('indels_realign_m0mp1oa.gff'))])
conf_list.append(conf)
# test 5
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('snp_store_realign_m0mp1oa_it1ipt01.stdout'),
args=[ph.inFile('human-chr22-inf2.fa'),
ph.inFile('human-reads2.sam'),
'-it', str(1), '-ipt', str(0.1), '-osc', '-re', '-oa', '-hq',
'-o', ph.outFile('snps_realign_m0mp1oa_it1ipt01.vcf'),
'-id', ph.outFile('indels_realign_m0mp1oa_it1ipt01.gff')],
to_diff=[(ph.inFile('snp_store_realign_m0mp1oa_it1ipt01.stdout'),
ph.outFile('snp_store_realign_m0mp1oa_it1ipt01.stdout')),
(ph.inFile('snps_realign_m0mp1oa_it1ipt01.vcf'),
ph.outFile('snps_realign_m0mp1oa_it1ipt01.vcf'),
transforms),
(ph.inFile('indels_realign_m0mp1oa_it1ipt01.gff'),
ph.outFile('indels_realign_m0mp1oa_it1ipt01.gff'))])
conf_list.append(conf)
# ============================================================
# Execute the tests.
# ============================================================
failures = 0
for conf in conf_list:
res = app_tests.runTest(conf)
# Output to the user.
print ' '.join(['snp_store'] + conf.args),
if res:
print 'OK'
else:
failures += 1
print 'FAILED'
# Cleanup.
ph.deleteTempDir()
print '=============================='
print ' total tests: %d' % len(conf_list)
print ' failed tests: %d' % failures
print 'successful tests: %d' % (len(conf_list) - failures)
print '=============================='
# Compute and return return code.
return failures != 0
开发者ID:IsmailM,项目名称:seqan,代码行数:101,代码来源:run_tests.py
示例3: main
#.........这里部分代码省略.........
redir_stdout=ph.outFile('iso_r01_m200.A00_B00.stdout'),
args=['-o', ph.inFile('../example/r01/iso_r01_m200.A00'), '-c',
ph.inFile('../example/r01/iso_r01_m200.B00'), '-v', '2', '-i'],
to_diff=[(ph.inFile('iso_r01_m200.A00_B00.stdout'),
ph.outFile('iso_r01_m200.A00_B00.stdout'))])
conf_list.append(conf)
# Example 2
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('iso_r01_m200.A01_B01.stdout'),
args=['-o', ph.inFile('../example/r01/iso_r01_m200.A01'), '-c',
ph.inFile('../example/r01/iso_r01_m200.B01'), '-v', '2', '-i'],
to_diff=[(ph.inFile('iso_r01_m200.A01_B01.stdout'),
ph.outFile('iso_r01_m200.A01_B01.stdout'))])
conf_list.append(conf)
# Example 3
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('iso_r01_m200.A00_B01.stdout'),
args=['-o', ph.inFile('../example/r01/iso_r01_m200.A00'), '-c',
ph.inFile('../example/r01/iso_r01_m200.B01'), '-v', '2','-i'],
to_diff=[(ph.inFile('iso_r01_m200.A00_B01.stdout'),
ph.outFile('iso_r01_m200.A00_B01.stdout'))])
conf_list.append(conf)
# Example 4
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('iso_r01_m200.A00.stdout'),
args=['-o', ph.inFile('../example/r01/iso_r01_m200.A00'), '-v', '2'],
to_diff=[(ph.inFile('iso_r01_m200.A00.stdout'),
ph.outFile('iso_r01_m200.A00.stdout'))])
conf_list.append(conf)
# Example 5
#Example 6
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('srg_latin-4.stdout'),
args=['-o', ph.inFile('../example/srg/latin-4'), '-v', '2'],
to_diff=[(ph.inFile('srg_latin-4.stdout'),
ph.outFile('srg_latin-4.stdout'))])
conf_list.append(conf)
# Example 7
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('srg_lattice-4.stdout'),
args=['-o', ph.inFile('../example/srg/lattice-4'), '-v', '2'],
to_diff=[(ph.inFile('srg_lattice-4.stdout'),
ph.outFile('srg_lattice-4.stdout'))])
conf_list.append(conf)
# Example 8
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('srg_paley-5.stdout'),
args=['-o', ph.inFile('../example/srg/paley-5'), '-v', '2'],
to_diff=[(ph.inFile('srg_paley-5.stdout'),
ph.outFile('srg_paley-5.stdout'))])
conf_list.append(conf)
# Example 9
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('srg_sts7.stdout'),
args=['-o', ph.inFile('../example/srg/sts-7'), '-v', '2'],
to_diff=[(ph.inFile('srg_sts7.stdout'),
ph.outFile('srg_sts7.stdout'))])
conf_list.append(conf)
# Example 10
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('srg_triang-5.stdout'),
args=['-o', ph.inFile('../example/srg/triang-5'), '-v', '2'],
to_diff=[(ph.inFile('srg_triang-5.stdout'),
ph.outFile('srg_triang-5.stdout'))])
conf_list.append(conf)
# ============================================================
# Execute the tests.
# ============================================================
failures = 0
for conf in conf_list:
res = app_tests.runTest(conf)
# Output to the user.
print ' '.join(['sgip'] + conf.args),
if res:
print 'OK'
else:
failures += 1
print 'FAILED'
# Cleanup.
ph.deleteTempDir()
print '=============================='
print ' total tests: %d' % len(conf_list)
print ' failed tests: %d' % failures
print 'successful tests: %d' % (len(conf_list) - failures)
print '=============================='
# Compute and return return code.
return failures != 0
开发者ID:IsmailM,项目名称:seqan,代码行数:101,代码来源:run_tests.py
示例4: main
def main(source_base, binary_base):
"""Main entry point of the script."""
print 'Executing test for searchjoin'
print '==========================='
print
ph = app_tests.TestPathHelper(
source_base, binary_base,
'apps/searchjoin/tests') # tests dir
# ============================================================
# Auto-detect the binary path.
# ============================================================
path_to_join = app_tests.autolocateBinary(
binary_base, 'bin', 's4_join')
path_to_search = app_tests.autolocateBinary(
binary_base, 'bin', 's4_search')
# ============================================================
# Built TestConf list.
# ============================================================
# Build list with TestConf objects, analoguely to how the output
# was generated in generate_outputs.sh.
conf_list = []
# ============================================================
# Define program parameters.
# ============================================================
# Seed length
SL = {
'geo': ['5'],
'dna': ['10']
}
# Errors
K = {
'geo': ['0', '1', '3'],
'dna': ['0', '8', '16']
}
# Threads
THREADS = '4'
# ============================================================
# Configure Join Tests.
# ============================================================
for alphabet in ['geo', 'dna']:
for k in K[alphabet]:
for sl in SL[alphabet]:
conf = app_tests.TestConf(
program=path_to_join,
# redir_stdout=ph.outFile('join_%s_%s_%s.stdout' % (alphabet, k, sl)),
args=[ph.inFile('%s_database.csv' % alphabet), k,
'-i', alphabet,
'-t', THREADS,
'-sl', sl,
'-o', ph.outFile('join_%s_%s_%s.out' % (alphabet, k, sl))],
to_diff=[(ph.inFile('join_%s_%s.out' % (alphabet, k)),
ph.outFile('join_%s_%s_%s.out' % (alphabet, k, sl)),
transforms)])
conf_list.append(conf)
# ============================================================
# Configure Search Tests.
# ============================================================
for alphabet in ['geo', 'dna']:
for sl in SL[alphabet]:
conf = app_tests.TestConf(
program=path_to_search,
# redir_stdout=ph.outFile('search_%s_%s.stdout' % (alphabet, sl)),
args=[ph.inFile('%s_database.csv' % alphabet),
ph.inFile('%s_queries.csv' % alphabet),
'--no-wait',
'-i', alphabet,
'-t', THREADS,
'-sl', sl,
'-o', ph.outFile('search_%s_%s.out' % (alphabet, sl))],
to_diff=[(ph.inFile('search_%s.out' % (alphabet)),
ph.outFile('search_%s_%s.out' % (alphabet, sl)),
transforms)])
conf_list.append(conf)
# ============================================================
# Run Tests.
# ============================================================
# Execute the tests.
failures = 0
for conf in conf_list:
res = app_tests.runTest(conf)
# Output to the user.
print ' '.join([conf.program] + conf.args),
if res:
print 'OK'
else:
#.........这里部分代码省略.........
开发者ID:Garonenur,项目名称:seqan,代码行数:101,代码来源:run_tests.py
示例5: main
#.........这里部分代码省略.........
# Build list with TestConf objects, analoguely to how the output
# was generated in generate_outputs.sh.
conf_list = []
# We prepare a list of transforms to apply to the output files. This is
# used to strip the input/output paths from the programs' output to
# make it more canonical and host independent.
ph.outFile('-') # To ensure that the out path is set.
transforms = [
app_tests.ReplaceTransform(
os.path.join(ph.source_base_path,
'apps/fiona/tests') + os.sep,
'', right=True),
app_tests.ReplaceTransform(ph.temp_dir + os.sep, '', right=True),
app_tests.NormalizeScientificExponentsTransform(),
]
# ============================================================
# Run on uniformly random DNA.
# ============================================================
# Note that instead of comparing the results with expected results, we
# use a checker that computes the gain and compares it with a threshold.
# Illumina Mode
for i in [1, 2]:
min_gain = {1: 40.0, 2: 50.0}
conf = app_tests.TestConf(
program=path_to_fiona_illumina,
args=['-nt', '1',
'-i', str(i),
'-g', '10000',
ph.inFile('reads.illumina.fq'),
ph.outFile('reads.illumina.corrected.i%d.fa' % i)],
redir_stdout=ph.outFile('reads.illumina.fq.i%d.stdout' % i),
redir_stderr=ph.outFile('reads.illumina.fq.i%d.stderr' % i),
check_callback=ResultChecker(
path_to_compute_gain, ph.inFile('genome.10k.fa'),
ph.inFile('reads.illumina.sam'),
ph.outFile('reads.illumina.corrected.i%d.fa' % i),
min_gain.get(i, 100.0)),
to_diff=[(ph.inFile('reads.illumina.fq.i%d.stdout' % i),
ph.outFile('reads.illumina.fq.i%d.stdout' % i),
transforms),
(ph.inFile('reads.illumina.fq.i%d.stderr' % i),
ph.outFile('reads.illumina.fq.i%d.stderr' % i),
transforms),
])
conf_list.append(conf)
# Indel Mode
for i in [1, 2]:
min_gain = {1: 70.0, 2: 85.0}
conf = app_tests.TestConf(
program=path_to_fiona,
args=['-nt', '1',
'-i', str(i),
'-g', '10000',
ph.inFile('reads.454.fq'),
ph.outFile('reads.454.corrected.i%d.fa' % i)],
redir_stdout=ph.outFile('reads.454.fq.i%d.stdout' % i),
redir_stderr=ph.outFile('reads.454.fq.i%d.stderr' % i),
check_callback=ResultChecker(
path_to_compute_gain, ph.inFile('genome.10k.fa'),
ph.inFile('reads.454.sam'),
ph.outFile('reads.454.corrected.i%d.fa' % i),
min_gain.get(i, 100.0)),
to_diff=[(ph.inFile('reads.454.fq.i%d.stdout' % i),
ph.outFile('reads.454.fq.i%d.stdout' % i),
transforms),
(ph.inFile('reads.454.fq.i%d.stderr' % i),
ph.outFile('reads.454.fq.i%d.stderr' % i),
transforms),
])
conf_list.append(conf)
# Execute the tests.
failures = 0
for conf in conf_list:
res = app_tests.runTest(conf)
# Output to the user.
print ' '.join(conf.commandLineArgs())
if res:
print 'OK'
else:
failures += 1
print 'FAILED'
# Cleanup.
ph.deleteTempDir()
print '=============================='
print ' total tests: %d' % len(conf_list)
print ' failed tests: %d' % failures
print 'successful tests: %d' % (len(conf_list) - failures)
print '=============================='
# Compute and return return code.
return failures != 0
开发者ID:Garonenur,项目名称:seqan,代码行数:101,代码来源:run_tests.py
示例6: main
def main(source_base, binary_base):
"""Main entry point of the script."""
print 'Executing test for Yara'
print '=============================='
print
ph = app_tests.TestPathHelper(
source_base, binary_base,
'apps/yara/tests') # tests dir
# ============================================================
# Auto-detect the binary path.
# ============================================================
path_to_indexer = app_tests.autolocateBinary(
binary_base, 'bin', 'yara_indexer')
path_to_mapper = app_tests.autolocateBinary(
binary_base, 'bin', 'yara_mapper')
# ============================================================
# Built TestConf list.
# ============================================================
# Build list with TestConf objects, analoguely to how the output
# was generated in generate_outputs.sh.
conf_list = []
# ============================================================
# Run Indexer Tests
# ============================================================
for organism in ['adeno']:
# Get file extensions for the fm index files
exts = [os.path.basename(fname).split('.', 1)[-1]
for fname in glob.glob(ph.inFile('gold/%s-genome.*' % organism))]
conf = app_tests.TestConf(
program=path_to_indexer,
args=[ph.inFile('input/%s-genome.fa' % organism),
'-o', ph.outFile('%s-genome' % organism)],
to_diff=[(ph.inFile('gold/%s-genome.%s' % (organism, ext)),
ph.outFile('%s-genome.%s' % (organism, ext)), 'md5') for ext in exts])
conf_list.append(conf)
# ============================================================
# Run Single-End Mapper Tests
# ============================================================
# mapper_args = [
# ['--threads', '1' ]],
# ['--threads', '8' ]
# ]
# mapper_suffix = ['t1', 't8']
mapper_args = [[]]
mapper_suffix = ['t1']
for organism in ['adeno']:
for i in range(0, len(mapper_args)):
conf = app_tests.TestConf(
program=path_to_mapper,
args=[ph.inFile('gold/%s-genome' % organism),
ph.inFile('input/%s-reads_1.fa' % organism),
'-o', ph.outFile('%s-reads_1.%s.sam' % (organism, mapper_suffix[i]))] +
mapper_args[i],
to_diff=[(ph.inFile('gold/%s-reads_1.%s.sam' % (organism, mapper_suffix[i])),
ph.outFile('%s-reads_1.%s.sam' % (organism, mapper_suffix[i])),
sam_transforms)])
conf_list.append(conf)
# ============================================================
# Execute the tests
# ============================================================
failures = 0
for conf in conf_list:
res = app_tests.runTest(conf)
# Output to the user.
print ' '.join([conf.program] + conf.args),
if res:
print 'OK'
else:
failures += 1
print 'FAILED'
# Cleanup.
ph.deleteTempDir()
print '=============================='
print ' total tests: %d' % len(conf_list)
print ' failed tests: %d' % failures
print 'successful tests: %d' % (len(conf_list) - failures)
print '=============================='
# Compute and return return code.
return failures != 0
开发者ID:Garonenur,项目名称:seqan,代码行数:99,代码来源:run_tests.py
示例7: main
def main(source_base, binary_base):
"""Main entry point of the script."""
print 'Executing test for sam2matrix'
print '============================='
print
ph = app_tests.TestPathHelper(
source_base, binary_base,
'apps/sam2matrix/tests') # tests dir
# ============================================================
# Auto-detect the binary path.
# ============================================================
path_to_program = app_tests.autolocateBinary(
binary_base, 'apps/sam2matrix', 'sam2matrix')
# ============================================================
# Built TestConf list.
# ============================================================
# Build list with TestConf objects, analoguely to how the output
# was generated in generate_outputs.sh.
conf_list = []
# ============================================================
# First Section.
# ============================================================
# App TestConf objects to conf_list, just like this for each
# test you want to run.
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('out.stdout'),
args=['-m', ph.inFile('ecoli.sam'), '-m', ph.inFile('ehec.sam'), '-r',
ph.inFile('ecoli_0.50_ehec_0.50.fq'), '-rf', 'ecoli.fa', '-rf',
'ehec.fa', '-o', ph.outFile('test_sam2matrix.tsv')],
to_diff=[(ph.inFile('out.stdout'),
ph.outFile('out.stdout')),
(ph.inFile('gold.tsv'),
ph.outFile('test_sam2matrix.tsv'))])
conf_list.append(conf)
# ============================================================
# Execute the tests.
# ============================================================
failures = 0
for conf in conf_list:
res = app_tests.runTest(conf)
# Output to the user.
print ' '.join(['sam2matrix'] + conf.args),
if res:
print 'OK'
else:
failures += 1
print 'FAILED'
# Cleanup.
ph.deleteTempDir()
print '=============================='
print ' total tests: %d' % len(conf_list)
print ' failed tests: %d' % failures
print 'successful tests: %d' % (len(conf_list) - failures)
print '=============================='
# Compute and return return code.
return failures != 0
开发者ID:Garonenur,项目名称:seqan,代码行数:68,代码来源:run_tests.py
示例8: main
def main(source_base, binary_base):
"""Main entry point of the script."""
print 'Executing test for tree_recomb'
print '=============================='
print
ph = app_tests.TestPathHelper(
source_base, binary_base,
'core/apps/tree_recon/tests') # tests dir
# ============================================================
# Auto-detect the binary path.
# ============================================================
path_to_program = app_tests.autolocateBinary(
binary_base, 'core/apps/tree_recon', 'tree_recon')
# ============================================================
# Built TestConf list.
# ============================================================
# Build list with TestConf objects, analoguely to how the output
# was generated in generate_outputs.sh.
conf_list = []
for i in [1, 2, 3]:
conf = app_tests.TestConf(
program=path_to_program,
args=['-m', ph.inFile('example%d.dist' % i),
'-o', ph.outFile('example%d.out' % i)],
to_diff=[(ph.inFile('example%d.out' % i),
ph.outFile('example%d.out' % i))])
conf_list.append(conf)
for i in [1, 2, 3]:
for b in ['nj', 'min', 'max', 'avg', 'wavg']:
if i == 1 and b == 'avg':
continue # Skip, rounding problems MSVC vs GCC.
conf = app_tests.TestConf(
program=path_to_program,
args=['-b', b,
'-m', ph.inFile('example%d.dist' % i),
'-o', ph.outFile('example%d.%s.out' % (i, b))],
to_diff=[(ph.inFile('example%d.%s.out' % (i, b)),
ph.outFile('example%d.%s.out' % (i, b)))])
conf_list.append(conf)
for i in [1, 2, 3]:
for f in ['dot', 'newick']:
conf = app_tests.TestConf(
program=path_to_program,
args=['-f', f,
'-m', ph.inFile('example%d.dist' % i),
'-o', ph.outFile('example%d.%s.out' % (i, f))],
to_diff=[(ph.inFile('example%d.%s.out' % (i, f)),
ph.outFile('example%d.%s.out' % (i, f)))])
conf_list.append(conf)
# Execute the tests.
failures = 0
for conf in conf_list:
res = app_tests.runTest(conf)
# Output to the user.
print ' '.join(['tree_recomb'] + conf.args),
if res:
print 'OK'
else:
failures += 1
print 'FAILED'
# Cleanup.
ph.deleteTempDir()
print '=============================='
print ' total tests: %d' % len(conf_list)
print ' failed tests: %d' % failures
print 'successful tests: %d' % (len(conf_list) - failures)
print '=============================='
# Compute and return return code.
return failures != 0
开发者ID:pombredanne,项目名称:seqan-mirror,代码行数:78,代码来源:run_tests.py
示例9: main
#.........这里部分代码省略.........
ph.outFile("simulator.left5.fq"),
"-or",
ph.outFile("simulator.right5.fq"),
],
redir_stdout=ph.outFile("simulator.out5.stdout"),
redir_stderr=ph.outFile("simulator.out5.stderr"),
to_diff=[
(ph.inFile("simulator.left5.fq"), ph.outFile("simulator.left5.fq")),
(ph.inFile("simulator.right5.fq"), ph.outFile("simulator.right5.fq")),
(ph.inFile("simulator.out5.stdout"), ph.outFile("simulator.out5.stdout"), transforms),
(ph.inFile("simulator.out5.stderr"), ph.outFile("simulator.out5.stderr"), transforms),
],
)
conf_list.append(conf)
conf = app_tests.TestConf(
program=path_to_simulator,
args=[
"-n",
"1000",
"-ir",
ph.inFile("random.fasta"),
"-iv",
ph.inFile("random_var1.vcf"),
"--meth-fasta-in",
ph.inFile("random_meth1.fasta"),
"--methylation-levels",
"--enable-bs-seq",
"-o",
ph.outFile("simulator.left6.fq"),
"-or",
ph.outFile("simulator.right6.fq"),
],
redir_stdout=ph.outFile("simulator.out6.stdout"),
redir_stderr=ph.outFile("simulator.out6.stderr"),
to_diff=[
(ph.inFile("simulator.left6.fq"), ph.outFile("simulator.left6.fq")),
(ph.inFile("simulator.right6.fq"), ph.outFile("simulator.right6.fq")),
(ph.inFile("simulator.out6.stdout"), ph.outFile("simulator.out6.stdout"), transforms),
(ph.inFile("simulator.out6.stderr"), ph.outFile("simulator.out6.stderr"), transforms),
],
)
conf_list.append(conf)
# 454 Model
conf = app_tests.TestConf(
program=path_to_simulator,
args=[
"--seq-technology",
"454",
"--fragment-mean-size",
"800",
"--454-read-length-mean",
"200",
"--454-read-length-stddev",
"20",
"-n",
"1000",
"-v",
"-ir",
ph.inFile("random.fasta"),
"-o",
ph.outFile("simulator.left8.fq"),
"-oa",
ph.outFile("simulator.out8.sam"),
],
redir_stdout=ph.outFile("simulator.out8.stdout"),
redir_stderr=ph.outFile("simulator.out8.stderr"),
to_diff=[
(ph.inFile("simulator.left8.fq"), ph.outFile("simulator.left8.fq")),
(ph.inFile("simulator.out8.sam"), ph.outFile("simulator.out8.sam")),
(ph.inFile("simulator.out8.stdout"), ph.outFile("simulator.out8.stdout"), transforms),
(ph.inFile("simulator.out8.stderr"), ph.outFile("simulator.out8.stderr"), transforms),
],
)
conf_list.append(conf)
# Execute the tests.
failures = 0
for conf in conf_list:
res = app_tests.runTest(conf)
# Output to the user.
print " ".join([os.path.basename(conf.program)] + conf.args),
if res:
print "OK"
else:
failures += 1
print "FAILED"
# Cleanup.
ph.deleteTempDir()
print "=============================="
print " total tests: %d" % len(conf_list)
print " failed tests: %d" % failures
print "successful tests: %d" % (len(conf_list) - failures)
print "=============================="
# Compute and return return code.
return failures != 0
开发者ID:Garonenur,项目名称:seqan,代码行数:101,代码来源:run_tests.py
示例10: main
def main(source_base, binary_base):
"""Main entry point of the script."""
print 'Executing test for %(APP_NAME)s'
print '========================='
print
ph = app_tests.TestPathHelper(
source_base, binary_base,
'%(LOCATION)s/tests') # tests dir
# ============================================================
# Auto-detect the binary path.
# ============================================================
path_to_program = app_tests.autolocateBinary(
binary_base, '%(LOCATION)s', '%(APP_NAME)s')
# ============================================================
# Built TestConf list.
# ============================================================
# Build list with TestConf objects, analoguely to how the output
# was generated in generate_outputs.sh.
conf_list = []
# ============================================================
# First Section.
# ============================================================
# App TestConf objects to conf_list, just like this for each
# test you want to run.
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('STDOUT_FILE'),
args=['ARGS', 'MUST', 'BE', 'STRINGS', str(1), str(99),
ph.inFile('INPUT_FILE1'),
ph.inFile('INPUT_FILE2')],
to_diff=[(ph.inFile('STDOUT_FILE'),
ph.outFile('STDOUT_FILE')),
(ph.inFile('INPUT_FILE1'),
ph.outFile('INPUT_FILE1'))])
conf_list.append(conf)
# ============================================================
# Execute the tests.
# ============================================================
failures = 0
for conf in conf_list:
res = app_tests.runTest(conf)
# Output to the user.
print ' '.join(['%(APP_NAME)s'] + conf.args),
if res:
print 'OK'
else:
failures += 1
print 'FAILED'
# Cleanup.
ph.deleteTempDir()
print '=============================='
print ' total tests: %%d' %% len(conf_list)
print ' failed tests: %%d' %% failures
print 'successful tests: %%d' %% (len(conf_list) - failures)
print '=============================='
# Compute and return return code.
return failures != 0
开发者ID:pombredanne,项目名称:seqan-mirror,代码行数:68,代码来源:run_tests.py
示例11: main
#.........这里部分代码省略.........
# -st 1 -m stellar.gff
# ============================================================
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('st1_l30_m.stdout'),
redir_stderr=ph.outFile('st1_l30_m.stderr'),
args=[ph.inFile('adeno.fa'),
ph.inFile('adeno_modified_reads.fa'),
'-m', ph.inFile('stellar.gff'),
'-gff', ph.outFile('st1_l30_m.gff'),
'-vcf', ph.outFile('st1_l30_m.vcf'),
'-st', str(1),
],
to_diff=[(ph.inFile('st1_l30_m.vcf'),
ph.outFile('st1_l30_m.vcf'),
transforms),
(ph.inFile('st1_l30_m.gff'),
ph.outFile('st1_l30_m.gff'))])
conf_list.append(conf)
#out="st1_l30_m"
#${GUSTAF} adeno.fa adeno_modified_reads.fa -st 1 -m stellar.gff -gff ${out}.gff -vcf ${out}.vcf > ${out}.stdout 2> ${out}.stderr
# ============================================================
# -st 1 -l 30 -ith 5
# ============================================================
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('st1_l30_ith5.stdout'),
redir_stderr=ph.outFile('st1_l30_ith5.stderr'),
args=[ph.inFile('adeno.fa'),
ph.inFile('adeno_modified_reads.fa'),
'-gff', ph.outFile('st1_l30_ith5.gff'),
'-vcf', ph.outFile('st1_l30_ith5.vcf'),
'-st', str(1),
'-l', str(30),
'-ith', str(5),
],
to_diff=[(ph.inFile('st1_l30_m.vcf'),
ph.outFile('st1_l30_m.vcf'),
transforms),
(ph.inFile('st1_l30_ith5.gff'),
ph.outFile('st1_l30_ith5.gff'))])
conf_list.append(conf)
#out="st1_l30_ith5"
#${GUSTAF} adeno.fa adeno_modified_reads.fa -st 1 -l 30 -ith 5 -gff ${out}.gff -vcf ${out}.vcf > ${out}.stdout 2> ${out}.stderr
# ============================================================
# -st 1 -l 30 -gth 3
# ============================================================
conf = app_tests.TestConf(
program=path_to_program,
redir_stdout=ph.outFile('st1_l30_gth3.stdout'),
redir_stderr=ph.outFile('st1_l30_gth3.stderr'),
args=[ph.inFile('adeno.fa'),
ph.inFile('adeno_modified_reads.fa'),
'-gff', ph.outFile('st1_l30_gth3.gff'),
'-vcf', ph.outFile('st1_l30_gth3.vcf'),
'-st', str(1),
'-l', str(30),
'-gth', str(3),
],
to_diff=[(ph.inFile('st1_l30_m.vcf'),
ph.outFile('st1_l30_m.vcf'),
transforms),
(ph.inFile('st1_l30_gth3.gff'),
ph.outFile('st1_l30_gth3.gff'))])
conf_list.append(conf)
#out="st1_l30_gth3"
#${GUSTAF} adeno.fa adeno_modified_reads.fa -st 1 -l 30 -gth 3 -gff ${out}.gff -vcf ${out}.vcf > ${out}.stdout 2> ${out}.stderr
# ============================================================
# Execute the tests.
# ============================================================
failures = 0
for conf in conf_list:
res = app_tests.runTest(conf)
# Output to the user.
print ' '.join(['gustaf'] + conf.args),
if res:
print 'OK'
else:
failures += 1
print 'FAILED'
# Cleanup.
ph.deleteTempDir()
print '=============================='
print ' total tests: %d' % len(conf_list)
print ' failed tests: %d' % failures
print 'successful tests: %d' % (len(conf_list) - failures)
print '=============================='
# Compute and return return code.
return failures != 0
开发者ID:CVroland,项目名称:seqan,代码行数:101,代码来源:run_tests.py
示例12: main
#.........这里部分代码省略.........
'-oa', ph.outFile('alns1.%s.sam' % method),
],
redir_stdout=ph.outFile('alns1.%s.sam.stdout' % method),
redir_stderr=ph.outFile('alns1.%s.sam.stderr' % method),
to_diff=[(ph.inFile('alns1.%s.fa' % method),
ph.outFile('alns1.%s.fa' % method)),
(ph.inFile('alns1.%s.sam' % method),
ph.outFile('alns1.%s.sam' % method)),
(ph.inFile('alns1.%s.sam.stderr' % method),
ph.outFile('alns1.%s.sam.stderr' % method),
transforms),
(ph.inFile('alns1.%s.sam.stdout' % method),
ph.outFile('alns1.%s.sam.stdout' % method),
transforms),
])
conf_list.append(conf)
# all consensus variants (except for align) for SAM input
for oa_ext in ['.sam', '.txt']:
for method in ['overlap_consensus', 'pos_consensus',
'contig_consensus', 'realign', 'nop']:
args = ['-m', method,
'-i', ph.inFile('alns1.sam'),
'-oa', ph.outFile('alns1.%s%s' % (method, oa_ext)),
]
to_diff = [(ph.inFile('alns1.%s.fa' % method),
ph.outFile('alns1.%s.fa' % method)),
(ph.inFile('alns1.%s%s' % (method, oa_ext)),
ph.outFile('alns1.%s%s' % (method, oa_ext))),
(ph.inFile('alns1.%s%s.stderr' % (method, oa_ext)),
ph.outFile('alns1.%s%s.stderr' % (method, oa_ext)),
transforms),
(ph.inFile('alns1.%s%s.stdout' % (method, oa_ext)),
ph.outFile('alns1.%s%s.stdout' % (method, oa_ext)),
transforms)
]
if oa_ext != '.txt':
args += ['-oc', ph.outFile('alns1.%s.fa' % method),]
to_diff += [(ph.inFile('alns1.%s.fa' % method),
ph.outFile('alns1.%s.fa' % method))]
conf = app_tests.TestConf(
program=path_to_seqcons,
args=args,
redir_stdout=ph.outFile('alns1.%s%s.stdout' % (method, oa_ext)),
redir_stderr=ph.outFile('alns1.%s%s.stderr' % (method, oa_ext)),
to_diff=to_diff)
conf_list.append(conf)
# align_consensus for longer sequences that are roughly globally similar
for oa_ext in ['.sam', '.txt']:
for method in ['align_consensus']:
args = ['-m', method,
'-i', ph.inFile('seqs2.fa'),
'-oa', ph.outFile('seqs2.%s%s' % (method, oa_ext)),
]
to_diff = [(ph.inFile('seqs2.%s.fa' % method),
ph.outFile('seqs2.%s.fa' % method)),
(ph.inFile('seqs2.%s%s' % (method, oa_ext)),
ph.outFile('seqs2.%s%s' % (method, oa_ext))),
(ph.inFile('seqs2.%s%s.stderr' % (method, oa_ext)),
ph.outFile('seqs2.%s%s.stderr' % (method, oa_ext)),
transforms),
(ph.inFile('seqs2.%s%s.stdout' % (method, oa_ext)),
ph.outFile('seqs2.%s%s.stdout' % (method, oa_ext)),
transforms)
]
if oa_ext != '.txt':
args += ['-oc', ph.outFile('seqs2.%s.fa' % method),]
to_diff += [(ph.inFile('seqs2.%s.fa' % method),
ph.outFile('seqs2.%s.fa' % method))]
conf = app_tests.TestConf(
program=path_to_seqcons,
args=args,
redir_stdout=ph.outFile('seqs2.%s%s.stdout' % (method, oa_ext)),
redir_stderr=ph.outFile('seqs2.%s%s.stderr' % (method, oa_ext)),
to_diff=to_diff)
conf_list.append(conf)
# Execute the tests.
failures = 0
for conf in conf_list:
res = app_tests.runTest(conf)
# Output to the user.
print ' '.join([os.path.basename(conf.program)] + conf.args),
if res:
print 'OK'
else:
failures += 1
print 'FAILED'
# Cleanup.
ph.deleteTempDir()
print '=============================='
print ' total tests: %d' % len(conf_list)
print ' failed tests: %d' % failures
print 'successful tests: %d' % (len(conf_list) - failures)
print '=============================='
# Compute and return return code.
return failures != 0
开发者ID:Garonenur,项目名称:seqan,代码行数:101,代码来源:run_tests.py
示例13: main
def main(source_base, binary_base):
"""Main entry point of the script."""
print 'Executing test for roi_intersect'
print '================================'
print
ph = app_tests.TestPathHelper(
source_base, binary_base,
'extras/apps/ngs_roi/tests') # tests dir
# ============================================================
# Auto-detect the binary path.
# ============================================================
path_to_project = app_tests.autolocateBinary(
binary_base, 'extras/apps/ngs_roi', 'roi_feature_projection')
path_to_bam2roi = app_tests.autolocateBinary(
binary_base, 'extras/apps/ngs_roi', 'bam2roi')
# ============================================================
# Built TestConf list.
# ============================================================
# Build list with TestConf objects, analoguely to how the output
# was generated in generate_outputs.sh.
conf_list = []
# We prepare a list of transforms to apply to the output files. This is
# used to strip the input/output paths from the programs' output to
# make it more canonical and host independent.
ph.outFile('-') # To ensure that the out path is set.
transforms = [
app_tests.ReplaceTransform(os.path.join(ph.source_base_path, 'extras/apps/ngs_roi/tests') + os.sep, '', right=True),
app_tests.ReplaceTransform(ph.tem
|
请发表评论