-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheB2_uniq_matK.m
executable file
·71 lines (63 loc) · 1.73 KB
/
eB2_uniq_matK.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
function eB2_uniq_matK
x=fastaread('matK_rpsv.fasta');
N=size(x,1)
L=length(x(1).Sequence)
xnew=cell(1);
hit=1;
for nn=1:N
seq=x(nn).Sequence;
listN=strfind(seq,'N');
%listW=strfind(seq,'W');'K'
%listR=strfind(seq,'R');
%listY=strfind(seq,'Y');
if isempty(listN)==1 %%%&& isempty(listW)==1 && isempty(listR)==1 && isempty(listY)==1
fprintf('[%d:%d][%d]%s\n',nn,hit,length(seq),seq);
xnew(hit)=cellstr(seq);
hit=hit+1;
end
end
N_ORG=size(xnew,2)
xnew_uniq=unique(xnew);
N_UNQ=size(xnew_uniq,2)
xratio=N_UNQ/N_ORG
out=zeros(N_UNQ,L);
for mm=1:N_UNQ
tmpseq=char(xnew_uniq(mm));
for pp=1:length(tmpseq)
if strcmp(tmpseq(pp),'A')
out(mm,pp)=1;
elseif strcmp(tmpseq(pp),'C')
out(mm,pp)=2;
elseif strcmp(tmpseq(pp),'G')
out(mm,pp)=3;
elseif strcmp(tmpseq(pp),'T')
out(mm,pp)=4;
elseif strcmp(tmpseq(pp),'M')
out(mm,pp)=5;
elseif strcmp(tmpseq(pp),'R')
out(mm,pp)=6;
elseif strcmp(tmpseq(pp),'W')
out(mm,pp)=7;
elseif strcmp(tmpseq(pp),'S')
out(mm,pp)=8;
elseif strcmp(tmpseq(pp),'Y')
out(mm,pp)=9;
elseif strcmp(tmpseq(pp),'K')
out(mm,pp)=10;
elseif strcmp(tmpseq(pp),'V')
out(mm,pp)=11;
elseif strcmp(tmpseq(pp),'H')
out(mm,pp)=12;
elseif strcmp(tmpseq(pp),'D')
out(mm,pp)=13;
elseif strcmp(tmpseq(pp),'B')
out(mm,pp)=14;
% m a or c amino r a or g purine w a or t s c or g y c or t pyrimidine k g or t keto
else
tmpseq(pp)
error('?');
end
end
end
imagesc(out);
return