ld_matrix: Get LD matrix for list of SNPs

Description Usage Arguments Details Value

View source: R/ld_matrix.R

Description

This function takes a list of SNPs and searches for them in a specified super-population in the 1000 Genomes phase 3 reference panel. It then creates an LD matrix of r values (signed, and not squared). All LD values are with respect to the major alleles in the 1000G dataset. You can specify whether the allele names are displayed.

Usage

1
2
3
4
5
6
7
ld_matrix(
  variants,
  with_alleles = TRUE,
  pop = "EUR",
  bfile = NULL,
  plink_bin = NULL
)

Arguments

variants

List of variants (rsids)

with_alleles

Whether to append the allele names to the SNP names. Default: TRUE

pop

Super-population to use as reference panel. Default = "EUR". Options are EUR, SAS, EAS, AFR, AMR. 'legacy' also available - which is a previously used verison of the EUR panel with a slightly different set of markers

bfile

If this is provided then will use the API. Default = NULL

plink_bin

If null and bfile is not null then will detect packaged plink binary for specific OS. Otherwise specify path to plink binary. Default = NULL

Details

The data used for generating the LD matrix includes only bi-allelic SNPs with MAF > 0.01, so it's quite possible that a variant you want to include will be absent. If it is absent, it will be automatically excluded from the results.

You can check if your variants are present in the LD reference panel using ieugwasr::ld_reflookup()

This function does put load on the OpenGWAS servers, which makes life more difficult for other users, and has been limited to analyse only up to 500 variants at a time. We have implemented a method and made available the LD reference panels to perform the operation locally, see ieugwasr::ld_matrix() and related vignettes for details.

Value

Matrix of LD r values


MRCIEU/ieugwasr documentation built on May 8, 2021, 4:18 a.m.