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

Python app_tests.autolocateBinary函数代码示例

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

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



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

示例1: main

def main(source_base, binary_base):
    """Main entry point of the script."""

    print 'Executing test for rabema'
    print '========================='
    print
    
    ph = app_tests.TestPathHelper(
        source_base, binary_base,
        'core/apps/rabema/tests')  # tests dir

    # ============================================================
    # Auto-detect the binary path.
    # ============================================================

    path_to_prepare = app_tests.autolocateBinary(
      binary_base, 'core/apps/rabema', 'rabema_prepare_sam')
    path_to_build = app_tests.autolocateBinary(
      binary_base, 'core/apps/rabema', 'rabema_build_gold_standard')
    path_to_evaluate = app_tests.autolocateBinary(
      binary_base, 'core/apps/rabema', 'rabema_evaluate')

    # ============================================================
    # Copy Files To Temp Dir.
    # ============================================================

    # We copy over the genome because an FAI file will be created.
    shutil.copyfile(ph.inFile('adeno-genome.fa'),
                    ph.outFile('adeno-genome.fa'))

    # ============================================================
    # Build TestConf list.
    # ============================================================

    # Build list with TestConf objects, analoguely to how the output
    # was generated in generate_outputs.sh.
    conf_list = []

    # ============================================================
    # Prepare SAM
    # ============================================================

    conf = app_tests.TestConf(
        program=path_to_prepare,
        args=['-i', ph.inFile('gold-adeno-hamming-08.sam'),
              '-o', ph.outFile('gold-adeno-hamming-08.by_qname.sam')],
        to_diff=[(ph.inFile('gold-adeno-hamming-08.by_qname.sam'),
                  ph.outFile('gold-adeno-hamming-08.by_qname.sam'))])
    conf_list.append(conf)
    conf = app_tests.TestConf(
        program=path_to_prepare,
        args=['-i', ph.inFile('gold-adeno-edit-08.sam'),
              '-o', ph.outFile('gold-adeno-edit-08.by_qname.sam')],
        to_diff=[(ph.inFile('gold-adeno-edit-08.by_qname.sam'),
                  ph.outFile('gold-adeno-edit-08.by_qname.sam'))])
    conf_list.append(conf)

    # ============================================================
    # 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'))])
#.........这里部分代码省略.........
开发者ID:CVroland,项目名称:seqan,代码行数:101,代码来源:run_tests.py


示例2: main

def main(source_base, binary_base):
    """Main entry point of the script."""

    print 'Executing test for snp_store'
    print '========================='
    print
    
    ph = app_tests.TestPathHelper(
        source_base, binary_base,
        'apps/snp_store/tests')  # tests dir

    # ============================================================
    # Auto-detect the binary path.
    # ============================================================

    path_to_program = app_tests.autolocateBinary(
      binary_base, 'apps/snp_store', 'snp_store')

    # ============================================================
    # 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.RegexpReplaceTransform("#.*snp_store.exe", "#snp_store"),
        app_tests.RegexpReplaceTransform("#[^ ]+snp_store", "#snp_store"),
        app_tests.ReplaceTransform(ph.inFile(''), ''),
        app_tests.ReplaceTransform(ph.outFile(''), ''),
        ]

    # ============================================================
    # First Section.
    # ============================================================

    # App TestConf objects to conf_list, just like this for each
    # test you want to run.
    # default
    conf = app_tests.TestConf(
        program=path_to_program,
        redir_stdout=ph.outFile('snp_store_default.stdout'),
        args=[ph.inFile('human-chr22-inf2.fa'),
              ph.inFile('human-reads2.gff'),
              '-o', ph.outFile('snps_default.vcf'),
              '-id', ph.outFile('indels_default.gff'),],
        to_diff=[(ph.inFile('snp_store_default.stdout'),
                  ph.outFile('snp_store_default.stdout')),
                 (ph.inFile('snps_default.vcf'),
                  ph.outFile('snps_default.vcf'),
                  transforms),
                 (ph.inFile('indels_default.gff'),
                  ph.outFile('indels_default.gff',))])
    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'),
#.........这里部分代码省略.........
开发者ID:IsmailM,项目名称:seqan,代码行数:101,代码来源:run_tests.py


示例3: main

