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.
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=TRUEto 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). Overridesreturn_dirargument.- 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.
Examples
magma_dirs <- MAGMA.Celltyping::import_magma_files(ids = c("ieu-a-298"))
#> Using built-in example files: ieu-a-298.tsv.gz.35UP.10DOWN
#> Returning MAGMA directories.