freqsap.report ============== .. py:module:: freqsap.report .. autoapi-nested-parse:: Module for generating reports from variant frequency data. Classes ------- .. autoapisummary:: freqsap.report.ReferenceSNPReport freqsap.report.PopulationFilter Module Contents --------------- .. py:class:: ReferenceSNPReport(variation: freqsap.variation.Variation, metadata: dict, studies: list[freqsap.study.Study]) Report containing frequency data for a reference SNP. Aggregates metadata and study data for a specific genetic variation. .. attribute:: _variation The genetic variation this report describes. :type: Variation .. attribute:: _metadata Metadata about the variation. :type: dict .. attribute:: _studies List of population studies with frequency data. :type: list[Study] .. py:attribute:: _variation :type: freqsap.variation.Variation .. py:attribute:: _metadata :type: dict .. py:attribute:: _studies :type: list[freqsap.study.Study] .. py:method:: header() -> list[str] 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. :rtype: list[str] .. py:method:: rows() -> list[dict] 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. :rtype: list[dict] .. py:class:: PopulationFilter Class to filter reports for only certain populations. .. py:attribute:: _mapping :type: ClassVar[dict[str, set[str]]] .. py:method:: apply(regions: list[str], report: ReferenceSNPReport) -> list[dict] :staticmethod: Filter reports for certain regions. :param regions: List of regions to include. :type regions: list[str] :param report: Report from which to filter rows. :type report: ReferenceSNPReport :returns: Rows from only the specified regions. :rtype: list[dict]