Commit bf03c0d2 authored by Carlos GO's avatar Carlos GO
Browse files

svg fix

parent 3cc4ed41
......@@ -43,14 +43,14 @@ def draw(smiles):
drawer.DrawMolecule(mc)
drawer.FinishDrawing()
svg = drawer.GetDrawingText()
svg = svg.replace('svg:','')
svg = svg.replace(':svg','')
savepath = os.path.join("static", "mol_drawings", f"{smiles_hash}.svg")
# Draw.MolToFile( mc, savepath )
# for line in svg_file:
# if "xmlns:svg" in line:
# line = line.replace(":svg", "")
with open(savepath, "w") as svg_file:
for line in svg_file:
if "xmlns:svg" in line:
line = line.replace(":svg", "")
svg_file.write(line)
svg_file.write(svg)
# drawing = svg2rlg(f"../Data/{name}.svg")
# renderPDF.drawToFile(svg, f"../Data/ligand_images/{name}.pdf")
def screen(fp_pred, library, n_hits=30):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment