Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
Bio.PopGen.GenePop.LargeFileParser.Record Class Reference

List of all members.

Public Member Functions

def __init__
def data_generator

Public Attributes

 handle
 marker_len
 comment_line
 loci_list
 populations
 data_generator
 stack

Detailed Description

Holds information from a GenePop record.

Members:
marker_len         The marker length (2 or 3 digit code per allele).    

comment_line       Comment line.

loci_list          List of loci names.

data_generator     Iterates over population data.

The generator will only work once. If you want to read a handle
twice you have to re-open it!

data_generator can either be () - an empty tuple - marking a new
population or an individual. An individual is something like
('Ind1', [(1,1), (3,None), (200,201)],
In the case above the individual is called Ind1,
has three diploid loci. For the second loci, one of the alleles
is unknown.

Definition at line 67 of file LargeFileParser.py.


Constructor & Destructor Documentation

Definition at line 91 of file LargeFileParser.py.

00091 
00092     def __init__(self, handle):
00093         self.handle          = handle
00094         self.marker_len      = 0
00095         self.comment_line    = ""
00096         self.loci_list       = []
00097         self.populations     = []
00098         self.data_generator  = None
00099         self.stack           = [] 


Member Function Documentation

Definition at line 100 of file LargeFileParser.py.

00100 
00101     def data_generator(self):
00102         for handle in [self.stack, self.handle]:
00103             for line in handle:
00104                 line = line.rstrip()
00105                 if line.upper()=='POP':
00106                     yield ()
00107                 else:
00108                     indiv_name, allele_list, marker_len = get_indiv(line)
00109                     clean_list = []
00110                     for locus in allele_list:
00111                         mk_real = []
00112                         for al in locus:
00113                             if al==0:
00114                                 mk_real.append(None)
00115                             else:
00116                                 mk_real.append(al)
00117                         clean_list.append(tuple(mk_real))
00118                     yield indiv_name, clean_list
00119         raise StopIteration()
00120         

Here is the call graph for this function:


Member Data Documentation

Definition at line 94 of file LargeFileParser.py.

Definition at line 97 of file LargeFileParser.py.

Definition at line 92 of file LargeFileParser.py.

Definition at line 95 of file LargeFileParser.py.

Definition at line 93 of file LargeFileParser.py.

Definition at line 96 of file LargeFileParser.py.

Definition at line 98 of file LargeFileParser.py.


The documentation for this class was generated from the following file: