A simple wrapper function. Using a summary set, find outliers in the MR analysis between the pair of trais. Find other 'candidate traits' associated with those outliers. Perform MR of each of those candidate traits with the original exposure and outcome.
new()Create a new dataset and initialise an R interface
Tryx$new(dat)
datDataset from TwoSampleMR::harmonise_data
print()Tryx$print(...)
get_outliers()Detect outliers in exposure-outcome dataset.
Tryx$get_outliers( dat = self$output$dat, outliers = "RadialMR", outlier_correction = "none", outlier_threshold = ifelse(outlier_correction == "none", 0.05/nrow(dat), 0.05) )
datOutput from TwoSampleMR::harmonise_data. Note - only the first id.exposure - id.outcome pair will be used.
outliersDefault is to use the RadialMR package to identify IVW outliers. Alternatively can providen an array of SNP names that are present in dat$SNP to use as outliers.
outlier_correctionDefualt = "none", but can select from ("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none").
outlier_thresholdIf outlier_correction = "none" then the p-value threshold for detecting outliers is by default 0.05.
set_candidate_traits()Set a list of GWAS IDs used.
Tryx$set_candidate_traits(id_list = NULL)
id_listThe list of trait IDs to search through for candidate associations. The default is the high priority traits in available_outcomes().
scan()Search for candidate traits associated with outliers.
Tryx$scan( dat = self$output$dat, search_correction = "none", search_threshold = ifelse(search_correction == "none", 5e-08, 0.05), use_proxies = FALSE )
datOutput from TwoSampleMR::harmonise_data.
search_correctionDefault = "none", but can select from ("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none.
search_thresholdIf search_correction = "none" then the p-value threshold for detecting an association between an outlier and a candidate trait is by default 5e-8. Otherwise it is 0.05.
use_proxiesWhether to use proxies when looking up associations. FALSE by default for speed.
candidate_instruments()Obtain instruments for the candidate traits.
Tryx$candidate_instruments( candidate_instruments = NULL, include_outliers = FALSE )
candidate_instrumentsInstruments for candidate traits.
include_outliersWhen performing MR of candidate traits against exposures or outcomes, whether to include the original outlier SNP. Default is FALSE.
outcome_instruments()Extract instrument for candidate trait instruments for the original outcome.
Tryx$outcome_instruments( candidate_outcome = NULL, dat = self$output$dat, use_proxies = FALSE )
candidate_outcomeExtracted instrument SNPs from outcome.
datOutput from TwoSampleMR::harmonise_data.
use_proxiesWhether to use proxies when looking up associations. FALSE by default for speed.
exposure_instruments()Extract instrument for candidate trait instruments for the original exposure.
Tryx$exposure_instruments( candidate_exposure = NULL, dat = self$output$dat, use_proxies = FALSE )
candidate_exposureExtracted instrument SNPs from exposure.
datOutput from TwoSampleMR::harmonise_data.
use_proxiesWhether to use proxies when looking up associations. FALSE by default for speed.
exposure_candidate_instruments()Extract instrument for the original exposure for the candidate traits.
Tryx$exposure_candidate_instruments( exposure_candidate = NULL, dat = self$output$dat, use_proxies = FALSE, include_outliers = FALSE )
exposure_candidateExtracted instrument SNPs from exposure.
datOutput from TwoSampleMR::harmonise_data.
use_proxiesWhether to use proxies when looking up associations. FALSE by default for speed.
include_outliersWhen performing MR of candidate traits against exposures or outcomes, whether to include the original outlier SNP. Default is FALSE.
extractions()Extract instruments for MR analyses.
Tryx$extractions( dat = self$output$dat, candidate_instruments = NULL, candidate_outcome = NULL, candidate_exposure = NULL, exposure_candidate = NULL, include_outliers = FALSE, use_proxies = FALSE )
datOutput from TwoSampleMR::harmonise_data.
candidate_instrumentsInstruments for candidate traits.
candidate_outcomeExtracted instrument SNPs from outcome.
candidate_exposureExtracted instrument SNPs from exposure.
exposure_candidateExtracted instrument SNPs from exposure.
include_outliersWhen performing MR of candidate traits against exposures or outcomes, whether to include the original outlier SNP. Default is FALSE.
use_proxiesWhether to use proxies when looking up associations. FALSE by default for speed.
candidate_outcome_dat()Make a dataset for the candidate traits and the original outcome.
Tryx$candidate_outcome_dat(dat = self$output$dat)
datOutput from TwoSampleMR::harmonise_data.
candidate_exposure_dat()Make a dataset for the candidate traits and the original exposure.
Tryx$candidate_exposure_dat(dat = self$output$dat)
datOutput from TwoSampleMR::harmonise_data.
exposure_candidate_dat()Make a dataset for the original exposure and the candidate traits.
Tryx$exposure_candidate_dat(dat = self$output$dat)
datOutput from TwoSampleMR::harmonise_data.
harmonise()Harmonised exposure - outcome dataset.
Tryx$harmonise(dat = self$output$dat)
datOutput from TwoSampleMR::harmonise_data.
mr()Perform MR anlayses of 1) candidate traits-outcome 2) candidate traits-exposure 3) exposure-candidate traits.
Tryx$mr(dat = self$output$dat, mr_method = "mr_ivw")
datOutput from TwoSampleMR::harmonise_data.
mr_methodMethod to use for candidate trait - exposure/outcome analysis. Default is mr_ivw. Can also provide basic MR methods e.g. mr_weighted_mode, mr_weighted_median etc. Also possible to use "strategy1" which performs IVW in the first instance, but then weighted mode for associations with high heterogeneity.
mrtryx()All-in-one: 1) Detect outlier 2) Search candidate traits 3) Perform MR of candidate traits and the outcome / exposure.
Tryx$mrtryx( dat = self$output$dat, outliers = "RadialMR", outlier_correction = "none", outlier_threshold = ifelse(outlier_correction == "none", 0.05/nrow(dat), 0.05), use_proxies = FALSE, search_correction = "none", search_threshold = ifelse(search_correction == "none", 5e-08, 0.05), include_outliers = FALSE, mr_method = "mr_ivw" )
datOutput from harmonise_data. Note - only the first id.exposure - id.outcome pair will be used.
outliersDefault is to use the RadialMR package to identify IVW outliers. Alternatively can providen an array of SNP names that are present in dat$SNP to use as outliers.
outlier_correctionDefualt = "none", but can select from ("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none").
outlier_thresholdIf outlier_correction = "none" then the p-value threshold for detecting outliers is by default 0.05.
use_proxiesWhether to use proxies when looking up associations. FALSE by default for speed.
search_correctionDefault = "none", but can select from ("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none").
search_thresholdIf search_correction = "none" then the p-value threshold for detecting an association between an outlier and a candidate trait is by default 5e-8. Otherwise it is 0.05.
include_outliersWhen performing MR of candidate traits against exposures or outcomes, whether to include the original outlier SNP. Default is FALSE.
mr_methodMethod to use for candidate trait - exposure/outcome analysis. Default is mr_ivw. Can also provide basic MR methods e.g. mr_weighted_mode, mr_weighted_median etc. Also possible to use "strategy1" which performs IVW in the first instance, but then weighted mode for associations with high heterogeneity.
tryx.sig()Identify putatively significant associations in the outlier scan.
Tryx$tryx.sig(mr_threshold_method = "fdr", mr_threshold = 0.05)
mr_threshold_methodThis is the argument to be passed to p.adjust. Default is "fdr". If no p-value adjustment is to be applied then specify "unadjusted".
mr_thresholdThreshold to declare significance
adjustment()Outlier adjustment estimation - How much of the heterogeneity due to the outlier can be explained by alternative pathways?
Tryx$adjustment(tryxscan = self$output, id_remove = NULL)
tryxscanOutput from x$mrtryx()
id_removeList of IDs to exclude from the adjustment analysis. It is possible that in the outlier search a candidate trait will come up which is essentially just a surrogate for the outcome trait (e.g. if you are analysing coronary heart disease as the outcome then a variable related to heart disease medication might come up as a candidate trait). Adjusting for a trait which is essentially the same as the outcome will erroneously nullify the result, so visually inspect the candidate trait list and remove those that are inappropriate.
datOutput from harmonise_data. Note - only the first id.exposure - id.outcome pair will be used.
adjustment.mv()Similar to adjusment, but when there are multiple traits associated with a single variant.
Tryx$adjustment.mv( tryxscan = self$output, lasso = TRUE, id_remove = NULL, proxies = FALSE )
tryxscanOutput from x$scan()
lassoWhether to shrink the estimates of each trait within SNP. Default=TRUE.
id_removeList of IDs to exclude from the adjustment analysis. It is possible that in the outlier search a candidate trait will come up which is essentially just a surrogate for the outcome trait (e.g. if you are analysing coronary heart disease as the outcome then a variable related to heart disease medication might come up as a candidate trait). Adjusting for a trait which is essentially the same as the outcome will erroneously nullify the result, so visually inspect the candidate trait list and remove those that are inappropriate.
proxiesLook for proxies in the MVMR methods. Default = FALSE.
datOutput from harmonise_data. Note - only the first id.exposure - id.outcome pair will be used.
analyse()This returns various heterogeneity statistics, IVW estimates for raw, adjusted and outlier removed datasets, and summary of peripheral traits detected etc.
Tryx$analyse( tryxscan = self$output, plot = TRUE, id_remove = NULL, filter_duplicate_outliers = TRUE )
tryxscanOutput from x$scan().
plotWhether to plot or not. Default is TRUE.
id_removeList of IDs to exclude from the adjustment analysis. It is possible that in the outlier search a candidate trait will come up which is essentially just a surrogate for the outcome trait (e.g. if you are analysing coronary heart disease as the outcome then a variable related to heart disease medication might come up as a candidate trait). Adjusting for a trait which is essentially the same as the outcome will erroneously nullify the result, so visually inspect the candidate trait list and remove those that are inappropriate.
duplicate_outliers_methodSometimes more than one trait will associate with a particular outlier. TRUE = only keep the trait that has the biggest influence on heterogeneity.
analyse.mv()Similar to analyse, but when there are multiple traits associated with a single variant.
Tryx$analyse.mv( tryxscan = self$output, lasso = TRUE, plot = TRUE, id_remove = NULL, proxies = FALSE )
tryxscanOutput from x$scan()
lassoWhether to shrink the estimates of each trait within SNP. Default=TRUE.
id_removeList of IDs to exclude from the adjustment analysis. It is possible that in the outlier search a candidate trait will come up which is essentially just a surrogate for the outcome trait (e.g. if you are analysing coronary heart disease as the outcome then a variable related to heart disease medication might come up as a candidate trait). Adjusting for a trait which is essentially the same as the outcome will erroneously nullify the result, so visually inspect the candidate trait list and remove those that are inappropriate.
proxiesLook for proxies in the MVMR methods. Default = FALSE.
manhattan_plot()Draw a Manhattan style plot for candidate traits-outcome/exposure associations.
Tryx$manhattan_plot( what = "outcome", id_remove = NULL, y_scale = NULL, label = TRUE )
whatAnalyse candidate-exposure ('exposure') or candidate-outcome ('outcome') associations
id_removeList of IDs to exclude from the adjustment analysis. It is possible that in the outlier search a candidate trait will come up which is essentially just a surrogate for the outcome trait (e.g. if you are analysing coronary heart disease as the outcome then a variable related to heart disease medication might come up as a candidate trait). Adjusting for a trait which is essentially the same as the outcome will erroneously nullify the result, so visually inspect the candidate trait list and remove those that are inappropriate.
y_scaleThe scaling function to be applied to y scale.
labelDisplay the names of the traits on the graph.
clone()The objects of this class are cloneable with this method.
Tryx$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.