def __init__(self, residue_dict, derivative): self.residue_dict = residue_dict self.derivative = derivative formula = Formula(derivative.form()) for residue, count in residue_dict.iteritems(): formula.add(residue.form().multiply(count)) self.formula = formula
def __init__(self, code): self.residue = code formula = Formula(Residue.residues[code]['formula']) formula.add('C2H2NO') self.formula = formula