Package 'gwasglue2'

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

Help Index


Add a SummarySet to a DataSet

Description

Add a SummarySet to a DataSet

Usage

add_summaryset(
  summary_sets,
  dataset,
  harmonise = TRUE,
  tolerance = 0.08,
  action = 1
)

Arguments

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)

  • action = 1: Assume all alleles are coded on the forward strand, i.e. do not attempt to flip alleles

  • action = 2: Try to infer positive strand alleles, using allele frequencies for palindromes (default, conservative);

  • action = 3: Correct strand for non-palindromic SNPs, and drop all palindromic SNPs from the analysis (more conservative).

Value

A harmonised gwasglue2 DataSet object with input SummarySets added


Add to metadata in the SummarySet

Description

Add to metadata in the SummarySet

Usage

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
)

Arguments

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.

Value

gwasglue2 SummarySet object with metadata stored.


Assert if the shapes of SummarySets in the gwasglue2 DataSet are the same

Description

Assert if the shapes of SummarySets in the gwasglue2 DataSet are the same

Usage

assertSameShape(dataset)

## S4 method for signature 'DataSet'
assertSameShape(dataset)

Arguments

dataset

A gwasglue2 DataSet object.

Value

logical TRUE/FALSE


Convert tool to TwoSampleMR format

Description

Converts SummarySets within a Dataset to a format that can be read by TwoSampleMR

Usage

convertForTwoSampleMR(dataset)

## S4 method for signature 'DataSet'
convertForTwoSampleMR(dataset)

Arguments

dataset

The gwasglue2 DataSet object

Value

The gwasglue2 SummarySet object converted to TwoSampleMR format


Creates a DataSet object using gwasglue2 SummarySet objects, and harmonise data against data

Description

Creates a DataSet object using gwasglue2 SummarySet objects, and harmonise data against data

Usage

create_dataset(
  summary_sets = list(),
  harmonise = TRUE,
  tolerance = 0.08,
  action = 1
)

Arguments

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)

  • action = 1: Assume all alleles are coded on the forward strand, i.e. do not attempt to flip alleles

  • action = 2: Try to infer positive strand alleles, using allele frequencies for palindromes (default, conservative);

  • action = 3: Correct strand for non-palindromic SNPs, and drop all palindromic SNPs from the analysis (more conservative).

Value

A harmonised gwasglue2 DataSet object


Creates a DataSet object using GWAS summary statistics, and harmonise data against data

Description

Creates a DataSet object using GWAS summary statistics, and harmonise data against data

Usage

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",
  ...
)

Arguments

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)

  • action = 1: Assume all alleles are coded on the forward strand, i.e. do not attempt to flip alleles

  • action = 2: Try to infer positive strand alleles, using allele frequencies for palindromes (default, conservative);

  • action = 3: Correct strand for non-palindromic SNPs, and drop all palindromic SNPs from the analysis (more conservative).

beta_col

Name of column with effect sizes. The default is "beta".

se_col

Name of column with standard errors. The default is "se".

samplesize_col

Column name for sample size. The default is "n".

pvalue_col

Name of column with p-value. The default is "p".

chr_col

Column name for chromosome . The default is "chr".

position_col

Column name for the position. Together, with @param chr gives the physical coordinates of the variant. The default is "position".

rsid_col

Required name of column with variants rs IDs. The default is "rsid".

effect_allele_col

Name of column with effect allele. Must contain only the characters "A", "C", "T" or "G". The default is "ea".

other_allele_col

Name of column with non effect allele. Must contain only the characters "A", "C", "T" or "G". The default is ⁠"nea⁠.

eaf_col

Name of column with effect allele frequency. The default is "eaf".

id_col

The default is "id".

trait_col

Column name for the column with phenotype name corresponding the the variant. The default is "trait"

...

Other columns

Value

A harmonised gwasglue2 DataSet object

See Also

create_metadata() to create a metadata object


Metadata object

Description

Reads metadata and converts it to gwasglue2 format.

Usage

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,
  ...
)

Arguments

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

Value

A metadata list.


Create SummarySet from log Bayes Factor

Description

Create SummarySet from log Bayes Factor

Usage

create_summary_set_from_lbf(summaryset, lbf, L)

Arguments

summaryset

gwasglue2 SummarySet object

lbf

p-vector of log Bayes Factors for each SNP

L

credible set index number

Value

marginalised summaryset (beta, se and trait id)


A function to create a gwasglue2 SummarySet object from different sources and formats

Description

A function to create a gwasglue2 SummarySet object from different sources and formats

Usage

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
)

