Bases: object
Represents a chromosome (linkage group). Nodes in the chromosome are loci, with edges in between representing some type of distance (genetic or physical)
Methods
| add_locus(locus[, pos, locus_id]) | Adds the locus at a given genetic position |
| get_bordering_loci(pos) | Gets the loci that surround a given genetic position |
| get_bordering_loci_inds(pos) | Gets the indices of the loci that surround a given genetic position |
| get_chrom_length() | Gets the length of the chromosome in centimorgans |
| get_locus(locus_ind) | Gets a locus object by index |
| get_locus_by_name(locus_name) | Gets a locus object by name |
| get_locus_ind(locus_name) | Gets the index of a locus object by name |
| get_recomb_points([obligate]) | Gets recombination point(s) in centimorgans using the exponential |
Adds the locus at a given genetic position
| Parameters: | locus : locus object
pos : float
locus_id : hashable, optional
|
|---|---|
| Raises: | ValueError
|
Gets the loci that surround a given genetic position
| Parameters: | pos : float
|
|---|---|
| Returns: | locus1, locus2 |
| Raises: | ValueError
|
Gets the indices of the loci that surround a given genetic position
| Parameters: | pos : float
|
|---|---|
| Returns: | locus ind 1, locus2 ind 2 |
| Raises: | ValueError
|
Gets the length of the chromosome in centimorgans
| Returns: | The length of the chromosome, in centimorgans |
|---|
Gets a locus object by index
| Parameters: | locus_ind : int
|
|---|---|
| Returns: | The locus object at the index |
Gets a locus object by name
| Parameters: | locus_name : hashable
|
|---|---|
| Returns: | The locus object for the name |
Bases: object
Represents an individual composed of 1 or more chromosomes, each of which has 2 haplotypes
Methods
| get_raw_nonepistatic_G() | Gets the value of G for the individual, without taking into |
| mate(other) | Mates 2 diploidIndividuals to produce a new diploidIndividual |
Instantiates an individual
| Parameters: | haplotype_dict : dict
|
|---|
Bases: quantgen.core.chromosome.chromosome
Represents the alleles along a single phased haplotype
Methods
| add_locus(locus[, pos, locus_id]) | Adds the locus at a given genetic position |
| get_bordering_loci(pos) | Gets the loci that surround a given genetic position |
| get_bordering_loci_inds(pos) | Gets the indices of the loci that surround a given genetic position |
| get_chrom_length() | Gets the length of the chromosome in centimorgans |
| get_locus(locus_ind) | Gets a locus object by index |
| get_locus_by_name(locus_name) | Gets a locus object by name |
| get_locus_ind(locus_name) | Gets the index of a locus object by name |
| get_recomb_points([obligate]) | Gets recombination point(s) in centimorgans using the exponential |
| recombine2(haplo1, haplo2) | Recombines 2 haplotypes |
Instantiates the haplotype
| Parameters: | chromosome : chromosome
genos : list
|
|---|---|
| Raises: | ValueError
|
Bases: object
Represents a diallelic locus on a chromosome.
Note that the comparison functions only compare positions.
Methods
| get_a_d_values() | Gets the values of a and d under that allele configuration See Lynch/Walsh pg. |
| get_alpha(p1) | Gets the average effect of allelic substitution, alpha. |
| get_alpha_vals(p1) | Gets the slope of the number of alleles on the phenotypic values |
| get_mu_G(p1) | Gets the theoretical average phenotype assuming the locus |
| get_raw_G(allele1, allele2) | Gets the value of G for this locus, given a genotype |
| set_a(a) | Sets the value of a for the locus |
| set_cM(location) | Sets the genetic location of the locus |
| set_k(k) | Sets the value of k for the locus |
Instantiates the locus. See Lynch/Walsh pg. 62
| Parameters: | a : float
k : float
|
|---|
Gets the values of a and d under that allele configuration See Lynch/Walsh pg. 62
| Returns: | a, d |
|---|
Gets the average effect of allelic substitution, alpha. See Lynch/Walsh ph. 68. Under the assumption of random mating, this represents the average change in genotypic value that results when a B2 allele is randomly substituted for a B1 allele.
| Parameters: | p1 : float
|
|---|---|
| Returns: | alpha, the average effect of allelic substitution |
Gets the slope of the number of alleles on the phenotypic values (the average effects)
| Parameters: | p1 : float
|
|---|---|
| Returns: | alpha1, alpha2 |
Gets the theoretical average phenotype assuming the locus is the only locus affecting the phenotype
| Parameters: | p1 : float
|
|---|---|
| Returns: | mu_G for the locus |
Gets the value of G for this locus, given a genotype
| Parameters: | allele1 : int
allele2 : int
|
|---|---|
| Returns: | The value of G |
Sets the value of a for the locus
| Parameters: | a : float
|
|---|