| Title: | Identifying Trait-Relevant Functional Annotations |
|---|---|
| Description: | Using enrichment of genome-wide association summary statistics to identify trait-relevant cellular functional annotations. Compatibility updates by Renova. |
| Authors: | Diego Calderon [aut, cre] |
| Maintainer: | Diego Calderon <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0.9001 |
| Built: | 2026-11-16 18:27:08 UTC |
| Source: | https://github.com/renova-r/rolypoly |
Bootstrap parameter estimates for confidence intervals.
bootstrap_estimator(rolypoly, bootstrap_iters, run_light, run_parallel)bootstrap_estimator(rolypoly, bootstrap_iters, run_light, run_parallel)
rolypoly |
rolypoly object |
bootstrap_iters |
number of bootstrap iterations to run |
run_light |
if we throw away bootstrap data |
run_parallel |
if we want to collect bootstrap data in parallel |
## Not run: bootstrap_estimator(rolypoly)## Not run: bootstrap_estimator(rolypoly)
A vector of indenpendent heritability contributions of block annotations is returned. Sum the vector to get total explained heritability and divide by sum to get proportion.
calculate_annotation_block_heritability(block_data, params)calculate_annotation_block_heritability(block_data, params)
block_data |
functional information of blocks |
params |
parameter fit |
## Not run: calculate_annotation_block_heritability(block_data, params)## Not run: calculate_annotation_block_heritability(block_data, params)
From a model fit we can predict expected variance of a block based on information we have about the block. In the example of gene expression this would equate to predicting the importance of a gene based on its signature of expression.
calculate_block_values(block_data, params)calculate_block_values(block_data, params)
block_data |
block_data |
params |
parameter fit |
returns block values
## Not run: calculate_gene_values(block_data, params)## Not run: calculate_gene_values(block_data, params)
From a model fit we can predict expected variance of a block based on information we have about the block. In the example of gene expression this would equate to predicting the importance of a gene based on its signature of expression.
calculate_expected_block_values_given_ld(rolypoly, block_values)calculate_expected_block_values_given_ld(rolypoly, block_values)
rolypoly |
rolypoly object |
block_values |
estimated block values. |
## Not run: calculate_expected_block_values_given_ld(rolypoly, block_values)## Not run: calculate_expected_block_values_given_ld(rolypoly, block_values)
Use CV to find appropriate values of lambda for either feature selection or for prediction.
cv_regularized_parameter_estimator(vectorized_rolypoly_data, n_folds = 10, ...)cv_regularized_parameter_estimator(vectorized_rolypoly_data, n_folds = 10, ...)
vectorized_rolypoly_data |
rolypoly data used for inference |
n_folds |
number of folds for cross validation |
... |
other arguments to pass to cv.glmnet |
results from cross validation
## Not run: cv_regularized_parameter_estimator(vectorized_rolypoly_data)## Not run: cv_regularized_parameter_estimator(vectorized_rolypoly_data)
We must open block annotation data, gwas data, snp annotations, gene annotations. Here, you'll find functions that to this and organize these data into a rolypoly object.
Functions for inferring relevant annotations using the polyTest model.
Given the path of a gwas file open it into a data.table object
make_ld_matrix(all_snps, ld_data)make_ld_matrix(all_snps, ld_data)
all_snps |
The snps that were queried |
ld_data |
A returned LD matrix with SNP, Proxy, and RSquared columns |
an LD matrix where query snps will be the first columns in the correct order
## Not run: make_ld_matrix(all_snps, ld_data)## Not run: make_ld_matrix(all_snps, ld_data)
Helper function to make a summary table of results from bootstrap data.
make_results_df(value_collection, annotations, model_estimates)make_results_df(value_collection, annotations, model_estimates)
value_collection |
collection of bootstrapped value estimates |
annotations |
vector of annotation names |
model_estimates |
estimates for bias parameter estimates |
data frame with results summary
## Not run: make_results_df(value_collection)## Not run: make_results_df(value_collection)
Find parameter estimates for the data.
parameter_estimator(vectorized_rolypoly_data)parameter_estimator(vectorized_rolypoly_data)
vectorized_rolypoly_data |
rolypoly data that has been vectorized |
results of inference
## Not run: parameter_estimator(rolypoly)## Not run: parameter_estimator(rolypoly)
Visualize parameter estimates after running inference
plot_rolypoly_annotation_estimates(rolypoly)plot_rolypoly_annotation_estimates(rolypoly)
rolypoly |
a rolypoly object |
ggplot2 object
## Not run: plot_rolypoly_annotation_estimates(rolypoly)## Not run: plot_rolypoly_annotation_estimates(rolypoly)
Rank annotations by p-value after running inference
plot_rolypoly_annotation_ranking(rolypoly)plot_rolypoly_annotation_ranking(rolypoly)
rolypoly |
a rolypoly object |
ggplot2 object
## Not run: plot_rolypoly_annotation_ranking(rolypoly)## Not run: plot_rolypoly_annotation_ranking(rolypoly)
Functions for inferring relevant annotations using the polyTest model.
Find robust parameter estimates for the data.
robust_parameter_estimator(vectorized_rolypoly_data, outlier_threshold = 10)robust_parameter_estimator(vectorized_rolypoly_data, outlier_threshold = 10)
vectorized_rolypoly_data |
vectorized rolypoly data |
outlier_threshold |
outlier threshold for robust inference |
## Not run: parameter_estimator(rolypoly)## Not run: parameter_estimator(rolypoly)
The rolypoly package for identifying annotations associated with complex traits.
Add LD corrected block scores to rolypoly.
rolypoly_add_ld_corrected_gwas_block_scores(rolypoly, fast_calculation = T)rolypoly_add_ld_corrected_gwas_block_scores(rolypoly, fast_calculation = T)
rolypoly |
rolypoly data |
fast_calculation |
if F then LD deconvolution else quadratic form. |
rolypoly object with LD corrected gwas scores attached
## Not run: rolypoly_add_ld_corrected_gwas_block_scores(rolypoly)## Not run: rolypoly_add_ld_corrected_gwas_block_scores(rolypoly)
Takes block information, potentially independent LD blocks or gene blocks, and gwas data and organizes the data for interenal processing
rolypoly_link_blocks_and_gwas(rolypoly, ld_folder, r2_threshold = 0.2, run_parallel = F)rolypoly_link_blocks_and_gwas(rolypoly, ld_folder, r2_threshold = 0.2, run_parallel = F)
rolypoly |
a rolypoly object |
ld_folder |
path to a folder with ld data |
r2_threshold |
LD threshold to look at data |
run_parallel |
check if user wants to run in parallel |
rolypoly object with data attached
## Not run: rolypoly_link_blocks_and_gwas(rolypoly, ld_folder, r2_threshold)## Not run: rolypoly_link_blocks_and_gwas(rolypoly, ld_folder, r2_threshold)
Load annotations for blocks of LD, in some cases this is a gene annotation with a window around a gene.
rolypoly_load_block_annotation(rolypoly, block_annotation, genes = T)rolypoly_load_block_annotation(rolypoly, block_annotation, genes = T)
rolypoly |
rolypoly data object |
block_annotation |
annotation information for block |
genes |
if these are genes |
rolypoly data with block annotations attached
## Not run: rolypoly_load_block_annotation(rolypoly, block_annotation)## Not run: rolypoly_load_block_annotation(rolypoly, block_annotation)
Block annotations, usually gene model.
rolypoly_load_block_data(rolypoly, block_data)rolypoly_load_block_data(rolypoly, block_data)
rolypoly |
a rolypoly object |
block_data |
a data frame of block information, usually gene expression. Requires rownames that are identitcal to block labels loaded previously. |
a rolypoly object with block information loaded
## Not run: rolypoly_load_block_data(rolypoly, block_data)## Not run: rolypoly_load_block_data(rolypoly, block_data)
Load gwas data
rolypoly_load_gwas(rolypoly, gwas_data, snp_annotations = NULL, gwas_z_filter = -1, add_spline = F, n_knots = 1, add_poly = F, n_degree = 2)rolypoly_load_gwas(rolypoly, gwas_data, snp_annotations = NULL, gwas_z_filter = -1, add_spline = F, n_knots = 1, add_poly = F, n_degree = 2)
rolypoly |
rolypoly data |
gwas_data |
gwas data |
snp_annotations |
if there are additional snp annotations included |
gwas_z_filter |
if we want to remove large effect SNPs |
add_spline |
for fitting a spline to maf |
n_knots |
number of knots for spline |
add_poly |
for fitting a polynomial to maf |
n_degree |
degree of polynomial to fit |
rolypoly object with gwas data loaded
## Not run: rolypoly_load_gwas(rolypoly, gwas_data)## Not run: rolypoly_load_gwas(rolypoly, gwas_data)
Coordinates running inference.
rolypoly_perform_inference(rolypoly, bootstrap_iters = 50, outlier_threshold = -1, run_light = F, run_parallel = F)rolypoly_perform_inference(rolypoly, bootstrap_iters = 50, outlier_threshold = -1, run_light = F, run_parallel = F)
rolypoly |
rolypoly object |
bootstrap_iters |
number of bootstrap iterations to perform |
outlier_threshold |
threshold for performing robust regression, still experimental. |
run_light |
if we throw out bootstrap data |
run_parallel |
if we collect bootstraps in parallel |
rolypoly object with inference information attached
## Not run: run_inference(rolypoly)## Not run: run_inference(rolypoly)
If p-values are desired use the other inference function. This for prediction purposes.
rolypoly_perform_regularized_inference(rolypoly, ...)rolypoly_perform_regularized_inference(rolypoly, ...)
rolypoly |
a rolypoly object |
... |
other arguments to pass to cv.glmnet |
rolypoly object with regularization results
## Not run: rolypoly_perform_regularized_inference(rolypoly)## Not run: rolypoly_perform_regularized_inference(rolypoly)
The entry point for rolypoly analysis. If no expression data, we assume that we are running just the vegas score processing.
rolypoly_roll(rolypoly = NULL, gwas_data = NULL, block_annotation = NULL, block_data = NULL, ld_folder = NULL, bootstrap_iters = 50, outlier_threshold = -1, perform_cv = F, n_folds = 10, gwas_z_filter = -1, add_spline = F, n_knots = 1, add_poly = F, n_degree = 2, run_light = T, gwas_link_parallel = F, bootstrap_parallel = F, keep_model = F, keep_gwas = F, ...)rolypoly_roll(rolypoly = NULL, gwas_data = NULL, block_annotation = NULL, block_data = NULL, ld_folder = NULL, bootstrap_iters = 50, outlier_threshold = -1, perform_cv = F, n_folds = 10, gwas_z_filter = -1, add_spline = F, n_knots = 1, add_poly = F, n_degree = 2, run_light = T, gwas_link_parallel = F, bootstrap_parallel = F, keep_model = F, keep_gwas = F, ...)
rolypoly |
Previous rolypoly run to parts of pipeline. |
gwas_data |
Gwas data for a trait, including snp annotations. |
block_annotation |
Start and end points for blocks |
block_data |
Information about blocks. |
ld_folder |
Folder with LD information. |
bootstrap_iters |
Number bootstrap iterations to perform for inference. |
outlier_threshold |
Set to positive if we want to run robusted regression. |
perform_cv |
If we want to interpret annotation effects do not set this to T. However, if our goal is prediction accuracy then set this to T. |
n_folds |
number of folds for cross validation |
gwas_z_filter |
Z-score filter for SNPs, helps prevent large effects biasing inference. |
add_spline |
If we want to fit a spline to maf. |
n_knots |
number of knots to add to the spline. |
add_poly |
If we want to fit a polynomial to maf. |
n_degree |
the degree of the polynomial. |
run_light |
if we want to throw away bootstrap data, and save memory |
gwas_link_parallel |
if user wants to run in gwas linking in parallel, registerDoParallel must have been run in advance. |
bootstrap_parallel |
if user wants to run in bootstraps in parallel, registerDoParallel must have been run in advance. |
keep_model |
if we should keep the regression model, can be large. |
keep_gwas |
set to T if we want to include gwas in returned rolypoly object. |
... |
other arguments to pass to cv.glmnet |
rolypoly object
## Not run: rolypoly_roll(rolypoly)## Not run: rolypoly_roll(rolypoly)
A dataset containing simulated block data annotation for use in the rolypoly vignette.
sim_block_annotationsim_block_annotation
A data frame with 1000 rows and 4 variables:
chromosome, we only use autosomes
base pair position of variant
rsid identifier of variant
effect size, univariate regression coefficient
I generated these fields to link with SNP positions
A dataset containing simulated expression data for use in the rolypoly vignette.
sim_expression_data_normalizedsim_expression_data_normalized
A data frame with 1000 rows and 5 variables:
simulated expression data for tissue. This tissue has a significant effect on the simulated gwas.
simulated expression data for tissue
simulated expression data for tissue. This tissue has a significant effect on the simulated gwas.
simulated expression data for tissue
simulated expression data for tissue
I generated this dataset
A dataset containing simulated genome-wide association summary statistics for use in the rolypoly vignette.
sim_gwas_datasim_gwas_data
A data frame with 14934 rows and 6 variables:
chromosome, we only use autosomes
base pair position of variant
rsid identifier of variant
effect size, univariate regression coefficient
standard error of effect size
minor allele frequency
rsids were from 1000g and I generated the other fields
Take a list of rolypoly data and vectorize it for inference.
vectorize_rolypoly(data)vectorize_rolypoly(data)
data |
the list of block information from rolypoly object |
list of necessary information for inference
## Not run: vectorize_rolypoly(data)## Not run: vectorize_rolypoly(data)