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
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
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
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