Title: | GWAS summary data sources connected to analytical tools |
---|---|
Description: | Description: Many tools exist that use GWAS summary data for colocalisation, fine mapping, Mendelian randomization, visualisation, etc. This package is a conduit that connects R packages that can retrieve GWAS summary data to various tools for analysing those data. |
Authors: | Gibran Hemani [aut] , Rita Rasteiro [cre, aut] , Christopher Woods [aut] |
Maintainer: | Rita Rasteiro <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2024-11-22 03:53:05 UTC |
Source: | https://github.com/MRCIEU/gwasglue2 |
Add a SummarySet to a DataSet
add_summaryset( summary_sets, dataset, harmonise = TRUE, tolerance = 0.08, action = 1 )
add_summaryset( summary_sets, dataset, harmonise = TRUE, tolerance = 0.08, action = 1 )
summary_sets |
one or more gwasglue2 Summarysets objects to add to an existent DataSet object. If more than one it should be a list |
dataset |
The gwasglue2 DataSet object to add to |
harmonise |
logical (default TRUE). It harmonises the summary sets in the DataSet against each other. |
tolerance |
Inherited from harmoniseData() (default 0.08) |
action |
Inherited from harmoniseData() (Default 1)
|
A harmonised gwasglue2 DataSet object with input SummarySets added
Add to metadata in the SummarySet
addToMetadata( summary_set, id = getMetadata(summary_set)$id, sample_size = getMetadata(summary_set)$sample_size, nsnp = getMetadata(summary_set)$nsnp, trait = getMetadata(summary_set)$trait, sd = getMetadata(summary_set)$sd, unit = getMetadata(summary_set)$unit, ncontrol = getMetadata(summary_set)$ncontrol, build = getMetadata(summary_set)$build, population = getMetadata(summary_set)$population, ncase = getMetadata(summary_set)$ncase ) ## S4 method for signature 'SummarySet' addToMetadata( summary_set, id = getMetadata(summary_set)$id, sample_size = getMetadata(summary_set)$sample_size, nsnp = getMetadata(summary_set)$nsnp, trait = getMetadata(summary_set)$trait, sd = getMetadata(summary_set)$sd, unit = getMetadata(summary_set)$unit, ncontrol = getMetadata(summary_set)$ncontrol, build = getMetadata(summary_set)$build, population = getMetadata(summary_set)$population, ncase = getMetadata(summary_set)$ncase )
addToMetadata( summary_set, id = getMetadata(summary_set)$id, sample_size = getMetadata(summary_set)$sample_size, nsnp = getMetadata(summary_set)$nsnp, trait = getMetadata(summary_set)$trait, sd = getMetadata(summary_set)$sd, unit = getMetadata(summary_set)$unit, ncontrol = getMetadata(summary_set)$ncontrol, build = getMetadata(summary_set)$build, population = getMetadata(summary_set)$population, ncase = getMetadata(summary_set)$ncase ) ## S4 method for signature 'SummarySet' addToMetadata( summary_set, id = getMetadata(summary_set)$id, sample_size = getMetadata(summary_set)$sample_size, nsnp = getMetadata(summary_set)$nsnp, trait = getMetadata(summary_set)$trait, sd = getMetadata(summary_set)$sd, unit = getMetadata(summary_set)$unit, ncontrol = getMetadata(summary_set)$ncontrol, build = getMetadata(summary_set)$build, population = getMetadata(summary_set)$population, ncase = getMetadata(summary_set)$ncase )
summary_set |
A gwasglue2 SummarySet object. |
id |
GWAS study ID. |
sample_size |
Sample size. |
nsnp |
Number of variants in the study. |
trait |
Phenotype name corresponding the the variant. |
sd |
Trait standard deviation. |
unit |
Unit. |
ncontrol |
Number of controls in study. |
build |
genome build version. |
population |
Study sample population. |
ncase |
Number of cases in study. |
gwasglue2 SummarySet object with metadata stored.
Assert if the shapes of SummarySets in the gwasglue2 DataSet are the same
assertSameShape(dataset) ## S4 method for signature 'DataSet' assertSameShape(dataset)
assertSameShape(dataset) ## S4 method for signature 'DataSet' assertSameShape(dataset)
dataset |
A gwasglue2 DataSet object. |
logical TRUE/FALSE
Converts SummarySets within a Dataset to a format that can be read by TwoSampleMR
convertForTwoSampleMR(dataset) ## S4 method for signature 'DataSet' convertForTwoSampleMR(dataset)
convertForTwoSampleMR(dataset) ## S4 method for signature 'DataSet' convertForTwoSampleMR(dataset)
dataset |
The gwasglue2 DataSet object |
The gwasglue2 SummarySet object converted to TwoSampleMR format
Creates a DataSet object using gwasglue2 SummarySet objects, and harmonise data against data
create_dataset( summary_sets = list(), harmonise = TRUE, tolerance = 0.08, action = 1 )
create_dataset( summary_sets = list(), harmonise = TRUE, tolerance = 0.08, action = 1 )
summary_sets |
A list of gwasglue2 SummarySet objects |
harmonise |
logical (default TRUE). It harmonises the summary sets in the DataSet against each other. |
tolerance |
Inherited from harmoniseData() (default 0.08) |
action |
Inherited from harmoniseData() (Default 1)
|
A harmonised gwasglue2 DataSet object
Creates a DataSet object using GWAS summary statistics, and harmonise data against data
create_dataset_from_tibble( data = list(), metadata = NULL, harmonise = TRUE, tolerance = 0.08, action = 1, beta_col = "beta", se_col = "se", samplesize_col = "n", pvalue_col = "p", chr_col = "chr", position_col = "position", rsid_col = "rsid", effect_allele_col = "ea", other_allele_col = "nea", eaf_col = "eaf", id_col = "id", trait_col = "trait", ... )
create_dataset_from_tibble( data = list(), metadata = NULL, harmonise = TRUE, tolerance = 0.08, action = 1, beta_col = "beta", se_col = "se", samplesize_col = "n", pvalue_col = "p", chr_col = "chr", position_col = "position", rsid_col = "rsid", effect_allele_col = "ea", other_allele_col = "nea", eaf_col = "eaf", id_col = "id", trait_col = "trait", ... )
data |
A list of GWAS summary data (tibles) |
metadata |
A list with metadata information. If NULL, it creates metadata with information retrieved from the dataset. |
harmonise |
logical (default TRUE). It harmonises the summary sets in the DataSet against each other. |
tolerance |
Inherited from harmoniseData() (default 0.08) |
action |
Inherited from harmoniseData() (Default 1)
|
beta_col |
Name of column with effect sizes. The default is |
se_col |
Name of column with standard errors. The default is |
samplesize_col |
Column name for sample size. The default is |
pvalue_col |
Name of column with p-value. The default is |
chr_col |
Column name for chromosome . The default is |
position_col |
Column name for the position. Together, with @param chr gives the physical coordinates of the variant. The default is |
rsid_col |
Required name of column with variants rs IDs. The default is |
effect_allele_col |
Name of column with effect allele. Must contain only the characters "A", "C", "T" or "G". The default is |
other_allele_col |
Name of column with non effect allele. Must contain only the characters "A", "C", "T" or "G". The default is |
eaf_col |
Name of column with effect allele frequency. The default is |
id_col |
The default is |
trait_col |
Column name for the column with phenotype name corresponding the the variant. The default is |
... |
Other columns |
A harmonised gwasglue2 DataSet object
create_metadata()
to create a metadata object
Reads metadata and converts it to gwasglue2 format.
create_metadata( metadata = NULL, id = NA, sample_size = NA, nsnp = NA, trait = NA, sd = NA, unit = NA, ncontrol = NA, build = NA, population = NA, ncase = NA, ... )
create_metadata( metadata = NULL, id = NA, sample_size = NA, nsnp = NA, trait = NA, sd = NA, unit = NA, ncontrol = NA, build = NA, population = NA, ncase = NA, ... )
metadata |
A dataframe with metadata information. Not required. |
id |
GWAS study ID. |
sample_size |
Sample size. |
nsnp |
Number of variants in the study. |
trait |
Phenotype name corresponding the the variant. |
sd |
Trait standard deviation. |
unit |
Unit |
ncontrol |
Nb of controls in study |
build |
genome build version. |
population |
Study sample population. |
ncase |
Number of cases in study. |
... |
Other metadata information |
A metadata list.
Create SummarySet from log Bayes Factor
create_summary_set_from_lbf(summaryset, lbf, L)
create_summary_set_from_lbf(summaryset, lbf, L)
summaryset |
gwasglue2 SummarySet object |
lbf |
p-vector of log Bayes Factors for each SNP |
L |
credible set index number |
marginalised summaryset (beta, se and trait id)
A function to create a gwasglue2 SummarySet object from different sources and formats
create_summaryset( data, metadata = NULL, type = "tibble", qc = FALSE, beta_col = NULL, se_col = NULL, samplesize_col = NULL, pvalue_col = NULL, logpvalue_col = NULL, chr_col = NULL, position_col = NULL, rsid_col = NULL, effect_allele_col = NULL, other_allele_col = NULL, eaf_col = NULL, id_col = NULL, trait_col = NULL, build = NULL )
create_summaryset( data, metadata = NULL, type = "tibble", qc = FALSE, beta_col = NULL, se_col = NULL, samplesize_col = NULL, pvalue_col = NULL, logpvalue_col = NULL, chr_col = NULL, position_col = NULL, rsid_col = NULL, effect_allele_col = NULL, other_allele_col = NULL, eaf_col = NULL, id_col = NULL, trait_col = NULL, build = NULL )
data |
GWAS summary statistics. |
metadata |
A list with metadata information. If NULL, it creates metadata with information retrieved from the dataset |
type |
Input @param data type. Default is |
qc |
Quality control. It checks the @param data and look for problems that can stop gwasglue2 from runing. If TRUE gwasglue will try to solve the problems. Default is FALSE |
beta_col |
Name of column with effect sizes. The default is |
se_col |
Name of column with standard errors. The default is |
samplesize_col |
Column name for sample size. The default is |
pvalue_col |
Name of column with p-value. The default is |
logpvalue_col |
Name of column with log(p-value). The default is |
chr_col |
Column name for chromosome . The default is |
position_col |
Column name for the position. Together, with @param chr gives the physical coordinates of the variant. The default is |
rsid_col |
Required name of column with variants rs IDs. The default is |
effect_allele_col |
Name of column with effect allele. Must contain only the characters "A", "C", "T" or "G". The default is |
other_allele_col |
Name of column with non effect allele. Must contain only the characters "A", "C", "T" or "G". The default is |
eaf_col |
Name of column with effect allele frequency. The default is |
id_col |
GWAS study ID column. The default is |
trait_col |
Column name for the column with phenotype name corresponding the the variant. The default is |
build |
Reference genome assembly to generate the genomic data. Default is NULL.
|
A gwasglue2 SummarySet object
create_metadata()
to create a metadata object
A function to create a gwasglue2 SummarySet object from a vcf file
create_summaryset_from_gwasvcf( data, metadata = NULL, qc = FALSE, beta_col = "ES", se_col = "SE", samplesize_col = "SS", logpvalue_col = "LP", pvalue_col = "p", chr_col = "seqnames", position_col = "start", rsid_col = "ID", effect_allele_col = "ALT", other_allele_col = "REF", eaf_col = "AF", id_col = "id", build = NULL )
create_summaryset_from_gwasvcf( data, metadata = NULL, qc = FALSE, beta_col = "ES", se_col = "SE", samplesize_col = "SS", logpvalue_col = "LP", pvalue_col = "p", chr_col = "seqnames", position_col = "start", rsid_col = "ID", effect_allele_col = "ALT", other_allele_col = "REF", eaf_col = "AF", id_col = "id", build = NULL )
data |
GWAS summary statistics. In the GWAS vcf dataframe format |
metadata |
A list with metadata information. If NULL, it creates metadata with information retrieved from the dataset |
qc |
Quality control. It checks the @param data and look for problems that can stop gwasglue2 from runing. If TRUE gwasglue will try to solve the problems. Default is FALSE |
beta_col |
Name of column with effect sizes. The default is |
se_col |
Name of column with standard errors. The default is |
samplesize_col |
Column name for sample size. The default is |
logpvalue_col |
Name of column with log(p-value). The default is |
pvalue_col |
Name of column with p-value. The default is |
chr_col |
Column name for chromosome . The default is |
position_col |
Column name for the position. Together, with @param chr gives the physical coordinates of the variant. The default is |
rsid_col |
Required name of column with variants rs IDs. The default is |
effect_allele_col |
Name of column with effect allele. Must contain only the characters "A", "C", "T" or "G". The default is |
other_allele_col |
Name of column with non effect allele. Must contain only the characters "A", "C", "T" or "G". The default is |
eaf_col |
Name of column with effect allele frequency. The default is |
id_col |
GWAS study ID column. The default is |
build |
Reference genome assembly to generate the vcf file. Default is NULL.
|
A gwasglue2 SummarySet object
create_metadata()
to create a metadata object
A function to create a gwasglue2 SummarySet object from a tibble
create_summaryset_from_tibble( data = tibble(), metadata = NULL, qc = FALSE, beta_col = "beta", se_col = "se", samplesize_col = "n", pvalue_col = "p", chr_col = "chr", position_col = "position", rsid_col = "rsid", effect_allele_col = "ea", other_allele_col = "nea", eaf_col = "eaf", id_col = "id", trait_col = "trait", build = NULL )
create_summaryset_from_tibble( data = tibble(), metadata = NULL, qc = FALSE, beta_col = "beta", se_col = "se", samplesize_col = "n", pvalue_col = "p", chr_col = "chr", position_col = "position", rsid_col = "rsid", effect_allele_col = "ea", other_allele_col = "nea", eaf_col = "eaf", id_col = "id", trait_col = "trait", build = NULL )
data |
GWAS summary statistics. A tibble |
metadata |
A list with metadata information. If NULL, it creates metadata with information retrieved from the dataset |
qc |
Quality control. It checks the @param data and look for problems that can stop gwasglue2 from runing. If TRUE gwasglue will try to solve the problems. Default is FALSE |
beta_col |
Name of column with effect sizes. The default is |
se_col |
Name of column with standard errors. The default is |
samplesize_col |
Column name for sample size. The default is |
pvalue_col |
Name of column with p-value. The default is |
chr_col |
Column name for chromosome . The default is |
position_col |
Column name for the position. Together, with @param chr gives the physical coordinates of the variant. The default is |
rsid_col |
Required name of column with variants rs IDs. The default is |
effect_allele_col |
Name of column with effect allele. Must contain only the characters "A", "C", "T" or "G". The default is |
other_allele_col |
Name of column with non effect allele. Must contain only the characters "A", "C", "T" or "G". The default is |
eaf_col |
Name of column with effect allele frequency. The default is |
id_col |
GWAS study ID column. The default is |
trait_col |
Column name for the column with phenotype name corresponding the the variant. The default is |
build |
Reference genome assembly to generate the genomic data. Default is NULL.
|
A gwasglue2 SummarySet object
create_metadata()
to create a metadata object
dataset_to_hyprcoloc is a wrapper function used inside ritarasteiro/hyprcoloc::hyprcoloc() to read DataSet objects
dataset_to_hyprcoloc(dataset)
dataset_to_hyprcoloc(dataset)
dataset |
gwasglue2 DataSet object |
parameters needed to run hyprcoloc
An S4 class to represent the Data Set
DataSet function
DataSet(...)
DataSet(...)
... |
Array of gwasglue2 SummarySet object names. |
A gwasglue2 DataSet object
summary_sets
A list of SummarySet objects (default NA).
overlap_variants
among all SummarySets
is_resized
logical (default FALSE).
is_harmonised
logical (default FALSE).
overall_dropped_SNPs
A vector of RSIDs that were removed from the summary_sets.
dropped_SNPs
A list of pairwise harmonising output (SNPs removed from the summary_sets )
palindromic_SNPs
A list of pairwise harmonising output.
ambiguous_SNPs
A list of pairwise harmonising output.
incompatible_alleles_SNPs
A list of pairwise harmonising output.
ld_matrix
LD matrix from reference population
is_harmonisedLD
logical (default FALSE).
zscores
vector of calculated z-scores
susie_marginalised
logical (default FALSE).
susieR
susieR::susie_rss() output
is_converted
logical (default FALSE).
describe
A description of the DataSet (default NA).
trait_organisation
A list with the trait organization within the DataSet (default NA).
Dimensions of the GWAS Summary Statistics data
dimData(summary_set) ## S4 method for signature 'SummarySet' dimData(summary_set)
dimData(summary_set) ## S4 method for signature 'SummarySet' dimData(summary_set)
summary_set |
A gwasglue2 SummarySet object |
The dimensions of the GWAS Summary Statistics data
Human genome chain files are download from UCSC
download_chainfile(from = "GRCh37", to = "GRCh38")
download_chainfile(from = "GRCh37", to = "GRCh38")
from |
genome assembly to which GWAS summary data is currently mapped. Default "GRCh37".
|
to |
genome assembly to which should be mapped. Default "GRCh38"
|
A chain file
Get Method to retrieve the attributes linked to the SummarySet
getAttributes(summary_set) ## S4 method for signature 'SummarySet' getAttributes(summary_set)
getAttributes(summary_set) ## S4 method for signature 'SummarySet' getAttributes(summary_set)
summary_set |
A gwasglue2 SummarySet object |
The attributes associated with the SummarySet
Get Method to retrieve the GWAS Summary Statistics
getData(dataset, index) ## S4 method for signature 'DataSet' getData(dataset, index)
getData(dataset, index) ## S4 method for signature 'DataSet' getData(dataset, index)
dataset |
A gwasglue2 DataSet object |
index |
Index of gwasglue2 SummarySet objects within DataSet |
A tibble with GWAS summary statistics
Similar to getSummaryData()
Get Method to retrieve the Linkage Disequilibrium matrix
getLDMatrix(dataset) ## S4 method for signature 'DataSet' getLDMatrix(dataset)
getLDMatrix(dataset) ## S4 method for signature 'DataSet' getLDMatrix(dataset)
dataset |
A gwasglue2 DataSet object |
The LD matrix
Size of the DataSet
getLength(dataset) ## S4 method for signature 'DataSet' getLength(dataset)
getLength(dataset) ## S4 method for signature 'DataSet' getLength(dataset)
dataset |
A gwasglue2 DataSet objec |
Number of gwasglue2 SummarySet objects within the DataSet
Get Method to retrieve the metadata stored in the SummarySet
getMetadata(summary_set) ## S4 method for signature 'SummarySet' getMetadata(summary_set)
getMetadata(summary_set) ## S4 method for signature 'SummarySet' getMetadata(summary_set)
summary_set |
A gwasglue2 SummarySet object. |
The gwasglue2 SummarySet metadata.
Get Method to retrieve RSID/variants stored in the SummarySet
getRSID(summary_set) ## S4 method for signature 'SummarySet' getRSID(summary_set)
getRSID(summary_set) ## S4 method for signature 'SummarySet' getRSID(summary_set)
summary_set |
A gwasglue2 SummarySet object |
The RSID/variants
Similar to getVariants()
Get the Shape of the gwasglue2 objects
getShape(object) ## S4 method for signature 'SummarySet' getShape(object)
getShape(object) ## S4 method for signature 'SummarySet' getShape(object)
object |
A gwasglue2 SummarySet or DataSet object. |
The shape of the gwasglue2 object
Get Method to retrieve the GWAS Summary Statistics from the SummarySet
getSummaryData(summary_set) ## S4 method for signature 'SummarySet' getSummaryData(summary_set)
getSummaryData(summary_set) ## S4 method for signature 'SummarySet' getSummaryData(summary_set)
summary_set |
A gwasglue2 SummarySet object. |
A tibble with GWAS summary statistics
Get Method to retrieve the gwasglue2 SummarySet object
getSummarySet(dataset, index) ## S4 method for signature 'DataSet' getSummarySet(dataset, index)
getSummarySet(dataset, index) ## S4 method for signature 'DataSet' getSummarySet(dataset, index)
dataset |
A gwasglue2 DataSet object |
index |
Index of gwasglue2 SummarySet objects within DataSet |
summarySet gwasglue2 SummarySet object
Get the trait organisation of the gwasglue2 DataSet
getTraitOrg(dataset) ## S4 method for signature 'DataSet' getTraitOrg(dataset)
getTraitOrg(dataset) ## S4 method for signature 'DataSet' getTraitOrg(dataset)
dataset |
A gwasglue2 DataSet object. |
The trait organisation of the gwasglue2 object
Get Method to retrieve RSID/variants stored in the SummarySet
getVariants(summary_set) ## S4 method for signature 'SummarySet' getVariants(summary_set)
getVariants(summary_set) ## S4 method for signature 'SummarySet' getVariants(summary_set)
summary_set |
A gwasglue2 SummarySet object |
The RSID/variants
Similar to getRSID()
Function to create a LDmatrix gwasglue2 object and set the @slot ld_matrix u
harmonise_ld(dataset, bfile = NULL, plink_bin = NULL)
harmonise_ld(dataset, bfile = NULL, plink_bin = NULL)
dataset |
The DataSet gwasglue2 object |
bfile |
It corresponds to the path and prefix of the plink files used to build the LD correlation matrix. |
plink_bin |
Path to the plink executable |
The DataSet gwasglue2 object harmonised
Harmonise LD matrix against summary data (now it just looks for overlaped variants. The harmonisation is done in ld_matrix_local) harmonise_ld_dat() is based TwoSampleMR::harmonise_ld_dat()
harmonise_ld_dat(x, ld)
harmonise_ld_dat(x, ld)
x |
harmonised dataset |
ld |
Output from ld_matrix |
List of dataset and harmonised LD matrix
Harmonise the alleles and effects between two summary sets
harmoniseData(dataset, tolerance, action) ## S4 method for signature 'DataSet' harmoniseData(dataset, tolerance, action)
harmoniseData(dataset, tolerance, action) ## S4 method for signature 'DataSet' harmoniseData(dataset, tolerance, action)
dataset |
The gwasglue2 DataSet object |
tolerance |
Tolerance value. |
action |
Level of strictness in dealing with SNPs.
|
The gwasglue2 DataSet object harmonised
Check if the DataSet is harmonised
isHarmonised(dataset) ## S4 method for signature 'DataSet' isHarmonised(dataset)
isHarmonised(dataset) ## S4 method for signature 'DataSet' isHarmonised(dataset)
dataset |
A gwasglue2 DataSet object |
TRUE/FALSE
Check if the DataSet is harmonised against LD matrix
isHarmonisedLD(dataset) ## S4 method for signature 'DataSet' isHarmonisedLD(dataset)
isHarmonisedLD(dataset) ## S4 method for signature 'DataSet' isHarmonisedLD(dataset)
dataset |
A gwasglue2 DataSet object |
TRUE/FALSE
Convert log Bayes Factor to summary stats
lbf_to_z_cont(lbf, n, af, prior_v = 50)
lbf_to_z_cont(lbf, n, af, prior_v = 50)
lbf |
p-vector of log Bayes Factors for each SNP |
n |
Overall sample size |
af |
p-vector of allele frequencies for each SNP |
prior_v |
Variance of prior distribution. SuSiE uses 50 |
tibble with lbf, af, beta, se, z
modified from ieugwasr::ld_matrix_local () Get LD matrix using local plink binary and reference dataset
ld_matrix_local(variants, bfile, plink_bin)
ld_matrix_local(variants, bfile, plink_bin)
variants |
List of variants (in plink 'set range' format). |
bfile |
Path to bed/bim/fam ld reference panel |
plink_bin |
Specify path to plink binary. Default = |
data frame
Converts SummarySet GWAS summary data to a different genome assembly. Human genome chain files are download from ENSEMBL
liftover(summaryset, chainfile = NULL, to = "GRCh38")
liftover(summaryset, chainfile = NULL, to = "GRCh38")
summaryset |
A gwasglue2 SummarySet object |
chainfile |
The chainfile used to remap the genomic coordinates. If |
to |
genome assembly to which should be mapped. Default "GRCh38"
|
A gwasglue2 SummarySet object with GWAS summary data genomic coordinates remapped.
create_metadata()
and addToMetadata()
on how to create or add to metadata.
Note that if using chainfile
the analyses are not restricted to Human GWAS.
Merge Datasets
merge_datasets(datasets)
merge_datasets(datasets)
datasets |
A list of gwasglue2 DataSet objects |
A gwasglue2 DataSet object with input DataSets merged
Statistical combination of the results from two or more separate studies. It uses the fixed-effect model assuming that one true effect size underlies all the studies in the meta-analysis.
meta_analysis(dataset, method = "fixed")
meta_analysis(dataset, method = "fixed")
dataset |
gwasglue2 DataSet object |
method |
Uses fixed-effect model. Default ('"fixed"') |
gwasglue2 SummarySet object
create_metadata()
and addToMetadata()
on how to create or add to metadata.
Look for overlapped variants between SummarySets in the DataSet and Resize
overlapVariants(dataset, action) ## S4 method for signature 'DataSet' overlapVariants(dataset, action)
overlapVariants(dataset, action) ## S4 method for signature 'DataSet' overlapVariants(dataset, action)
dataset |
The gwasglue2 DataSet object |
action |
Level of strictness in dealing with SNPs during harmonisation.
|
The gwasglue2 DataSet object resized
Plot
plot_gwasglue(dataset, type, title)
plot_gwasglue(dataset, type, title)
dataset |
gwasglue2 DataSet object |
type |
Type of plot (Only available "manhattan" plots at the moment) |
title |
Main title for the plot |
A plot
Set Method to store the attributes of the SummarySet
setAttributes(summary_set, mr_label = NULL, ...) ## S4 method for signature 'SummarySet' setAttributes(summary_set, mr_label = NULL, ...)
setAttributes(summary_set, mr_label = NULL, ...) ## S4 method for signature 'SummarySet' setAttributes(summary_set, mr_label = NULL, ...)
summary_set |
A gwasglue2 SummarySet object |
mr_label |
It can be either |
... |
Other attributes information |
The gwasglue2 SummarySet object with the attributes stored
Set Method to add metadata to the SummarySet
setMetadata(summary_set, metadata) ## S4 method for signature 'SummarySet' setMetadata(summary_set, metadata)
setMetadata(summary_set, metadata) ## S4 method for signature 'SummarySet' setMetadata(summary_set, metadata)
summary_set |
A gwasglue2 SummarySet object. |
metadata |
A list with metadata information. |
gwasglue2 SummarySet object with metadata stored.
Set Method to store RSID/variants in the SummarySet
setRSID(summary_set, variants) ## S4 method for signature 'SummarySet' setRSID(summary_set, variants)
setRSID(summary_set, variants) ## S4 method for signature 'SummarySet' setRSID(summary_set, variants)
summary_set |
A gwasglue2 SummarySet object |
variants |
The RSID/variants associated with the GWAS summary statistics |
The gwasglue2 SummarySet object with RSID/variants stored
Similar to setVariants()
Set the Shape of the gwasglue2 objects
setShape(object, shape) ## S4 method for signature 'SummarySet' setShape(object, shape)
setShape(object, shape) ## S4 method for signature 'SummarySet' setShape(object, shape)
object |
A gwasglue2 SummarySet or DataSet object |
shape |
The shape of the GWAS data |
The gwasglue2 object with the shape stored
Set the trait organisation of the gwasglue2 DataSet
setTraitOrg(dataset, ...) ## S4 method for signature 'DataSet' setTraitOrg(dataset, ...)
setTraitOrg(dataset, ...) ## S4 method for signature 'DataSet' setTraitOrg(dataset, ...)
dataset |
A gwasglue2 DataSet object |
... |
The organisation of the DataSet |
The gwasglue2 object with the trait organisation stored
Set Method to create an internal Variant ID for the SummarySet
setVariantid(summary_set) ## S4 method for signature 'SummarySet' setVariantid(summary_set)
setVariantid(summary_set) ## S4 method for signature 'SummarySet' setVariantid(summary_set)
summary_set |
A gwasglue2 SummarySet object |
A extra '"variantid"' column in the GWAS summary statistics tibble. The getSummaryData()
can be used to retrieve it.
Set Method to store RSID/variants in the SummarySet
setVariants(summary_set, variants) ## S4 method for signature 'SummarySet' setVariants(summary_set, variants)
setVariants(summary_set, variants) ## S4 method for signature 'SummarySet' setVariants(summary_set, variants)
summary_set |
A gwasglue2 SummarySet object |
variants |
The RSID/variants associated with the GWAS summary statistics |
The gwasglue2 SummarySet object with RSID/variants stored
Similar to setRSID()
Calculating Z-scores
setZscores(dataset) ## S4 method for signature 'DataSet' setZscores(dataset)
setZscores(dataset) ## S4 method for signature 'DataSet' setZscores(dataset)
dataset |
A gwasglue2 DataSet object |
An extra '"zscores"' column in the GWAS summary statistics tibble.
An S4 class to represent the Summary Set
ss
A tibble with the GWAS summary statistics (default NA).
metadata
A list with the metadata associated to ss (default NA).
variants
The RSID/variants associated with ss (default NA).
attributes
Attributes of the SummarySet. Eg. MR label Exposure/Outcome (default NA).
shape
The shape of the SummarySet (default NA).
shape
The shape of the SummarySet (default NA).
"single"
: single region
"multiple"
: multiple regions
"independent"
: independent/scattered variants
"pruned"
: genome wide - pruned
"full"
: genome wide - full
#' susie_to_dataset is a wrapper function used inside ritarasteiro/susieR::susie_rss() to create a marginalised DataSet object Converts ABFs to summary statistics and creates a new SummarySet for each credible set. Returns object is a gwasglue2 DataSet class object.
susie_to_dataset(summaryset, s, R)
susie_to_dataset(summaryset, s, R)
summaryset |
gwasglue2 SummarySet object |
s |
susieR object |
R |
lD matrix |
DataSet object