biopython v1.71.0 Bio.PopGen.GenePop.FileParser.FileRecord

Holds information from a GenePop record.

Attributes:

  • marker_len The marker length (2 or 3 digit code per allele).
  • comment_line Comment line.
  • loci_list List of loci names.

Methods:

  • get_individual Returns the next individual of the current population.
  • skip_population Skips the current population.

skip_population skips the individuals of the current population, returns True if there are more populations.

get_individual returns an individual of the current population (or None if the list ended).

Each individual is a pair composed by individual name and a list of alleles (2 per marker or 1 for haploid data). Examples::

('Ind1', [(1,2),    (3,3), (200,201)]
('Ind2', [(2,None), (3,3), (None,None)]
('Other1', [(1,1),  (4,3), (200,200)]

Link to this section Summary

Functions

Initialize the class

Returns (reconstructs) a GenePop textual representation

Gets the next individual

Removes a loci list (by name)

Removes a set of loci by position

Removes a locus by name

Removes a locus by position

Removes a population (by position)

Seeks a certain position in the file

Skips the Header. To be done after a re-open

Skips the current population. Returns true if there is another pop

Starts parsing a file containing a GenePop file

Link to this section Functions

Initialize the class.

Returns (reconstructs) a GenePop textual representation.

This might take a lot of memory. Marker length will be 3.

Link to this function get_individual()

Gets the next individual.

Returns individual information if there are more individuals in the current population. Returns True if there are no more individuals in the current population, but there are more populations. Next read will be of the following pop. Returns False if at end of file.

Link to this function remove_loci_by_name()

Removes a loci list (by name).

Arguments:

  • names - names
  • fname - file to be created with loci removed
Link to this function remove_loci_by_position()

Removes a set of loci by position.

Arguments:

  • positions - positions
  • fname - file to be created with locus removed
Link to this function remove_locus_by_name()

Removes a locus by name.

Arguments:

  • name - name
  • fname - file to be created with locus removed
Link to this function remove_locus_by_position()

Removes a locus by position.

Arguments:

  • pos - position
  • fname - file to be created with locus removed
Link to this function remove_population()

Removes a population (by position).

Arguments:

  • pos - position
  • fname - file to be created with population removed
Link to this function seek_position()

Seeks a certain position in the file.

Arguments:

  • pop - pop position (0 is first)
  • indiv - individual in pop

Skips the Header. To be done after a re-open.

Link to this function skip_population()

Skips the current population. Returns true if there is another pop.

Starts parsing a file containing a GenePop file.