ropensci / phylotaR

An automated pipeline for retrieving orthologous DNA sequences from GenBank in R
https://docs.ropensci.org/phylotaR
Other
23 stars 8 forks source link

Error in gzfile #41

Closed oscarIM closed 1 year ago

oscarIM commented 5 years ago

Hi, I try to use phylotaR. However, after long time (around 12 hrs) of sequences downloading, the software sends this error: Error in stages_run(wd = wd, frm = frm, to = nstages, stgs_msg = stgs_msg, : Unexpected Error in gzfile(file, "rb") : invalid 'description' argument. I attach the log and session file session_info.txt log.txt

DomBennett commented 5 years ago

Hi!

For taxonomic groups with large amounts of genetic data the download phase can be very slow and sometimes errors can arise due to records getting malformed (in your case it looks like a record has lost its description). Sometimes simply trying to download on a different day helps.

I have a few suggestions:

  1. Try restarting the phylotaR pipeline using restart()
  2. Try updating to the latest version of phylotaR (see below code snippet) and re-running.
  3. Use restez. This package downloads large chunks of GenBank to your local machine and phylotaR can query that instead of the remote database. It should be much faster and reduces the risk of malformed records. Downloading with restez is much faster because it fetches highly compressed sequence files. One downside is you may need to download large chunks of sequence data, you may need a lot of free disk space.

Currently restez is not available via CRAN due to a key dependency being archived. To use restez you will need to install packages via GitHub.

# devtools required for installtion via GitHub
install.packages("devtools")
# install key dependency no longer available on CRAN
devtools::install_github("hannesmuehleisen/MonetDBLite-R")
# install restez
devtools::install_github("ropensci/restez")
# install latest version of phylotaR (the one on CRAN does not make use of restez)
devtools::install_github("ropensci/phylotaR")
oscarIM commented 5 years ago

Thank you very much for your answer. However, now when using PhylotaR (after restez download), I have the error: Error in stages_run(wd = wd, frm = 1, to = nstages, stgs_msg = stgs_msg) : Unexpected Error in typ_location[[2]] : subscript out of bounds. I attached the code used library(phylotaR) library(restez) local_genbank<-getwd() restez_path_set(local_genbank) db_download(db = 'nucleotide') db_create(db = 'nucleotide') ###phylotaR ncbi_dr <- "/home/evolecolab/Software/ncbi-blast-2.9.0+-x64-linux/ncbi-blast-2.9.0+/bin" restez_path_set(filepath = local_genbank) txid <- 9443 setup(wd = getwd(), txid = txid, ncbi_dr = ncbi_dr) run(wd = getwd())

maelle commented 2 years ago

For info, we're looking for a new maintainer / a new maintainer team for this package, see #57 and feel free to volunteer, we'd be happy to help.

ShixiangWang commented 1 year ago

Thank you very much for your answer. However, now when using PhylotaR (after restez download), I have the error: Error in stages_run(wd = wd, frm = 1, to = nstages, stgs_msg = stgs_msg) : Unexpected Error in typ_location[[2]] : subscript out of bounds. I attached the code used library(phylotaR) library(restez) local_genbank<-getwd() restez_path_set(local_genbank) db_download(db = 'nucleotide') db_create(db = 'nucleotide') ###phylotaR ncbi_dr <- "/home/evolecolab/Software/ncbi-blast-2.9.0+-x64-linux/ncbi-blast-2.9.0+/bin" restez_path_set(filepath = local_genbank) txid <- 9443 setup(wd = getwd(), txid = txid, ncbi_dr = ncbi_dr) run(wd = getwd())

This is similar to https://github.com/ropensci/phylotaR/issues/39, it should work in the latest version. If not, please file a new issue.