broadinstitute / ichorCNA

Estimating tumor fraction in cell-free DNA from ultra-low-pass whole genome sequencing.
GNU General Public License v3.0
164 stars 88 forks source link

I have got an error while running an example code #84

Open chantisakee opened 3 years ago

chantisakee commented 3 years ago

Since I am a newbie in R and I did run ichorCNA via runIchorCNA.r which provided in ichorCNA/scripts/ dir. and got this error. What should I do?

Thank you in advance.

Error in download.file(url, destfile, quiet = TRUE) : cannot open URL 'http://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/chromInfo.txt.gz' Calls: getSeqInfo ... fetchExtendedChromInfoFromUCSC -> FUN -> fetch_ChromInfo_from_UCSC -> download.file In addition: Warning messages: 1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called ‘BSgenome.Hsapiens.UCSC.hg19’ 2: In download.file(url, destfile, quiet = TRUE) : URL 'http://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/chromInfo.txt.gz': status was 'Couldn't resolve host name' Execution halted

chantisakee commented 3 years ago

Actually it's my fault there is "proxy" problem. so I would like to know whether I just download this chromInfo.txt and put in somewhere without downloading everytime i run this analysis?

thanks

abcoxyzide commented 2 years ago

I installed ichorCNA using conda, and had the same problem. It appears that it's due to getSeqInfo() trying to load / download chromosome information.

It is possible to pre-fetch the seqinfo object, but you also need to modify runIchorCNA.R to load the object.

micknudsen commented 2 years ago

I had the same problem, and it went away after installing the BSgenome.Hsapiens.UCSC.hg38 package. I think what it does is simply downloading all the stuff needing (including chromInfo.txt.gz) and placing it inside the conda environment. That way, I didn't have to modify the runIchrCNA.R script.

anjalisa commented 2 years ago

Hello everybody,

I run into the same issue that is already reported.... I try to use ichorCNA (current version; loaded via a singularity container >> ubuntu-based, then R installed, then ichorCNA installed) on our LSF cluster, but frequently receive this error message

Error in download.file(url, destfile, quiet = TRUE) : cannot open URL 'http://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/chromInfo.txt.gz' Calls: getSeqInfo ... -> fetch_table_from_UCSC -> fetch_table_from_url

I installed BSgenome.Hsapiens.UCSC.hg38 , as well as BSgenome.Hsapiens.UCSC.hg19, as proposed by micknudsen, but without any success. Could someone help me out with this issue. That would be great!

taoziyu97 commented 1 year ago

Hi, I had the same problem when submitting the script to the cluster queue. Because the queue cannot be connected to the network. So I tried this way and that worked.

  1. Run the code with self-defined parameters locally. Such as the hg38 and UCSC.
genomeBuild = "hg38"
genomeStyle = "UCSC"
library(GenomeInfoDb)
bsg <- paste0("BSgenome.Hsapiens.UCSC.", genomeBuild)
  if (!require(bsg, character.only=TRUE, quietly=TRUE, warn.conflicts=FALSE)) {
    seqinfo <- Seqinfo(genome=genomeBuild)
  } else {
    seqinfo <- seqinfo(get(bsg))
  }
seqlevelsStyle(seqinfo) <- genomeStyle
seqinfo <- keepSeqlevels(seqinfo, value = paste0("chr",c(1:22,"X")))

Then save the output. For example:

saveRDS(seqinfo, file = "/home/seqinfo_hg38_ucsc.rds")
  1. Edit the code of ichorCNA/scripts/runIchorCNA.R

The line included getSeqInfo be commented out and added code as follow:

# seqinfo <- getSeqInfo(genomeBuild, genomeStyle)
if (genomeBuild == "hg19" &  genomeStyle == "UCSC") {
  seqinfo <- readRDS("/home/seqinfo_hg19_ucsc.rds")
}
if (genomeBuild == "hg38" &  genomeStyle == "UCSC") {
  seqinfo <- readRDS("/home/seqinfo_hg38_ucsc.rds")
}

I attached the hg18 and hg19 UCSC files here.

ucsc.zip

Done.

anjalisa commented 1 year ago

True, that's a good solution !

Salaheddinekacimi commented 1 year ago

It worked thank you

Kodemannen commented 1 year ago

The solution mentioned here didn't work for me any longer.

What did work was installing the Bsgenome package from Anaconda. See: https://anaconda.org/bioconda/bioconductor-bsgenome.hsapiens.ucsc.hg38

SigAusf commented 8 months ago

This happened again and I solved with installing new version of GenomeInfoDb R package. The cause of the problem was the goldenpath url 'http://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/chromInfo.txt.gz'. In the new version of GenomeInfoDb package (v1.39.6), url was changed into 'http://hgdownload.soe.ucsc.edu/goldenPath/hg19/database/chromInfo.txt.gz'.

You can install that version of package from: https://github.com/Bioconductor/GenomeInfoDb Use this command in R devtools::install_github(repo="Bioconductor/GenomeInfoDb")