import_magma_files: Import preprocessed MAGMA files

View source: R/import_magma_files.r

import_magma_filesR Documentation

Import preprocessed MAGMA files

Description

Import preprocessed MAGMA SNPs-to-genes mapping files for many GWAS. These files were generated using map_snps_to_genes and are publicly available via the MAGMA_Files_Public GitHub repository. Metadata for each dataset (including trait descriptions) can be found here here.

Usage

import_magma_files(
  save_dir = tempdir(),
  ids = NULL,
  file_types = c(".genes.out", ".genes.raw"),
  overwrite = FALSE,
  return_dir = TRUE,
  return_tables = FALSE,
  nested = FALSE,
  nThread = 1,
  verbose = TRUE
)

Arguments

save_dir

Parent folder where you want to save the MAGMA files.

ids

[Optional] OpenGWAS dataset IDs. You see metadata for the GWAS here.

file_types

MAGMA file types to import. Both ".genes.out" and ".genes.raw" are needed to run MAGMA.Celltyping cell-type enrichment functions

overwrite

If the files have already been downloaded in the specified directory, these downloads will be skipped. Set overwrite=TRUE to force them to be re-downloaded (Default: FALSE).

return_dir

Return a list of unique directory names instead of the full file paths (Default: TRUE).

return_tables

Returns the files imported as tables (TRUE), instead of as paths (default: FALSE). Overrides return_dir argument.

nested

Return files as a list nested by id (default: FALSE).

nThread

Number of threads to parallelise downloads across.

verbose

Print messages.

Value

Named vector of paths to downloaded MAGMA files (or directories), or a data.table.

Source

MAGMA_Files_Public GitHub repository

Examples

magma_dirs <- MAGMA.Celltyping::import_magma_files(ids = c("ieu-a-298"))

NathanSkene/MAGMA_Celltyping documentation built on Aug. 21, 2023, 8:55 a.m.