def addReactionRulesBlock(self, rrBlock, dimerGenBlock, omniGenBlock, uniMolGenBlock, overwrite=False): if self.reactionRulesBlock and not overwrite: raise MzrExceptions.MoleculizerException( "Error: Cannot add a reaction rules block twice.") if not self.BlockPassesSanityCheck(rrBlock): raise InsaneBlockOnTheLooseException(rrBlock, "reaction rules") if not self.BlockPassesSanityCheck(dimerGenBlock): raise InsaneBlockOnTheLooseException(dimerGenBlock, "dimerization gen block") if not self.BlockPassesSanityCheck(omniGenBlock): raise InsaneBlockOnTheLooseException(omniGenBlock, "omni-gen block") if not self.BlockPassesSanityCheck(uniMolGenBlock): raise InsaneBlockOnTheLooseException(uniMolGenBlock, "uni-mol-gen block") self.reactionRulesBlock.extend(rrBlock) self.dimerizationGenBlock.extend(dimerGenBlock) self.omniGenBlock.extend(omniGenBlock) self.uniMolGenBlock.extend(uniMolGenBlock) self.reactionGensSection = ReactionRulesSection( self.reactionRulesBlock, self.dimerizationGenBlock, self.omniGenBlock, self.uniMolGenBlock)
def addUniMolGenStatement(self, uniMolGenLine): uniMolGenLine = self.PreProcessStatement(uniMolGenLine) self.uniMolGenBlock.append(uniMolGenLine) self.reactionGensSection = ReactionRulesSection( self.reactionRulesBlock, self.dimerizationGenBlock, self.omniGenBlock, self.uniMolGenBlock) return