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?

 Akzeptierte Antwort

The easiest way to add N zeros before it can be done by:
[repmat('0', 1, N) yourProSeq];

5 Kommentare

i think that works for matrix arrays only! I'm refering to only a row of sequence.
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"
thank you for the help.
Nedz
Nedz am 9 Apr. 2020
Bearbeitet: Nedz am 9 Apr. 2020
What if i want to add zeroes after the squence (on the right end)?
You flip the repmat() stuff and mm in above example.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Genomics and Next Generation Sequencing finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 31 Mär. 2020

Kommentiert:

am 9 Apr. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by