Description Usage Arguments Value Examples
View source: R/polygenic_test.R
Tests for evidence of polygenic selection by matching SNPs by DAF and using a one-sided Wilcoxon rank sum test.
1 | PolyTest(DAFs, pvalues, quantiles, allele_ages_quantiles)
|
DAFs |
1d array. Derived allele frequencies of trait associations |
pvalues |
1d array. Selection pvalues of trait associations |
quantiles |
data frame. Obtained from PolyTest_Init. |
allele_ages_quantiles |
List of data tables. Obtained from PolyTest_Init. |
Returns a pvalue.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Example analysis:
# read files
mut <- read.mut(system.file("extdata/example.mut.gz", package = "relater"), CHR = 1)
sele <- read.sele(system.file("extdata/example.sele.gz", package = "relater"), CHR = 1)
freq <- read.freq(system.file("extdata/example.freq.gz", package = "relater"), CHR = 1)
qual <- read.qual(system.file("extdata/example.qual.gz", package = "relater"), CHR = 1)
# Obtain allele_ages data table
allele_ages <- get.allele_ages(mut, freq, sele)
allele_ages <- filter.allele_ages(allele_ages, qual)
######### Polygenic selection test #########
# Initialise
quant <- PolyTest_Init(allele_ages)
# Make a fake polygenic trait
df <- allele_ages[!is.na(allele_ages$pvalue),]
df <- df[sample(1:nrow(df), 50, replace = FALSE),]
# Run polygenic test
PolyTest(df$DAF, df$pvalue, quant$quantiles, quant$allele_ages_quantiles)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.