LociOiling Lv 1
This recipe was inspired by recent discussions of the trim tool.
There's no sure-fire way for a recipe to tell whether its working on a trimmed protein.
However, if the trimmed protein consists of separate sections of the original protein, some of the segments will be abnormally far apart – gaps.
Just to keep things interesting, the protein in puzzle 2155b starts out with two gaps. These gaps are due to residues (segments) which turned up missing in the electron density experiment.
There's no way to tell if a gap is due to trimming the protein, or just missing segments. With puzzle 2155b, you can have both types.
Separate chains, seen in binder puzzles and elsewhere, are another possible source of gaps.
Detecting gaps is easy. The function structure.GetDistance returns the distance between the alpha carbons of two segments. It works on adjacent segments (segment N and N + 1, for example).
Distances are in Angstroms. A normal alpha carbon distance for adjacent segments is between 3.7 and 3.9 Angstroms. The recipe considers a distance of 4 Angstroms or more to be a gap.
This recipe only reports gaps and some related statistics. It doesn't do anything with the information, and is pretty much guaranteed not to change your score.