nanxstats / Rcpi

💊 Molecular informatics toolkit with integration of bioinformatics and cheminformatics tools for drug discovery
https://nanx.me/Rcpi/
Artistic License 2.0
37 stars 12 forks source link

getFASTAFromUniProt and getSeqFromUniProt errors #14

Closed Amirreza-Mousavi closed 2 years ago

Amirreza-Mousavi commented 3 years ago
id = c('P00750', 'P00751', 'P00752')

getFASTAFromUniProt(id) 
#gives "" "" ""

from R documentations of getFASTAFromUniProt does not run properly. the second line gives an empty character string, which will result in errors in other functions dependent on getFASTAFromUniProt such as getSeqFromUniProt.

Also,

id = c('P00750', 'P00751', 'P00752')

getSeqFromUniProt(id)
#ERROR

leads to error.

(Error in FUN(X[[i]], ...) : no line starting with a > character found)

which is obviously resulted from problems in getFASTAFromUniProt.

It seems that getURLAsynchronous in the implementation of getFASTAFromUniProt is causing the problem somehow. It's better to replace it with some equivalent base-R function.

askarlupka commented 2 years ago

I'm having the same issue with getSeqFromUniProt. I believe the URL has changed on uniprot's end. In the getFASTAFromUniProt function getURLAsynchronous is directed to a website. However I think that has recently been updated to, "https://https://rest.uniprot.org/uniprotkb/", id, ".fasta"

> getFASTAFromUniProt function (id, parallel = 5) { fastaURL = paste0("https://www.uniprot.org/uniprot/", id, ".fasta") fastaTxt = getURLAsynchronous(url = fastaURL, perform = parallel) return(fastaTxt) } <bytecode: 0x7fcc0e8555c0>

Example: "https://www.uniprot.org/uniprot/P00750.fasta" gets redirected to "https://rest.uniprot.org/uniprotkb/P00750.fasta"
nanxstats commented 2 years ago

Thanks @askarlupka and @Amirreza-Mousavi for reporting this.

I've fixed the issue in this repo - you can try it with remotes::install_github("nanxstats/Rcpi").

I also submitted the updated version v1.33.2 (devel) and v1.32.2 (release) to Bioconductor. It may take a few days to fully propagate through their build system.