How to read specific lines from a text file and store them in an array?

1 回表示 (過去 30 日間)
Rasif Ajwad
Rasif Ajwad 2015 年 10 月 20 日
コメント済み: per isakson 2015 年 10 月 20 日
I have a text file containing an Multiple Sequence Alignment (MSA) which has protein sequences stored in it. The contents of the file is like this:
>gi|73961569|ref|XP_547536.2| osteocalcin [C. lupus familiaris] MRSLMVLALLAVAALCLCLAGPADAKPSSAESRKGGATFVSKREGSEVVRRLRRYLDSGL GAPVPYPDPLEPKREVCELNPNCDELADHIGFQEAYQRFYGPV-
>gi|27806301|ref|NP_776674.1| osteocalcin preproprotein
MRTPMLLALLALAT--LCLAGRADAKPGDAESGK-GAAFVSKQEGSEVVKRLRRYLDHWL GAPAPYPDPLEPKREVCELNPDCDELADHIGFQEAYRRFYGPV-
From this file I just want to extract the lines containing the actual sequences (ones NOT starting with '>' symbol) and store them in an array for future use. One thing to mention is that line 2 and line 3 is one single sequence, so I also need to make them a single string and store it in one single position of an array. How can I do that?
I wanted to use 'fileread' but it reads all the file at a time, so it's not helpful.
  1 件のコメント
per isakson
per isakson 2015 年 10 月 20 日
Delete one of my our two identical questions!

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by