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::get_example_gwas() error #157

Closed
2 tasks done
Jadeapple opened this issue Nov 29, 2024 · 6 comments
Closed
2 tasks done

MAGMA.Celltyping::get_example_gwas() error #157

Jadeapple opened this issue Nov 29, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@Jadeapple
Copy link

Checklist

  • I am able to reproduce the bug with the latest version
  • I checked, but didn't find any duplicates (open OR closed) of this issue in the repo

Affected version

2.0.14

Steps to reproduce the bug

path_formatted <- MAGMA.Celltyping::get_example_gwas(trait = "prospective_memory")

Actual behavior

Importing munged GWAS summary statistics: prospective_memory
Loading required namespace: piggyback
Error in stopper("GitHub Personal Access Token (PAT) is missing.", "This is required to download Release files via piggyback.", :
GitHub Personal Access Token (PAT) is missing. This is required to download Release files via piggyback. See GitHub for details: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

Expected behavior

No error

Session info

R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-conda-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

@Jadeapple Jadeapple added the bug Something isn't working label Nov 29, 2024
@Al-Murphy
Copy link
Collaborator

Hi, the issue is exampled in the output message - you need to set up a itHub Personal Access Token (PAT) for your R sessions so piggyback can download the necessary data. Follow the steps in the provided link to do so.

Cheers,
Alan.

@Jadeapple
Copy link
Author

Hi Alan, thanks a lot! I have solved this problem. But an error appeared when I ran genesOutPath < MAGMA.Celltyping::map_snps_to_genes(path_formatted = path_formatted, genome_build = "GRCh37").

Error as follows:
==== MAGMA Step 2: Generate genes.out ====

Welcome to MAGMA v1.03 (linux)
Using flags:
--bfile /root/.cache/R/MAGMA.Celltyping/g1000_eur/g1000_eur synonym-dup=skip
--pval /root/.cache/R/MAGMA.Celltyping/prospective_memory.ukb.tsv ncol=N duplicate=drop
--gene-annot /root/.cache/R/MAGMA.Celltyping/MAGMA_Files/prospective_memory.ukb.tsv.35UP.10DOWN/prospective_memory.ukb.tsv.35UP.10DOWN.genes.annot
--out /root/.cache/R/MAGMA.Celltyping/MAGMA_Files/prospective_memory.ukb.tsv.35UP.10DOWN/prospective_memory.ukb.tsv.35UP.10DOWN

Start time is 17:11:58, Monday 02 Dec 2024

ERROR - parsing arguments: 1 value required for flag --bfile (found 2).

ls /root/.cache/R/MAGMA.Celltyping/g1000_eur/
g1000_eur.bed g1000_eur.bim g1000_eur.fam g1000_eur.synonyms

do you know what's wrong with my code?

@Al-Murphy
Copy link
Collaborator

Is this part of the example code in the documentation or your own data? I would need a reproducible example to try debug anything and I would advise getting the example code to run first as this will rule out any issues with your set up.

Thanks,
Alan

@Jadeapple
Copy link
Author

Hi Alan @Al-Murphy, this is part of the example code in the documentation (https://neurogenomics.github.io/MAGMA_Celltyping/articles/MAGMA.Celltyping.html).

When I first ran genesOutPath <- MAGMA.Celltyping::map_snps_to_genes(path_formatted = path_formatted, genome_build = "GRCh37"), magma_v1.10 was installed automatically, but showed the following errors:
/root/.cache/R/MAGMA.Celltyping/magma_v1.10/magma: /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by /root/.cache/R/MAGMA.Celltyping/magma_v1.10/magma) /root/.cache/R/MAGMA.Celltyping/magma_v1.10/magma: /lib64/libstdc++.so.6: version CXXABI_1.3.8' not found (required by /root/.cache/R/MAGMA.Celltyping/magma_v1.10/magma)
/root/.cache/R/MAGMA.Celltyping/magma_v1.10/magma: /lib64/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by /root/.cache/R/MAGMA.Celltyping/magma_v1.10/magma) /root/.cache/R/MAGMA.Celltyping/magma_v1.10/magma: /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by /root/.cache/R/MAGMA.Celltyping/magma_v1.10/magma)
/root/.cache/R/MAGMA.Celltyping/magma_v1.10/magma: /lib64/libstdc++.so.6: version CXXABI_1.3.8' not found (required by /root/.cache/R/MAGMA.Celltyping/magma_v1.10/magma) /root/.cache/R/MAGMA.Celltyping/magma_v1.10/magma: /lib64/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by /root/.cache/R/MAGMA.Celltyping/magma_v1.10/magma)
Error in strsplit(check_magma, " ")[[1]] : subscript out of bounds