def main(source_base, binary_base):
    """Main entry point of the script."""

    print 'Executing test for sgip'
    print '========================='
    print
    
    ph = app_tests.TestPathHelper(
        source_base, binary_base,
        'apps/sgip/tests')  # tests dir

    # ============================================================
    # Auto-detect the binary path.
    # ============================================================

    path_to_program = app_tests.autolocateBinary(
      binary_base, 'apps/sgip', 'sgip')

    # ============================================================
    # 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.
    
    # Example 1
    conf = app_tests.TestConf(
        program=path_to_program,
        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'],
#.........这里部分代码省略.........
开发者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

def main(source_base, binary_base):
    """Main entry point of the script."""

    print 'Executing test for fiona'
    print '========================'
    print

    ph = app_tests.TestPathHelper(
        source_base, binary_base,
        'apps/fiona/tests')  # tests dir

    # ============================================================
    # Auto-detect the binary path.
    # ============================================================

    path_to_fiona = app_tests.autolocateBinary(
      binary_base, 'apps/fiona', 'fiona')
    path_to_fiona_illumina = app_tests.autolocateBinary(
      binary_base, 'apps/fiona', 'fiona_illumina')
    path_to_compute_gain = app_tests.autolocateBinary(
      binary_base, 'apps/fiona', 'compute_gain')

    # ============================================================
    # 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,
                         '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),
#.........这里部分代码省略.........
开发者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

def main(source_base, binary_base):
    """Main entry point of the script."""

    print "Executing test for mason_variator"
    print "======================"
    print

    ph = app_tests.TestPathHelper(source_base, binary_base, "apps/mason2/tests")  # tests dir

    # ============================================================
    # Auto-detect the binary path.
    # ============================================================

    path_to_genome = app_tests.autolocateBinary(binary_base, "bin", "mason_genome")
    path_to_methylation = app_tests.autolocateBinary(binary_base, "bin", "mason_methylation")
    path_to_variator = app_tests.autolocateBinary(binary_base, "bin", "mason_variator")
    path_to_materializer = app_tests.autolocateBinary(binary_base, "bin", "mason_materializer")
    path_to_simulator = app_tests.autolocateBinary(binary_base, "bin", "mason_simulator")

    # ============================================================
    # 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, "apps/mason2/tests") + os.sep, "", right=True),
        app_tests.ReplaceTransform(ph.temp_dir + os.sep, "", right=True),
        app_tests.NormalizeScientificExponentsTransform(),
    ]

    # ============================================================
    # Test mason_genome
    # ============================================================

    conf = app_tests.TestConf(
        program=path_to_genome,
        args=["-l", "1000", "-o", ph.outFile("genome.test1.fasta")],
        redir_stdout=ph.outFile("genome.test1.stdout"),
        redir_stderr=ph.outFile("genome.test1.stderr"),
        to_diff=[
            (ph.inFile("genome.test1.fasta"), ph.outFile("genome.test1.fasta")),
            (ph.inFile("genome.test1.stdout"), ph.outFile("genome.test1.stdout"), transforms),
            (ph.inFile("genome.test1.stderr"), ph.outFile("genome.test1.stderr"), transforms),
        ],
    )
    conf_list.append(conf)
    conf = app_tests.TestConf(
        program=path_to_genome,
        args=["-s", "1", "-l", "1000", "-l", "100", "-o", ph.outFile("genome.test2.fasta")],
        redir_stdout=ph.outFile("genome.test2.stdout"),
        redir_stderr=ph.outFile("genome.test2.stderr"),
        to_diff=[
            (ph.inFile("genome.test2.fasta"), ph.outFile("genome.test2.fasta")),
            (ph.inFile("genome.test2.stdout"), ph.outFile("genome.test2.stdout"), transforms),
            (ph.inFile("genome.test2.stderr"), ph.outFile("genome.test2.stderr"), transforms),
        ],
    )
    conf_list.append(conf)

    # ============================================================
    # Test mason_methylation
    # ============================================================

    conf = app_tests.TestConf(
        program=path_to_methylation,
        args=["--seed", "33", "-i", ph.inFile("random.fasta"), "-o", ph.outFile("random_meth1.fasta")],
        redir_stdout=ph.outFile("methylation.test1.stdout"),
        redir_stderr=ph.outFile("methylation.test1.stderr"),
        to_diff=[
            (ph.inFile("methylation.test1.fasta"), ph.outFile("methylation.test1.fasta")),
            (ph.inFile("methylation.test1.stdout"), ph.outFile("methylation.test1.stdout"), transforms),
            (ph.inFile("methylation.test1.stderr"), ph.outFile("methylation.test1.stderr"), transforms),
        ],
    )

    # ============================================================
    # Test mason_variator
    # ============================================================

    # Generation methylation in variator.
    conf = app_tests.TestConf(
        program=path_to_variator,
        args=[
            "-ir",
            ph.inFile("random.fasta"),
            "-n",
            "2",
            "-ov",
            ph.outFile("random_var1.vcf"),
            "-of",
            ph.outFile("random_var1.fasta"),
            "--snp-rate",
            "0.001",
#.........这里部分代码省略.........
开发者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

def main(source_base, binary_base):
    """Main entry point of the script."""

    print 'Executing test for gustaf'
    print '==============================='
    print

    ph = app_tests.TestPathHelper(
         source_base, binary_base,
         'extras/apps/gustaf/tests')  # tests dir

    # ============================================================
    # Auto-detect the binary path.
    # ============================================================

    path_to_program = app_tests.autolocateBinary(
      binary_base, 'bin', 'gustaf')

    # ============================================================
    # 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/gustaf/tests') + os.sep,
            '', right=True),
        app_tests.ReplaceTransform(ph.temp_dir + os.sep, '', right=True),
        app_tests.NormalizeScientificExponentsTransform(),
        ]

    # ============================================================
    # Adeno Tests
    # ============================================================
    # ============================================================
    # Sanity check with default values and empty output file
    # ============================================================


    conf = app_tests.TestConf(
        program=path_to_program,
        redir_stdout=ph.outFile('st2_l100.stdout'),
        redir_stderr=ph.outFile('st2_l100.stderr'),
        args=[ph.inFile('adeno.fa'),
              ph.inFile('adeno_modified_reads.fa'),
              '-gff', ph.outFile('st2_l100.gff'),
              '-vcf', ph.outFile('st2_l100.vcf'),
              ],
        to_diff=[(ph.inFile('st2_l100.vcf'),
                  ph.outFile('st2_l100.vcf'),
                  transforms),
                 (ph.inFile('st2_l100.gff'),
                  ph.outFile('st2_l100.gff'))])
    conf_list.append(conf)

    #out="st2_l100"
    #${GUSTAF} adeno.fa adeno_modified_reads.fa -gff ${out}.gff -vcf ${out}.vcf > ${out}.stdout 2> ${out}.stderr

    # ============================================================
    # -st 1 -l 30
    # ============================================================


    conf = app_tests.TestConf(
        program=path_to_program,
        redir_stdout=ph.outFile('st1_l30.stdout'),
        redir_stderr=ph.outFile('st1_l30.stderr'),
        args=[ph.inFile('adeno.fa'),
              ph.inFile('adeno_modified_reads.fa'),
              '-gff', ph.outFile('st1_l30.gff'),
              '-vcf', ph.outFile('st1_l30.vcf'),
              '-st', str(1),
              '-l', str(30),
              ],
        to_diff=[(ph.inFile('st1_l30.vcf'),
                  ph.outFile('st1_l30.vcf'),
                  transforms),
                 (ph.inFile('st1_l30.gff'),
                  ph.outFile('st1_l30.gff'))])
    conf_list.append(conf)

    #out="st1_l30"
    #${GUSTAF} adeno.fa adeno_modified_reads.fa -st 1 -l 30 -gff ${out}.gff -vcf ${out}.vcf > ${out}.stdout 2> ${out}.stderr

    # ============================================================
    # -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'),
