tidypopgen0.3.2 package

Tidy Population Genetics

arrange.gen_tbl

An arrange method for gen_tibble objects

arrange.grouped_gen_tbl

An arrange method for grouped gen_tibble objects

augment_gt_pca

Augment data with information from a gt_pca object

augment_loci_gt_pca

Augment the loci table with information from a gt_pca object

augment_loci

Augment the loci table with information from a analysis object

augment_q_matrix

Augment data with information from a q_matrix object

augment.gt_dapc

Augment data with information from a gt_dapc object

autoplot_gt_admix

Autoplots for gt_admix objects

autoplot_gt_cluster_pca

Autoplots for gt_cluster_pca objects

autoplot_gt_dapc

Autoplots for gt_dapc objects

autoplot_gt_pca

Autoplots for gt_pca objects

autoplot_gt_pcadapt

Autoplots for gt_pcadapt objects

autoplot_q_matrix

Autoplots for q_matrix objects

autoplot.qc_report_indiv

Autoplots for qc_report_indiv objects

autoplot.qc_report_loci

Autoplots for qc_report_loci objects

c.gt_admix

Combine method for gt_admix objects

cash-set-.gen_tbl

A $ method for gen_tibble objects

cbind.gen_tbl

Combine a gen_tibble to a data.frame or tibble by column

count_loci

Count the number of loci in a gen_tibble

filter_high_relatedness

Filter individuals based on a relationship threshold

filter.gen_tbl

Tidyverse methods for gt objects

filter.grouped_gen_tbl

A filter method for grouped gen_tibble objects

find_duplicated_loci

Find duplicates in the loci table

gen_tibble

Constructor for a gen_tibble

get_p_matrix

Return a single P matrix from a gt_admix object

get_q_matrix

Return a single Q matrix from a gt_admix object

gt_add_sf

Add an simple feature geometry to a gen_tibble

gt_admix_reorder_q

Reorder the q matrices based on the grouping variable

gt_admixture

Run ADMIXTURE from R

gt_as_genind

Convert a gen_tibble to a genind object from adegenet

gt_as_genlight

Convert a gen_tibble to a genlight object from adegenet

gt_as_geno_lea

Convert a gentibble to a .geno file for sNMF from the LEA package

gt_as_hierfstat

Convert a gen_tibble to a data.frame compatible with hierfstat

gt_as_plink

Export a gen_tibble object to PLINK bed format

gt_as_vcf

Convert a gen_tibble to a VCF

gt_cluster_pca_best_k

Find the best number of clusters based on principal components

gt_cluster_pca

Run K-clustering on principal components

gt_dapc

Discriminant Analysis of Principal Components for gen_tibble

gt_extract_f2

Compute and store blocked f2 statistics for ADMIXTOOLS 2

gt_get_file_names

Get the names of files storing the genotypes of a gen_tibble

gt_has_imputed

Checks if a gen_tibble has been imputed

gt_impute_simple

Simple imputation based on allele frequencies

gt_impute_xgboost

Imputation based XGBoost

gt_load

Load a gen_tibble

gt_order_loci

Order the loci table of a gen_tibble

gt_pca_autoSVD

PCA controlling for LD for gen_tibble objects

gt_pca_partialSVD

PCA for gen_tibble objects by partial SVD

gt_pca_randomSVD

PCA for gen_tibble objects by randomized partial SVD

gt_pca

Principal Component Analysis for gen_tibble objects

gt_pcadapt

pcadapt analysis on a gen_tibble object

gt_pseudohaploid

Set the ploidy of a gen_tibble to include pseudohaploids

gt_save

Save a gen_tibble

gt_set_imputed

Sets a gen_tibble to use imputed data

gt_snmf

Run SNMF from R in tidypopgen

gt_update_backingfile

Update the backing matrix

gt_uses_imputed

Checks if a gen_tibble uses imputed data

indiv_het_obs

Estimate individual observed heterozygosity

indiv_inbreeding

Individual inbreeding coefficient

