# Tidy Population Genetics

## Documentation for package ‘tidypopgen’ version 0.3.2

- DESCRIPTION file.
- User guides, package vignettes and other documentation.
- Package NEWS.

## Help Pages

A C D F G I L M N P Q R S T W misc

## -- A --

arrange.gen_tbl | An arrange method for 'gen_tibble' objects
arrange.grouped_gen_tbl | An arrange method for grouped 'gen_tibble' objects
augment.gt_dapc | Augment data with information from a gt_dapc object
augment.gt_pca | Augment data with information from a gt_pca object
augment.q_matrix | Augment data with information from a q_matrix object
augment_gt_pca | Augment data with information from a gt_pca object
augment_loci | Augment the loci table with information from a analysis object
augment_loci.gt_pca | Augment the loci table with information from a gt_pca object
augment_loci_gt_pca | Augment the loci table with information from a gt_pca object
augment_q_matrix | Augment data with information from a q_matrix 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.qc_report_indiv | Autoplots for 'qc_report_indiv' objects
autoplot.qc_report_loci | Autoplots for 'qc_report_loci' objects
autoplot.q_matrix | Autoplots for 'q_matrix' objects
autoplot_gt_admix | Autoplots for 'gt_admix' 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

## -- C --

c.gt_admix | Combine method for gt_admix 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'
count_loci.tbl_df | Count the number of loci in a 'gen_tibble'
count_loci.vctrs_bigSNP | Count the number of loci in a 'gen_tibble'

## -- D --

distruct_colours | Distruct colours

## -- F --

filter.gen_tbl | Tidyverse methods for gt objects
filter.grouped_gen_tbl | A filter method for grouped 'gen_tibble' objects
filter_high_relatedness | Filter individuals based on a relationship threshold
find_duplicated_loci | Find duplicates in the loci table

## -- G --

gen_tibble | Constructor for a 'gen_tibble'
gen_tibble.character | Constructor for a 'gen_tibble'
gen_tibble.matrix | 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_admixture | Run ADMIXTURE from R
gt_admix_reorder_q | Reorder the q matrices based on the grouping variable
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 | Run K-clustering on principal components
gt_cluster_pca_best_k | Find the best number of clusters based on principal components
gt_dapc | Discriminant Analysis of Principal Components for gen_tibble
gt_dapc_tidiers | Tidy a 'gt_dapc' object
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 | Principal Component Analysis for 'gen_tibble' objects
gt_pcadapt | pcadapt analysis on a 'gen_tibble' object
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_tidiers | Tidy a 'gt_pca' object
gt_pseudohaploid | Set the ploidy of a 'gen_tibble' to include pseudohaploids
gt_roh_window | Detect runs of homozygosity using a sliding-window approach
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

## -- I --

indiv_het_obs | Estimate individual observed heterozygosity
indiv_het_obs.tbl_df | Estimate individual observed heterozygosity
indiv_het_obs.vctrs_bigSNP | Estimate individual observed heterozygosity
indiv_inbreeding | Individual inbreeding coefficient
indiv_inbreeding.grouped_df | Individual inbreeding coefficient
indiv_inbreeding.tbl_df | Individual inbreeding coefficient
indiv_inbreeding.vctrs_bigSNP | Individual inbreeding coefficient
indiv_missingness | Estimate individual missingness
indiv_missingness.tbl_df | Estimate individual missingness
indiv_missingness.vctrs_bigSNP | Estimate individual missingness
indiv_ploidy | Return individual ploidy
indiv_ploidy.tbl_df | Return individual ploidy
indiv_ploidy.vctrs_bigSNP | Return individual ploidy
is_loci_table_ordered | Test if the loci table is ordered
is_loci_table_ordered.tbl_df | Test if the loci table is ordered
is_loci_table_ordered.vctrs_bigSNP | Test if the loci table is ordered

## -- L --

