This function takes the output of the function Painting and computes the genome-wide 'copying vectors', i.e., the proportion of the genome copied from each reference population.
PaintingProfile(
filename_painting,
filename_idfile,
nboot,
blocksize,
use_IDs = FALSE
)
A vector containing filenames of painting profiles. These are the outputs of Painting.
The filename of the idfile, which is an output of Painting.
Number of bootstrap samples to generate.
Number of blocks to combine for the bootstrap. For example, if Painting was run with a blgsize of 1e-5 Morgans, blocksize should be 5000 to achieve a blocksize of 5cM.
If TRUE, compute profiles for each sample. If FALSE (default), compute profiles for each group as specified in the second column of the idfile.
A DataFrame with the copying proportions per bootstrap sample.
# Example usage in R:
path <- paste0(system.file("test/", package = "twigstats"),"/")
prefix <- "test" # prefix of files under path
df <- PaintingProfile(c(paste0(path, prefix, "_painting.txt.gz")),
paste0(path, prefix, "_idfile.txt.gz"),
nboot = 10, blocksize = 5000)
#>
[==================================================] 100%
head(df)
#> POP labs prop bootstrap
#> 1 P1 P1 0.4152534932 0
#> 2 P1 P2 0.2901599333 0
#> 3 P1 P3 0.1329425962 0
#> 4 P1 P4 0.0002013573 0
#> 5 P1 PX 0.1614426199 0
#> 6 P2 P1 0.2868077072 0