genetest.statistics package

Submodules

genetest.statistics.core module

class genetest.statistics.core.StatsModels[source]

Bases: object

fit(y, X)[source]

Fit the model.

Parameters:
Returns:

All available statistics for a given test.

Return type:

dict

exception genetest.statistics.core.StatsError(msg)[source]

Bases: Exception

An Exception raised if there is any statistical problem.

genetest.statistics.core.parse_modelspec(filename)[source]

Dynamically import a ModelSpec instance from a Python file.

The file needs to define a model variable corresponding to the ModelSpec instance.

genetest.statistics.descriptive module

genetest.statistics.descriptive.get_maf(genotypes, minor, major)[source]

Computes the minor allele frequency using genotypes.

Parameters:
  • genotypes (pandas.Series) – The genotypes.
  • minor (str) – The minor allele.
  • major (str) – The major allele.
Returns:

Returns the MAF, the minor allele, the major allele and a

boolean telling if the markers were flip or not.

Return type:

tuple

Note

The frequency is computed using the alternative allele (i.e. the 2 genotype). If there are more 2 genotypes than 0 genotypes, the alternative allele frequency will be higher than 0.5.

Note

When computing the alternative allele frequency, the missing genotypes are excluded. If there are no genotypes, NaN is returned.

Module contents