⚛️ A tool to visualise organic compounds
OCV (Organic Chemistry Visualiser) is a project that parses basic IUPAC nomenclature and renders the described compound.
OCV is a project I wrote to learn about how parsing and lexical analysis works. It should however be used as a visualiser, not as a IUPAC name verifier. This is as it attempts to be as accurate in parsing but has many limitations (take a look "What OCV can't do" section).
- Go to the latest release on the releases page.
- Download the .exe file for your system. If you're unsure, get the 32 bit version.
- No installation, double click to run
- 🧪 🎉
If something isn't working like you think it should, make sure you read through what OCV can and can't do below. If you are still stuck, create an issue.
- Locants cannot be guessed - they have to explicitly stated in every case.
- e.g.
hexandioic acid
has to be entered ashexan-1,6-dioic acid
. - Some simple cases have been patched - e.g.
ethene
can be entered instead ofeth-1-ene
. Specifically eth/ene/yne and prop/ene/yne names no longer need locants.
- e.g.
- Locants outside a main chain – e.g.
1-hexene
will not parse.hex-1-ene
should be used instead. - Nitrogen locants (e.g.
N-methyl
) are not supported. - Any functional group not listed in the "What OCV can do" section are not supported.
- Take a look at the three "Complex Example" names for examples of complicated nested organic compounds. They give a good overview of OCV's functionality.
- Straight chain and cyclical main bases
- The following functional groups (attached after the main chain, e.g.
-ol
, or as a substituent before the main chain, e.g.hydroxy-
)- Alkenes and Alkynes
- Acetyl groups
- Fluoro, Chloro, Bromo and Iodo groups
- Amide groups
- Carboxylic acid
- Aldehydes
- Ketones
- Alcohols
- Amines
- Nitro groups
- Recursive substituents (substituents with substituents)
- Error messages on impossible / unparseable names, e.g
hex-1,2-diyne
Example of a more complex name (not an actual compound but possible):
2,4,6-trihexyl-1,3,5-tri(7,5-di(5-cyclobutyl10-carboxy-6-nitrodecan-3,8-diynyl)cyclodecanyl)cyclohexane
If you're interested, take a look at howOCVworks.txt. It is a very comprehensive and (hopefully!) easy to read guide on how OCV works. Also take a look at the structure chart to see a visual overview of OCV (made with draw.io).
If you have any questions or comments, I'd love to hear from you! Send me an email on [email protected].
This project is licensed under the MIT License - see the LICENSE file for details
- I referred to Cambridge University's OPSIN project a lot. See the online interface here.
- jaimebuilds' The Super Tiny Compiler project helped me understand how parsing works. See it here.
- I used "carbon rings" by Ben Davis from the Noun Project as the application logo.