Package: tidypopgen 0.4.4.9001

Andrea Manica

tidypopgen: Tidy Population Genetics

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.1111/2041-210x.70204>.

Authors:Evie Carter [aut], Eirlys Tysall [aut], Andrea Manica [aut, cre, cph], Chang Christopher [ctb], Shaun Purcell [ctb], Bengtsson Henrik [ctb]

tidypopgen_0.4.4.9001.tar.gz
tidypopgen_0.4.4.9001.zip(r-4.7)tidypopgen_0.4.4.9001.zip(r-4.6)tidypopgen_0.4.4.9001.zip(r-4.5)
tidypopgen_0.4.4.9001.tgz(r-4.6-x86_64)tidypopgen_0.4.4.9001.tgz(r-4.6-arm64)tidypopgen_0.4.4.9001.tgz(r-4.5-x86_64)tidypopgen_0.4.4.9001.tgz(r-4.5-arm64)
tidypopgen_0.4.4.9001.tar.gz(r-4.7-arm64)tidypopgen_0.4.4.9001.tar.gz(r-4.7-x86_64)tidypopgen_0.4.4.9001.tar.gz(r-4.6-arm64)tidypopgen_0.4.4.9001.tar.gz(r-4.6-x86_64)
tidypopgen_0.4.4.9001.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
tidypopgen/json (API)
NEWS

