[Python] How do I find the distance of a residue coordinate from the solvent accessible surface

Discussão em 'Python' iniciado por Stack, Julho 2, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to use the Biopython residue depth module for finding out the depth of any desired residue from the protein's solvent accessible surface. But it keeps throwing a runtime error. How do i overcome this ?

    'msms' is not recognized as an internal or external command,
    operable program or batch file.
    Traceback (most recent call last):
    File "C:/Users/LENOVO GAMING-3/PycharmProjects/pythonProject1/main.py", line 29, in <module>
    LIST(myList1)
    File "C:/Users/LENOVO GAMING-3/PycharmProjects/pythonProject1/main.py", line 17, in LIST
    surface = get_surface(model)
    File "C:\Users\LENOVO GAMING-3\PycharmProjects\pythonProject1\venv\lib\site-packages\Bio\PDB\ResidueDepth.py", line 539, in get_surface
    "Failed to generate surface file using command:\n%s" % make_surface
    RuntimeError: Failed to generate surface file using command:
    msms -probe_radius 1.5 -if C:\Users\LENOVO~1\AppData\Local\Temp\tmps3luzncx -of C:\Users\LENOVO~1\AppData\Local\Temp\tmpzkicezc7 > C:\Users\LENOVO~1\AppData\Local\Temp\tmp34f671ju



    from Bio.PDB import *
    from Bio.PDB.ResidueDepth import ResidueDepth
    from Bio.PDB.PDBParser import PDBParser
    from Bio.PDB.ResidueDepth import min_dist

    def LIST(myList1):
    for i in myList1:
    InFile = f'{i}.cif' #.upper()
    structure = MMCIFParser(QUIET=True).get_structure(InFile, f'C:\\Users\\LENOVO GAMING 3\\PycharmProjects\\pythonProject1\\{i}.cif')
    model = structure[0]
    surface = get_surface(model)
    # rd = ResidueDepth(model)
    # coord = (1.113, 35.393, 9.268)
    dist = min_dist(structure.center_of_mass(geometric=True), surface)
    print(i, structure.header['resolution'], structure.center_of_mass(geometric=True))
    print(dist)


    myList1 = ['107l', '108l', '2y7q', '7r2v']
    LIST(myList1)

    Continue reading...

Compartilhe esta Página