Printing Molecules as ASCII Characters with RDKit! #4766
Unanswered
vfscalfani
asked this question in
Show and tell
Replies: 2 comments 3 replies
-
impressive! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Very cool! Have you considered depicting bond order by using multiple asterisks, that is
and up-and-down for a horizontal bond
and diagonal for an angled bond
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello RDKit Users,
I have been interested in printing molecules as ASCII characters using RDKit for awhile. Mostly for fun, but it can also be useful while using IPython or terminal windows without access to graphics.
I was finally able to put something together using RDKit. I think it is quite basic, but it works and that is step 1. :)
https://github.com/vfscalfani/teletype_mols/blob/main/rdkit_print_mol_ascii.ipynb
Currently, atoms are printed with their standard symbols, and bonds are denoted with an
*
. I think it would be easy to add atom label colors and symbols for different bond types. However, the part I would really like to figure out eventually is how to shrink the molecule into a smaller print area without distorting the molecule drawing. Any feedback is most welcome.If ASCII printing of molecules is interesting to you, check out the README, as I listed some related references and an alternate method using gnuplot.
A couple of examples of the output are below. I hope you find this useful.
Vin
Beta Was this translation helpful? Give feedback.
All reactions