webread error(ncbi)

조회 수: 3 (최근 30일)
arash manbu
arash manbu 2020년 12월 2일
답변: Rahul 2025년 6월 25일
im trying to get some information from ncbi website using this code:
HepatitisC = getgenbank('NC_004102');
HepatitisC = HepatitisC.Sequence;
Hepatitisc_length = length(HepatitisC);
first_300_bases = seqdisp(HepatitisC(1:300));
figure
ntdensity(HepatitisC)
bases = basecount(HepatitisC);
figure
basecount(HepatitisC,'chart','pie');
title('Distribution of Nucleotide Bases for Hepatitis C Virus');
figure
dimers = dimercount(HepatitisC,'chart','bar');
title('Hepatitis C Dimer Histogram');
seqshoworfs(HepatitisC);
orfs = seqshoworfs(HepatitisC,'AlternativeStartCodons',true);
AND I RECIVE THIS ERROR:
Error using webread (line 122)
The connection to URL
'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=nuccore&term=NC_004102%5BAccession%5D' timed out after 5
seconds. Set options.Timeout to a higher value.
Error in getncbidata>accession2gi (line 315)
searchXML = webread(searchurl);
Error in getncbidata (line 181)
[giID,db] = accession2gi(accessnum,db,'quick');
Error in getgenbank (line 76)
[varargout{1:nargout}] = getncbidata(accessnum,'fileformat','GenBank','database','nucleotide',varargin{:});
Error in Hepatitis (line 1)
HepatitisC = getgenbank('NC_004102');
im new to matlab and i dont know how to solve this.
thanks

답변 (1개)

Rahul
Rahul 2025년 6월 25일
I understand that you face the mentioned error of 'webread' while trying to obtain the data using 'getgenbank'. You can consider the following options to read the data correctlty:
  • Set a higher timout using the 'weboptions' function.
  • Obtain the data in a txt file using the 'websave' function with the weboptions defined.
  • Now read the data from the txt file using 'getbankread' function.
Here is an example:
wo = weboptions("Timeout", 10);
websave("output.txt", "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=950361812&rettype=gb&retmode=text&seq_start=6022&seq_stop=17213", wo);
data = genbankread("output.txt");
In recent MATLAB versions this issue has been resolved and just accessing data using 'getgenbank('NC_004102')' does not give the error.
The following MathWorks documentations can be referred:
Thanks.

카테고리

Help CenterFile Exchange에서 Sparse Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by