Ejemplo n.º 1
0
def main():
    # Get command line options
    opts, args = init_options()
    print "Annotating " + opts.infile

    all_replicons = common.read_replicon_names(opts.fasta)

    # Separate multiple annotation files
    annofile_list = opts.annofiles.split(",")
    if len(annofile_list) != len(all_replicons):
        print "ERROR: wrong number of replicon names for replicon files"
        exit(1)
    print "Using " + str(len(annofile_list)) + " .ptt files"

    annotations = common.read_annotations(annofile_list, all_replicons)

    lines_written = write_annotated(opts.infile, opts.outfile, annotations)
    print str(lines_written) + " lines written to " + opts.outfile
Ejemplo n.º 2
0
def main():
    # Get command line options
    opts, args = init_options()
    print "Annotating " + opts.infile

    all_replicons = common.read_replicon_names(opts.fasta)

    # Separate multiple annotation files
    annofile_list = opts.annofiles.split(",")
    if len(annofile_list) != len(all_replicons):
        print "ERROR: wrong number of replicon names for replicon files"
        exit(1)
    print "Using " + str(len(annofile_list)) + " .ptt files"

    annotations = common.read_annotations(annofile_list, all_replicons)

    lines_written = write_annotated(opts.infile, opts.outfile, annotations)
    print str(lines_written) + " lines written to " + opts.outfile
Ejemplo n.º 3
0
def main():
    # Get command line options
    opts, args = init_options()
    print "Tabulating " + opts.infile

    all_replicons = common.read_replicon_names(opts.fasta)

    # Separate multiple annotation files
    annofile_list = opts.annofiles.split(",")
    if len(annofile_list) != len(all_replicons):
        print "ERROR: wrong number of replicon names for replicon files"
        exit(1)
    print "Using annotation files " + str(annofile_list)

    annotations = common.read_annotations(annofile_list, all_replicons)

    (runs, hits, allhits) = read_hits_file(opts.infile)

    lines_written = write_tabulated(opts.outfile, runs, annotations, hits, allhits)
Ejemplo n.º 4
0
def main():
    # Get command line options
    opts, args = init_options()
    print "Tabulating " + opts.infile

    all_replicons = common.read_replicon_names(opts.fasta)

    # Separate multiple annotation files
    annofile_list = opts.annofiles.split(",")
    if len(annofile_list) != len(all_replicons):
        print "ERROR: wrong number of replicon names for replicon files"
        exit(1)
    print "Using annotation files " + str(annofile_list)

    annotations = common.read_annotations(annofile_list, all_replicons)

    (runs, hits, allhits) = read_hits_file(opts.infile)

    lines_written = write_tabulated(opts.outfile, runs, annotations, hits,
                                    allhits)
Ejemplo n.º 5
0
                             module.__dict__['IMG_FOLDER'],
                             'benchmark.json')) as file:
            benchmark_config = json.load(file)

        classification = benchmark_config['classification']
        classification_method = classification_map[classification]

        encoding = benchmark_config['encoding']
        types = benchmark_config['types']
        parameters = benchmark_config['data']

        ## Load annotations
        path = os.path.join('..', 'vision_images',
                            module.__dict__['IMG_FOLDER'])

        annotations = common.read_annotations(path)

        ## Run benchmarks
        output = pd.DataFrame(columns=[
            'class', 'method', 'type', 'filename', 'found', 'missed', 'extra'
        ])

        for b_name, benchmark in benchmarks.items():
            b_instance = benchmark()

            try:
                b_instance.setup()
            except AttributeError as e:
                print(f"No setup method found for {b_name}.")

            for m_name, method in benchmark.__dict__.items():