function rawData = assignSeqFilterFun(rawData, user)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%         assignFilter.m          %%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%run before uniqueFlagFun

if ~isempty(user.assFilter)
    
    diary on
    fprintf('Filtering out NOEs part of user.assFiler list supplied by the user')
    diary off
    
    
allIndices                              = 1:length(rawData);
    
bothAss                                 = [];
assignFilterIndx                        = [];
assignFilterCount                       = 1;

    
    
fprintf('\n\nRunning assignment Filter \n')

deleteScreenMsg                         = '';

    
for j = 1:length(rawData)
        
        
        if (mod(j,50) == 0) || j == length(rawData) || j == 1
            screenMsg = sprintf(['\n', num2str(length(rawData) + 1 - j), ' entries remaining.\n']);
            fprintf([deleteScreenMsg, screenMsg])
            deleteScreenMsg = repmat(sprintf('\b'), 1, length(screenMsg));
            
            if j == length(rawData)
                fprintf(deleteScreenMsg)
                fprintf('\nDONE\n')
            end
        end
          
        if ismember(rawData(j).procAss.ASSi, user.assFilter)...
        || ismember(rawData(j).procAss.ASSj, user.assFilter) 
            
            assignFilterIndx(assignFilterCount)     = j;
            assignFilterCount                       = assignFilterCount + 1;
            
        end
        
end
        
assignFilterCount                                   = assignFilterCount - 1;

assignFilterIndx

assignFilterIndx                                    = unique(assignFilterIndx);

noFilterAssignIndx                                  = setxor(assignFilterIndx, allIndices);


fprintf(['\n\n', num2str(assignFilterCount),' assignments filtered out','\n'])
% Remove assignments specified in filter

rawData                                             = rawData(noFilterAssignIndx);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%