-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathencodealn.m
37 lines (33 loc) · 853 Bytes
/
encodealn.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
function [aln2] = encodealn(aln)
%ENCODEALN - Convert nucleotide in alignment to integer.
%
% Syntax: [aln2] = encodealn(aln)
%
% Inputs:
% aln - Alignment structure letter representation
%
% Outputs:
% aln2 - Alignment structure integer representation
%
%
% See also: CODONISESEQ, ENCODESEQ
% Molecular Biology and Evolution Toolbox (MBEToolbox)
% Author: James Cai
% Email: jcai@tamu.edu
% Website: http://bioinformatics.org/mbetoolbox/
%
% $LastChangedDate: 2013-01-05 12:04:29 -0600 (Sat, 05 Jan 2013) $
% $LastChangedRevision: 327 $
% $LastChangedBy: jcai $
if ~(aln.seqtype),
error('Do not know the type of sequence!');
end
aln2=aln;
switch (aln2.seqtype)
case (1)
aln2.seq = i_encode_n(aln2.seq);
case (2)
aln2.seq = i_encode_n(aln2.seq);
case (3)
aln2.seq = i_encode_a(aln2.seq);
end