Пример #1
0
        for i in m.windows_score([x for x in m.signal_separation(testing_filename)],args.order,args.wsize, back_dict,sign_dict):
            out_fg.write("{}\n".format(i))
    sys.stderr.write("To plot the evaluation result, use the R script attached.\n")
    sys.stderr.write("MMID have finished the model building step succesfully.\n")

if args.identify:
    if args.model == None:
        model_file=output_mm
    else:
        model_file=args.model
    sys.stderr.write("\t\tMMID v.4\n\t\tAdvanced Genome Bioinformatics\n\t\tAndreu Bofill & David Mas\n\nThe input Markov Model data is from {}\n".format(model_file))
    sys.stderr.write("Identifying motifs in the FASTA file {}\n".format(args.query))
    sys.stdout.write("Motif Identifier.\nDefined Threshold:{0}\tFasta file input:{1}\tMarkov Model input:{2}\n".format(args.threshold,args.query,model_file))
    bg_MM,sg_MM=m.read_MM(model_file)
    for i in m.FASTA_iterator(args.query):
        for j,x in m.windows_score_query(i, args.order, args.wsize, bg_MM, sg_MM,args.threshold):
            sys.stdout.write("Sequence:{0}\tScore:{1:.3f}\n".format(j,x))

if args.weblogo:
    if args.model == None:
        model_file=output_mm
    else:
        model_file=args.model
    sys.stdout.write("Input MSA to generate a web logo:\n")
    bg_MM,sg_MM=m.read_MM(model_file)
    m.generate_weblogo(sg_MM,bg_MM)
    sys.stdout.write("In order to get the actual logo go to weblogo.berkeley.edu and paste the generated k-mers.\n")

if not args.identify and not args.train and not args.weblogo:
    sys.stderr.write("This Script needs some paths to run. Use the arguemnt -h to get help.\n")