On 06/10/2021 05:38, Evgeny Akkuratov wrote:
Good afternoon,

I have a question regarding your software.
I have two datasets of chemical molecules and I would like to know
whether there is any similar molecule in dataset #2 for the each
molecule from dataset #1. I was planning to use MolPrint2D score to
judge whether they are similar or not however I find out that I can do
it in Open Bable. Can I kindly ask you to guide me how to do it?
Both datasets are in sdf format.

Something like this should work; I assume you have access to a UNIX-like command line.

# convert both files to canonical SMILES
obabel f1.sdf -O f1.can
obabel f2.sdf -O f2.can
# only keep the SMILES and sort them
cut -f1 f1.can | sort > f1_sorted.can
cut -f1 f2.can | sort > f2_sorted.can
# find the intersection between the two sets of canonical SMILES
comm -12 f1_sorted.can f2_sorted.can

Regards,
F.

Best,
Evgeny

_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to