def read(results_file): """Parse a CODEML results file.""" results = {} if not os.path.exists(results_file): raise IOError, "Results file does not exist." handle = open(results_file) lines = handle.readlines() handle.close() (results, multi_models) = _parse_codeml.parse_basics(lines, results) results = _parse_codeml.parse_nssites(lines, results, multi_models) results = _parse_codeml.parse_pairwise(lines, results) results = _parse_codeml.parse_distances(lines, results) if len(results) == 0: raise ValueError, "Invalid results file" return results
def read(results_file): """Parse a CODEML results file.""" results = {} if not os.path.exists(results_file): raise IOError, "Results file does not exist." handle = open(results_file) lines = handle.readlines() handle.close() (results, multi_models) = _parse_codeml.parse_basics(lines, results) results = _parse_codeml.parse_nssites(lines, results, multi_models) results = _parse_codeml.parse_pairwise(lines, results) results = _parse_codeml.parse_distances(lines, results) if len(results) == 0: raise ValueError, "Invalid results file" return results