function [expres] = MakemisExpression(FB, RB, LIB, kind)

% this function take in a perfect adapter and creates a random expression that
% corresponds to mutated adapters.
% The variable "kind" defined is. The option is
% 'mutant'



FA = LIB.FA;
RA = LIB.RA;
SEQ = LIB.SEQ;

if strcmp(kind,'mutant')
   
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%%%%%%%%%  make the point mutants of adapters  %%%%%%%%%%%%%%%%%%%%%%%

        modFA = ['(' FA ];
        for i=1:numel(FA)
            modFA = [modFA '|' FA(1:i-1) '[ATCGBDEJKM]' FA(i+1:end)];
        end
        modFA = [ modFA ')' ];


        modRA = ['(' FA ];
        for i=1:numel(RA)
            modRA = [modRA '|' RA(1:i-1) '[ATCGBDEJKM]' RA(i+1:end)];
        end
        modRA = [ modRA ')' ];
    
else
    error(['Define how you want to match your adapters; the option is '...
           'mutant']);
end
    % match forward barcode (FB) then modified forward adapter FA and place 
    % the result into token FA1   
    FA1 = [ FB '(?<FA>' modFA ')' ]; 
    
    % match modified reverse adapter RA, place the result into token RA1,
    % then match the reverse barcode
    RA1 = [ '(?<RA>' modRA ')' RB ];

    % match SEQ and place the result from this regexp into token SEQ1 
    SEQ1 = [ '(?<SEQ>' SEQ ')' ];

    expres = [FA1 SEQ1 RA1];
end