tidypopgen 1.1.0
CRAN release: 2026-11-27
New features and changes
- new
gt_pca()computes PCAs, by default with missing genotypes handled asplink --pca(PLINK 1.9), without imputation;gt_pca_partialSVD()andgt_pca_randomSVD()are deprecated -
gt_pca()accepts pseudohaploid data, coded as homozygous diploids (as in PLINK) -
gt_pcadapt(),gt_dapc()andloci_ld_clump()work with missing genotypes without imputation, using the individuals genotyped at each locus (aspcadaptand PLINK) - new
loci_ld_prune()prunes loci asplink --indep-pairwise(PLINK 1.9) -
predict()of agt_pcausesproject_method = "least_squares"on all components by default, and is 2-3 times faster; newproject_method = "plink"projects as PLINK 1.9 -
pairwise_grm(method = "plink")gives PLINK 1.9’s relationship matrix -
pairwise_ibs(missing_correction = "allele_freq")corrects for missing genotypes as PLINK 1.9’s--distance - new
pairwise_dist()computes genetic distances between individuals as ngsDist, e.g. for neighbour-joining trees -
pairwise_king()on a groupedgen_tibblecomputes kinship within each group (it used to ignore the groups) -
pairwise_king(),pairwise_ibs(),pairwise_allele_sharing(),pairwise_dist(),indiv_inbreeding()andwindows_indiv_roh()are S3 generics, so that other packages can add methods - new
bootstrap_blocks(), for developers: the blocks of the block bootstrap, so that other packages can resample the same blocks - new
group_labels()andgroup_columns(), for developers: the labels and tidy columns of groups, so that other packages name groups as tidypopgen - new
gt_merge_vcfs()andgt_concat_vcfs()read several VCF files into a singlegen_tibble, asbcftools mergeandbcftools concat - integer chromosomes (
chromosomes_as_int) for datasets with many chromosomes; the original names of integer loci and chromosomes are kept in sidecar files (gt_lookup_loci(),gt_restore_loci()andgt_lookup_chromosomes()) - phased genotypes (experimental):
gen_tibble(phased = TRUE)reads phased VCF files;is_phased()andshow_haplotypes()give the phase,gt_as_vcf()writes it, andrbind()keeps it - new
gt_simulate_bn()simulates toy datasets (Balding-Nichols model) -
qc_report_loci(hwe = FALSE)gives the MAF and missingness of loci in a single pass -
gt_impute_simple()works after removing loci (but not individuals) -
gen_tibble()reads packedancestry genotype files in the TGENO layout (one record per individual, as in recent releases of the AADR) as well as GENO; the layout is detected from the header of the file, whatever its extension (.geno or .tgeno) - faster input and output: VCF, .bed and packedancestry (.geno) files are read in parallel (
n_cores), .ped files are read faster, and .gt files are saved twice as fast - faster
pairwise_king()(up to 1.8 times on CPUs with AVX2),pairwise_ibs()andpairwise_allele_sharing(), and much fasterindiv_inbreeding()andqc_report_indiv()on grouped data - faster
select_loci(), and fastergt_as_vcf(),gt_update_backingfile()andgt_order_loci()with many chromosomes;gt_as_genlight()uses less memory -
indiv_inbreeding()on a groupedgen_tibblereturns one value per individual, in the order of the rows (computed within each group); the list of one vector per group (type = "list") is deprecated. It also works on thegenotypescolumn, e.g. withinmutate() -
indiv_het_obs(),indiv_missingness()andindiv_ploidy()have methods for groupedgen_tibbles (all individuals in one pass, in the order of the rows) and for tibbles that lost their class -
loci_alt_freq(as_counts = TRUE)on a groupedgen_tibblefollowstype: by default a tibble with the columnsn_altandn_valid;type = "matrix"gives the two matrices of before, now with loci and group names - new article on large RAD-seq datasets; the big data article uses
gt_merge_vcfs()
Bug fixes
- fix occasional “File ‘…bk’ already exists” errors from functions using temporary backing files (PCA, LD clumping, KING, IBS and allele sharing)
-
loci_ld_clump(),gt_pcadapt()and the PCA functions: fix false “You can’t have missing values” errors (or hangs) after removing loci or individuals with missing genotypes -
gt_pca(method = "random")andgt_pca_autoSVD(): fix hangs or cryptic errors with a customfun_scalingand missing genotypes, and use at mostn_corescores -
gt_pcadapt(): clear error for loci with the same genotype in every individual (#179) -
gen_tibble(): error on .bed files whose size does not match the .bim and .fam files, and on individual-major .bed files -
gen_tibble(): packedancestry files that are truncated, or whose header does not match the .ind and .snp files, give an error before the backing file is created, and EIGENSTRAT (text) .geno files a clear error -
gen_tibble()on .ped files: a third allele always flags the locus as multi-allelic -
gen_tibble()with the “cpp” parser: fix malformed VCF files read as wrong genotypes (now an error), missing chromosomes (nowNA), and backing files left behind on errors -
gt_as_vcf(): fix loci with missing chromosomes (now written as “.”) -
loci_ld_clump(): error onexcludevalues that are not indices of loci -
rbind(): fix groupedgen_tibbles, which now keep the grouping of the first one -
gt_add_sf(): no “Adding missing grouping variables” message on groupedgen_tibbles -
loci_pi()on a groupedgen_tibblewith a single individual: fix the output, which was a plain vector whatevertype
tidypopgen 1.0.0
CRAN release: 2026-11-07
New features and changes
- optimisations to work on whole genomes, both speed and memory
- new functions to compute site frequency spectra (SFS) for demographic inference:
pop_sfs(),pairwise_pop_sfs()andnwise_pop_sfs() - native
windows_indiv_roh()matching the algorithm used by PLINK 1.9 (--homozyg); the old version, based ondetectRUNS, is deprecated asgt_roh_window() -
gt_roh_froh(),gt_roh_loci()andgt_roh_islands()summarise runs of homozygosity (F_ROH, loci in runs, and ROH islands) -
jackknife_*functions for genome-wide statistics with block jackknife standard errors -
pop_tajimas_d()and related functions handle missing genotypes aspixy, and work with polyploid and pseudohaploid data -
autoplot()method for the distance matrices ofpairwise_*functions - option to use integer loci names (
names_as_int) for large datasets, when reading VCF and PLINK bed files - polyploid support in
indiv_het_obs(),pop_het_obs(),loci_pi()andgt_as_genind(); clear errors where polyploids are not supported -
pairwise_ibs(type = "adjusted_counts")now returns PLINK’s allele count distance (--distance flat-missing) -
pairwise_*functions use imputed genotypes when set withgt_set_imputed(), and use several cores by default -
gen_tibble()on ped files stores individual information in the same columns as for bed files (see?gen_tibble) -
gen_tibble()copies the backing file of bigSNP objects (never modifying them), and works on read-only files -
rbind(use_position = TRUE)keeps the loci names of the reference, and needs much less memory; integer names are matched by position - the
as_isargument ofrbind()is deprecated (it was never implemented) -
cbind()renames duplicated columns asdplyr::bind_cols();idandgenotypescan not be added -
distruct_coloursholds the 56 distinct distruct colours, recycled with a warning byscale_fill_distruct() -
gt_as_genlight()keeps alleles, chromosomes and positions, so thatgt_from_genlight()can convert back - classes are preserved by all dplyr verbs; grouped functions keep the order of factor levels, and work with several grouping variables and empty groups
-
heatmap_add_dendro()returns agtable, which can be combined with patchwork -
augment_loci()works ongt_pca_autoSVD()results -
gt_admixture()uses ADMIXTURE on the PATH when conda is not installed - faster “cpp” VCF parser, and
select_loci_if()no longer loads all the genotypes - informative errors for invalid inputs to
gen_tibble(),show_loci<-,gt_order_loci(),gt_pcadapt(),gt_dapc(),pop_fst()and others
Bug fixes
-
gen_tibble(): fix backing file names (truncated at dots, or “.vcf.bk”), and backing files left behind on errors -
gen_tibble(): fix files with trailing blank lines, CRLF line endings or upper case extensions -
gen_tibble()on bed files keeps .fam IDs as text, and quantitative phenotypes as numbers -
gen_tibble()on VCF files: fix the ploidy of individuals missing on the first variant, partially missing genotypes, and genotypes above the ploidy -
gen_tibble(): “0” and “.” are always missing alleles; fix the “vcfR” parser on indels and on missing genotypes on the second variant -
gt_load(): fix the ploidies of gen_tibbles saved in the old bigSNP format -
gt_as_plink(): fix the .fam and .map information, missing alleles, and ped/raw files with numeric phenotypes, no population or pseudohaploids -
gt_as_vcf()andgt_as_plink(): fix positions in scientific notation, and the date in the VCF header -
gt_admixture()andgt_snmf(): fix seeds with several runs, paths containing “geno”, and the order of loci in P matrices -
gt_snmf(): fix continued projects, and the order of cross-entropies -
gt_impute_xgboost(): fix unsorted loci;gt_impute_simple(): restore the BLAS option -
filter_high_relatedness(): fix missing and strongly negative kinship coefficients -
snp_allele_sharing(): fix blocks of different sizes;indiv_het_obs(): fix the number of loci afterselect_loci() -
pop_global_stats(): fix loci where a population has no data;pop_tajimas_d(): fix loci with no valid genotypes -
loci_alt_freq()andloci_maf(): fix polyploids and single individuals - grouped
loci_*functions andqc_report_*: fix factor, numeric, non-contiguous and empty groups, and p-values above 1 -
loci_transitions()andloci_transversions(): fix misclassified substitutions -
windows_*functions: fix the last loci of chromosomes;windows_pairwise_pop_fst()andwindows_nwise_pop_pbs()ignoringmethod -
gt_roh_window(): fix homozygotes for the alternate allele withheterozygosity = TRUE -
gt_dapc()andgt_cluster_pca(): fix the default number of components, the variance retained, and the choice of k -
gt_pca_autoSVD(): fix unsorted loci;augment()ofgt_pcaandgt_dapc: fix single components and integer ids -
rbind(): fix ploidies after filtering, and missingallele_ref;rbind_dry_run(): fix paths to .bim files - dplyr verbs on grouped gen_tibbles: fix
select(),rename(),relocate(),[,ungroup(),group_by()andmutate() -
autoplot()ofq_matrixandgt_admix: fix the sorting options, numeric and unused groups, andtype = "cv"; ordering in otherautoplot()s -
gt_admix_reorder_q(): fix K = 1 -
heatmap_add_dendro(): fix ties and older ggplot2;heatmap_pairwise(): fix factor ids - fix chromosome names being renumbered in lexicographic order
-
gt_pseudohaploid(): fix other individuals of the backing file, and error on data that are not diploid -
tidy()andaugment()ofq_matrix: fix ignoring individual ids -
gt_as_genind(): fix loci names with “.”;gt_from_genlight(): fix objects withoutpop;gt_as_hierfstat(): fix numeric labels -
gt_update_backingfile(): fix numbers of loci that are multiples ofchunk_size; fix printing gen_tibbles with no loci - fix documentation and error messages of several functions
tidypopgen 0.4.4
CRAN release: 2026-05-19
- fix seed argument of
gt_admixture() - implement our own upset plot function to avoid dependency on
UpSetRpackage, which is no longer maintained - fix reading of VCFs when genotype separator symbol is present in the sample information
- fix
loci_functions output when calculating across groups for a single loci - fix
gt_update_backingfile()to preserve imputation metadata when backing files are updated - add validation in
gt_impute_simple()to detect and report SNP dimension mismatches caused by excluded SNPs - add
outdirargument ingt_admixture()to store partial outputs for large jobs - fix
gt_admixture()output file names when n_runs > 1
tidypopgen 0.4.3
CRAN release: 2026-01-23
- fix occasional test failure when temporary file names contained certain patterns
tidypopgen 0.4.2
CRAN release: 2026-01-22
- allow least squares projection of multiple components at once in
gt_project_pca()
tidypopgen 0.4.1
CRAN release: 2025-12-20
- duplicate-distance checks removed in
is_loci_table_ordered() - make
qc_report_*functions work with pseudohaploids
tidypopgen 0.4.0
CRAN release: 2025-10-24
- store chromosomes as factors, and remove redundant column storing chromosome as integer
tidypopgen 0.3.3
- only use the FBM backend (rather than a complete bigsnpr object)
- fix a few minor bugs
tidypopgen 0.3.0
- add
gt_pseudohaploid()and adapt appropriate functions to work with pseudohaploids