Arguments

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 "tibble". Other options: "vcf"

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 "beta" for @param type "tibble" and "ES"for @param type "vcf"..

se_col

Name of column with standard errors. The default is "se" for @param type "tibble" and "SE"for @param type "vcf".

samplesize_col

Column name for sample size. The default is "n" for @param type "tibble" and "SS"for @param type "vcf".

pvalue_col

Name of column with p-value. The default is "p".

logpvalue_col

Name of column with log(p-value). The default is "LP" for @param type "vcf".

chr_col

Column name for chromosome . The default is "chr" for @param type "tibble" and "seqnames"for @param type "vcf".

position_col

Column name for the position. Together, with @param chr gives the physical coordinates of the variant. The default is "position" for @param type "tibble" and "start"for @param type "vcf".

rsid_col

Required name of column with variants rs IDs. The default is "rsid" for @param type "tibble" and "ID"for @param type "vcf".

effect_allele_col

Name of column with effect allele. Must contain only the characters "A", "C", "T" or "G". The default is "ea" for @param type "tibble" and "ALT"for @param type "vcf".

other_allele_col

Name of column with non effect allele. Must contain only the characters "A", "C", "T" or "G". The default is ⁠"nea⁠ for @param type "tibble" and "REF"for @param type "vcf".

eaf_col

Name of column with effect allele frequency. The default is "eaf" for @param type "tibble" and "AF"for @param type "vcf".

id_col

GWAS study ID column. The default is "id".

trait_col

Column name for the column with phenotype name corresponding the the variant. The default is "trait"

build

Reference genome assembly to generate the genomic data. Default is NULL.

  • Options are "NCBI34", "NCBI35", "NCBI36", "GRCh37" or "GRCh38".

Value

A gwasglue2 SummarySet object

See Also

create_metadata() to create a metadata object


A function to create a gwasglue2 SummarySet object from a vcf file

Description

A function to create a gwasglue2 SummarySet object from a vcf file

Usage

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
)

Arguments

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 "ES".

se_col

Name of column with standard errors. The default is "SE".

samplesize_col

Column name for sample size. The default is "SS".

logpvalue_col

Name of column with log(p-value). The default is "LP".

pvalue_col

Name of column with p-value. The default is "p".

chr_col

Column name for chromosome . The default is "seqnames".

position_col

Column name for the position. Together, with @param chr gives the physical coordinates of the variant. The default is "start".

rsid_col

Required name of column with variants rs IDs. The default is "ID".

effect_allele_col

Name of column with effect allele. Must contain only the characters "A", "C", "T" or "G". The default is "ALT".

other_allele_col

Name of column with non effect allele. Must contain only the characters "A", "C", "T" or "G". The default is "REF".

eaf_col

Name of column with effect allele frequency. The default is "AF".

id_col

GWAS study ID column. The default is "id".

build

Reference genome assembly to generate the vcf file. Default is NULL.

  • Options are "NCBI34", "NCBI35", "NCBI36", "GRCh37" or "GRCh38".

Value

A gwasglue2 SummarySet object

See Also

create_metadata() to create a metadata object


A function to create a gwasglue2 SummarySet object from a tibble

Description

A function to create a gwasglue2 SummarySet object from a tibble

Usage

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
)

Arguments

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 "beta" for @param type "tibble" and "ES"for @param type "vcf"..

se_col

Name of column with standard errors. The default is "se" for @param type "tibble" and "SE"for @param type "vcf".

samplesize_col

Column name for sample size. The default is "n" for @param type "tibble" and "SS"for @param type "vcf".

pvalue_col

Name of column with p-value. The default is "p".

chr_col

Column name for chromosome . The default is "chr" for @param type "tibble" and "seqnames"for @param type "vcf".

position_col

Column name for the position. Together, with @param chr gives the physical coordinates of the variant. The default is "position" for @param type "tibble" and "start"for @param type "vcf".

rsid_col

Required name of column with variants rs IDs. The default is "rsid" for @param type "tibble" and "ID"for @param type "vcf".

effect_allele_col

Name of column with effect allele. Must contain only the characters "A", "C", "T" or "G". The default is "ea" for @param type "tibble" and "ALT"for @param type "vcf".

other_allele_col

Name of column with non effect allele. Must contain only the characters "A", "C", "T" or "G". The default is ⁠"nea⁠ for @param type "tibble" and "REF"for @param type "vcf".

eaf_col

Name of column with effect allele frequency. The default is "eaf" for @param type "tibble" and "AF"for @param type "vcf".

id_col

GWAS study ID column. The default is "id".

