privefl / bigsnpr

R package for the analysis of massive SNP arrays.
https://privefl.github.io/bigsnpr/
183 stars 43 forks source link

Getting this error while trying to convert from hg19 to hg38 #491

Closed znayema closed 2 months ago

znayema commented 2 months ago

my code

lifted <- snp_modifyBuild(data, "/work/larylab/NAYEMA/liftover/liftOver", from = "hg19", to = "hg38", check_reverse = TRUE)

Error in utils::download.file(url, destfile = chain, quiet = TRUE) : cannot open URL 'ftp://hgdownload.cse.ucsc.edu/goldenPath/hg19/liftOver/hg19ToHg38.over.chain.gz' In addition: Warning message: In utils::download.file(url, destfile = chain, quiet = TRUE) : URL 'ftp://hgdownload.cse.ucsc.edu/goldenPath/hg19/liftOver/hg19ToHg38.over.chain.gz': Timeout of 60 seconds was reached

privefl commented 2 months ago

These aren't particularly large files; this should take less than 60 sec to download. You can set options(timeout = 1000) and try again (maybe you'll need to delete partially downloaded files first).

privefl commented 2 months ago

Another possible issue is that downloads are blocked on your server. And you should ask someone to download this file for you.

privefl commented 2 months ago

Any update on this?

Hugolyu commented 2 months ago

Hi privefl,

I encountered the same bug. Here's the error message, and options(timeout = 1000) is not work.

Error in utils::download.file(url, destfile = chain, quiet = TRUE) : 
  cannot open URL 'ftp://hgdownload.cse.ucsc.edu/goldenPath/hg38/liftOver/hg38ToHg19.over.chain.gz'
In addition: Warning message:
In utils::download.file(url, destfile = chain, quiet = TRUE) :
  URL 'ftp://hgdownload.cse.ucsc.edu/goldenPath/hg38/liftOver/hg38ToHg19.over.chain.gz': Timeout of 60 seconds was reached

modi_df = snp_modifyBuild(
+   df,
+   "/home/liulab/GeneTools/PLINK/liftOver",
+   from = "hg38",
+   to = "hg19",
+   check_reverse = TRUE
+ )
Error in utils::download.file(url, destfile = chain, quiet = TRUE) : 
  cannot open URL 'ftp://hgdownload.cse.ucsc.edu/goldenPath/hg38/liftOver/hg38ToHg19.over.chain.gz'
In addition: Warning message:
In utils::download.file(url, destfile = chain, quiet = TRUE) :
  URL 'ftp://hgdownload.cse.ucsc.edu/goldenPath/hg38/liftOver/hg38ToHg19.over.chain.gz': Timeout of 1000 seconds was reached

It appears that the URL needs to be updated. File : bigsnpr / R / modify-positions.R On line 47, the URL is constructed as follows:

url <- paste0("ftp://hgdownload.cse.ucsc.edu/goldenPath/", from, "/liftOver/",

The new download URL should be:

https://hgdownload.soe.ucsc.edu/goldenPath/hg38/liftOver/hg38ToHg19.over.chain.gz

Or can you add a parameter to enable the utilization of a local chain file? Thanks for the tool , hope it helps.

privefl commented 2 months ago

Thanks for reporting.

So, just changing soe to cse?

The local file is probably a good idea too. Would you like to submit a PR for both of these?

znayema commented 2 months ago

Thanks Hugolyu and Privelf, my problem is fixed

privefl commented 1 month ago

Note that this has been added in v1.12.9:

znayema commented 1 month ago

Thank you for the updates


From: Florian Privé @.> Sent: Wednesday, May 15, 2024 3:49 AM To: privefl/bigsnpr @.> Cc: Nayema, Zannatun @.>; Author @.> Subject: Re: [privefl/bigsnpr] Getting this error while trying to convert from hg19 to hg38 (Issue #491)

Note that this has been added in v1.12.9:

— Reply to this email directly, view it on GitHubhttps://github.com/privefl/bigsnpr/issues/491#issuecomment-2111815706, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BDZ3U4ACPELCPTRIKGX4ZBDZCMHSNAVCNFSM6AAAAABF62SF22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJRHAYTKNZQGY. You are receiving this because you authored the thread.Message ID: @.***>