Allow users to query SVG files and SMILES generated using molconvert
Problem
- Export SVG files for each molecules generated from cdxmls using molconvert.
- 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
- Checkout
save_SVG_SMILE_files
branch locally - Build and deploy chemscraper docker image
- modify
modules/chemscraper/server/server.py
andmodules/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.
- Navigate to fastAPI swagger UI
- Try out the extractPdf endpoint with
true
andfalse
values for thegenerateSVGs
query parameter (default is false) - Download the response file and verify whether SVG files are present and matches the
generateSVGs
value.
Known issues
- Some of the SVGs generated by molconvert appear to be clipped (due to inadequate height/width?)
Edited by Yashdeep Thorat