Skip to content

genomicSimulationC v0.2.5

Choose a tag to compare

@vllrs vllrs released this 21 May 05:50
· 46 commits to main since this release

New Features

  • Add ability to load multiple recombination maps into simulation at a time. Loading a genetic map file will return a MapID that represents that particular map. All crossing functions now have additional parameters that allow you to select which recombination map to use when generating gametes from each group of parents. The crossing functions default to using the first loaded recombination map if not otherwise specified. Maps can be removed from memory using delete_recombination_map. The list of genetic markers tracked by the simulation, however, is still immutable, so genetic markers not present in the first map loaded will not be tracked or simulated.
    • BREAKING CHANGE: Simulation functions generating progeny now take an extra parameter, the recombination map to be used to generate gametes. If updating a script from an older version of genomicSimulation, the value NO_MAP can be passed to these parameters to continue using the first/default map.
  • New function change_allele_symbol changes the internal representation of a particular allele. It does not modify corresponding marker effects.

Bug Fixes

  • Fix a bug in large simulations where gaps in the AlleleMatrix linked list failed to be patched in condense_allele_matrix, and some genotypes lost their group numbers (group numbers reverted to 0).

Improvements

  • Smarter and more robust genotype matrix, genetic map, and effect file loaders. See R version vignette or Templates page of C version documentation for more information. (BREAKING CHANGE) This involves changes to the roster of file loader functions. As of v0.2.5, available file loader functions are:
    • load_data_files
    • load_genotypefile
    • load_mapfile
    • load_effectfile
  • All C code now has C-style "namespace guards" (the prefix gsc_ in front of every name). Data structures and user-friendly functions are still exported with non-prefixed "short names" unless GSC_NO_SHORT_NAMES is defined before import.
  • BREAKING CHANGE: Several function names have been changed, for better consistency within functional categories and better consistency with the R version of genomicSimulation.
    • To keep using the old names, import the names_stopgap.h header file. Optionally, #define GSC_DEPRECATED_VERBOSE before importing names_stopgap.h, and it will give runtime warnings as to exactly which names have changed, for an easy way to update a script to use the new names.
  • CONTIG_WIDTH and NAME_LENGTH (the "global settings") can now be altered without needing to modify the genomicSimulation source files, using macro definitions. See instructions at the top of sim-operations.h
  • genomicSimulation's malloc and free can be replaced with alternate implementations, using macro definitions. See instructions at the top of sim-operations.h.
  • Significant under-the-hood changes to crossing functions.
  • The same script and same random seed re-run post-0.2.4.003 will now produce different progeny.
  • Under-the-hood changes to condense_allele_matrix, for easier debugging.
  • Remove all Variable Length Arrays (VLAs).