Home > FR3DSource > zEdgeText.m

zEdgeText

PURPOSE ^

zEdgeText converts internal codes for pair interactions into text

SYNOPSIS ^

function [E] = zEdgeText(e,Detail,C1,C2)

DESCRIPTION ^

 zEdgeText converts internal codes for pair interactions into text

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % zEdgeText converts internal codes for pair interactions into text
0002 
0003 % e is the internal code
0004 % Detail = 1 says to give information about subcategories
0005 % C1 and C2 are the codes (1-4) of the two bases making the interaction,
0006 % so we know whether to keep the detail of lowercase letters, eg. cWw
0007 % If C1 is present and C2 is missing, C1 is interpreted as a paircode
0008 
0009 function [E] = zEdgeText(e,Detail,C1,C2)
0010 
0011 if nargin < 1,
0012   e = 1;
0013 end
0014 
0015 if nargin < 2,
0016   Detail = 0;
0017 end
0018 
0019 E = [];
0020 
0021 for i=1:length(e),
0022   switch fix(e(i))
0023     case    1,    E = [E 'cWw'];
0024     case    2,    E = [E 'tWw'];
0025     case    3,    E = [E 'cWH'];
0026     case    4,    E = [E 'tWH'];
0027     case    5,    E = [E 'cWS'];
0028     case    6,    E = [E 'tWS'];
0029     case    7,    E = [E 'cHh'];
0030     case    8,    E = [E 'tHh'];
0031     case    9,    E = [E 'cHS'];
0032     case   10,    E = [E 'tHS'];
0033     case   11,    E = [E 'cSs'];
0034     case   12,    E = [E 'tSs'];
0035     case   13,    E = [E 'bif'];
0036     case   14,    E = [E 'Rib'];
0037     case   -1,    E = [E 'cwW'];
0038     case   -2,    E = [E 'twW'];
0039     case   -3,    E = [E 'cHW'];
0040     case   -4,    E = [E 'tHW'];
0041     case   -5,    E = [E 'cSW'];
0042     case   -6,    E = [E 'tSW'];
0043     case   -7,    E = [E 'chH'];
0044     case   -8,    E = [E 'thH'];
0045     case   -9,    E = [E 'cSH'];
0046     case  -10,    E = [E 'tSH'];
0047     case  -11,    E = [E 'csS'];
0048     case  -12,    E = [E 'tsS'];
0049     case  -13,    E = [E 'bif'];
0050     case  -14,    E = [E 'Rib'];
0051     case   21,    E = [E 's35'];
0052     case  -21,    E = [E 's53'];
0053     case   22,    E = [E 's33'];
0054     case  -22,    E = [E 's33'];
0055     case   23,    E = [E 's55'];
0056     case  -23,    E = [E 's55'];
0057     case  101,    E = [E 'ncWw'];
0058     case  102,    E = [E 'ntWw'];
0059     case  103,    E = [E 'ncWH'];
0060     case  104,    E = [E 'ntWH'];
0061     case  105,    E = [E 'ncWS'];
0062     case  106,    E = [E 'ntWS'];
0063     case  107,    E = [E 'ncHh'];
0064     case  108,    E = [E 'ntHh'];
0065     case  109,    E = [E 'ncHS'];
0066     case  110,    E = [E 'ntHS'];
0067     case  111,    E = [E 'ncSs'];
0068     case  112,    E = [E 'ntSs'];
0069     case  113,    E = [E 'nbif'];
0070     case  114,    E = [E 'nRib'];
0071     case -101,    E = [E 'ncwW'];
0072     case -102,    E = [E 'ntwW'];
0073     case -103,    E = [E 'ncHW'];
0074     case -104,    E = [E 'ntHW'];
0075     case -105,    E = [E 'ncSW'];
0076     case -106,    E = [E 'ntSW'];
0077     case -107,    E = [E 'nchH'];
0078     case -108,    E = [E 'nthH'];
0079     case -109,    E = [E 'ncSH'];
0080     case -110,    E = [E 'ntSH'];
0081     case -111,    E = [E 'ncsS'];
0082     case -112,    E = [E 'ntsS'];
0083     case -113,    E = [E 'nbif'];
0084     case -114,    E = [E 'nRib'];
0085     case  121,    E = [E 'ns35'];
0086     case -121,    E = [E 'ns53'];
0087     case  122,    E = [E 'ns33'];
0088     case -122,    E = [E 'ns33'];
0089     case  123,    E = [E 'ns55'];
0090     case -123,    E = [E 'ns55'];
0091     otherwise     E = [E '----'];
0092   end
0093 
0094 
0095 EE = E;
0096 EE((end-1):end) = upper(E((end-1):end));
0097 
0098 if nargin == 4,
0099   if any(fix(abs(e)) == [11 12 111 112]),
0100     EE = E;                                     % reset to original
0101   elseif any(abs(e) == [1 7 8]) && (C1 == C2),
0102     EE = E;
0103   end
0104 end
0105 
0106 if nargin == 3,
0107   if any(fix(abs(e)) == [11 12 111 112]),
0108     EE = E;                                     % reset to original
0109   elseif any(abs(e) == [1 7 8]) && (any(C1 == [1 6 11 16])),
0110     EE = E;
0111   end
0112 end
0113 
0114 if any(fix(abs(e)) == [13 14 113 114]),
0115   EE = E;
0116 end
0117 
0118 E = EE;
0119 
0120 if abs(e(i)) < 29,                     % pairing or stacking
0121   if (fix(e(i)) == e(i)) || (Detail == 0),
0122     E = [E ' '];
0123   else
0124     d = abs(e(i)) - fix(abs(e(i)));
0125     d = fix(d*10+0.0001);
0126     d = max(1,d);
0127     T = 'abcdefghijkl';
0128     E = [E T(d)];
0129   end
0130  end
0131 end
0132

Generated on Fri 03-Apr-2009 09:52:35 by m2html © 2003