Chimera script specify filetype

Hi everyone, I have a donwload option on our page for chimera python scripts - one example is attached. When you open it, chimera asks for the filetype. How can I hardocde it’s a PDB file? Thanks, Thomas

Hi Thomas, This is a little out of my area, but my understanding is that the filename extension .py or .pyc will be recognized automatically as Python. I find this is true for .py as well as my locally (on this computer) generated .pyc files, but not for the file that you sent. I don’t know what is different about the file you sent, or whether it could be ascribed to .pyc not being compatible between different platforms. Here’s the list of Chimera filetypes and corresponding filename suffixes (and prefixes that could be used in the open command when the suffix isn’t present): <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/filetypes.html> Maybe try linking the py file instead? Sorry I don’t have a more definitive answer. Maybe the others can chime in (eventually). Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco On Aug 2, 2014, at 12:01 PM, Thomas Hrabe <thrabe@sanfordburnham.org> wrote:
Hi everyone, I have a donwload option on our page for chimera python scripts - one example is attached. When you open it, chimera asks for the filetype. How can I hardocde it’s a PDB file? Thanks, Thomas <chimeraMutationFrequency4DKXB.pyc>

Sorry, I didnt realize I sent the pyc file. Here’s the py file On Aug 2, 2014, at 12:29 PM, Elaine Meng <meng@cgl.ucsf.edu> wrote:
Hi Thomas, This is a little out of my area, but my understanding is that the filename extension .py or .pyc will be recognized automatically as Python. I find this is true for .py as well as my locally (on this computer) generated .pyc files, but not for the file that you sent. I don’t know what is different about the file you sent, or whether it could be ascribed to .pyc not being compatible between different platforms.
Here’s the list of Chimera filetypes and corresponding filename suffixes (and prefixes that could be used in the open command when the suffix isn’t present): <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/filetypes.html>
Maybe try linking the py file instead? Sorry I don’t have a more definitive answer. Maybe the others can chime in (eventually). Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco
On Aug 2, 2014, at 12:01 PM, Thomas Hrabe <thrabe@sanfordburnham.org> wrote:
Hi everyone, I have a donwload option on our page for chimera python scripts - one example is attached. When you open it, chimera asks for the filetype. How can I hardocde it’s a PDB file? Thanks, Thomas <chimeraMutationFrequency4DKXB.pyc>

Hi Thomas, In your openModels.open() call you need to tell Chimera what type of file it is since it has no prefix or suffix. So change it from openModels.open('2OID') to openModels.open('2OID', type='PDBID'). --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Aug 2, 2014, at 12:33 PM, Thomas Hrabe <thrabe@sanfordburnham.org> wrote:
Sorry, I didnt realize I sent the pyc file. Here’s the py file
On Aug 2, 2014, at 12:29 PM, Elaine Meng <meng@cgl.ucsf.edu> wrote:
Hi Thomas, This is a little out of my area, but my understanding is that the filename extension .py or .pyc will be recognized automatically as Python. I find this is true for .py as well as my locally (on this computer) generated .pyc files, but not for the file that you sent. I don’t know what is different about the file you sent, or whether it could be ascribed to .pyc not being compatible between different platforms.
Here’s the list of Chimera filetypes and corresponding filename suffixes (and prefixes that could be used in the open command when the suffix isn’t present): <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/filetypes.html>
Maybe try linking the py file instead? Sorry I don’t have a more definitive answer. Maybe the others can chime in (eventually). Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco
On Aug 2, 2014, at 12:01 PM, Thomas Hrabe <thrabe@sanfordburnham.org> wrote:
Hi everyone, I have a donwload option on our page for chimera python scripts - one example is attached. When you open it, chimera asks for the filetype. How can I hardocde it’s a PDB file? Thanks, Thomas <chimeraMutationFrequency4DKXB.pyc>
<chimeraMutationFrequency2OIDA.py>_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (3)
-
Elaine Meng
-
Eric Pettersen
-
Thomas Hrabe