Protein sequence manipulation for adding elements before or after the sequence.

how do i add zeros to both ends or one end (before or after) of a protein sequence?
Example:
a protein sequence is given as 'ITYTDCTESGQDLCLCEGSDVCGKGNKCILGSNGEENQCVTGEGTPKPQSHNDGDFEEIPEEYLQ'
how do i add zeros at the beginning before the first element of the sequence?

 採用された回答

Peng Li
Peng Li 2020 年 3 月 31 日
The easiest way to add N zeros before it can be done by:
[repmat('0', 1, N) yourProSeq];

5 件のコメント

Nedz
Nedz 2020 年 3 月 31 日
i think that works for matrix arrays only! I'm refering to only a row of sequence.
Peng Li
Peng Li 2020 年 4 月 1 日
Why didn't you give a try? by a row of sequence, it could either be a char array or a string. no matter what, it works this way.
char array
>> mm = 'ACGTACGT'
mm =
'ACGTACGT'
>> [repmat('0', 1, 10) mm]
ans =
'0000000000ACGTACGT'
string
>> mm = "ACGTACGT"
mm =
"ACGTACGT"
>> repmat('0', 1, 10)+mm
ans =
"0000000000ACGTACGT"
Nedz
Nedz 2020 年 4 月 1 日
thank you for the help.
Nedz
Nedz 2020 年 4 月 9 日
編集済み: Nedz 2020 年 4 月 9 日
What if i want to add zeroes after the squence (on the right end)?
Peng Li
Peng Li 2020 年 4 月 9 日
You flip the repmat() stuff and mm in above example.

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

その他の回答 (0 件)

カテゴリ

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

質問済み:

2020 年 3 月 31 日

コメント済み:

2020 年 4 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by