trait_col

Column name for the column with phenotype name corresponding the the variant. The default is "trait"

build

Reference genome assembly to generate the genomic data. Default is NULL.

  • Options are "NCBI34", "NCBI35", "NCBI36", "GRCh37" or "GRCh38".

Value

A gwasglue2 SummarySet object

See Also

create_metadata() to create a metadata object


DataSet to hyprcoloc

Description

dataset_to_hyprcoloc is a wrapper function used inside ritarasteiro/hyprcoloc::hyprcoloc() to read DataSet objects

Usage

dataset_to_hyprcoloc(dataset)

Arguments

dataset

gwasglue2 DataSet object

Value

parameters needed to run hyprcoloc


An S4 class to represent the Data Set

Description

An S4 class to represent the Data Set

DataSet function

Usage

DataSet(...)

Arguments

...

Array of gwasglue2 SummarySet object names.

Value

A gwasglue2 DataSet object

Slots

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

Description

Dimensions of the GWAS Summary Statistics data

Usage

dimData(summary_set)

## S4 method for signature 'SummarySet'
dimData(summary_set)

Arguments

summary_set

A gwasglue2 SummarySet object

Value

The dimensions of the GWAS Summary Statistics data


Chain files downloader

Description

Human genome chain files are download from UCSC

Usage

download_chainfile(from = "GRCh37", to = "GRCh38")

Arguments

from

genome assembly to which GWAS summary data is currently mapped. Default "GRCh37".

  • Other options: "NCBI34", "NCBI35", "NCBI36" and "GRCh38"

to

genome assembly to which should be mapped. Default "GRCh38"

  • Other options: "NCBI34", "NCBI35", "NCBI36" and "GRCh37"

Value

A chain file


Get Method to retrieve the attributes linked to the SummarySet

Description

Get Method to retrieve the attributes linked to the SummarySet

Usage

getAttributes(summary_set)

## S4 method for signature 'SummarySet'
getAttributes(summary_set)

Arguments

summary_set

A gwasglue2 SummarySet object

Value

The attributes associated with the SummarySet


Get Method to retrieve the GWAS Summary Statistics

Description

Get Method to retrieve the GWAS Summary Statistics

Usage

getData(dataset, index)

## S4 method for signature 'DataSet'
getData(dataset, index)

Arguments

dataset

A gwasglue2 DataSet object

index

Index of gwasglue2 SummarySet objects within DataSet

Value

A tibble with GWAS summary statistics

See Also

Similar to getSummaryData()


Get Method to retrieve the Linkage Disequilibrium matrix

Description

Get Method to retrieve the Linkage Disequilibrium matrix

Usage

getLDMatrix(dataset)

## S4 method for signature 'DataSet'
getLDMatrix(dataset)

Arguments

dataset

A gwasglue2 DataSet object

Value

The LD matrix


Size of the DataSet

Description

Size of the DataSet

Usage

getLength(dataset)

## S4 method for signature 'DataSet'
getLength(dataset)

Arguments

dataset

A gwasglue2 DataSet objec

Value

Number of gwasglue2 SummarySet objects within the DataSet


Get Method to retrieve the metadata stored in the SummarySet

Description

Get Method to retrieve the metadata stored in the SummarySet

Usage

getMetadata(summary_set)

## S4 method for signature 'SummarySet'
getMetadata(summary_set)

Arguments

summary_set

A gwasglue2 SummarySet object.

Value

The gwasglue2 SummarySet metadata.


Get Method to retrieve RSID/variants stored in the SummarySet

Description

Get Method to retrieve RSID/variants stored in the SummarySet

Usage

getRSID(summary_set)

## S4 method for signature 'SummarySet'
getRSID(summary_set)

Arguments

summary_set

A gwasglue2 SummarySet object

Value

The RSID/variants

See Also

Similar to getVariants()


Get the Shape of the gwasglue2 objects

Description

Get the Shape of the gwasglue2 objects

Usage

getShape(object)

## S4 method for signature 'SummarySet'
getShape(object)

Arguments

object

A gwasglue2 SummarySet or DataSet object.

Value

The shape of the gwasglue2 object


Get Method to retrieve the GWAS Summary Statistics from the SummarySet

Description

Get Method to retrieve the GWAS Summary Statistics from the SummarySet

Usage

getSummaryData(summary_set)

## S4 method for signature 'SummarySet'
getSummaryData(summary_set)

Arguments

summary_set

A gwasglue2 SummarySet object.

Value

A tibble with GWAS summary statistics


Get Method to retrieve the gwasglue2 SummarySet object

Description

