Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownAACode = errors.New("unknown amino acid code")
ErrUnknownAACode Single letter AA code unknown
Functions ¶
func ChemicalFormula ¶
ChemicalFormula a molecule to a string
func InitCommonMolecules ¶
InitCommonMolecules initializes some common molecules It only needs to be called in case elements.Elems is initialized with a non-standard table
Types ¶
type AtomsCount ¶
type AtomsCount struct {
// contains filtered or unexported fields
}
AtomsCount contains an atom index and atom count
func (*AtomsCount) IdxCount ¶
func (ac *AtomsCount) IdxCount() (int, int)
IdxCount returns the index and count of an atom in a molecule
type Molecule ¶
type Molecule struct {
// contains filtered or unexported fields
}
Molecule represents a single molecule
func Add ¶
Add two molecules. The atoms in the molecules must be sorted by atom index The molecules must use the same elements table (this is not checked) FIXME: handle situation where molecules have different element pointer
func SimpleFormula ¶
SimpleFormula converts a chemical formula to a structure that contains elements/atom counts
func (*Molecule) Atoms ¶
func (m *Molecule) Atoms() []AtomsCount
Atoms returns the atoms/count of a molecule