Skip to contents

gen_tibble

Functions for creating, saving, and loading gen_tibble objects.

gen_tibble()
Constructor for a gen_tibble
gt_save()
Save a gen_tibble
gt_load()
Load a gen_tibble
gt_get_file_names()
Get the names of files storing the genotypes of a gen_tibble

Show

Functions to view loci and genotype information stored in a gen_tibble.

show_genotypes()
Show the genotypes of a gen_tibble
show_loci() `show_loci<-`()
Show the loci information of a gen_tibble
show_ploidy()
Show the ploidy information of a gen_tibble
count_loci()
Count the number of loci in a gen_tibble
augment_loci()
Augment the loci table with information from a analysis object

Selecting loci

Functions to select loci from a gen_tibble, either based on loci information, or genotype information.

select_loci()
The select verb for loci
select_loci_if()
The select_if verb for loci

Imputing

Functions for imputing missing data in a gen_tibble.

gt_impute_simple()
Simple imputation based on allele frequencies
gt_has_imputed()
Checks if a gen_tibble has been imputed
gt_uses_imputed()
Checks if a gen_tibble uses imputed data
gt_set_imputed()
Sets a gen_tibble to use imputed data

Merging

Functions for merging gen_tibble objects.

rbind_dry_run()
Generate a report of what would happen to each SNP in a merge
rbind(<gen_tbl>)
Combine two gen_tibbles
summary(<rbind_report>)
Print a summary of a merge report

Exporting

Functions for exporting a gen_tibble to another format.

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

Quality control

Functions reporting summary statistics for a gen_tibble.

qc_report_loci()
Create a Quality Control report for loci
qc_report_indiv()
Create a Quality Control report for individuals
autoplot(<qc_report_loci>)
Autoplots for qc_report_loci objects
autoplot(<qc_report_indiv>)
Autoplots for qc_report_indiv objects
filter_high_relatedness()
Filter individuals based on a relationship threshold

Loci

Functions operating across loci.

loci_alt_freq() loci_maf()
Estimate allele frequencies at each 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_transitions()
Find transitions
loci_transversions()
Find transversions

Individual

Functions operating across individuals.

indiv_het_obs()
Estimate individual observed heterozygosity
indiv_missingness()
Estimate individual missingness
indiv_ploidy()
Return individual ploidy

Population

Functions operating on a gen_tibble grouped by population.

pop_fis()
Compute population specific FIS
pop_fst()
Compute population specific Fst
pop_global_stats()
Compute basic population global statistics
pop_het_exp() pop_gene_div()
Compute the population expected heterozygosity
pop_het_obs()
Compute the population observed heterozygosity

Pairwise

Functions comparing individuals or populations.

pairwise_allele_sharing()
Compute the Pairwise Allele Sharing Matrix for a gen_tibble object
pairwise_ibs()
Compute the Identity by State Matrix for a gen_tibble object
pairwise_pop_fst()
Compute pairwise population Fst
pairwise_king()
Compute the KING-robust Matrix for a a gen_tibble object

PCA

Functions for performing Principal Component Analysis.

gt_pca
Principal Component Analysis for gen_tibble objects
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
predict(<gt_pca>)
Predict scores of a PCA
tidy(<gt_pca>)
Tidy a gt_pca object
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
autoplot(<gt_pca>)
Autoplots for gt_pca objects

DAPC

Functions for performing Discriminant Analysis of Principal Components.

gt_dapc()
Discriminant Analysis of Principal Components for gen_tibble
gt_cluster_pca()
Run K-clustering on principal components
gt_cluster_pca_best_k()
Find the best number of clusters based on principal components
tidy(<gt_dapc>)
Tidy a gt_dapc object
augment(<gt_dapc>)
Augment data with information from a gt_dapc object
autoplot(<gt_dapc>)
Autoplots for gt_dapc objects
autoplot(<gt_cluster_pca>)
Autoplots for gt_cluster_pca objects

K-clustering (e.g. ADMXITURE)

Functions for creating, tidying, and visualising q_matrix objects.

q_matrix()
Read and structure .Q files or existing matrices as q_matrix or q_matrix_list objects.
get_q_matrix()
Return a single Q matrix from a q_matrix_list object
get_p_matrix()
Return a single P matrix from a q_matrix_list object
tidy(<q_matrix>)
Tidy a Q matrix
augment(<q_matrix>)
Augment data with information from a q_matrix object
autoplot(<q_matrix>)
Autoplots for q_matrix objects
summary(<q_matrix_list>)
Summarise a Q matrix list
distruct_colours
Distruct colours
scale_fill_distruct()
Scale constructor using the distruct colours
theme_distruct()
A theme to match the output of distruct

Other analyses (e.g. ADMIXTOOLS2, pcadapt)

Functions for other analyses within R.

gt_extract_f2()
Compute and store blocked f2 statistics for ADMIXTOOLS 2
gt_roh_window()
Detect runs of homozygosity using a sliding-window approach
gt_pcadapt()
pcadapt analysis on a gen_tibble object
autoplot(<gt_pcadapt>)
Autoplots for gt_pcadapt objects

bigSNP

Mostly for developers: Functions for operating directly on bigSNP objects.

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