sprinkle_markers_into_genome: Randomly distribute markers along the chromosomes of a genome

View source: R/sprinkle_markers_into_genomes.R

sprinkle_markers_into_genomeR Documentation

Randomly distribute markers along the chromosomes of a genome

Description

If you have a bunch of markers, but you don't know where in the genome they are, BUT you have an idea of how big the genome is and how many chromosomes are in it, this will place your markers uniformly within the length of the genome. This will let you assess how much of an effect the physical linkage might have on pairwise relationship inference.

Usage

sprinkle_markers_into_genome(markers, genome)

Arguments

markers

A tibble of markers and allele frequencies like markers40. It should have the columns Chrom, Locus, Pos, Allele, LocIdx, AlleIdx, and Freq, AND it must have been run through reindex_markers().

genome

A tibble like that in the chromo_lengths component of the list returned by geometric_chromo_lengths(). It must have the columns idx, chrom, scaled_length, num_bases.

Value

This returns a tibble that is of the same format as markers, but the positions of the markers have been simulated uniformly into the length of the genome in genome. Note that the Locus column in markers is retained as the name of each locus.

Examples

# make a fake genome
genome = geometric_chromo_lengths(n = 41, L = 7.4, sl = 0.2)$chrom_lengths
# get the markers to sprinkle into that genome
markers = markers40

eriqande/CKMRsim documentation built on Aug. 2, 2024, 7:23 a.m.