The script functions by:
- Identify residues that contain a 6-membered ring AND have atom names C1, C2, C3, C4, C5, and O5
- Determine the geometric center of the ring for residues from Step 1
- Identify the geometric center of the connecting residue by 1) determining the oxygen that is connected to C1 and is NOT named O5, and 2) identifying the carbon that is attached to this oxygen that is NOT the same residue number as that of the C1
– Nomenclature for the glycosidic oxygen is inconsistent. Sometimes it is named O1 and part of the C1-containing residue. Other times, it is named based on the carbon that it is attached to on the neighboring residue (i.e. O4)
- Build shapes with the appropriate color according to the residue name
- Connect the shapes with cylinders between the two geometric centers
This is not the same order in which the script operates, but describes the key components of building the glycans. There are also steps for determining whether the glycan is N-linked, O-linked, or a terminal residue.