indiv_missingness

Estimate individual missingness

indiv_ploidy

Return individual ploidy

is_loci_table_ordered

Test if the loci table is ordered

load_example_gt

Load example gen_tibble

loci_alt_freq

Estimate allele frequencies at each locus

loci_chromosomes

Get the chromosomes of loci in a gen_tibble

loci_hwe

Test Hardy-Weinberg equilibrium at each locus

loci_ld_clump

Clump loci based on a Linkage Disequilibrium threshold

loci_missingness

Estimate missingness at each locus

loci_names

Get the names of loci in a gen_tibble

loci_pi

Estimate nucleotide diversity (pi) at each locus

loci_transitions

Find transitions

loci_transversions

Find transversions

mutate.gen_tbl

A mutate method for gen_tibble objects

mutate.grouped_gen_tbl

A mutate method for grouped gen_tibble objects

nwise_pop_pbs

Compute the Population Branch Statistics for each combination of popul...

pairwise_allele_sharing

Compute the Pairwise Allele Sharing Matrix for a gen_tibble object

pairwise_grm

Compute the Genomic Relationship Matrix for a gen_tibble object

pairwise_ibs

Compute the Identity by State Matrix for a gen_tibble object

pairwise_king

Compute the KING-robust Matrix for a a gen_tibble object

pairwise_pop_fst

Compute pairwise population Fst

pipe

Pipe operator

pop_fis

Compute population specific FIS

pop_fst

Compute population specific Fst

pop_global_stats

Compute basic population global statistics

pop_het_exp

Compute the population expected heterozygosity

pop_het_obs

Compute the population observed heterozygosity

pop_tajimas_d

Estimate Tajima's D for the whole genome

predict_gt_pca

Predict scores of a PCA

q_matrix

Convert a standard matrix to a q_matrix object

qc_report_indiv

Create a Quality Control report for individuals

qc_report_loci

Create a Quality Control report for loci

rbind_dry_run

Generate a report of what would happen to each SNP in a merge

rbind.gen_tbl

Combine two gen_tibbles

read_q_files

Read and structure .Q files or existing matrices as q_matrix or `gt_...

reexports

Objects exported from other packages

scale_fill_distruct

Scale constructor using the distruct colours

select_loci_if

The select_if verb for loci

select_loci

The select verb for loci

show_genotypes

Show the genotypes of a gen_tibble

show_loci

Show the loci information of a gen_tibble

show_ploidy

Show the ploidy information of a gen_tibble

snp_allele_sharing

Compute the Pairwise Allele Sharing Matrix for a bigSNP object

snp_ibs

Compute the Identity by State Matrix for a bigSNP object

snp_king

Compute the KING-robust Matrix for a bigSNP object

summary_rbind_dry_run

Print a summary of a merge report

summary.gt_admix

Summary method for gt_admix objects

theme_distruct

A theme to match the output of distruct

tidy_gt_pca

Tidy a gt_pca object

tidy.gt_dapc

Tidy a gt_dapc object

tidy.q_matrix

Tidy a Q matrix

tidypopgen-package

tidypopgen: Tidy Population Genetics

windows_indiv_roh

Detect runs of homozygosity using a sliding-window approach

windows_nwise_pop_pbs

Compute the Population Branch Statistics over a sliding window

windows_pairwise_pop_fst

Compute pairwise Fst for a sliding window

windows_pop_tajimas_d

Compute Tajima's D for a sliding window

windows_stats_generic

Estimate window statistics from per locus estimates

We provide a tidy grammar of population genetics, facilitating the manipulation and analysis of data on biallelic single nucleotide polymorphisms (SNPs). 'tidypopgen' scales to very large genetic datasets by storing genotypes on disk, and performing operations on them in chunks, without ever loading all data in memory. The full functionalities of the package are described in Carter et al. (2025) <doi:10.1101/2025.06.06.658325>.

  • Maintainer: Andrea Manica
  • License: GPL (>= 3)
  • Last published: 2025-08-27