Dear Responsible,

I am working on a script that should iterate through several structures, check the structures for clashes among all atoms, and eliminate the pdb in any clashes are found.

Here is what I have worked out so far:

# -*- coding: utf-8 -*-

import os
from chimera import runCommand as rc
from chimera import replyobj
import chimera

# Specify folder
folder_path = "/gporq3/store_0/usr/chiarini/chroma/chroma/"

# String to be found
search_string = "xxx"

# List of files in the folder
file_names = [fn for fn in os.listdir(folder_path) if fn.endswith(".pdb")]

print("File trovati nella cartella:" + str(file_names))

# Loop on every file containing 'search_string' in the name
for pdb_file in file_names:
    if search_string in pdb_file:
        pdb_path = os.path.join(folder_path, pdb_file)

        # Open the PDB
        rc("open {}".format(pdb_path))

        # Calculates clashes
        rc("findclash")
        rc("wait")

        # Verify if any clashes are found
        clashes = chimera.clashClashList()

        if clashes:
            # If clashes are found eliminates the file
            os.remove(pdb_path)
            print("Clash trovati, il file {} è stato eliminato.".format(pdb_file))
        else:
            # If no clash, exit normally
            print("Nessun clash trovato per {}.".format(pdb_file))


But no analisys is done at all. I have been searching through the script page (https://www.rbvi.ucsf.edu/trac/chimera/wiki/Scripts) in order to found some clue on this function but so far I have found none.

Could you help me on this issue?

Thank you in advance

Valerio Chiarini