Get Method to retrieve the gwasglue2 SummarySet object

Usage

getSummarySet(dataset, index)

## S4 method for signature 'DataSet'
getSummarySet(dataset, index)

Arguments

dataset

A gwasglue2 DataSet object

index

Index of gwasglue2 SummarySet objects within DataSet

Value

summarySet gwasglue2 SummarySet object


Get the trait organisation of the gwasglue2 DataSet

Description

Get the trait organisation of the gwasglue2 DataSet

Usage

getTraitOrg(dataset)

## S4 method for signature 'DataSet'
getTraitOrg(dataset)

Arguments

dataset

A gwasglue2 DataSet object.

Value

The trait organisation of the gwasglue2 object


Get Method to retrieve RSID/variants stored in the SummarySet

Description

Get Method to retrieve RSID/variants stored in the SummarySet

Usage

getVariants(summary_set)

## S4 method for signature 'SummarySet'
getVariants(summary_set)

Arguments

summary_set

A gwasglue2 SummarySet object

Value

The RSID/variants

See Also

Similar to getRSID()


Harmonise data against LD matrix

Description

Function to create a LDmatrix gwasglue2 object and set the @slot ld_matrix u

Usage

harmonise_ld(dataset, bfile = NULL, plink_bin = NULL)

Arguments

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

Value

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()

Description

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()

Usage

harmonise_ld_dat(x, ld)

Arguments

x

harmonised dataset

ld

Output from ld_matrix

Value

List of dataset and harmonised LD matrix


Harmonise the alleles and effects between two summary sets

Description

Harmonise the alleles and effects between two summary sets

Usage

harmoniseData(dataset, tolerance, action)

## S4 method for signature 'DataSet'
harmoniseData(dataset, tolerance, action)

Arguments

dataset

The gwasglue2 DataSet object

tolerance

Tolerance value.

action

Level of strictness in dealing with SNPs.

  • action = 1: Assume all alleles are coded on the forward strand, i.e. do not attempt to flip alleles

  • action = 2: Try to infer positive strand alleles, using allele frequencies for palindromes (default, conservative);

  • action = 3: Correct strand for non-palindromic SNPs, and drop all palindromic SNPs from the analysis (more conservative).

Value

The gwasglue2 DataSet object harmonised


Check if the DataSet is harmonised

Description

Check if the DataSet is harmonised

Usage

isHarmonised(dataset)

## S4 method for signature 'DataSet'
isHarmonised(dataset)

Arguments

dataset

A gwasglue2 DataSet object

Value

TRUE/FALSE


Check if the DataSet is harmonised against LD matrix

Description

Check if the DataSet is harmonised against LD matrix

Usage

isHarmonisedLD(dataset)

## S4 method for signature 'DataSet'
isHarmonisedLD(dataset)

Arguments

dataset

A gwasglue2 DataSet object

Value

TRUE/FALSE


Convert log Bayes Factor to summary stats

Description

Convert log Bayes Factor to summary stats

Usage

lbf_to_z_cont(lbf, n, af, prior_v = 50)

Arguments

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

Value

tibble with lbf, af, beta, se, z


modified from ieugwasr::ld_matrix_local () Get LD matrix using local plink binary and reference dataset

Description

modified from ieugwasr::ld_matrix_local () Get LD matrix using local plink binary and reference dataset

Usage

ld_matrix_local(variants, bfile, plink_bin)

Arguments

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 = NULL.

Value

data frame


Remap genomic coordinates to a different genome assembly

Description

Converts SummarySet GWAS summary data to a different genome assembly. Human genome chain files are download from ENSEMBL

Usage

liftover(summaryset, chainfile = NULL, to = "GRCh38")

Arguments

summaryset

A gwasglue2 SummarySet object

chainfile

The chainfile used to remap the genomic coordinates. If NULL a chainfile is downloaded using the to and the summarysetmetadata to check the genome assembly to which GWAS summary data is currently mapped.

to

genome assembly to which should be mapped. Default "GRCh38"

  • Other options: "NCBI34", "NCBI35", "NCBI36", GRCh37" and "GRCh38"

Value

A gwasglue2 SummarySet object with GWAS summary data genomic coordinates remapped.

See Also

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

Description

Merge Datasets

Usage

merge_datasets(datasets)

Arguments

datasets

A list of gwasglue2 DataSet objects

Value

A gwasglue2 DataSet object with input DataSets merged


Meta analysis

Description

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.

Usage

meta_analysis(dataset, method = "fixed")

Arguments

dataset

gwasglue2 DataSet object

method

