<div dir="ltr"><div>Hello Elaine,</div><div><br></div><div>thanks for your help. I'll try it.</div><div><br></div><div>Best regards,<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El vie, 11 jun 2021 a las 16:51, Elaine Meng (<<a href="mailto:meng@cgl.ucsf.edu">meng@cgl.ucsf.edu</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Diego,<br>
If you look at the "export" help link I sent before, there are several other formats: STL, OBJ, COLLADA, VRML... <br>
<br>
<<a href="https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/export.html" rel="noreferrer" target="_blank">https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/export.html</a>><br>
<br>
First use some commands to show patches for a test case, e.g.<br>
<br>
open 2gbp<br>
surface protein & :BGC za<5<br>
~ribbon<br>
~disp<br>
<br>
And then you can use either the export command or menu: File... Export Scene and choose the different formats to try them. I don't know what you plan to do with them, so you'd have to try them yourself to decide if any will work for you.<br>
<br>
I tried some of them. Looks like I can get the patches using STL and COLLADA. As mentioned in the Limitations in the help link, OBJ has the same problem as VTK that it saves the whole surface even when only patches are shown at the time of saving.<br>
<br>
Elaine<br>
<br>
<br>
> On Jun 11, 2021, at 12:42 AM, Diego Amaya via Chimera-users <<a href="mailto:chimera-users@cgl.ucsf.edu" target="_blank">chimera-users@cgl.ucsf.edu</a>> wrote:<br>
> <br>
> Hello Elaine,<br>
> <br>
> Thanks for your explanations. Would it be possible to build the patches and export them in another format ?<br>
> <br>
> Best regards<br>
> <br>
> El jue, 10 jun 2021 a las 23:56, Elaine Meng (<<a href="mailto:meng@cgl.ucsf.edu" target="_blank">meng@cgl.ucsf.edu</a>>) escribió:<br>
> Hi Diego,<br>
> Sorry, Chimera VTK export has the limitation that it always exports the whole thing (all atoms and the whole surface) even if it is not displayed. So you can't get just the patches from some atoms (at least, I can't think of a way to do it).<br>
> <br>
> <<a href="https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/export.html" rel="noreferrer" target="_blank">https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/export.html</a>><br>
> <br>
> "VTK export includes only molecule models, molecular surfaces, and multiscale surfaces with associated atoms. The molecule export includes all atoms and bonds, even if not displayed, and uses dots to represent atoms and wires to represent bonds regardless of their display styles in Chimera."<br>
> <br>
> Secondarily, about displaying atomic patches of molecular surface in Chimera (which you could possibly try exporting to some other format):<br>
> if you really want patches that go with the atoms, but within the context of the full surface, you would not use "surfcat." Normally the surface would go around the whole protein, and you could get patches from atoms that are in that surface by simply using the "surface" command to display those patches. If you use surfcat, you are telling it to instead make a surface enclosing only those atoms, ignoring the rest of the protein.<br>
> <br>
> I usually recommend figuring out exactly what commands you need for some example situation (test case) by typing commands directly into the command line. Then you can generalize to a script after that. Here is one example. Say I want the surface patches of protein atoms that are within 5 angstroms of the ligand BGC in structure 2gbp. Commands:<br>
> <br>
> open 2gbp<br>
> surface protein & :BGC za<5<br>
> <br>
> However, this will not solve the main problem that VTK will still export the whole surface including the parts that aren't shown.<br>
> Elaine<br>
> -----<br>
> Elaine C. Meng, Ph.D. <br>
> UCSF Chimera(X) team<br>
> Department of Pharmaceutical Chemistry<br>
> University of California, San Francisco<br>
> <br>
> > On Jun 10, 2021, at 2:04 PM, Diego Amaya via Chimera-users <<a href="mailto:chimera-users@cgl.ucsf.edu" target="_blank">chimera-users@cgl.ucsf.edu</a>> wrote:<br>
> > <br>
> > Hello all,<br>
> > I'm trying to get surface patches of PDB structures in VTK format. So I want to define a patch as the set of atoms within a given radius of a specific residue, build the surface corresponding to that patch and export the result in VTK format. Additionally, I want to do all this with a python script. <br>
> > <br>
> > Here the code I'm trying but doesn't work :<br>
> > <br>
> > import pychimera<br>
> > pychimera.patch_environ()<br>
> > pychimera.enable_chimera()<br>
> > import os<br>
> > import chimera<br>
> > from chimera import runCommand as rc<br>
> > <br>
> > list_resid = [31, 64]<br>
> > radius = 3<br>
> > list_pdbs = ['ensayo.pdb']<br>
> > <br>
> > for resid in list_resid:<br>
> > for line in list_pdbs:<br>
> > list_atoms = []<br>
> > rc('open '+line)<br>
> > rc('sel :{} za<{}'.format(resid, radius))<br>
> > for a in chimera.selection.currentAtoms():<br>
> > list_atoms.append('serialNumber=' + str(a.serialNumber))<br>
> > sel_atoms = ' or '.join(list_atoms)<br>
> > rc('surfcat patch @*/{}'.format(sel_atoms))<br>
> > rc('surface patch')<br>
> > rc("export format VTK {}_resid_{}_radius_{}.vtk".format(line[:-4], resid, radius))<br>
> > <br>
> > rc("close all")<br>
> > <br>
> > Thanks in advance for your help.<br>
> > -- <br>
> > Diego A. Amaya Ramírez<br>
> <br>
> <br>
> <br>
> -- <br>
> Diego A. Amaya Ramírez<br>
> <br>
> 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 <a href="http://www.unal.edu.co" rel="noreferrer" target="_blank">www.unal.edu.co</a>. 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.<br>
> _______________________________________________<br>
> Chimera-users mailing list: <a href="mailto:Chimera-users@cgl.ucsf.edu" target="_blank">Chimera-users@cgl.ucsf.edu</a><br>
> Manage subscription: <a href="https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" rel="noreferrer" target="_blank">https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a><br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Diego A. Amaya Ramírez</div></div>
<br>
<b style="color:rgb(34,34,34);font-family:Calibri,sans-serif;font-size:14.6667px;font-style:normal;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><span style="font-size:6.5pt;line-height:9.96667px;font-family:"Ancizar Sans",sans-serif;color:black">Aviso legal:</span></b><span style="font-style:normal;font-weight:400;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);font-size:6.5pt;line-height:9.96667px;font-family:"Ancizar Sans",sans-serif;color:black"> 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 </span><span style="color:rgb(34,34,34);font-family:Calibri,sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);font-size:6.5pt;line-height:9.96667px"><a href="http://www.unal.edu.co/" style="color:blue" target="_blank"><span style="font-family:"Ancizar Sans",sans-serif">www.unal.edu.co</span></a></span><span style="font-style:normal;font-weight:400;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);font-size:6.5pt;line-height:9.96667px;font-family:"Ancizar Sans",sans-serif;color:black">.<u><span> </span></u>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.</span><br><span style="color:rgb(245,132,111);font-family:ClearSans-Regular,Arial,Verdana,Helvetica,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none"><span></span></span><span style="color:rgb(245,132,111);font-family:ClearSans-Regular,Arial,Verdana,Helvetica,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none"><span></span></span>