OERoleSet

class OERoleSet

This class represents OERoleSet, a parent class for objects that need to store OERole objects.

An OERole is an object that helps define a classification (naming) scheme to represent a category or functional role.

role = oechem.OERole("my:analysis:active-site")
print(role.GetName())

Objects derived from OERoleSet can have OERole objects added to them as a way of marking them for particular uses.

frag = oechem.OEAtomBondSet()  # isa OERoleSet
frag.AddRole(role)
The following classes derive from this class:

It is possible to test if an OERole has been added using the HasRole method, or with the OEHasRole predicate.

AddRole

AddRole(role: OERole) -> bool

Add the specified OERole to this OERoleSet. Returns true if successful.

AddRole(name: str) -> bool

Convenience method for adding a OERole by name.

frag.AddRole("my:analysis:low-energy")

ClearRoles

ClearRoles() -> None

Delete all the OERole objects from this OERoleSet.

DeleteRole

DeleteRole(role: OERole) -> bool
DeleteRole(name: str) -> bool

Delete the specified OERole from this OERoleSet. Returns true if successful.

frag.DeleteRole(role)
frag.DeleteRole("my:analysis:some-role")

GetRoles

GetRoles() -> Iterable[OERole]

Returns an iterator of every OERole object in this OERoleSet.

print([r.GetName() for r in frag.GetRoles()])

HasRole

HasRole(role: OERole) -> bool

Returns true if the OERoleSet contains the specified role.

role2 = oechem.OERole("my:analysis:low-energy")
print(frag.HasRole(role2))
HasRole(name: str) -> bool

Convenience method for testing membership with a string.

print(frag.HasRole("my:analysis:small"))

NumRoles

NumRoles() -> int

Returns the current number of OERole objects in this OERoleSet.