예제 #1
0
def get_loganalysis_text(xmldata):
    # prepare the base path for the beast analysis
    basepath = beast.prepare()
    with open(os.path.join(basepath, 'myjob.xml'), 'w') as fout:
        fout.write(xmldata + '\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()
    return analysis_text
예제 #2
0
def get_loganalysis_text(xmldata):
    # prepare the base path for the beast analysis
    basepath = beast.prepare()
    with open(os.path.join(basepath, 'myjob.xml'), 'w') as fout:
        fout.write(xmldata + '\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()
    return analysis_text
예제 #3
0
파일: 20120419b.py 프로젝트: BIGtigr/xgcode
def get_loganalysis_array(start_pos, stop_pos, nsamples, header_seq_pairs):
    # get the xml contents
    xml_string = beasttut.get_xml_string(
            start_pos, stop_pos, nsamples, 'myjob.log', 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)
    return arr
예제 #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
예제 #5
0
파일: 20120412a.py 프로젝트: BIGtigr/xgcode
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