how to import gene fasta file from NCBI using matlab 2016a

3 ビュー (過去 30 日間)
Priyanka Roy
Priyanka Roy 2017 年 2 月 28 日
コメント済み: Paola Favaretto 2017 年 3 月 1 日
I want to import gene fasta file from NCBI database using the Accession Number. I use the code Data = getgenbank('NP_752927.1'); but, getting this error : Error using getncbidata (line 191) The key NP_752927.1 was not found in the nucleotide database at this time. Please check that the input is a valid accession number or try again.
NOTE: This function is dependent on NCBI's Entrez tools and sequence databases. Changes to either may cause this function to break.
Error in getgenbank (line 70)
[varargout{1:nargout}] = getncbidata(accessnum,'fileformat','GenBank','database','nucleotide',varargin{:});
How will i resolve the error?

採用された回答

Paola Favaretto
Paola Favaretto 2017 年 2 月 28 日
Are you sure it is a valid accession number? When I search the NCBI databases with the id you provided, I get 0 results.
  1 件のコメント
Priyanka Roy
Priyanka Roy 2017 年 3 月 1 日
Escherichia coli O157:H7 str. Sakai, complete genome. NCBI Reference Sequence: NC_002695.1 ACCESSION NC_002695
I can manually download the Fasta file from NCBI database, but getting the same error while using the code : Data = getgenbank('NC_002695');
what will be the code for importing the fasta file directly from NCBI database ?

サインインしてコメントする。

その他の回答 (1 件)

Paola Favaretto
Paola Favaretto 2017 年 3 月 1 日
編集済み: Paola Favaretto 2017 年 3 月 1 日
What version of Bioinformatics Toolbox are you using? I am able to download the sequence without issues.
You can get the sequence information by typing:
a = getgenbank('NC_002695', 'sequenceonly', true)
Or you can save the sequence in a FASTA formatted file by typing:
a = getgenbank('NC_002695', 'tofile', 'S:/myfile2.fa', 'fileformat', 'fasta')
This is a snippet of the output:
a =
struct with fields:
Header: 'NC_002695.1 Escherichia coli O157:H7 str. Sakai, complete genome'
Sequence: 'AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTCTCTGACAGC ...'
  4 件のコメント
Priyanka Roy
Priyanka Roy 2017 年 3 月 1 日
I run the code:
a = getgenbank('NC_002695', 'sequenceonly', true)
and then got this error:
Error using getncbidata (line 227) Cannot save the contents of the URL to 'C:\Users\Su\AppData\Local\Temp\tp1f17e28a_9c1a_40e3_a428_c56374602d85'.
Error in getgenbank (line 70) [varargout{1:nargout}] = getncbidata(accessnum,'fileformat','GenBank','database','nucleotide',varargin{:});
Paola Favaretto
Paola Favaretto 2017 年 3 月 1 日
See if this patch solves your problem. (NCBI switched their protocol to https in late September 2016).
If not, I suggest you contact MathWorks Customer Support to get the help you need to solve your particular problem.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by