Package Bio :: Package PopGen :: Package GenePop :: Class Record
[hide private]
[frames] | no frames]

Class Record

source code

object --+
         |
        Record

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.

pop_list           List of population names.

populations        List of population data.

In most genepop files, the population name is not trustable.
It is strongly recommended that populations are referred by index.

populations has one element per population. Each element is itself
a list of individuals, each individual is a pair composed by individual
name and a list of alleles (2 per marker or 1 for haploids): Example
[
    [
        ('Ind1', [(1,2),    (3,3), (200,201)],
        ('Ind2', [(2,None), (3,3), (None,None)],
    ],
    [
        ('Other1', [(1,1),  (4,3), (200,200)],
    ]
]

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__str__(self)
Returns (reconstructs) a GenePop textual representation.
source code
 
split_in_pops(self, pop_names)
Splits a GP record in a dictionary with 1 pop per entry.
source code
 
split_in_loci(self, gp)
Splits a GP record in a dictionary with 1 locus per entry.
source code
 
remove_population(self, pos)
Removes a population (by position).
source code
 
remove_locus_by_position(self, pos)
Removes a locus by position.
source code
 
remove_locus_by_name(self, name)
Removes a locus by name.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 
Returns (reconstructs) a GenePop textual representation.
        

Overrides: object.__str__

split_in_pops(self, pop_names)

source code 
Splits a GP record in a dictionary with 1 pop per entry.

Given a record with n pops and m loci returns a dictionary
of records (key pop_name) where each item is a record
with a single pop and m loci.

Parameters:
pop_names - Population names

split_in_loci(self, gp)

source code 
Splits a GP record in a dictionary with 1 locus per entry.

Given a record with n pops and m loci returns a dictionary
of records (key locus name) where each item is a record
with a single locus and n pops.