[chimerax-users] Generating surfaces from a specific selection

Eric Pettersen pett at cgl.ucsf.edu
Wed Jun 30 10:21:42 PDT 2021


Hi Diego,
	If there are interior voids within the structure your main surface is enclosing, there will be "bubbles" like what you're seeing, where solvent (or possibly larger things) could theoretically be contained.  If you want to only create the outermost surface and not any of the interior void surfaces then add "visiblePatches 1" to your surface command, and only the single largest surface will be created.

--Eric

> On Jun 30, 2021, at 8:32 AM, Diego Amaya <diaamayaram at unal.edu.co> wrote:
> 
> Hi Eric,
> 
> Thanks for your fast reply. The script works but I identify a "weird behavior" in some surfaces. In some cases, you can find "isolated spheres"  and if you superimpose them with the corresponding entire surface, these spheres are buried in the structure. All the pdb files have the same atom order and there are no waters, ions or other molecules. The structure is composed of two protein chains. I tried several probeRadius and gridSpacing values but the problem stays. Any suggestions ?
> 
> Best regards,
> 
> 
> 
> 
> El mar, 29 jun 2021 a las 22:58, Eric Pettersen (<pett at cgl.ucsf.edu <mailto:pett at cgl.ucsf.edu>>) escribió:
> Hi Diego,
> 	It's impossible to be 100% certain without knowing exactly which line it crashed in, but my strong suspicion is that the long atom spec you generate overran some limit in the atom spec or command parser and resulted in a crash.  I will be investigating in more detail later, but working off that assumption I would change your script to directly select the atoms in Python rather than via a command.  I'm going to assume the atoms in your PDB files are always in the same order, and that the structure is the only model open.  If so, change these lines in the 'if' block:
> 
>                 cur_sel = selected_atoms(session).unique_structures[0].atoms.serial_numbers
>                 for a in cur_sel:
>                     list_atoms.append('@@serial_number='+str(a))
>                 sel_atoms = ' | '.join(list_atoms)
> 
> to:
> 
>                 selected = session.models[0].atoms.selecteds
> 
> and these lines in the 'else' block:
> 
>                 rc(session, 'sel {}'.format(sel_atoms))
>                 rc(session, 'surface {} enclose #1'.format(sel_atoms))
> to:
> 
>                 session.models[0].atoms.selecteds = selected
>                 rc(session, 'surface sel enclose #1')
> --Eric
> 
> 	Eric Pettersen
> 	UCSF Computer Graphics Lab
> 
> 
>> On Jun 29, 2021, at 10:00 AM, Diego Amaya via ChimeraX-users <chimerax-users at cgl.ucsf.edu <mailto:chimerax-users at cgl.ucsf.edu>> wrote:
>> 
>> Hello,
>> 
>> I have a pdb trajectory of 50 frames (in separated pdb files). I want to generate only the solvent accessible surface around amino acid 31 within a radius of 15 A. I want to use the same set of atoms when generating each surface with respect to the first frame of the trajectory. I'm using the python script here below but it doesn't work, I get a segmentation error in the else block. It works if I use "rc(session, 'surface zone #1.1  nearAtoms :{} distance {}'.format(resid, radius))" in the else block but in that way I don't use exactly the same atoms each time. Any suggestions? 
>> 
>> Thanks in advance.
>> 
>> Here the code :
>> 
>> ###########################################################
>> from chimerax.core.commands import run as rc
>> 
>> def get_surfaces(resid, radius):
>>     from chimerax.core.commands import run as rc
>>     from chimerax.atomic import selected_atoms
>> 
>>     with open('list_pdbs.txt', 'r') as list_pdbs:
>>         flag = 0
>>         for pdb_file in list_pdbs:
>>             if flag == 0:
>>                 list_atoms = []
>>                 rc(session, 'open ' + pdb_file.strip())
>>                 rc(session, 'sel :{} @<{}'.format(resid, radius))
>>                 cur_sel = selected_atoms(session).unique_structures[0].atoms.serial_numbers
>>                 for a in cur_sel:
>>                     list_atoms.append('@@serial_number='+str(a))
>>                 sel_atoms = ' | '.join(list_atoms)
>>                 rc(session, 'surface #1 enclose #1')
>>                 rc(session, 'surface zone #1.1  nearAtoms :{} distance {}'.format(resid, radius))
>>                 rc(session, '~ribbon')
>>                 rc(session, '~disp')
>>                 rc(session, "save {}_resid_{}_radius_{}.stl format stl".format(pdb_file.strip()[:-4], resid, radius))
>>                 rc(session, 'surface close')
>>                 rc(session, '~sel')
>>                 rc(session, "close all")
>>                 flag = 1
>>             else:
>>                 rc(session, 'open ' + pdb_file.strip())
>>                 rc(session, 'sel {}'.format(sel_atoms))
>>                 rc(session, 'surface {} enclose #1'.format(sel_atoms))
>>                 rc(session, '~ribbon')
>>                 rc(session, '~disp')
>>                 rc(session, "save {}_resid_{}_radius_{}.stl format stl".format(pdb_file.strip()[:-4], resid, radius))
>>                 rc(session, '~sel')
>>                 rc(session, 'surface close')
>>                 rc(session, "close all")
>>                 
>> resid = 31
>> radius = 15
>> 
>> get_surfaces(resid, radius)
>> rc(session, "quit")
>> #############################################################
>> 
>> 
>> -- 
>> Diego A. Amaya Ramírez
>> 
>> Aviso legal: El contenido de este mensaje y los archivos adjuntos son confidenciales y de uso exclusivo de la Universidad Nacional de Colombia. Se encuentran dirigidos sólo para el uso del destinatario al cual van enviados. La reproducción, lectura y/o copia se encuentran prohibidas a cualquier persona diferente a este y puede ser ilegal. Si usted lo ha recibido por error, infórmenos y elimínelo de su correo. Los Datos Personales serán tratados conforme a la Ley 1581 de 2012 y a nuestra Política de Datos Personales que podrá consultar en la página web www.unal.edu.co <http://www.unal.edu.co/>. Las opiniones, informaciones, conclusiones y cualquier otro tipo de dato contenido en este correo electrónico, no relacionados con la actividad de la Universidad Nacional de Colombia, se entenderá como personales y de ninguna manera son avaladas por la Universidad.
>> _______________________________________________
>> ChimeraX-users mailing list
>> ChimeraX-users at cgl.ucsf.edu <mailto:ChimeraX-users at cgl.ucsf.edu>
>> Manage subscription:
>> https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>
> 
> 
> 
> -- 
> Diego A. Amaya Ramírez
> 
> Aviso legal: El contenido de este mensaje y los archivos adjuntos son confidenciales y de uso exclusivo de la Universidad Nacional de Colombia. Se encuentran dirigidos sólo para el uso del destinatario al cual van enviados. La reproducción, lectura y/o copia se encuentran prohibidas a cualquier persona diferente a este y puede ser ilegal. Si usted lo ha recibido por error, infórmenos y elimínelo de su correo. Los Datos Personales serán tratados conforme a la Ley 1581 de 2012 y a nuestra Política de Datos Personales que podrá consultar en la página web www.unal.edu.co <http://www.unal.edu.co/>. Las opiniones, informaciones, conclusiones y cualquier otro tipo de dato contenido en este correo electrónico, no relacionados con la actividad de la Universidad Nacional de Colombia, se entenderá como personales y de ninguna manera son avaladas por la Universidad.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimerax-users/attachments/20210630/90f8b748/attachment.html>


More information about the ChimeraX-users mailing list