Exemplo n.º 1
0
def main(args=None):

    info()
    
    if args is None:
        args = sys.argv[1:]

    if "-h" in args or "--help" in args:
        usage()
        sys.exit(2)

    if "-id" in args:
        run_id = get_arg(args, "-id")
    else:
        run_id = str(int(time.time())) # use timestamp as unique run identifier

    # determine mode (new alignment or redrawing)
    if "-redraw" in args:
        new_align = False
    else:
        new_align = True

    ensure_dir([g_root_dir, r_root_dir])
    for item in dirs.values():
        ensure_dir([r_root_dir+run_id+item])

    # one-pair or multiple?
    if len(genomes) < 2:
        raise Exception("ERROR: Need at least two genomes to align!")
    elif len(genomes) == 2:
        align_pairwise(genomes, new_align, r_root_dir, g_root_dir, dirs, run_id, max_size, chop_mode, mauve_exec, mtype, segtype, min_size)
    else:
        align_multi(genomes, new_align, r_root_dir, g_root_dir, dirs, run_id, max_size, chop_mode, mauve_exec, mtype, segtype, idpt, fct_flags, fct_colors, min_size)
Exemplo n.º 2
0
# prep directories
data_dir = "data/"+argv[1]+"/"

run = argv[2]

dirs = {
    'seqfiles': data_dir+"seqfiles/",
    'mauve': data_dir+"mauve/"+run+"/",
    'aln_segs': data_dir+"seg_aln/",
    'maps': data_dir+"maps/"+run+"/"
}
for item in dirs.values():
    ensure_dir([item])


# determine mode (new alignment or redrawing)
new_align = True
if len(argv) > 3:
    mode = argv[3]
    if mode == 'redraw':
        new_align = False

# one-pair or multiple?
if len(genomes) < 2:
    raise Exception("ERROR: Not enough genomes to align!")
elif len(genomes) == 2:
    align_pairwise(genomes, new_align, dirs, run)
else:
    align_multi(genomes, new_align, dirs, run)