Skip to content

Instantly share code, notes, and snippets.

@sneumann
Last active September 27, 2022 09:07
Show Gist options
  • Save sneumann/072adeb302ca010e2eb5de24e3bdb413 to your computer and use it in GitHub Desktop.
Save sneumann/072adeb302ca010e2eb5de24e3bdb413 to your computer and use it in GitHub Desktop.
#!/bin/bash
wget -O- https://www.chemotion-repository.net/api/v1/public/molecule.json?id=6338 |\
jq "$(cat <<EOF
{ "@context": "https://schema.org/",
"@type": "MolecularEntity",
"dct:conformsTo": { "http://purl.org/dc/terms/conformsTo": {
"@id": "https://bioschemas.org/profiles/MolecularEntity/0.5-RELEASE",
"@type": "CreativeWork" }
},
"@id": .molecule.tag.taggable_data.chemotion.doi,
name: .molecule.iupac_name,
url: "http://chemotion-repository.net/home/publications/molecules/\(.molecule.id)",
identifier: "chemotion ID ?",
iupacName:.molecule.iupac_name,
smiles: .molecule.cano_smiles,
inChI: .molecule.inchistring,
inChIKey: .molecule.inchikey,
molecularFormula: .molecule.sum_formular,
molecularWeight: { value: .molecule.molecular_weight }
}
EOF
)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment