Skip to content

genomicSimulationC v0.3

Latest

Choose a tag to compare

@vllrs vllrs released this 25 Jul 06:44

This release would be v0.2.7 in the old numbering scheme, but the numbering scheme is being simplified.

New Features

  • It is now possible to add "centre" values to a set of marker effects. The centre values are subtracted from the breeding value contribution of each marker when calculating breeding values. Centres can be added using new functions change_eff_set_centres_to_values, change_eff_set_centres_of_markers, and change_eff_set_centres_of_allele_count, or by adding an extra column titled "centre" to the input effect file. These centre values can be useful, for example, for marker effects derived from GBLUP, where proper use of these marker effects requires subtracting a factor based on allele frequency from each marker's score.
  • CHANGE: when initialising the simulation with a genotype file but no map file, the default behaviour is now to generate a map where each genetic marker from the genotype file belongs to a separate chromosome/linkage group, and therefore each marker's inheritance is unlinked/independent of the inheritance of alleles at other markers. The old default (generated map where all markers are on the same chromosome, 1cM apart) is still available via function gsc_create_uniformspaced_recombmap. The new behaviour is available via function gsc_create_unlinked_recombmap.
  • A warning is now displayed if a map is loaded that has a very large chromosome length to number of markers ratio, which might correspond to loading a map with (invalid) base pair positions instead of (correct) centimorgan positions.
  • A warning is now displayed if the primary map contains duplicate marker names, because data from further input files will only be loaded into one of the duplicates.
  • The simulation now does store chromosome names internally, not just chromosome orderings.

Improvements

  • Small improvements in speed of breeding value calculation.
  • Generalisation of header-parsing logic of load_mapfile and load_effectfile, to prepare for accepting further columns in future.
  • BREAKING CHANGE: calculate_local_bvs now returns local BVs in a DecimalMatrix and can be called with a group number or NO_GROUP, like other calculate_ functions. Removed calculate_group_local_bvs as its function was subsumed. To calculate and save local BVs to a file, use the function save_local_bvs.
  • BREAKING CHANGE: EffectMatrix has been replaced with new struct MarkerEffects. To match, gsc_delete_effect_matrix has been renamed to gsc_delete_effect_set.
  • The conversion script that creates the library for the genomicSimulation R package now converts fprintf(stderr, "msg") to Rprintf("NOTE! msg"), instead of warning("msg"), so that non-stopping errors like these are still printed if a segfault occurs. (By default, R hides warning messages until the end of execution scope, and so loses them if a segfault occurs).
  • The conversion script that creates the library for the genomicSimulation R package now adds a tag to converted files below the version number, noting that they have been through the conversion process, and what version of the conversion script converted them. The first version-numbered conversion script is version "v2".
  • Makefile has a new target "sharedlib" (run make sharedlib) to compile genomicSimulation as a shared library, rather than a standalone executable that runs the test suite.

Bug Fixes

  • Fix a segfault that occured when calling load_data_files with genotype_file = NULL.
  • Fix a segfault that occured when trying to create iterators for a simulation object with no loaded genotypes.
  • Fix a bug where marker names had trailing spaces (and therefore, when loading more input files later, could not be matched) when automatically generating a genetic map from a genotype file.
  • Fix a bug in create_evenlength_blocks_each_chr where too many markers would be allocated to the last block because genetic distances were being cumulatively summed even though they were already cumulative values. This bug would date back to v0.2.5, when ability to load multiple recombination maps was added.
  • Memory allocations of size 0 are no longer requested when attempting to use a MarkerBlocks struct that has been deleted.
  • SimData.n_groups is no longer decremented if a call is made to delete_group for a group number with zero members (a nonexistent group).
  • Fix a bug during genotype file loading where alleles would not be saved to the SimData if the program was creating a genetic map from the markers in the file.
  • Fix a bug where the simulation would crash on the first command run after a simulation-initialisation where a genotype file was provided, but genomicSimulation failed to load any genotypes from it (which could be caused by an incorrect genotype file name or an incorrect genotype file format)