Ejemplo n.º 1
0
def get_response_content(fs):
    header_sequence_pairs = beasttut.get_header_seq_pairs()
    interval_xml_data = beasttut.get_xml_string(
            fs.start_pos, fs.stop_pos, fs.nsamples, 'myjob.log',
            header_sequence_pairs)
    arr = get_loganalysis_array(interval_xml_data)
    s = '\n'.join('\t'.join(str(x) for x in row) for row in arr) + '\n'
    return s
Ejemplo n.º 2
0
def get_response_content(fs):
    header_sequence_pairs = beasttut.get_header_seq_pairs()
    interval_xml_data = beasttut.get_xml_string(fs.start_pos, fs.stop_pos,
                                                fs.nsamples, 'myjob.log',
                                                header_sequence_pairs)
    arr = get_loganalysis_array(interval_xml_data)
    s = '\n'.join('\t'.join(str(x) for x in row) for row in arr) + '\n'
    return s
Ejemplo n.º 3
0
def get_response_content(fs):
    # init the response and get the user variables
    start_pos = fs.start
    stop_pos = fs.stop
    nsamples = fs.nsamples
    out = StringIO()
    # get the xml contents
    xml_string = beasttut.get_xml_string(
            start_pos, stop_pos, nsamples, 'myjob.log',
            beasttut.get_header_seq_pairs())
    # prepare the base path for the beast analysis
    basepath = beast.prepare()
    with open(os.path.join(basepath, 'myjob.xml'), 'w') as fout:
        fout.write(xml_string + '\n')
    beast.run_beast(basepath, g_beast_jar_path)
    beast.run_loganalyser(basepath)
    # read the analysis
    with open(os.path.join(basepath, 'myjob-loganalyser.txt')) as fin:
        analysis_text = fin.read()
    # parse the analysis
    arr = beast.loganalyser_to_array(analysis_text)
    s = '\n'.join('\t'.join(str(x) for x in row) for row in arr) + '\n'
    # return the response
    return s
Ejemplo n.º 4
0
def get_response_content(fs):
    # init the response and get the user variables
    start_pos = fs.start
    stop_pos = fs.stop
    nsamples = fs.nsamples
    out = StringIO()
    # get the xml contents
    xml_string = beasttut.get_xml_string(start_pos, stop_pos, nsamples,
                                         'myjob.log',
                                         beasttut.get_header_seq_pairs())
    # prepare the base path for the beast analysis
    basepath = beast.prepare()
    with open(os.path.join(basepath, 'myjob.xml'), 'w') as fout:
        fout.write(xml_string + '\n')
    beast.run_beast(basepath, g_beast_jar_path)
    beast.run_loganalyser(basepath)
    # read the analysis
    with open(os.path.join(basepath, 'myjob-loganalyser.txt')) as fin:
        analysis_text = fin.read()
    # parse the analysis
    arr = beast.loganalyser_to_array(analysis_text)
    s = '\n'.join('\t'.join(str(x) for x in row) for row in arr) + '\n'
    # return the response
    return s