freqsap.study

Module for representing population study data.

Classes

Study

Represents a population genetics study with allele frequency data.

Module Contents

class freqsap.study.Study[source]

Represents a population genetics study with allele frequency data.

source[source]

The data source or database name.

Type:

str

population[source]

The population identifier.

Type:

str

group[source]

The population group or ethnicity.

Type:

str

size[source]

The sample size of the study.

Type:

int

reference[source]

The reference allele with its frequency.

Type:

Allele

alternatives[source]

List of alternative alleles with their frequencies.

Type:

list[Allele]

source: str[source]
population: str[source]
group: str[source]
size: int[source]
reference: freqsap.allele.Allele[source]
alternatives: list[freqsap.allele.Allele][source]
header() list[str][source]

Get the column headers for this study’s data.

Returns:

List of column header names.

Return type:

list[str]

row() dict[source]

Convert study data to a dictionary row format.

Creates a dictionary with study metadata, reference allele data, and all alternative allele data with dynamically numbered columns.

Returns:

Dictionary containing all study data in row format.

Return type:

dict