Skip to contents

Generate simulated subjects

Functions used to generate a fbm of simulated subjects

gen_sim()
Simulate genetic data
G_func_fam()
Simulate SNP for all subjects and liabilities for family
G_func_simple()
Simulate SNP for all subjects
MAF_func()
Simulate vector containing minor allele frequencies (MAF)
beta_func()
Simulate beta

GWAS

Functions used to perform GWAS on genetic data

GWAS()
Computes causal SNP's

LT-FH

Functions used to perform LT-FH on genetic data

get_cov()
Create covariance matrix
gibbs_sampl()
Create LTFH estimations for a configuration.
LTFH()
Estimates liabilities for every subject

Prediction

Functions used to perform compute and use polygenic risk score

PRS_cross()
Uses cross validation to train and estimate PRS for each fold
pred_model()
Trains model on train data given the target vector.
prediction()
Predicts the probability of having the given trait

Data visulisation

Functions to visualise methods and results

GWAS

scatter_plot()
Plots true causal effects against estimated effects
manhattan_plot()
Creates a Manhattan plot
power_plot()
Creates a power plot

LT-FH

control_plot()
Plotting estimated liabilities agianst distribution
LTFH_plot()
Plots estimated liabilities against true liabilities
plot_gibbs()
Plot the convergence of gibb_sampl

Prediction

prs_plot()
Creates evaluation plot for MSE, AUC or r squared
decision_cross()
Creates evaluation plot for decision boundary

Controls for distributions sampled from

Functions which can be used to check if result follow the expected

dist_check()
Check distribution of liabilities

Helper Functions

Functions to ease the use of genstats

get_names()
Adds a postfix to given names for each family member
snp_attach()
Attach rds_file