freqsap.report

Module for generating reports from variant frequency data.

Classes

ReferenceSNPReport

Report containing frequency data for a reference SNP.

PopulationFilter

Class to filter reports for only certain populations.

Module Contents

class freqsap.report.ReferenceSNPReport(variation: freqsap.variation.Variation, metadata: dict, studies: list[freqsap.study.Study])[source]

Report containing frequency data for a reference SNP.

Aggregates metadata and study data for a specific genetic variation.

_variation[source]

The genetic variation this report describes.

Type:

Variation

_metadata[source]

Metadata about the variation.

Type:

dict

_studies[source]

List of population studies with frequency data.

Type:

list[Study]

_variation: freqsap.variation.Variation[source]
_metadata: dict[source]
_studies: list[freqsap.study.Study][source]
header() list[str][source]

Generate column headers for the report.

Combines base fields (id, position) with study-specific headers, ensuring no duplicate fields.

Returns:

List of column header names.

Return type:

list[str]

rows() list[dict][source]

Generate data rows for the report.

Each row contains the variation ID and position combined with data from one study.

Returns:

List of dictionaries, each representing one row of data.

Return type:

list[dict]

class freqsap.report.PopulationFilter[source]

Class to filter reports for only certain populations.

_mapping: ClassVar[dict[str, set[str]]][source]
static apply(regions: list[str], report: ReferenceSNPReport) list[dict][source]

Filter reports for certain regions.

Parameters:
Returns:

Rows from only the specified regions.

Return type:

list[dict]