How can I read a DNA sequence (Fasta file ) from NCBI and store it in array or in a specific variable

I want to click on command in my window to enter the Accession Number of the sequence, then the output must be for example S=ATCCTGGAA....
i am try this code, but does not work
%% Read sequence data from FASTA files
s = fastaread('AC168908.txt')

回答 (1 件)

Smit
Smit 2023 年 2 月 10 日
Hi,
I understand you want to read the DNA sequence from a FASTA file.
The function “fastaread” will read the FASTA file and store the data in a structure. This structure also contains the DNA sequence. So, all you need to do extract the sequence access the “Sequence” field in the structure in the following manner
sequence = s.Sequence;
For more information on “fastaread” you can visit the documentation page.

カテゴリ

ヘルプ センター および File Exchange で Genomics and Next Generation Sequencing についてさらに検索

質問済み:

2022 年 11 月 22 日

回答済み:

2023 年 2 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by