#.........这里部分代码省略.........
开发者ID:CVroland,项目名称:seqan,代码行数:101,代码来源:run_tests.py


示例12: main

def main(source_base, binary_base):
    """Main entry point of the script."""

    print 'Executing test for seqcons2'
    print '==========================='
    print

    ph = app_tests.TestPathHelper(
        source_base, binary_base,
        'apps/seqcons2/tests')  # tests dir

    # ============================================================
    # Auto-detect the binary path.
    # ============================================================

    path_to_seqcons = app_tests.autolocateBinary(
      binary_base, 'bin', 'seqcons2')

    # ============================================================
    # 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,
                         'apps/seqcons2/tests') + os.sep,
            '', right=True),
        app_tests.ReplaceTransform(ph.temp_dir + os.sep, '', right=True),
        app_tests.RegexpReplaceTransform(r'Overall time: .*s', r'Overall time: <removed>s', right=True, left=True),
        app_tests.NormalizeScientificExponentsTransform(),
        ]

    # ============================================================
    # Test seqcons2
    # ============================================================

    # overlap_consensus and nop for FASTA input
    for method in ['overlap_consensus', 'nop']:
        conf = app_tests.TestConf(
            program=path_to_seqcons,
            args=['-m', method,
                  '-i', ph.inFile('alns1.sam'),
                  '-oc', ph.outFile('alns1.%s.fa' % method),
                  '-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
#.........这里部分代码省略.........
开发者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')  # te 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python app_tests.main函数代码示例发布时间:2022-05-27
下一篇:
Python seq_tests_common.compare_records函数代码示例发布时间: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