// These bins are often WAY too big -- the point is to partition space first,
// and use the empirical distributions to decide if it's valid or not.
// Box boundaries are inclusive, so a point on the border could go either way.
// In those cases, though, it really doesn't matter, so it can be arbitrary.
// All boundaries are on a non-cyclic 0-360 or 0-180 grid.
// Some rotamers need more than one box to account for this.
// Boundaries were determined by hand by IWD while looking at kins labeled
// by an automatic hill-climbing algorithm.
//  name    min1    max1    min2    max2    ...

// thr, val, ser, cys
// val has weird "extra" peaks above 1%: 125-135 and 345-360
p       0       120
t       120     240
m       240     360

// pro
Cg_endo 0       180
Cg_exo  180     360

// phe, tyr
p90     0       120     0       180
t80     120     240     0       180
m-85    240     360     35      150
m-30    240     360     0       35
m-30    240     360     150     180

// trp
p-90    0       120     180     360
p90     0       120     0       180
t-105   120     240     180     305
t90     120     240     0       180
t90     120     240     305     360
m-90    240     360     180     305
m0      240     360     305     360
m0      240     360     0       45
m95     240     360     45      180

// his
p-80    0       120     180     360
p80     0       120     0       180
t-160   120     240     130     225
t-80    120     240     225     360
t60     120     240     0       130
m-70    240     360     225     360
m-70    240     360     0       20
m170    240     360     130     225
m80     240     360     20      130

// leu
pp      0       120     0       120
pt?     0       120     120     240
tp      120     240     0       120
tt      120     240     120     240
tm?     120     240     240     360
mp      240     360     0       120
mt      240     360     120     240
mm?     240     360     240     360

// ile
pp      0       120     0       120
pt      0       120     120     240
tp      120     240     0       120
tt      120     240     120     240
tm?     120     240     240     360
mp      240     360     0       120
mt      240     360     120     240
mm      240     360     240     360

// asn
p-10    0       120     180     360
p30     0       120     0       180
t-20    120     240     180     360
t-20    120     240     0       10
t30     120     240     10      180
m-20    240     360     300     360
m-20    240     360     0       40
m-80    240     360     200     300
m120    240     360     40      200

// asp
p-10    0       120     90      180
p30     0       120     0       90
t0      120     240     0       45
t0      120     240     120     180
t70     120     240     45      120
m-20    240     360     0       180

// gln
pt20    0       120     120     240     0       360
pm0     0       120     240     360     0       360
pp0?    0       120     0       120     0       360
tp-100  120     240     0       120     150     300
tp60    120     240     0       120     0       150
tp60    120     240     0       120     300     360
tt0     120     240     120     240     0       360
tm0?    120     240     240     360     0       360
mp0     240     360     0       120     0       360
mt-30   240     360     120     240     0       360
mm-40   240     360     240     360     0       60
mm-40   240     360     240     360     210     360
mm100   240     360     240     360     60      210

// glu
pp20?   0       120     0       120     0       180
pt-20   0       120     120     240     0       180
pm0     0       120     240     360     0       180
tp10    120     240     0       120     0       180
tt0     120     240     120     240     0       180
tm-20   120     240     240     360     0       180
mp0     240     360     0       120     0       180
mt-10   240     360     120     240     0       180
mm-40   240     360     240     360     0       180

// met (mmt and tpt maybe two peaks each)
ppp?    0       120     0       120     0       120
ptp     0       120     120     240     0       120
ptt?    0       120     120     240     120     240
ptm     0       120     120     240     240     360
pmm?    0       120     240     360     240     360
tpp     120     240     0       120     0       120
tpp     120     240     0       120     330     360
tpt     120     240     0       120     120     330
ttp     120     240     120     240     0       120
ttt     120     240     120     240     120     240
ttm     120     240     120     240     240     360
tmt?    120     240     240     360     120     240
tmm?    120     240     240     360     240     360
mpp?    240     360     0       120     0       120
mpt?    240     360     0       120     120     240
mtp     240     360     120     240     0       120
mtt     240     360     120     240     120     240
mtm     240     360     120     240     240     360
mmt     240     360     240     360     30      240
mmm     240     360     240     360     0       30
mmm     240     360     240     360     240     360

