if value is None:
raise ApiError("MolResidueData.chain can not be set to None")
else:
molSystemCode = value.molSystem.code
chainCode = value.code
if self.molSystemCode != molSystemCode or self.chainCode != value.code:
self.chainCode = chainCode
self.molSystemCode = molSystemCode