Skip to content

Latest commit

 

History

History
59 lines (47 loc) · 937 Bytes

File metadata and controls

59 lines (47 loc) · 937 Bytes

gomol2

Go MOL2 simple parser

Description

Simple Go package for parsing Tripos Mol2 File Format.

GoMOL2 Wiki

Feature parsing:

  1. Atom
  • atom_id
  • atom_name
  • x, y, z
  • atom_type
  • substructure
    • subst_name
    • charge
    • status_bit TODO
  1. Bond
  • bond_id
  • origin_atom_id
  • target_atom_id
  • bond_type
  • status_bits TODO
  1. Molecule
  • mol_name
  • num_atoms
  • num_bonds
  • num_subst TODO
  • num_feat TODO
  • num_sets TODO
  • mol_type
  • charge_type
  • status_bits
  • mol_comment TODO

Install & Usage

Install: go get github.com/ldinc/gomol2/mol2

Example:

Parsing from file:

mol, err := mol2.ParseFile(filename)
fmt.Println(mol)

Parsing from byte-slice

var buffer []byte
...
mol, err := mol2.ParseText(buffer)
fmt.Println(mol)