snpio.popgenstats.pop_gen_statistics.PopGenStatistics

class snpio.popgenstats.pop_gen_statistics.PopGenStatistics(genotype_data, verbose=False, debug=False)[source]

Class for calculating population genetics statistics from SNP data.

This class provides methods for calculating population genetics statistics from SNP data. It is designed to work with GenotypeData objects. The PopGenStatistics class can calculate Patterson’s D-statistic, partitioned D-statistic, D-foil statistic, summary statistics, and perform PCA dimensionality reduction analysis. It also includes methods for calculating Fst, Nei’s genetic distance, and detecting Fst outliers using permutation or DBSCAN clustering methods. Finally, it can conduct AMOVA (Analysis of Molecular Variance) to partition genetic variation among and within populations.

__init__(genotype_data, verbose=False, debug=False)[source]

Initialize the PopGenStatistics object.

This class provides methods for calculating population genetics statistics from SNP data. It is designed to work with GenotypeData objects. The PopGenStatistics class can calculate Patterson’s D-statistic, partitioned D-statistic, D-foil statistic, summary statistics, and perform PCA dimensionality reduction analysis.

Parameters:
  • genotype_data (GenotypeData) – GenotypeData object containing SNP data and metadata.

  • verbose (bool) – Whether to display verbose output. Defaults to False.

  • debug (bool) – Whether to display debug output. Defaults to False.

Methods

__init__(genotype_data[, verbose, debug])

Initialize the PopGenStatistics object.

amova([regionmap, n_permutations, n_jobs, ...])

Conduct AMOVA (Analysis Of Molecular Variance).

calculate_d_statistics(method, population1, ...)

Calculate D-statistics with bootstrap support and return a summary DataFrame and overall stats.

detect_fst_outliers([correction_method, ...])

Detect Fst outliers from SNP data using permutation or DBSCAN.

fst_distance([method, n_reps, n_jobs, ...])

Estimate Weir & Cockerham's Fst, optionally run statistical tests.

neis_genetic_distance([method, n_reps, ...])

Calculate Nei's genetic distance and optionally run statistical tests.

pca([n_components, center, scale, n_axes, ...])

Run PCA on genotype data and generate a scatterplot colored by missing data proportions.

summary_statistics([method, n_reps, n_jobs, ...])

Calculate a suite of summary statistics for SNP data.