Back to index

python-biopython  1.60
Classes | Functions
Bio.Phylo.PAML.yn00 Namespace Reference

Classes

class  Yn00Error
class  Yn00

Functions

def read

Class Documentation

class Bio::Phylo::PAML::yn00::Yn00Error
yn00 has failed. Run with verbose = True to view yn00's error
message

Definition at line 13 of file yn00.py.


Function Documentation

def Bio.Phylo.PAML.yn00.read (   results_file)
Parse a yn00 results file.

Definition at line 111 of file yn00.py.

00111 
00112 def read(results_file):
00113     """Parse a yn00 results file."""
00114     results = {}
00115     if not os.path.exists(results_file):
00116         raise IOError, "Results file does not exist."
00117     handle = open(results_file)
00118     lines = handle.readlines()
00119     handle.close()
00120     for line_num in range(len(lines)):
00121         line = lines[line_num]
00122         if "(A) Nei-Gojobori (1986) method" in line:
00123             ng86_start = line_num + 1 
00124         elif "(B) Yang & Nielsen (2000) method" in line:
00125             (results, sequences) = _parse_yn00.parse_ng86(lines[ng86_start:line_num], 
00126                     results)
00127             yn00_start = line_num + 1
00128         elif "(C) LWL85, LPB93 & LWLm methods" in line:
00129             results = _parse_yn00.parse_yn00(lines[yn00_start:line_num], results, 
00130                     sequences)
00131             results = _parse_yn00.parse_others(lines[line_num+1:], results, 
00132                     sequences)
00133     if len(results) == 0:
00134         raise ValueError, "Invalid results file."
00135     return results
00136 
00137 

Here is the call graph for this function:

Here is the caller graph for this function: