%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  atomGrps2  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%   Scripts that use the grpNum and atoms:
%   NOEfitFun.m 
%   stereoAndQ2H.m, pdbNumCodeFilter
%   process_spindiffAll.m, stereo.m
%   3spin: simulations.m, rhosim


conditions.methyl(1).grpNum     = 100;
conditions.methyl(1).atoms      = [305 315 325];

conditions.methyl(2).grpNum     = 101;
conditions.methyl(2).atoms      = [120 130 140];

conditions.methyl(3).grpNum     = 102;
conditions.methyl(3).atoms      = [170 180 190];

conditions.methyl(4).grpNum     = 103;
conditions.methyl(4).atoms      = [335 345 355];

conditions.methyl(5).grpNum     = 104;
conditions.methyl(5).atoms      = [220 230 240];

conditions.methyl(6).grpNum     = 105;
conditions.methyl(6).atoms      = [270 280 290];

conditions.methyl(7).grpNum     = 106;
conditions.methyl(7).atoms      = [365 375 385];

conditions.methyl(8).grpNum     = 107;
conditions.methyl(8).atoms      = [250 255 260];

conditions.methyl(9).grpNum     = 6111; % overlap of pseudo methyl 101 102
conditions.methyl(9).atoms      = [101 102];

conditions.methyl(10).grpNum    = 6112; % overlap of pseudo methyl 104 105
conditions.methyl(10).atoms     = [104 105];


conditions.methylene(1).grpNum  = 2007;
conditions.methylene(1).atoms   = [3 4];

conditions.methylene(2).grpNum  = 2008;
conditions.methylene(2).atoms   = [5 6];

conditions.methylene(3).grpNum  = 2010;
conditions.methylene(3).atoms   = [12 13];

conditions.methylene(4).grpNum  = 2011;
conditions.methylene(4).atoms   = [18 19];

conditions.methylene(5).grpNum  = 2014;
conditions.methylene(5).atoms   = [29 30];

conditions.methylene(6).grpNum  = 2015;
conditions.methylene(6).atoms   = [31 32];

conditions.methylene(7).grpNum  = 2017;
conditions.methylene(7).atoms   = [47 48];

conditions.methylene(8).grpNum  = 2020;
conditions.methylene(8).atoms   = [49 41];

conditions.methylene(9).grpNum  = 2069;
conditions.methylene(9).atoms   = [56 57];

conditions.methylene(10).grpNum = 2071;
conditions.methylene(10).atoms  = [58 70];

conditions.methylene(11).grpNum = 2072;
conditions.methylene(11).atoms  = [61 62];

conditions.methylene(12).grpNum = 2080;
conditions.methylene(12).atoms  = [52 53];

conditions.methylene(13).grpNum = 2081;
conditions.methylene(13).atoms  = [65 66];

conditions.methylene(14).grpNum = 4021;
conditions.methylene(14).atoms  = [41 47 48 49];

conditions.methylene(15).grpNum = 4074;
conditions.methylene(15).atoms  = [61 62 58 70];

conditions.all.PROring              = [2 5 6 2008 18 19 2011 29 30 2014];

conditions.all.PHETYRring           = [47 48 2017 41 49 2020 34 35];

conditions.all.HISring              = [63 42 43 67];
conditions.all.TRPring              = [39 51 33 38 40 37];


conditions.all.HA                       = [2];

conditions.all.HNHA                 	= [1 2];
conditions.all.labile                   = [14 15 16 17 34 64 67];

conditions.all.nGrpAtoms                = [1 2 9 14 15 16 17 20 33 34 35 37 38 39 40 42 43 51 63 64 67 68];
conditions.all.methylPseudo             = sort([conditions.methyl.grpNum]);
conditions.all.methylAtoms              = sort([conditions.methyl(1:8).atoms]);

conditions.all.methylAtomsAndPseudo     = sort([conditions.methyl(1:8).atoms, conditions.methyl.grpNum]);

conditions.all.methylenePseudo          = sort([conditions.methylene.grpNum]);
conditions.all.methylenePseudoNOaro     = sort([conditions.methylene(1:13).grpNum, conditions.methylene(1:13).atoms]);
conditions.all.methyleneAtoms           = sort(unique([conditions.methylene(1:13).atoms]));
conditions.all.methyleneAtomsAndPseudo  = sort([conditions.methylene(1:13).atoms, conditions.methylene.grpNum]);
conditions.all.nGrpMethyleneNoNH        = sort([setdiff(conditions.all.nGrpAtoms,1),conditions.all.methyleneAtomsAndPseudo]);

conditions.all.allPseudo                = sort([conditions.all.methylPseudo, conditions.all.methylenePseudo]);
conditions.all.methylMethyleneAtoms     = sort([conditions.all.methylAtoms, conditions.all.methyleneAtoms]);
conditions.all.allAtoms                 = sort([conditions.all.methylMethyleneAtoms, conditions.all.nGrpAtoms]);
conditions.all.allAtomsAllPseudo        = sort([conditions.all.allAtoms, conditions.all.allPseudo]); 
conditions.all.allExceptMethylene       = setxor([conditions.all.allAtomsAllPseudo], [conditions.all.methyleneAtoms]);

conditions.all.Q2H                      = sort( [ conditions.methylene(1:13).grpNum ] );
conditions.all.Q3H                      = sort( [ conditions.methyl(1:8).grpNum ] );
conditions.all.Q4H                      = sort( [ conditions.methylene(14:15).grpNum ] );
conditions.all.Q6H                      = sort( [ conditions.methyl(9:10).grpNum ] );

% % % % HisAroAtoms     = [42, 43, 63, 67];
% % % % PheTyrAroAtoms  = [2017, 2020, 4021, 34, 35, 41, 47, 48, 49];
% % % % TrpAroAtoms     = [33, 37, 38, 39, 40, 51];

conditions.all.aromatics                = [42, 43, 63, 67, 2017, 2020, 4021, 34, 35, 41, 47, 48, 49, 33, 37, 38, 39, 40, 51];
conditions.all.aromaticsP               = [2017, 2020, 4021];
conditions.all.aromaticsH               = [42, 43, 63, 67, 34, 35, 41, 47, 48, 49, 33, 37, 38, 39, 40, 51];

conditions.all.aromat                   = conditions.all.aromatics;
conditions.all.metheneAll               = [2, 9, 20, conditions.all.aromat];
conditions.all.metheneNoHA              = [9, 20, conditions.all.aromat];

conditions.all.methyleneANYPseudo       = sort([conditions.all.methylPseudo, conditions.all.methylenePseudo ,conditions.all.methyleneAtoms]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%