function [thisSeqs,thisScore] = PNA3nanofiber()

clear all
close all

%------------------------------------------------------------------
% SST strands
% 4 helices x 3 strands per "section" = 12 strands
% each is 12-nt long
SSTseq = repmat('NNNNNNNNNNNN ',1,9);

%
% SSTconstr = [a b c d e];
% a = strand id number
% b = base number - start complementarity region (from 5' or N-terminal end of strand)
% c = strand id number
% d = base number - end of complementarity region (from 3' or C-terminal end of strand)
% e = number of bases that should be complementary


%Visualization of 3-helix nanofiber structural motif
%     0    5   10   15   20   25   30
%S0N% \-07->[----02---->\-07->[----02---->\-16->
%S0C%       /-01-]<----03----]
%S1N%       \-01->[----05----> 
%S1C%             /-04-]<----06----]
%S2N%             \-04->[----08----> 
%S2C%                   /-07-]<----09----]
%S0N% \-07->[----02---->\-07->[----02---->\-16->

SSTconstr=[ 
  2 1 1 6 6; 2 7 3 12 6; 7 7 3 6 6;
  5 1 4 6 6; 5 7 6 12 6; 1 7 6 6 6; 
  8 1 7 6 6; 8 7 9 12 6; 4 7 9 6 6;  
];

[St,wc,eq] = constraints(SSTseq,SSTconstr,[]);

% at this point St = 'NNN ...'

rS=randbase(St);
% CONSTRAIN INITIAL CONDITION
S=constrain(rS,wc,eq)

% OPTIMIZE
load Bad6mer
global bestS bad6mer
bad6mer=make_bad6mer;

[thisSeqs,thisScore] = optimize(S,St,wc,eq, 'score_spurious');
thisSeqs
thisScore