Skip to content

Allow users to query SVG files and SMILES generated using molconvert

Yashdeep Thorat requested to merge save_SVG_SMILE_files into containerize

Problem

  1. Export SVG files for each molecules generated from cdxmls using molconvert.
  2. Export file containing a list of SMILE strings generated from cdxmls

Approach

  • Add an optional query parameter to /extractPdf endpoint to export SVGs files along with the cdxmls.
  • Add a method that runs molconvert in bash to generate the svg output from cdxmls and then parse it to create SVG files. (The svg files have the same names as the molecule cdxmls)
  • Export the list of smile strings to an additional file when they are generated as part of post-processing steps for /extractPdf.

How to test

  1. Checkout save_SVG_SMILE_files branch locally
  2. Build and deploy chemscraper docker image
  • modify modules/chemscraper/server/server.py and modules/chemscraper/server/utils.py to point to yolo and symbolscraper instances.
  • run make docker to generate docker image with name and tag found in Makefile
  • run docker run -p 8000:8000 <image_name>:<image_tag>
  • Open FastAPI swagger UI on http://localhost:8000/docs and try the /extractPdf endpoint.
  1. Navigate to fastAPI swagger UI
  2. Try out the extractPdf endpoint with true and false values for the generateSVGs query parameter (default is false)
  3. Download the response file and verify whether SVG files are present and matches the generateSVGs value.

Known issues

  1. Some of the SVGs generated by molconvert appear to be clipped (due to inadequate height/width?)
Edited by Yashdeep Thorat

Merge request reports