// lys (kept all b/c can't see 4D peaks; some never really occur)
pppp?   0       120     0       120     0       120     0       120
pppt?   0       120     0       120     0       120     120     240
pppm?   0       120     0       120     0       120     240     360
pptp?   0       120     0       120     120     240     0       120
pptt?   0       120     0       120     120     240     120     240
pptm?   0       120     0       120     120     240     240     360
ppmp?   0       120     0       120     240     360     0       120
ppmt?   0       120     0       120     240     360     120     240
ppmm?   0       120     0       120     240     360     240     360
ptpp?   0       120     120     240     0       120     0       120
ptpt    0       120     120     240     0       120     120     240
ptpm?   0       120     120     240     0       120     240     360
pttp    0       120     120     240     120     240     0       120
pttt    0       120     120     240     120     240     120     240
pttm    0       120     120     240     120     240     240     360
ptmp?   0       120     120     240     240     360     0       120
ptmt    0       120     120     240     240     360     120     240
ptmm?   0       120     120     240     240     360     240     360
pmpp?   0       120     240     360     0       120     0       120
pmpt?   0       120     240     360     0       120     120     240
pmpm?   0       120     240     360     0       120     240     360
pmtp?   0       120     240     360     120     240     0       120
pmtt?   0       120     240     360     120     240     120     240
pmtm?   0       120     240     360     120     240     240     360
pmmp?   0       120     240     360     240     360     0       120
pmmt?   0       120     240     360     240     360     120     240
pmmm?   0       120     240     360     240     360     240     360
tppp?   120     240     0       120     0       120     0       120
tppt?   120     240     0       120     0       120     120     240
tppm?   120     240     0       120     0       120     240     360
tptp    120     240     0       120     120     240     0       120
tptt    120     240     0       120     120     240     120     240
tptm    120     240     0       120     120     240     240     360
tpmp?   120     240     0       120     240     360     0       120
tpmt?   120     240     0       120     240     360     120     240
tpmm?   120     240     0       120     240     360     240     360
ttpp    120     240     120     240     0       120     0       120
ttpt    120     240     120     240     0       120     120     240
ttpm?   120     240     120     240     0       120     240     360
tttp    120     240     120     240     120     240     0       120
tttt    120     240     120     240     120     240     120     240
tttm    120     240     120     240     120     240     240     360
ttmp?   120     240     120     240     240     360     0       120
ttmt    120     240     120     240     240     360     120     240
ttmm    120     240     120     240     240     360     240     360
tmpp?   120     240     240     360     0       120     0       120
tmpt?   120     240     240     360     0       120     120     240
tmpm?   120     240     240     360     0       120     240     360
tmtp?   120     240     240     360     120     240     0       120
tmtt?   120     240     240     360     120     240     120     240
tmtm?   120     240     240     360     120     240     240     360
tmmp?   120     240     240     360     240     360     0       120
tmmt?   120     240     240     360     240     360     120     240
tmmm?   120     240     240     360     240     360     240     360
mppp?   240     360     0       120     0       120     0       120
mppt?   240     360     0       120     0       120     120     240
mppm?   240     360     0       120     0       120     240     360
mptp?   240     360     0       120     120     240     0       120
mptt    240     360     0       120     120     240     120     240
mptm?   240     360     0       120     120     240     240     360
mpmp?   240     360     0       120     240     360     0       120
mpmt?   240     360     0       120     240     360     120     240
mpmm?   240     360     0       120     240     360     240     360
mtpp    240     360     120     240     0       120     0       120
mtpt    240     360     120     240     0       120     120     240
mtpm?   240     360     120     240     0       120     240     360
mttp    240     360     120     240     120     240     0       120
mttt    240     360     120     240     120     240     120     240
mttm    240     360     120     240     120     240     240     360
mtmp?   240     360     120     240     240     360     0       120
mtmt    240     360     120     240     240     360     120     240
mtmm    240     360     120     240     240     360     240     360
mmpp?   240     360     240     360     0       120     0       120
mmpt?   240     360     240     360     0       120     120     240
mmpm?   240     360     240     360     0       120     240     360
mmtp    240     360     240     360     120     240     0       120
mmtt    240     360     240     360     120     240     120     240
mmtm    240     360     240     360     120     240     240     360
mmmp?   240     360     240     360     240     360     0       120
mmmt    240     360     240     360     240     360     120     240
mmmm    240     360     240     360     240     360     240     360

// arg (again, some entries are dummies for peaks that never occur)
ppp_?   0       120     0       120     0       120     0       360
ppt_?   0       120     0       120     120     240     0       360
ppm_?   0       120     0       120     240     360     0       360
ptp85   0       120     120     240     0       120     0       120
ptp180  0       120     120     240     0       120     120     360
ptt85   0       120     120     240     120     240     0       120
ptt180  0       120     120     240     120     240     120     240
ptt-85  0       120     120     240     120     240     240     360
ptm85   0       120     120     240     240     360     0       120
ptm180  0       120     120     240     240     360     120     360
pmp_?   0       120     240     360     0       120     0       360
pmt_?   0       120     240     360     120     240     0       360
pmm_?   0       120     240     360     240     360     0       360
tpp85   120     240     0       120     0       120     0       120
tpp180  120     240     0       120     0       120     120     360
tpt85   120     240     0       120     120     240     0       120
tpt180  120     240     0       120     120     240     120     360
tpm_?   120     240     0       120     240     360     0       360
ttp85   120     240     120     240     0       120     0       120
ttp180  120     240     120     240     0       120     120     240
ttp-105 120     240     120     240     0       120     240     360
ttt85   120     240     120     240     120     240     0       120
ttt180  120     240     120     240     120     240     120     240
ttt-85  120     240     120     240     120     240     240     360
ttm105  120     240     120     240     240     360     0       120
ttm180  120     240     120     240     240     360     120     240
ttm-85  120     240     120     240     240     360     240     360
tmp_?   120     240     240     360     0       120     0       360
tmt_?   120     240     240     360     120     240     0       360
tmm_?   120     240     240     360     240     360     0       360
mpp_?   240     360     0       120     0       120     0       360
mpt_?   240     360     0       120     120     240     0       360
mpm_?   240     360     0       120     240     360     0       360
mtp85   240     360     120     240     0       120     0       120
mtp180  240     360     120     240     0       120     120     240
mtp-105 240     360     120     240     0       120     240     360
mtt85   240     360     120     240     120     240     0       120
mtt180  240     360     120     240     120     240     120     240
mtt-85  240     360     120     240     120     240     240     360
mtm105  240     360     120     240     240     360     0       120
mtm180  240     360     120     240     240     360     120     240
mtm-85  240     360     120     240     240     360     240     360
mmp_?   240     360     240     360     0       120     0       360
mmt85   240     360     240     360     120     240     0       120
mmt180  240     360     240     360     120     240     120     240
mmt-85  240     360     240     360     120     240     240     360
mmm180  240     360     240     360     240     360     0       240
mmm-85  240     360     240     360     240     360     240     360


