libsequence  1.9.5
FragmentsRescaling.hpp File Reference

Helper functions for simulating partially linked fragments One often wants to simulate partially linked fragments under neutral models. An efficient way to do this is to simulate a contiguous fragment, but with the recombination rate varying along the region (to represent the variable genetic distances between fragments). This header file declares functions that make this task easier, particularly the operations of rescaling the positions of mutations/marginal trees from the genetic map back to the physical map. More...

#include <Sequence/Coalescent/SimTypes.hpp>
#include <vector>
#include <utility>

Go to the source code of this file.

Namespaces

 Sequence
 The namespace in which this library resides.
 
 Sequence::coalsim
 Routines for coalescent simulation.
 

Functions

int Sequence::coalsim::sample_length (const std::vector< std::pair< int, int > > &fragments)
 When simulating partially linked regions, return the total length of sample material that we are simulating. More...
 
int Sequence::coalsim::total_length (const std::vector< std::pair< int, int > > &fragments)
 When simulating partially linked regions, return the total length of the region. More...
 
void Sequence::coalsim::calculate_scales (const std::vector< std::pair< int, int > > &fragments, std::vector< std::pair< double, double > > *sample_scale, std::vector< std::pair< double, double > > *mutation_scale)
 This is a helper function that rescales physical distance in base pairs to continuous distance on the interval 0,1. More...
 
void Sequence::coalsim::rescale_mutation_positions (Sequence::SimData *d, const std::vector< std::pair< double, double > > &sample_scale, const std::vector< std::pair< double, double > > &mutation_scale)
 Rescales the positions of the mutations in d from the scale given in sample_scale to that given in mutation_scale. More...
 
void Sequence::coalsim::rescale_arg (arg *sample_history, const std::vector< std::pair< int, int > > &fragments)
 Rescales the beginnings of marginal trees in an ancestral recombination graph from a genetic scale to a physical scale.
 
double Sequence::coalsim::integrate_genetic_map (const std::vector< chromosome > &sample, const int &current_nsam, const std::vector< double > &genetic_map, std::vector< double > *reclens)
 When simulating non-uniform recombination rates, the probability of recombination at each point in the simulation needs to be obtained by integrating over the genetic map and the current sample configuration. This function does that. More...
 

Detailed Description

Helper functions for simulating partially linked fragments One often wants to simulate partially linked fragments under neutral models. An efficient way to do this is to simulate a contiguous fragment, but with the recombination rate varying along the region (to represent the variable genetic distances between fragments). This header file declares functions that make this task easier, particularly the operations of rescaling the positions of mutations/marginal trees from the genetic map back to the physical map.

Definition in file FragmentsRescaling.hpp.