public CustomMolecule(SmallMoleculeLibraryAttributes libraryAttributes) : this(libraryAttributes.ChemicalFormula, libraryAttributes.MoleculeName, libraryAttributes.CreateMoleculeID()) { Assume.IsFalse(libraryAttributes.IsEmpty); }
public static CustomMolecule FromSmallMoleculeLibraryAttributes(SmallMoleculeLibraryAttributes libraryAttributes) { Assume.IsFalse(libraryAttributes.IsEmpty); SmallMoleculeLibraryAttributes.ParseMolecularFormulaOrMassesString(libraryAttributes.ChemicalFormulaOrMassesString, out var formula, out var monoMass, out var averageMass); return(new CustomMolecule(formula, monoMass, averageMass, libraryAttributes.MoleculeName, libraryAttributes.CreateMoleculeID())); }