pubchem

package
v0.0.0-...-a011eca Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: BSD-3-Clause, GPL-2.0, BSD-3-Clause, + 1 more Imports: 7 Imported by: 0

Documentation

Overview

Package for interacting with the pubchem database to look up chemical properties

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compoundproperties

func Compoundproperties(name string) (string, error)

Types

type Molecule

type Molecule struct {
	Name             string
	MolecularFormula string  `json:"MolecularFormula"`
	MolecularWeight  float64 `json:"MolecularWeight"`
	CID              int     `json:"CID"`
}

The principle type returned from querying the pubchem database if the molecule is not defined as a substance.

func MakeMolecule

func MakeMolecule(name string) (Molecule, error)

Lookup and make a molecule based on molecule name

func MakeMolecules

func MakeMolecules(names []string) ([]Molecule, error)

Make an array of molecules based on molecule names If any errors are encountered they will be aggregated and returned at the end.

func (Molecule) GramPerL

func (molecule Molecule) GramPerL(molarity wunit.Concentration) (weightpervol wunit.Concentration)

Converts a concentration in mol/L to a g/L concentration

func (Molecule) MolPerL

func (molecule Molecule) MolPerL(weightpervol wunit.Concentration) (molarity wunit.Concentration)

Converts a concentration in g/L to a mol/L concentration

func (Molecule) MolarConcentration

func (molecule Molecule) MolarConcentration() (weightpervol wunit.Concentration)

Returns the concentration in g/L required for 1 mol/L of the molecule

func (Molecule) MolarMass

func (molecule Molecule) MolarMass() (weight wunit.Mass)

Returns the mass in g required for 1 mol of the molecule

func (Molecule) ToString

func (molecule Molecule) ToString() string

Returns a summary of the molecule properties

type Properties

type Properties struct {
	MolecularFormula string  `json:"MolecularFormula"`
	MolecularWeight  float64 `json:"MolecularWeight"`
	CID              int     `json:"CID"`
}

type Pubchemjson

type Pubchemjson struct {
	Propertytable []Properties `json:"Properties"`
}

type Pubchemtable

type Pubchemtable struct {
	Pubchemjson `json:"PropertyTable"`
}

type Substance

type Substance struct {
	Name string
	SID  int `json:"SID"`
}

distinct from a molecule in that a substance does not possess a clear Molecular formula or molecular wieght. e.g. Bovine Serum Albumin. not currently implemented as an output returned by querying the pubchem database

Jump to

Keyboard shortcuts

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