How to add the results of nmercount

1 ビュー (過去 30 日間)
Razvan
Razvan 2014 年 5 月 7 日
回答済み: Scott Ronquist 2020 年 6 月 2 日
Hi,
I would like to use nmercount to count the 5-mers in multiple strings, and then to add the counts in only one structure.
Is there a quick way of adding 2 nmercount results?

回答 (1 件)

Scott Ronquist
Scott Ronquist 2020 年 6 月 2 日
Perhaps the quickest way would be to join the sequences prior to running nmercount, using a character not used in the sequences you are joining.
The following example joins the sequences using "!":
% Get 3 protein sequences and join them with "!" as a delimiter
s1 = getgenpept("AAA59174",'SequenceOnly',true);
s2 = getgenpept("AAC29001",'SequenceOnly',true);
s3 = getgenpept("O00327",'SequenceOnly',true);
sAll = strjoin({s1, s2, s3}, "!");
% Run nmercount and remove rows that contain "!"
nmers = nmercount(sAll,5);
rows2remove = find(contains(nmers(:,1), "!"));
nmers(rows2remove,:) = [];

Community Treasure Hunt

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

Start Hunting!

Translated by