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, ref_st=None, lig_mapping=None, ref_mapping=None): """ 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' :param ref_st: Reference structure (if specified) :type ref_st: 'schrodinger.structure.Structure' or None :param lig_mapping: Ligand mapping atom indices, or None :type lig_mapping: list or None :param ref_mapping: Reference mapping atom indices, or None :type ref_mapping: list or None :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()) if ref_st: lid.setLigandWithTemplate(lig_st, ref_st, lig_mapping, ref_mapping) else: lid.setLigand(lig_st) lid.setReceptor(rec_st) lid.setReceptor(rec_st) lid.pullSaltBridges() lid.pullHBonds() lid.compute() img = sk.getQImage() return img