mbuild_polybuild.aa_monomers.cbma.Cbma.reset_labels¶
- Cbma.reset_labels()¶
Reset Compound labels so that substituents and ports are renumbered, indexed from port[0] to port[N], where N-1 is the number of ports.
Notes
Will renumber the labels in a given Compound. Duplicated labels are named in the format “{name}[$]”, where the $ stands in for the 0-indexed number in the Compound hierarchy with given “name”.
i.e. self.labels.keys() = [“CH2”, “CH2”, “CH2”] would transform into self.labels.keys() = [“CH2[0]”, “CH2[1]”, “CH2[2]”] and i.e. self.labels.keys() = [“CH2[1]”, “CH2[3]”, “CH2[5]”] would transform into self.labels.keys() = [“CH2[0]”, “CH2[1]”, “CH2[2]”]
Additonally, if it doesn’t exist, duplicated labels that are numbered as above with the “[$]” will also be put into a list index. self.labels.keys() = [“CH2”, “CH2”, “CH2”] would transform into self.labels.keys() = [“CH2[0]”, “CH2[1]”, “CH2[2]”] as shown above, but also have a label of self.labels[“all-CH2s”], which is a list of all CH2 children in the Compound.