# Install 'tidypopgen' in R:
install.packages('tidypopgen', repos = c('https://evolecolgroup.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/evolecolgroup/tidypopgen/issues

Pkgdown/docs site:https://evolecolgroup.github.io

Uses libs:
  • openblas– Optimized BLAS
  • zlib– Compression library
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:

On CRAN:

Conda:

openblaszlibcppopenmp

8.81 score 13 stars 1 packages 46 scripts 370 downloads 95 exports 79 dependencies

Last updated from:dc6885bc8c (on dev). Checks:13 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK430
linux-devel-x86_64OK365
source / vignettesOK409
linux-release-arm64OK380
linux-release-x86_64OK419
macos-release-arm64OK257
macos-release-x86_64OK680
macos-oldrel-arm64OK287
macos-oldrel-x86_64OK478
windows-develOK468
windows-releaseOK422
windows-oldrelOK493
wasm-releaseOK245

Exports:%>%augmentaugment_lociautoplotcount_locifilter_high_relatednessfind_duplicated_locigen_tibbleget_p_matrixget_q_matrixgt_add_sfgt_admix_reorder_qgt_admixturegt_as_genindgt_as_genlightgt_as_geno_leagt_as_hierfstatgt_as_plinkgt_as_vcfgt_cluster_pcagt_cluster_pca_best_kgt_dapcgt_extract_f2gt_from_genlightgt_get_file_namesgt_has_imputedgt_impute_simplegt_impute_xgboostgt_loadgt_order_locigt_pca_autoSVDgt_pca_partialSVDgt_pca_randomSVDgt_pcadaptgt_pseudohaploidgt_roh_windowgt_savegt_set_imputedgt_snmfgt_update_backingfilegt_uses_imputedheatmap_add_dendroheatmap_pairwiseindiv_het_obsindiv_inbreedingindiv_missingnessindiv_ploidyis_loci_table_orderedload_example_gtloci_alt_freqloci_chromosomesloci_hweloci_ld_clumploci_mafloci_missingnessloci_namesloci_piloci_transitionsloci_transversionsnwise_pop_pbspairwise_allele_sharingpairwise_grmpairwise_ibspairwise_kingpairwise_pop_fstpop_fispop_fstpop_gene_divpop_global_statspop_het_exppop_het_obspop_tajimas_dq_matrixqc_report_indivqc_report_locirbind_dry_runread_q_filesscale_fill_distructselect_lociselect_loci_ifshow_genotypesshow_locishow_loci<-show_ploidysnp_allele_sharingsnp_ibssnp_kingtheme_distructtidyupset_plotwindows_indiv_rohwindows_nwise_pop_pbswindows_pairwise_pop_fstwindows_pop_tajimas_dwindows_stats_generic

Dependencies:BHbigassertrbigparallelrbigreadrbigsnprbigsparserbigstatsrbigutilsrbitclassclassIntclicodetoolscowplotcpp11data.tableDBIDEoptimRdigestdoParalleldoRNGdplyre1071farverffflockforeachgenericsggplot2gluegtableisobanditeratorsKernSmoothlabelinglatticelifecyclemagrittrMASSMatrixnaborparallellypatchworkpillarpkgconfigproxypspurrrR6RColorBrewerRcppRcppArmadilloRcppEigenRhpcBLASctlrlangrmiorngtoolsrobustbaseroptimRSpectrarunnerrunonces2S7scalessfstringistringrtibbletidyrtidyselecttriebeardunitsurltoolsutf8vctrsviridisLitewithrwk

PLINK cheatsheet

Rendered froma99_plink_cheatsheet.Rmdusingknitr::rmarkdownon Jun 02 2026.

Last update: 2025-05-09
Started: 2024-06-11

Population genetic analysis with tidypopgen

Rendered froma03_example_clustering_and_dapc.Rmdusingknitr::rmarkdownon Jun 02 2026.

Last update: 2025-10-15
Started: 2024-06-11

Quality Control

Rendered froma02_qc.Rmdusingknitr::rmarkdownon Jun 02 2026.

Last update: 2026-05-12
Started: 2024-06-11

The grammar of population genetics

Rendered froma01_overview.Rmdusingknitr::rmarkdownon Jun 02 2026.

Last update: 2025-12-17
Started: 2024-06-11

tidypopgen

Rendered fromtidypopgen.Rmdusingknitr::rmarkdownon Jun 02 2026.

Last update: 2025-10-17
Started: 2025-03-21

Readme and manuals

Help Manual

Help pageTopics
A $ method for 'gen_tibble' objects$<-.gen_tbl
An arrange method for 'gen_tibble' objectsarrange.gen_tbl
An arrange method for grouped 'gen_tibble' objectsarrange.grouped_gen_tbl
Augment data with information from a gt_pca objectaugment.gt_pca augment_gt_pca
Augment the loci table with information from a analysis objectaugment_loci
Augment the loci table with information from a gt_pca objectaugment_loci.gt_pca augment_loci_gt_pca
Augment data with information from a q_matrix objectaugment.q_matrix augment_q_matrix
Augment data with information from a gt_dapc objectaugment.gt_dapc
Autoplots for 'gt_admix' objectsautoplot.gt_admix autoplot_gt_admix
Autoplots for 'gt_pca' objectsautoplot.gt_pca autoplot_gt_pca
Autoplots for 'gt_pcadapt' objectsautoplot.gt_pcadapt autoplot_gt_pcadapt
Autoplot for pairwise distance matricesautoplot.pairwise_matrix autoplot.pairwise_tbl autoplot_pairwise autoplot_pairwise_matrix autoplot_pairwise_tbl
Autoplots for 'q_matrix' objectsautoplot.q_matrix autoplot_q_matrix
Autoplots for 'gt_cluster_pca' objectsautoplot.gt_cluster_pca
Autoplots for 'gt_dapc' objectsautoplot.gt_dapc
Autoplots for 'qc_report_indiv' objectsautoplot.qc_report_indiv
Autoplots for 'qc_report_loci' objectsautoplot.qc_report_loci
Combine method for gt_admix objectsc.gt_admix
Combine a gen_tibble to a data.frame or tibble by columncbind.gen_tbl
Count the number of loci in a 'gen_tibble'count_loci count_loci.tbl_df count_loci.vctrs_bigSNP
Distruct coloursdistruct_colours
Filter individuals based on a relationship thresholdfilter_high_relatedness
Tidyverse methods for gt objectsfilter.gen_tbl
A filter method for grouped 'gen_tibble' objectsfilter.grouped_gen_tbl
Find duplicates in the loci tablefind_duplicated_loci
Constructor for a 'gen_tibble'gen_tibble gen_tibble.character gen_tibble.matrix
Return a single P matrix from a 'gt_admix' objectget_p_matrix
Return a single Q matrix from a 'gt_admix' objectget_q_matrix
Add an simple feature geometry to a 'gen_tibble'gt_add_sf
Reorder the q matrices based on the grouping variablegt_admix_reorder_q
Run ADMIXTURE from Rgt_admixture
Convert a 'gen_tibble' to a 'genind' object from 'adegenet'gt_as_genind
Convert a 'gen_tibble' to a 'genlight' object from 'adegenet'gt_as_genlight
Convert a 'gentibble' to a .geno file for sNMF from the LEA packagegt_as_geno_lea
Convert a 'gen_tibble' to a data.frame compatible with 'hierfstat'gt_as_hierfstat
Export a 'gen_tibble' object to PLINK bed formatgt_as_plink
Convert a 'gen_tibble' to a VCFgt_as_vcf
Run K-clustering on principal componentsgt_cluster_pca
Find the best number of clusters based on principal componentsgt_cluster_pca_best_k
Discriminant Analysis of Principal Components for gen_tibblegt_dapc
Compute and store blocked f2 statistics for ADMIXTOOLS 2gt_extract_f2
Convert a 'genlight' object from adegenet to a 'gen_tibble'gt_from_genlight
Get the names of files storing the genotypes of a 'gen_tibble'gt_get_file_names
Checks if a 'gen_tibble' has been imputedgt_has_imputed
Simple imputation based on allele frequenciesgt_impute_simple
Imputation based XGBoostgt_impute_xgboost
Load a gen_tibblegt_load
Order the loci table of a gen_tibblegt_order_loci
Principal Component Analysis for 'gen_tibble' objectsgt_pca
PCA controlling for LD for 'gen_tibble' objectsgt_pca_autoSVD
PCA for 'gen_tibble' objects by partial SVDgt_pca_partialSVD
PCA for 'gen_tibble' objects by randomized partial SVDgt_pca_randomSVD
pcadapt analysis on a 'gen_tibble' objectgt_pcadapt
Set the ploidy of a 'gen_tibble' to include pseudohaploidsgt_pseudohaploid
Save a gen_tibblegt_save
Sets a 'gen_tibble' to use imputed datagt_set_imputed
Run SNMF from R in tidypopgengt_snmf
Update the backing matrixgt_update_backingfile
Checks if a 'gen_tibble' uses imputed datagt_uses_imputed
Add dendrograms to a heatmap of pairwise distancesheatmap_add_dendro
Pairwise distance heatmapheatmap_pairwise
Estimate individual observed heterozygosityindiv_het_obs indiv_het_obs.tbl_df indiv_het_obs.vctrs_bigSNP
Individual inbreeding coefficientindiv_inbreeding indiv_inbreeding.grouped_df indiv_inbreeding.tbl_df indiv_inbreeding.vctrs_bigSNP
Estimate individual missingnessindiv_missingness indiv_missingness.tbl_df indiv_missingness.vctrs_bigSNP
Return individual ploidyindiv_ploidy indiv_ploidy.tbl_df indiv_ploidy.vctrs_bigSNP
Test if the loci table is orderedis_loci_table_ordered is_loci_table_ordered.tbl_df is_loci_table_ordered.vctrs_bigSNP
Load example gen_tibbleload_example_gt
Estimate allele frequencies at each locusloci_alt_freq loci_alt_freq.grouped_df loci_alt_freq.tbl_df loci_alt_freq.vctrs_bigSNP loci_maf loci_maf.grouped_df loci_maf.tbl_df loci_maf.vctrs_bigSNP
Get the chromosomes of loci in a 'gen_tibble'loci_chromosomes loci_chromosomes.tbl_df loci_chromosomes.vctrs_bigSNP
Test Hardy-Weinberg equilibrium at each locusloci_hwe loci_hwe.grouped_df loci_hwe.tbl_df loci_hwe.vctrs_bigSNP
Clump loci based on a Linkage Disequilibrium thresholdloci_ld_clump loci_ld_clump.tbl_df loci_ld_clump.vctrs_bigSNP
Estimate missingness at each locusloci_missingness loci_missingness.grouped_df loci_missingness.tbl_df loci_missingness.vctrs_bigSNP
Get the names of loci in a 'gen_tibble'loci_names loci_names.tbl_df loci_names.vctrs_bigSNP
Estimate nucleotide diversity (pi) at each locusloci_pi loci_pi.grouped_df loci_pi.tbl_df loci_pi.vctrs_bigSNP
Find transitionsloci_transitions loci_transitions.tbl_df loci_transitions.vctrs_bigSNP
Find transversionsloci_transversions loci_transversions.tbl_df loci_transversions.vctrs_bigSNP
A mutate method for 'gen_tibble' objectsmutate.gen_tbl
A mutate method for grouped 'gen_tibble' objectsmutate.grouped_gen_tbl
Compute the Population Branch Statistics for each combination of populationsnwise_pop_pbs
Compute the Pairwise Allele Sharing Matrix for a 'gen_tibble' objectpairwise_allele_sharing
Compute the Genomic Relationship Matrix for a 'gen_tibble' objectpairwise_grm
Compute the Identity by State Matrix for a 'gen_tibble' objectpairwise_ibs
Compute the KING-robust Matrix for a 'gen_tibble' objectpairwise_king
Compute pairwise population Fstpairwise_pop_fst
Compute population specific FISpop_fis
Compute population specific Fstpop_fst
Compute basic population global statisticspop_global_stats
Compute the population expected heterozygositypop_gene_div pop_het_exp
Compute the population observed heterozygositypop_het_obs
Estimate Tajima's D for the whole genomepop_tajimas_d pop_tajimas_d.grouped_df pop_tajimas_d.tbl_df pop_tajimas_d.vctrs_bigSNP
Predict scores of a PCApredict.gt_pca
Convert a standard matrix to a 'q_matrix' objectq_matrix
Create a Quality Control report for individualsqc_report_indiv qc_report_indiv.grouped_df qc_report_indiv.tbl_df
Create a Quality Control report for lociqc_report_loci qc_report_loci.grouped_df qc_report_loci.tbl_df
Generate a report of what would happen to each SNP in a mergerbind_dry_run
Combine two gen_tibblesrbind.gen_tbl
Read and structure .Q files or existing matrices as 'q_matrix' or 'gt_admix' objects.read_q_files
Scale constructor using the distruct coloursscale_fill_distruct
The 'select' verb for 'loci'select_loci
The 'select_if' verb for 'loci'select_loci_if
Show the genotypes of a 'gen_tibble'show_genotypes show_genotypes.tbl_df show_genotypes.vctrs_bigSNP
Show the loci information of a 'gen_tibble'show_loci show_loci.tbl_df show_loci.vctrs_bigSNP show_loci<- show_loci<-.tbl_df show_loci<-.vctrs_bigSNP
Show the ploidy information of a 'gen_tibble'show_ploidy show_ploidy.tbl_df show_ploidy.vctrs_bigSNP
Compute the Pairwise Allele Sharing Matrix for a bigSNP objectsnp_allele_sharing
Compute the Identity by State Matrix for a bigSNP objectsnp_ibs
Compute the KING-robust Matrix for a bigSNP objectsnp_king
Summary method for gt_admix objectssummary.gt_admix
Print a summary of a merge reportsummary.rbind_report summary_rbind_report
A theme to match the output of distructtheme_distruct
Tidy a 'gt_dapc' objectgt_dapc_tidiers tidy.gt_dapc
Tidy a 'gt_pca' objectgt_pca_tidiers tidy.gt_pca
Tidy a Q matrixtidy.q_matrix
Draw an UpSet plot from a data frame of logical columnsupset_plot
Detect runs of homozygosity using a sliding-window approachgt_roh_window windows_indiv_roh
Compute the Population Branch Statistics over a sliding windowwindows_nwise_pop_pbs
Compute pairwise Fst for a sliding windowwindows_pairwise_pop_fst
Compute Tajima's D for a sliding windowwindows_pop_tajimas_d
Estimate window statistics from per locus estimateswindows_stats_generic