Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAGMA.Celltyping::import_magma_files issue #137

Open
sofiapuvogelvittini opened this issue Nov 25, 2022 · 1 comment
Open

MAGMA.Celltyping::import_magma_files issue #137

sofiapuvogelvittini opened this issue Nov 25, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sofiapuvogelvittini
Copy link

sofiapuvogelvittini commented Nov 25, 2022

1. Bug description

I was previously using the following code to extract the GWAS summaries of 1) Biological insights from 108 schizophrenia-associated genetic loci. Nature, 2014 2) Genome-wide association study identifies
30 loci associated with bipolar disorder. Nature Genetics, 2019 3) Meta-analysis of GWAS of over 16,000
individuals with autism spectrum disorder highlights a novel locus at 10q24.32 and a significant
overlap with schizophrenia. Molecular Autism, 2017. 4) Liu, J.Z., S. van Sommeren, H. Huang, et al., Association analyses identify 38
susceptibility loci for inflammatory bowel disease and highlight shareed genetic risk across
populations. Nat Genet, 2015

diseases<-c("ieu-a-22","ieu-b-41","ieu-a-1185","ieu-a-12")
magma_dirs <- MAGMA.Celltyping::import_magma_files(ids = diseases)

However, it's not working anymore.
Also, if I try with each dissease per separate,
magma_dirs <- MAGMA.Celltyping::import_magma_files(ids = c("ieu-a-22")),
I obtain the same error message.

Could you pleas help me to understand what migh be going wrong?
Thank you very much

Console output

Error in download.file(url = x, destfile = destfile): cannot open URL 'https://github.com/neurogenomics/MAGMA_Files_Public/raw/master/data/MAGMA_Files/ieu-a-22.tsv.gz.35UP.10DOWN/ieu-a-22.tsv.gz.35UP.10DOWN.genes.out'
Traceback:

  1. MAGMA.Celltyping::import_magma_files(ids = c("ieu-a-22"))
  2. github_download_files(filelist = magma_files, save_dir = fix_path(save_dir),
    . nThread = nThread, overwrite = overwrite, verbose = verbose)
  3. unlist(parallel::mclapply(filelist, function(x) {
    . branch <- stringr::str_split(string = x, pattern = "/")[[1]][7]
    . folder_structure <- paste(stringr::str_split(string = x,
    . pattern = "/")[[1]][-c(seq(1, 7))], collapse = "/")
    . destfile <- file.path(save_dir, folder_structure)
    . dir.create(dirname(destfile), showWarnings = FALSE, recursive = TRUE)
    . if (!file.exists(destfile) | isTRUE(overwrite)) {
    . message_parallel("Downloading file ==> ", destfile)
    . download.file(url = x, destfile = destfile)
    . }
    . else {
    . message_parallel("Importing previously downloaded file: ",
    . destfile)
    . }
    . return(destfile)
    . }, mc.cores = nThread))
  4. parallel::mclapply(filelist, function(x) {
    . branch <- stringr::str_split(string = x, pattern = "/")[[1]][7]
    . folder_structure <- paste(stringr::str_split(string = x,
    . pattern = "/")[[1]][-c(seq(1, 7))], collapse = "/")
    . destfile <- file.path(save_dir, folder_structure)
    . dir.create(dirname(destfile), showWarnings = FALSE, recursive = TRUE)
    . if (!file.exists(destfile) | isTRUE(overwrite)) {
    . message_parallel("Downloading file ==> ", destfile)
    . download.file(url = x, destfile = destfile)
    . }
    . else {
    . message_parallel("Importing previously downloaded file: ",
    . destfile)
    . }
    . return(destfile)
    . }, mc.cores = nThread)
  5. lapply(X, FUN, ...)
  6. FUN(X[[i]], ...)
  7. download.file(url = x, destfile = destfile)


@sofiapuvogelvittini sofiapuvogelvittini added the bug Something isn't working label Nov 25, 2022
@bschilder bschilder self-assigned this Mar 1, 2023
@bschilder
Copy link
Collaborator

Those files were removed bc of some issues I discovered with how many non-biallelic SNPs were being dropped by MungeSumStats (up to 50% of all SNPs), which had some unknown degree of effect on the MAGMA files. Once I sort this out, I am working on regenerating these MAGMA files.

In the meantime, you can always create new MAGMA files yourself with map_snps_to_genes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants