Proteomicslab57357 / UniprotR

Retrieving Information of Proteins from Uniprot
GNU General Public License v3.0
59 stars 18 forks source link

GetAccessionList is writing an html file rather than a fasta file #28

Closed grimmem1 closed 2 years ago

grimmem1 commented 2 years ago

GetAccessionList is writing an html file rather than a fasta file. Am I misusing the tool, or is this expected behavior? Thanks.

> library(UniprotR)
> Accessions <- GetAccessionList("https://s3.amazonaws.com/csvpastebin/uploads/9571fa356c67a0c7c95e8431799a051a/Accessions.csv") 
> GETSeqFastaUniprot(Accessions, FileName = "example")
Please wait we are processing your accessions ...
> list.files()                                                                       
[1] "example.fasta"
> system("head example.fasta")
<!doctype html><html lang=en><head><meta charset=utf-8/><title>UniProt</title><meta name=viewport content=width=device-width,initial-scale=1/><meta name=theme-color content=#00639a/><link rel=apple-touch-icon sizes=180x180 href=/apple-touch-icon.png/><link rel=icon type=image/png sizes=32x32 href=/favicon-32x32.png/><link rel=icon type=image/png sizes=16x16 href=/favicon-16x16.png/><link rel=manifest href=/manifest.json/><link rel=preconnect href=https://fonts.gstatic.com//><link rel=preconnect href=https://rest.uniprot.org//><link rel=preload as=style href=https://fonts.googleapis.com/css?family=Lato:400,700|Source+Sans+Pro:600,700&display=swap/><script async src=https://www.googletagmanager.com/gtag/js?id=UA-6228219-1></script><script>window.dataLayer = window.dataLayer || [];
      function gtag() {
        dataLayer.push(arguments);
      }
      gtag('js', new Date());
      gtag('config', 'UA-6228219-1', {
        anonymize_ip: true,
        allow_google_signals: false,
        allow_ad_personalization_signals: false,
        restricted_data_processing: true,
> library(msa)
> test <- readAAStringSet("example.fasta")
Error in .Call2("fasta_index", filexp_list, nrec, skip, seek.first.rec,  : 
  reading FASTA file example.fasta: ">" expected at beginning of line 1
AliYoussef96 commented 2 years ago

For sure this is not the expected behavior. It should return a normal fasta file.

I believe that is due to the new API updates by Uniprot DB. We will solve this issue in the nearest update of UniprotR.

MohmedSoudy commented 2 years ago

Hi @grimmem1, Thank you for your interest in UniprotR. As my colleague Ali illustrated, the error is due to the update in the Uniprot API and it's resolved in the next version of UniprotR UniprotR_2.2.2 that will be available within a few days on CRAN.