Version: v0.0.0-...-8b1917f Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2021 License: MIT Imports: 5 Imported by: 0




This section is empty.


View Source
var ErrUnknownAACode = errors.New("Unknown amino acid code")

ErrUnknownAACode Single letter AA code unknown


func ChemicalFormula

func ChemicalFormula(m Molecule, e *elements.Elems) (string, error)

ChemicalFormula a molecule to a string

func InitCommonMolecules

func InitCommonMolecules(e *elements.Elems)

InitCommonMolecules initializes some common molecules It must be called after (re-)initializing elements.Elems


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 retruns 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

func Add(m1 Molecule, m2 Molecule) Molecule

Add two molecules. The atoms in the molecules must be sorted by atom index

func AminoAcid

func AminoAcid(aa byte) (Molecule, error)

AminoAcid returns the molecule (minus H2O) for a single letter amino acid code

func PepProt

func PepProt(p string) (Molecule, error)

PepProt returns the molecule peptide or protein

func SimpleFormula

func SimpleFormula(f string, e *elements.Elems) (Molecule, error)

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

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL