calculate volume major blob

Dear all, I need to do the work for thousands of structures, so Iam interesting in a scripting solution here. After a surfnet calculation on a given atom selection, my script select the whole surface model and calculates the volume of the all bunch. However, I'd like to have the volume of the major blob only. On the other hand, for a given number of structures, I would like to remove all minor blobs blobs so that only the major one remains on the screen. How could I do this second step? All the best, JD Dr. Jean-Didier Maréchal Lecturer Computational Biotechnological Chemistry @ Transmet Unitat de Química Física Departament de Química Universitat Autònoma de Barcelona Edifici C.n. 08193 Cerdanyola (Barcelona) Tel: +34.935814936 e-mail: JeanDidier.Marechal@uab.es

Hi JD, I've attached a Chimera Python script that calculates the volumes of each connected piece of a surface and deletes all but the largest piece. Tom
Dear all,
I need to do the work for thousands of structures, so Iam interesting in a scripting solution here.
After a surfnet calculation on a given atom selection, my script select the whole surface model and calculates the volume of the all bunch. However, I'd like to have the volume of the major blob only.
On the other hand, for a given number of structures, I would like to remove all minor blobs blobs so that only the major one remains on the screen. How could I do this second step?
All the best, JD
Dr. Jean-Didier Maréchal Lecturer Computational Biotechnological Chemistry @ Transmet Unitat de Química Física Departament de Química Universitat Autònoma de Barcelona Edifici C.n. 08193 Cerdanyola (Barcelona)
# Calculate the volume of each connected surface component and then delete # all but the largest component. # Find all surface models from chimera import openModels from _surface import SurfaceModel surfs = openModels.list(modelTypes = [SurfaceModel]) # Divide surface into connected pieces, report volumes, delete all but largest. from Surface import actions from MeasureVolume import enclosed_volume for s in surfs: pieces = [] for p in s.surfacePieces: # Split surface piece into connected components. cplist = actions.split_surface_piece(p) for cp in cplist: # Calculate volume. varray, tarray = cp.geometry v, holes = enclosed_volume(varray, tarray) if holes == 0: pieces.append((v, cp)) if pieces: # Print volumes. pieces.sort() pieces.reverse() volumes = ', '.join(['%.3g' % v for v,p in pieces]) print 'Volumes ', volumes # Delete all but largest volume piece. v0, p0 = pieces[0] for p in s.surfacePieces: if p != p0: s.removePiece(p)
participants (2)
-
Jean Didier Pie Marechal
-
Tom Goddard