コード例 #1
0
def _get_serial_range(sel_keyword, map, start, stop):
    from iotbx.pdb import utils_base_256_ordinal as o
    o_start = None
    o_stop = None
    if (start is not None and start.count(" ") != len(start)):
        o_start = o(start)
    if (stop is not None and stop.count(" ") != len(stop)):
        o_stop = o(stop)
    if (o_start is not None and o_stop is not None and o_start > o_stop):
        raise RuntimeError("range with first index > last index: %s %s:%s" %
                           (sel_keyword, start, stop))
    result = []
    for s, iselection in map.items():
        os = o(s)
        if (o_start is not None and os < o_start): continue
        if (o_stop is not None and os > o_stop): continue
        result.append(iselection)
    return result
コード例 #2
0
 def get_resid_range(self, start, stop):
     from iotbx.pdb import utils_base_256_ordinal as o
     o_start = None
     o_stop = None
     if (start is not None and start.count(" ") != len(start)):
         o_start = o(resid_shift(start))
     if (stop is not None and stop.count(" ") != len(stop)):
         o_stop = o(resid_shift(stop))
     if (o_start is not None and o_stop is not None and o_start > o_stop):
         raise RuntimeError(
             "range with first index > last index: resid %s:%s" %
             (start, stop))
     result = []
     for s, iselection in self.resid.items():
         os = o(s)
         if (o_start is not None and os < o_start): continue
         if (o_stop is not None and os > o_stop): continue
         result.append(iselection)
     return result
コード例 #3
0
 def get_resid_range(self, start, stop):
   from iotbx.pdb import utils_base_256_ordinal as o
   o_start = None
   o_stop = None
   if (start is not None and start.count(" ") != len(start)):
     o_start = o(resid_shift(start))
   if (stop is not None and stop.count(" ") != len(stop)):
     o_stop = o(resid_shift(stop))
   if (    o_start is not None
       and o_stop is not None
       and o_start > o_stop):
     raise RuntimeError(
       "range with first index > last index: resid %s:%s" % (start, stop))
   result = []
   for s,iselection in self.resid.items():
     os = o(s)
     if (o_start is not None and os < o_start): continue
     if (o_stop  is not None and os > o_stop): continue
     result.append(iselection)
   return result
コード例 #4
0
def _get_serial_range(sel_keyword, map, start, stop):
  from iotbx.pdb import utils_base_256_ordinal as o
  o_start = None
  o_stop = None
  if (start is not None and start.count(" ") != len(start)):
    o_start = o(start)
  if (stop is not None and stop.count(" ") != len(stop)):
    o_stop = o(stop)
  if (    o_start is not None
      and o_stop is not None
      and o_start > o_stop):
    raise RuntimeError(
      "range with first index > last index: %s %s:%s" % (
        sel_keyword, start, stop))
  result = []
  for s,iselection in map.items():
    os = o(s)
    if (o_start is not None and os < o_start): continue
    if (o_stop  is not None and os > o_stop): continue
    result.append(iselection)
  return result