so I ran MAGMA.Celltyping::magma_uninstall() and MAGMA.Celltyping::magma_install(desired_version="1.03").

Also, when I first ran genesOutPath <- MAGMA.Celltyping::map_snps_to_genes(path_formatted = path_formatted, genome_build = "GRCh37"), it showed :
Installed MAGMA version: MAGMA
Skipping MAGMA installation.
A different version of MAGMA than desired_version is currently installed: MAGMA Set upgrade=TRUE to install desired_version as well: v1.10
Using: magma_v1.03
genome_ref not found in storage_dir. Downloading from remote server instead ==> /root/.cache/R/MAGMA.Celltyping/g1000_eur
trying URL 'https://vu.data.surfsara.nl/index.php/s/VZNByNwpD8qqINe/download'
Content type 'application/zip' length 511626945 bytes (487.9 MB)

downloaded 2.9 MB

Error in utils::download.file(url = input_url, destfile = zipfile) :
download from 'https://vu.data.surfsara.nl/index.php/s/VZNByNwpD8qqINe/download' failed
In addition: Warning messages:
1: In system(as.character(paste(x, "--version")), intern = TRUE) :
running command '/root/.cache/R/MAGMA.Celltyping/magma_v1.03/magma --version' had status 3
2: In system(as.character(paste(x, "--version")), intern = TRUE) :
running command '/root/.cache/R/MAGMA.Celltyping/magma_v1.03/magma --version' had status 3
3: In utils::download.file(url = input_url, destfile = zipfile) :
downloaded length 0 != reported length 0
4: In utils::download.file(url = input_url, destfile = zipfile) :
URL 'https://vu.data.surfsara.nl/index.php/s/VZNByNwpD8qqINe/download': Timeout of 300 seconds was reached

so I downloaded 1000 genomes reference file manually from https://vu.data.surfsara.nl/index.php/s/VZNByNwpD8qqINe/download, and put it under the directory /root/.cache/R/MAGMA.Celltyping/g1000_eur/.

then I ran genesOutPath <- MAGMA.Celltyping::map_snps_to_genes(path_formatted = path_formatted, genome_build = "GRCh37"), it showed:
Installed MAGMA version: MAGMA
Skipping MAGMA installation.
A different version of MAGMA than desired_version is currently installed: MAGMA Set upgrade=TRUE to install desired_version as well: v1.10
Using: magma_v1.03
Using existing genome_ref found in storage_dir.
ℹ All local files already up-to-date!

==== MAGMA Step 1: Generate genes.annot file ====

Welcome to MAGMA v1.03 (linux)
Using flags:
--annotate window=35,10
--snp-loc /root/.cache/R/MAGMA.Celltyping/prospective_memory.ukb.tsv
--gene-loc /root/.cache/R/MAGMA.Celltyping/NCBI37.3.gene.loc
--out /root/.cache/R/MAGMA.Celltyping/MAGMA_Files/prospective_memory.ukb.tsv.35UP.10DOWN/prospective_memory.ukb.tsv.35UP.10DOWN

Start time is 17:11:57, Monday 02 Dec 2024

