def _make_fragment_list(pp, length):
 frag_list = []
 for i in range(0, ((len(pp) - length) + 1)):
  f = Fragment(length, (-1))
  for j in range(0, length):
   residue = pp[(i + j)]
   resname = residue.get_resname()
   if residue.has_id('CA'):
    ca = residue['CA']
   else:
    raise PDBException('CHAINBREAK')
   if ca.is_disordered():
    raise PDBException('CHAINBREAK')
   ca_coord = ca.get_coord()
   f.add_residue(resname, ca_coord)
  frag_list.append(f)
 return frag_list

def _make_fragment_list ( pp , length ) : frag_list = [ ] for i in range ( 0 , ( ( len ( pp ) - length ) + 1 ) ) : f = Fragment ( length , ( - 1 ) ) for j in range ( 0 , length ) : residue = pp [ ( i + j ) ] resname = residue . get_resname ( ) if residue . has_id ( 'CA' ) : ca = residue [ 'CA' ] else : raise PDBException ( 'CHAINBREAK' ) if ca . is_disordered ( ) : raise PDBException ( 'CHAINBREAK' ) ca_coord = ca . get_coord ( ) f . add_residue ( resname , ca_coord ) frag_list . append ( f ) return frag_list
dice up a peptide in fragments of length "length" .