Home » DataWarrior » Cheminformatics » Developing plugins using SDK2 (How to use queryMolFile and similarityLimit in Example2 in SDK2.0)
Developing plugins using SDK2 [message #1668] Wed, 13 July 2022 09:17 Go to next message
helloWorld22 is currently offline  helloWorld22
Messages: 13
Registered: June 2022
Junior Member
I'm a new user to datawarrior and trying to implement a plugin supporting structure search on our internal DB.

I have already downloaded SDK 2.0 for dw and stuck at run(Wink where queryMolFile and similarityLimit is captured from the configuration - CONFIGURATION_QUERY_STRUCTURE and CONFIGURATION_SIMILARITY_LIMIT.
After these values are captured, how can I search a DB file containing mol files at the run time?
The mol files are stored into DB and I'm retrieving them using a query and storing them in rs and then showing them in the pluginHelper object in the cell with column type - 2.
So, I can view all the 1000s of mol files but I cannot filter them at run time based on similarity and user query structure.

Can you please help me how I can search with the queryMolfile and similarityLimit?
Re: Developing plugins using SDK2 [message #1670 is a reply to message #1668] Wed, 13 July 2022 22:19 Go to previous messageGo to next message
thomas is currently offline  thomas
Messages: 663
Registered: June 2014
Senior Member
It seems you refer to example 2. Please provide some more light on your environment. I do not fully understand the question. It seems that you have some kind of database that contains molfiles. Does the database support structure searches (similarity and substructure)? If yes, then your code should make sure that only structure search hits are retrieved. If there is no way to search on the database, you need to retrieve all molfiles, which naturally will take a long time. In this case retrieval is the bottleneck. You could filter in the plugin code to only pass structure search matches to DataWarrior. But much easier would be to just add all structures to a DataWarrior table and to use a structure filter to do the filtering.

The best option, however, would be to ask your server to do the structure search and to only retrieve structure hits over the network. Second, molfiles are very large. Retrieving a compressed list of molfiles or a compressed SD-file would be an easy solution. Better would be to use a more compact stringified format. If you can live with the stereo deficencies, you could use SMILES. Better would be to add OpenChemLib idcodes into the database and to retrieve them. They are much more compact than SMILES, are canonical and contain the full enhanced stereo representation.
Re: Developing plugins using SDK2 [message #1673 is a reply to message #1670] Thu, 14 July 2022 16:04 Go to previous message
helloWorld22 is currently offline  helloWorld22
Messages: 13
Registered: June 2022
Junior Member
Hi Thomas,
Thanks for replying.
Yes, I was referring to example2.

Currently, the DB contains mol file and SMILES as CLOB and string in the DB, respectively.

I want to do a similiarity search but dont want to get everything from the DB and then filter it.
So what I want to do is:
Use Datawarrior or openchemlib.jar to do a similarity search on existing database.

I believe, since datawarrior is a client, it needs all the data from DB to do the similarity search.

Is it possible to achieve the same feature of datawarrior bundled with openchemlib.jar and implement it in an API?

[Updated on: Thu, 14 July 2022 16:33]

Report message to a moderator

Previous Topic: ChemAxon calculated properties
Next Topic: Find similars
Goto Forum:

Current Time: Mon May 20 05:20:13 CEST 2024

Total time taken to generate the page: 0.04805 seconds