Source code for schrodinger.application.livedesign.lid

"""
Create Ligand Interaction Diagrams (LID) for LiveDesign.

Copyright Schrodinger, LLC. All rights reserved.
"""

from schrodinger.infra import mmerr

from schrodinger.ui import sketcher


[docs]def generate_lid(lig_st, rec_st): """ Generate a Ligand Interaction Diagram and save it to a file :param lig_st: Ligand structure :type lig_st: 'schrodinger.structure.Structure' :param rec_st: Receptor structure :type rec_st: 'schrodinger.structure.Structure' :return: LID image :rtype: 'PyQt5.QtGui.QImage' """ with mmerr.disable_mmerr(): sk = sketcher.sketcher() sk.showBondCustomLabels(True) sk.setMaximumWidth(800) sk.setMaximumHeight(800) sk.setLIDMode(True) lid = sketcher.sketcherLID(sk.getScene()) lid.setLigand(lig_st) lid.setReceptor(rec_st) lid.pullSaltBridges() lid.pullHBonds() lid.compute() img = sk.getQImage() return img