rendered paste bodyfunction [] = unity(file, leader)
load TAV.mat; load Codons.mat;
S = getseq(file);
S = num2char(char2num(S, 1, 0), 0, 1);
Fasta = strcat(file, '.fasta');
write2fasta(Fasta, strcat(S, leader), 'prfb', 60);
Include = ['-I"', fileparts(which('FreeAlign.pm')), '"'];
[x, Signal] = system(['perl', ' ', Include, ' ', which('free_scan.pl'), ' ', '-r -e -q auuccuccacuag', ' ', Fasta]);
Signal = str2num(Signal);
cp = 0; % codon preset, to be used if codons are to be skipped at the beginning
% Set C1, initialx, Nstop and phi_sp
phi_sp=-13*(pi/180); initialx = 0.001; C1 = 0.005; C2 = initialx; Nstop=1000; spc=1;
disp(length(Signal) - length(S));
% Run it through the model
[mag,theta,x] = calcmpx(S(3*cp+1:end),Signal,phi_sp,Names,TAV,C1,C2,Nstop,spc);
% Polar plot
figure(1); polar(theta,mag);
% Displacement plot
figure(2); plot(1+cp:length(x)+cp, x); axis([1 length(x)+cp min(-4,min(x)) max(4,max(x))]); grid; xlabel('Codon Number'); ylabel('x(k)');