load_example_gt | Load example gen_tibble
loci_alt_freq | Estimate allele frequencies at each locus
loci_alt_freq.grouped_df | Estimate allele frequencies at each locus
loci_alt_freq.tbl_df | Estimate allele frequencies at each locus
loci_alt_freq.vctrs_bigSNP | Estimate allele frequencies at each locus
loci_chromosomes | Get the chromosomes of loci in a 'gen_tibble'
loci_chromosomes.tbl_df | Get the chromosomes of loci in a 'gen_tibble'
loci_chromosomes.vctrs_bigSNP | Get the chromosomes of loci in a 'gen_tibble'
loci_hwe | Test Hardy-Weinberg equilibrium at each locus
loci_hwe.grouped_df | Test Hardy-Weinberg equilibrium at each locus
loci_hwe.tbl_df | Test Hardy-Weinberg equilibrium at each locus
loci_hwe.vctrs_bigSNP | Test Hardy-Weinberg equilibrium at each locus
loci_ld_clump | Clump loci based on a Linkage Disequilibrium threshold
loci_ld_clump.tbl_df | Clump loci based on a Linkage Disequilibrium threshold
loci_ld_clump.vctrs_bigSNP | Clump loci based on a Linkage Disequilibrium threshold
loci_maf | Estimate allele frequencies at each locus
loci_maf.grouped_df | Estimate allele frequencies at each locus
loci_maf.tbl_df | Estimate allele frequencies at each locus
loci_maf.vctrs_bigSNP | Estimate allele frequencies at each locus
loci_missingness | Estimate missingness at each locus
loci_missingness.grouped_df | Estimate missingness at each locus
loci_missingness.tbl_df | Estimate missingness at each locus
loci_missingness.vctrs_bigSNP | Estimate missingness at each locus
loci_names | Get the names of loci in a 'gen_tibble'
loci_names.tbl_df | Get the names of loci in a 'gen_tibble'
loci_names.vctrs_bigSNP | Get the names of loci in a 'gen_tibble'
loci_pi | Estimate nucleotide diversity (pi) at each locus
loci_pi.grouped_df | Estimate nucleotide diversity (pi) at each locus
loci_pi.tbl_df | Estimate nucleotide diversity (pi) at each locus
loci_pi.vctrs_bigSNP | Estimate nucleotide diversity (pi) at each locus
loci_transitions | Find transitions
loci_transitions.tbl_df | Find transitions
loci_transitions.vctrs_bigSNP | Find transitions
loci_transversions | Find transversions
loci_transversions.tbl_df | Find transversions
loci_transversions.vctrs_bigSNP | Find transversions

## -- M --

mutate.gen_tbl | A mutate method for 'gen_tibble' objects
mutate.grouped_gen_tbl | A mutate method for grouped 'gen_tibble' objects

## -- N --

nwise_pop_pbs | Compute the Population Branch Statistics for each combination of populations

## -- P --

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
pop_fis | Compute population specific FIS
pop_fst | Compute population specific Fst
pop_gene_div | Compute the population expected heterozygosity
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
pop_tajimas_d.grouped_df | Estimate Tajima's D for the whole genome
pop_tajimas_d.tbl_df | Estimate Tajima's D for the whole genome
pop_tajimas_d.vctrs_bigSNP | Estimate Tajima's D for the whole genome
predict.gt_pca | Predict scores of a PCA

## -- Q --

qc_report_indiv | Create a Quality Control report for individuals
qc_report_indiv.grouped_df | Create a Quality Control report for individuals
qc_report_indiv.tbl_df | Create a Quality Control report for individuals
qc_report_loci | Create a Quality Control report for loci
qc_report_loci.grouped_df | Create a Quality Control report for loci
qc_report_loci.tbl_df | Create a Quality Control report for loci
q_matrix | Convert a standard matrix to a 'q_matrix' object

## -- R --

rbind.gen_tbl | Combine two gen_tibbles
rbind_dry_run | Generate a report of what would happen to each SNP in a merge
read_q_files | Read and structure .Q files or existing matrices as 'q_matrix' or 'gt_admix' objects.

## -- S --

scale_fill_distruct | Scale constructor using the distruct colours
select_loci | The 'select' verb for 'loci'
select_loci_if | The 'select_if' verb for 'loci'
show_genotypes | Show the genotypes of a 'gen_tibble'
show_genotypes.tbl_df | Show the genotypes of a 'gen_tibble'
show_genotypes.vctrs_bigSNP | Show the genotypes of a 'gen_tibble'
show_loci | Show the loci information of a 'gen_tibble'
show_loci.tbl_df | Show the loci information of a 'gen_tibble'
show_loci.vctrs_bigSNP | Show the loci information of a 'gen_tibble'
show_loci<- | Show the loci information of a 'gen_tibble'
show_loci<-.tbl_df | Show the loci information of a 'gen_tibble'
show_loci<-.vctrs_bigSNP | Show the loci information of a 'gen_tibble'
show_ploidy | Show the ploidy information of a 'gen_tibble'
show_ploidy.tbl_df | Show the ploidy information of a 'gen_tibble'
show_ploidy.vctrs_bigSNP | 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.gt_admix | Summary method for gt_admix objects
summary.rbind_report | Print a summary of a merge report
summary_rbind_report | Print a summary of a merge report

## -- T --

theme_distruct | A theme to match the output of distruct
tidy.gt_dapc | Tidy a 'gt_dapc' object
tidy.gt_pca | Tidy a 'gt_pca' object
tidy.q_matrix | Tidy a Q matrix

## -- W --

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

## -- misc --

$<-.gen_tbl | A $ method for 'gen_tibble' objects