Uses fixed-effect model. Default ('"fixed"')

Value

gwasglue2 SummarySet object

See Also

create_metadata() and addToMetadata() on how to create or add to metadata.


Look for overlapped variants between SummarySets in the DataSet and Resize

Description

Look for overlapped variants between SummarySets in the DataSet and Resize

Usage

overlapVariants(dataset, action)

## S4 method for signature 'DataSet'
overlapVariants(dataset, action)

Arguments

dataset

The gwasglue2 DataSet object

action

Level of strictness in dealing with SNPs during harmonisation.

  • action = 1: Assume all alleles are coded on the forward strand, i.e. do not attempt to flip alleles

  • action = 2: Try to infer positive strand alleles, using allele frequencies for palindromes (default, conservative);

  • action = 3: Correct strand for non-palindromic SNPs, and drop all palindromic SNPs from the analysis (more conservative).

Value

The gwasglue2 DataSet object resized


Plot

Description

Plot

Usage

plot_gwasglue(dataset, type, title)

Arguments

dataset

gwasglue2 DataSet object

type

Type of plot (Only available "manhattan" plots at the moment)

title

Main title for the plot

Value

A plot


Set Method to store the attributes of the SummarySet

Description

Set Method to store the attributes of the SummarySet

Usage

setAttributes(summary_set, mr_label = NULL, ...)

## S4 method for signature 'SummarySet'
setAttributes(summary_set, mr_label = NULL, ...)

Arguments

summary_set

A gwasglue2 SummarySet object

mr_label

It can be either "exposure" or '"outcome". Default NULL.

...

Other attributes information

Value

The gwasglue2 SummarySet object with the attributes stored


Set Method to add metadata to the SummarySet

Description

Set Method to add metadata to the SummarySet

Usage

setMetadata(summary_set, metadata)

## S4 method for signature 'SummarySet'
setMetadata(summary_set, metadata)

Arguments

summary_set

A gwasglue2 SummarySet object.

metadata

A list with metadata information.

Value

gwasglue2 SummarySet object with metadata stored.


Set Method to store RSID/variants in the SummarySet

Description

Set Method to store RSID/variants in the SummarySet

Usage

setRSID(summary_set, variants)

## S4 method for signature 'SummarySet'
setRSID(summary_set, variants)

Arguments

summary_set

A gwasglue2 SummarySet object

variants

The RSID/variants associated with the GWAS summary statistics

Value

The gwasglue2 SummarySet object with RSID/variants stored

See Also

Similar to setVariants()


Set the Shape of the gwasglue2 objects

Description

Set the Shape of the gwasglue2 objects

Usage

setShape(object, shape)

## S4 method for signature 'SummarySet'
setShape(object, shape)

Arguments

object

A gwasglue2 SummarySet or DataSet object

shape

The shape of the GWAS data

Value

The gwasglue2 object with the shape stored


Set the trait organisation of the gwasglue2 DataSet

Description

Set the trait organisation of the gwasglue2 DataSet

Usage

setTraitOrg(dataset, ...)

## S4 method for signature 'DataSet'
setTraitOrg(dataset, ...)

Arguments

dataset

A gwasglue2 DataSet object

...

The organisation of the DataSet

Value

The gwasglue2 object with the trait organisation stored


Set Method to create an internal Variant ID for the SummarySet

Description

Set Method to create an internal Variant ID for the SummarySet

Usage

setVariantid(summary_set)

## S4 method for signature 'SummarySet'
setVariantid(summary_set)

Arguments

summary_set

A gwasglue2 SummarySet object

Value

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

Description

Set Method to store RSID/variants in the SummarySet

Usage

setVariants(summary_set, variants)

## S4 method for signature 'SummarySet'
setVariants(summary_set, variants)

Arguments

summary_set

A gwasglue2 SummarySet object

variants

The RSID/variants associated with the GWAS summary statistics

Value

The gwasglue2 SummarySet object with RSID/variants stored

See Also

Similar to setRSID()


Calculating Z-scores

Description

Calculating Z-scores

Usage

setZscores(dataset)

## S4 method for signature 'DataSet'
setZscores(dataset)

Arguments

dataset

A gwasglue2 DataSet object

Value

An extra '"zscores"' column in the GWAS summary statistics tibble.


An S4 class to represent the Summary Set

Description

An S4 class to represent the Summary Set

Slots

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


SusieR to DataSet

Description

#' 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.

Usage

susie_to_dataset(summaryset, s, R)

Arguments

summaryset

gwasglue2 SummarySet object

s

susieR object

R

lD matrix

Value

DataSet object