-
Notifications
You must be signed in to change notification settings - Fork 0
MAGMA_Celltyping
MAGMA_Celltyping is a key tool developed by the lab and all computational lab members should be familiar with it's usage.
If you are new to working with GWAS summary statistics, it may help to read this description written by Michel Nivard: 2. Important resources and key information · MichelNivard/GenomicSEM Wiki
Download the magma executable to a folder in your local directory, e.g. 'home/magma_v1.08a'
Now add that folder to your $PATH. Open your bash profile with vi ~/.bash_profile
then add these lines to it:
export PATH=~/magma_v1.08a:$PATH
module load gcc/8.2.0
You'll need to run source ~/.bash_profile
before running R for this to work.
Because RStudio doesn't load bash variables, you'll also want to add this to ~/.REnviron
(but only the export PATH
part, not module load
).
We keep a shared set of precomputed MAGMA files at /projects/neurogenomics-lab/live/MAGMA_Files/
. If you want to use these for a gene set enrichment, then here's some example code:
library(MAGMA.Celltyping)
storage_dir <- "~/Downloads"
# Set path the 1000 genomes reference data.
genome_ref_dir = file.path(storage_dir,"g1000_eur")
if(!file.exists(sprintf("%s/g1000_eur.bed",genome_ref_dir))){
download.file("https://ctg.cncr.nl/software/MAGMA/ref_data/g1000_eur.zip",destfile=sprintf("%s.zip",genome_ref_dir))
unzip(sprintf("%s.zip",genome_ref_dir),exdir=genome_ref_dir)
}
genome_ref_path = sprintf("%s/g1000_eur",genome_ref_dir)
data("rbfox_binding")
gwas_sumstats_path = "/rds/general/user/nskene/projects/neurogenomics-lab/live/ALS_2018.annotated"
geneset_res = calculate_geneset_enrichment(geneset=rbfox_binding,gwas_sumstats_path=gwas_sumstats_path,analysis_name="Rbfox_20016",upstream_kb=35,downstream_kb=10,genome_ref_path=genome_ref_path,geneset_species="mouse")
This example uses the ALS GWAS. Change the gwas_sumstats_path to switch to a different file. The original sum stats doesn't need to be there, just use the start of the folder name from within the MAGMA_Files folder, as was done for ALS_2018.annotated
.
Note that you may need to change the upstream_kb and downstream_kb, depending on the MAGMA files used (look at the file names).
- Home
- Useful Info
- To do list for new starters
- Recommended Reading
-
Computing
- Our Private Cloud System
- Cloud Computing
- Docker
- Creating a Bioconductor package
- PBS example scripts for the Imperial HPC
- HPC Issues list
- Nextflow
- Analysing TIP-seq data with the nf-core/cutandrun pipeline
- Shared tools on Imperial HPC
- VSCode
- Working with Google Cloud Platform
- Retrieving raw sequence data from the SRA
- Submitting read data to the European Nucleotide Archive
- R markdown
- Lab software
- Genetics
- Reproducibility
- The Lab Website
- Experimental
- Lab resources
- Administrative stuff