This function outputs the first coalescence with an individual from a pre-specified group identity along the genome. If the first such coalescnece involves several copying candidates, a random haplotype is chosen. Output is in GLOBEtrotter format.
Painting(
file_anc,
file_mut,
file_map,
file_out,
poplabels,
blgsize = NULL,
pops = NULL,
chrs = NULL
)
Filename of anc file. If chrs is specified, this should only be the prefix, resulting in filenames of ${file_anc}_chr${chr}.anc(.gz).
Filename of mut file. If chrs is specified, this should only be the prefix, resulting in filenames of ${file_anc}_chr${chr}.anc(.gz).
File prefix of recombination map.
File prefix of output files
Filename of poplabels file
(Optional) SNP block size in Morgan. Default is 0.05 (5 cM). If blgsize is 1 or greater, if will be interpreted as base pair distance rather than centimorgan distance.
(Optional) Populations for which data should be extracted. Names need to match the second column of the poplabels file
(Optional) Vector of chromosome IDs
void. Write three files idfile, paint, rec to disc.
file_anc <- system.file("sim/msprime_ad0.8_split250_1_chr1.anc.gz", package = "twigstats")
file_mut <- system.file("sim/msprime_ad0.8_split250_1_chr1.mut.gz", package = "twigstats")
poplabels <- system.file("sim/msprime_ad0.8_split250_1.poplabels", package = "twigstats")
file_map <- system.file("sim/genetic_map_combined_b37_chr1.txt.gz", package = "twigstats")
#define populations to paint against:
pops <- c("P1","P2","P3","P4")
Painting(file_anc, file_mut, file_map, file_out = "test", poplabels, blgsize = 1e-5)