Starting annotation...
Reading gene locations from file /root/.cache/R/MAGMA.Celltyping/NCBI37.3.gene.loc...
adding window: 35000bp (before), 10000bp (after)
19161 gene locations read from file
chromosome 1: 2016 genes
chromosome 2: 1226 genes
chromosome 3: 1050 genes
chromosome 4: 745 genes
chromosome 5: 856 genes
chromosome 6: 750 genes
chromosome 7: 906 genes
chromosome 8: 669 genes
chromosome 9: 775 genes
chromosome 10: 723 genes
chromosome 11: 1275 genes
chromosome 12: 1009 genes
chromosome 13: 320 genes
chromosome 14: 595 genes
chromosome 15: 586 genes
chromosome 16: 817 genes
chromosome 17: 1147 genes
chromosome 18: 271 genes
chromosome 19: 1389 genes
chromosome 20: 527 genes
chromosome 21: 215 genes
chromosome 22: 442 genes
chromosome X: 805 genes
chromosome Y: 47 genes
Reading SNP locations from file /root/.cache/R/MAGMA.Celltyping/prospective_memory.ukb.tsv...
WARNING: on line 1, chromosome code 'CHR' not recognised; skipping SNP (ID = SNP)
398092 SNP locations read from file
of those, 215415 (54.11%) mapped to at least one gene
Writing annotation to file /root/.cache/R/MAGMA.Celltyping/MAGMA_Files/prospective_memory.ukb.tsv.35UP.10DOWN/prospective_memory.ukb.tsv.35UP.10DOWN.genes.annot
for chromosome 1, 744 genes are empty (out of 2016)
for chromosome 2, 425 genes are empty (out of 1226)
for chromosome 3, 319 genes are empty (out of 1050)
for chromosome 4, 275 genes are empty (out of 745)
for chromosome 5, 252 genes are empty (out of 856)
for chromosome 6, 234 genes are empty (out of 750)
for chromosome 7, 275 genes are empty (out of 906)
for chromosome 8, 272 genes are empty (out of 669)
for chromosome 9, 238 genes are empty (out of 775)
for chromosome 10, 239 genes are empty (out of 723)
for chromosome 11, 394 genes are empty (out of 1275)
for chromosome 12, 313 genes are empty (out of 1009)
for chromosome 13, 121 genes are empty (out of 320)
for chromosome 14, 211 genes are empty (out of 595)
for chromosome 15, 220 genes are empty (out of 586)
for chromosome 16, 307 genes are empty (out of 817)
for chromosome 17, 305 genes are empty (out of 1147)
for chromosome 18, 84 genes are empty (out of 271)
for chromosome 19, 393 genes are empty (out of 1389)
for chromosome 20, 151 genes are empty (out of 527)
for chromosome 21, 65 genes are empty (out of 215)
for chromosome 22, 150 genes are empty (out of 442)
for chromosome X, 805 genes are empty (out of 805)
for chromosome Y, 47 genes are empty (out of 47)
at least one SNP mapped to each of a total of 12322 genes (out of 19161)

End time is 17:11:58, Monday 02 Dec 2024 (elapsed: 00:00:01)

==== MAGMA Step 2: Generate genes.out ====

Welcome to MAGMA v1.03 (linux)
Using flags:
--bfile /root/.cache/R/MAGMA.Celltyping/g1000_eur/g1000_eur synonym-dup=skip
--pval /root/.cache/R/MAGMA.Celltyping/prospective_memory.ukb.tsv ncol=N duplicate=drop
--gene-annot /root/.cache/R/MAGMA.Celltyping/MAGMA_Files/prospective_memory.ukb.tsv.35UP.10DOWN/prospective_memory.ukb.tsv.35UP.10DOWN.genes.annot
--out /root/.cache/R/MAGMA.Celltyping/MAGMA_Files/prospective_memory.ukb.tsv.35UP.10DOWN/prospective_memory.ukb.tsv.35UP.10DOWN

Start time is 17:11:58, Monday 02 Dec 2024

ERROR - parsing arguments: 1 value required for flag --bfile (found 2).

Terminating program.
Warning messages:
1: In system(as.character(paste(x, "--version")), intern = TRUE) :
running command '/root/.cache/R/MAGMA.Celltyping/magma_v1.03/magma --version' had status 3
2: In system(as.character(paste(x, "--version")), intern = TRUE) :
running command '/root/.cache/R/MAGMA.Celltyping/magma_v1.03/magma --version' had status 3

Do you need any more information?

Thanks!

@Al-Murphy
Copy link
Collaborator

I would say it is better to use MAGMA Celltypings functionality to download MAGMA and the dependencies to avoid issues like you are having. If you can't get it working, have a look at our docker images to get up and running and avoid any system specific dependencies.

@Jadeapple
Copy link
Author

Thank you, Alan! I will try it.

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