
To the Chimera Team, Hello, my name is Harrison Helmick, and I am a PhD student in Purdue University's department of food science. I hope that you all are doing well. I am interested in developing more relationships between bioinformatic models and end use properties of foods, helping us understand and predict characteristics like emulsification, gelling, denaturation, etc. I have been using Chimera to run molecular dynamic simulations, as well as analyze the protein structures and compare those to experimental properties. I'd like to see if there are predictable functional differences based on intermediate steps of denaturation of common seed storage proteins used in food. I have found Chimera to be super interesting and helpful in terms of my learning so far. One of the characteristics I'd like to quantify is the change in secondary structure over the course of denaturation. I would like to have a script that returns the number of residues that are identified as the basic secondary structures so that I can graph the relative proportion of these structures of the course of the simulation. I'd also like to see which helices and strands are being degraded first, and I will compare that to their relative surface accessibility. The way I have gone about this is to use the Chimera command per frame scripts KSDSSP, sel hex, and writesel to attempt to generate files for each frame. With a short python code, we could loop over the files to see which residue numbers disappear first and the progression of the destruction of helices, strands, etc. I haven't been able to get the dynamic file writing to work though, so I always write over the original file instead of saving it as a new one. While I could probably figure out the dynamic file writing, this seems inefficient, and I was wondering if you all had a better script this process. Thank you, -- Harrison Helmick Graduate Research Assistant, Ross Fellowship Kokini Lab, Purdue University Philip E. Nelson Hall of Food Science 745 Agriculture Mall Dr. West Lafayette, IN 47907-2009

Hi Harrison, I don't know python so can't speak to that part of your question, but as for the per-frame command script, you can substitute the frame number to write a separate file for each frame. E.g. the dialog for defining a per-frame Chimera command script has a string, by default <FRAME>, to substitute in for the frame number. Then your writesel command in the per-frame script could include <FRAME> in the output filename to make a separate one each time, e.g. something like the following plus any other writesel options you want: writesel /Users/myself/location/helix<FRAME>.txt If the "Use leading zeroes..." option in that dialog is on, then you'd get frame numbers all the same length, say filenames like helix001.txt, helix002.txt ... helix099.txt, helix100.txt, helix101.txt, etc. in directory /Users/myself/location/ <http://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/movie/movie.html#per-frame> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/writesel.html> I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jul 30, 2020, at 10:07 AM, Helmick, Harrison Dale Brent <hhelmick@purdue.edu> wrote:
To the Chimera Team,
Hello, my name is Harrison Helmick, and I am a PhD student in Purdue University's department of food science. I hope that you all are doing well. I am interested in developing more relationships between bioinformatic models and end use properties of foods, helping us understand and predict characteristics like emulsification, gelling, denaturation, etc. I have been using Chimera to run molecular dynamic simulations, as well as analyze the protein structures and compare those to experimental properties. I'd like to see if there are predictable functional differences based on intermediate steps of denaturation of common seed storage proteins used in food. I have found Chimera to be super interesting and helpful in terms of my learning so far. One of the characteristics I'd like to quantify is the change in secondary structure over the course of denaturation. I would like to have a script that returns the number of residues that are identified as the basic secondary structures so that I can graph the relative proportion of these structures of the course of the simulation. I'd also like to see which helices and strands are being degraded first, and I will compare that to their relative surface accessibility. The way I have gone about this is to use the Chimera command per frame scripts KSDSSP, sel hex, and writesel to attempt to generate files for each frame. With a short python code, we could loop over the files to see which residue numbers disappear first and the progression of the destruction of helices, strands, etc. I haven't been able to get the dynamic file writing to work though, so I always write over the original file instead of saving it as a new one. While I could probably figure out the dynamic file writing, this seems inefficient, and I was wondering if you all had a better script this process.
Thank you,
-- Harrison Helmick Graduate Research Assistant, Ross Fellowship Kokini Lab, Purdue University Philip E. Nelson Hall of Food Science 745 Agriculture Mall Dr. West Lafayette, IN 47907-2009 _______________________________________________ Chimera-users mailing list: Chimera-users@cgl.ucsf.edu Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

Elaine, Hey thank you so much for sending this over! With your suggestion, I was able to get a per frame script written that saves all of the files into a folder, and I'm now working on some Python code to extract the right information from those files. Thank you so much for your help! Harrison ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Thursday, July 30, 2020 7:10 PM To: Helmick, Harrison Dale Brent <hhelmick@purdue.edu> Cc: chimera-users@cgl.ucsf.edu <chimera-users@cgl.ucsf.edu> Subject: Re: [Chimera-users] Scripting Question Hi Harrison, I don't know python so can't speak to that part of your question, but as for the per-frame command script, you can substitute the frame number to write a separate file for each frame. E.g. the dialog for defining a per-frame Chimera command script has a string, by default <FRAME>, to substitute in for the frame number. Then your writesel command in the per-frame script could include <FRAME> in the output filename to make a separate one each time, e.g. something like the following plus any other writesel options you want: writesel /Users/myself/location/helix<FRAME>.txt If the "Use leading zeroes..." option in that dialog is on, then you'd get frame numbers all the same length, say filenames like helix001.txt, helix002.txt ... helix099.txt, helix100.txt, helix101.txt, etc. in directory /Users/myself/location/ <http://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/movie/movie.html#per-frame> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/writesel.html> I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jul 30, 2020, at 10:07 AM, Helmick, Harrison Dale Brent <hhelmick@purdue.edu> wrote:
To the Chimera Team,
Hello, my name is Harrison Helmick, and I am a PhD student in Purdue University's department of food science. I hope that you all are doing well. I am interested in developing more relationships between bioinformatic models and end use properties of foods, helping us understand and predict characteristics like emulsification, gelling, denaturation, etc. I have been using Chimera to run molecular dynamic simulations, as well as analyze the protein structures and compare those to experimental properties. I'd like to see if there are predictable functional differences based on intermediate steps of denaturation of common seed storage proteins used in food. I have found Chimera to be super interesting and helpful in terms of my learning so far. One of the characteristics I'd like to quantify is the change in secondary structure over the course of denaturation. I would like to have a script that returns the number of residues that are identified as the basic secondary structures so that I can graph the relative proportion of these structures of the course of the simulation. I'd also like to see which helices and strands are being degraded first, and I will compare that to their relative surface accessibility. The way I have gone about this is to use the Chimera command per frame scripts KSDSSP, sel hex, and writesel to attempt to generate files for each frame. With a short python code, we could loop over the files to see which residue numbers disappear first and the progression of the destruction of helices, strands, etc. I haven't been able to get the dynamic file writing to work though, so I always write over the original file instead of saving it as a new one. While I could probably figure out the dynamic file writing, this seems inefficient, and I was wondering if you all had a better script this process.
Thank you,
-- Harrison Helmick Graduate Research Assistant, Ross Fellowship Kokini Lab, Purdue University Philip E. Nelson Hall of Food Science 745 Agriculture Mall Dr. West Lafayette, IN 47907-2009 _______________________________________________ Chimera-users mailing list: Chimera-users@cgl.ucsf.edu Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

Hi Harrison, Elaine covered the writesel issue. Sounds like you are proficient with Python, so here's a short script that writes the percentage of residues that are helix each frame to a file: outf = open("/Users/myself/location/helix_percent.txt", "w") from chimera import openModels, Molecule m = openModels.list(modelTypes=[Molecule])[0] for i, cs in enumerate(m.coordSets): m.activeCoordSet = cs numHelix = 0 for r in m.residues: if r.isHelix: numHelix += 1 print>>outf, "frame %d, %.1f%% helix" % (I, numHelix * 100.0 / len(m.residues)) outf.close() You can use Chimera's Python shell (Tools→General Controls→IDLE) to nose around, use dir() on things to find attributes, and to try things out. Feel free to ask more questions if needed. --Eric Eric Pettersen UCSF Computer Graphics Lab
On Jul 30, 2020, at 10:07 AM, Helmick, Harrison Dale Brent <hhelmick@purdue.edu> wrote:
To the Chimera Team,
Hello, my name is Harrison Helmick, and I am a PhD student in Purdue University's department of food science. I hope that you all are doing well. I am interested in developing more relationships between bioinformatic models and end use properties of foods, helping us understand and predict characteristics like emulsification, gelling, denaturation, etc. I have been using Chimera to run molecular dynamic simulations, as well as analyze the protein structures and compare those to experimental properties. I'd like to see if there are predictable functional differences based on intermediate steps of denaturation of common seed storage proteins used in food. I have found Chimera to be super interesting and helpful in terms of my learning so far. One of the characteristics I'd like to quantify is the change in secondary structure over the course of denaturation. I would like to have a script that returns the number of residues that are identified as the basic secondary structures so that I can graph the relative proportion of these structures of the course of the simulation. I'd also like to see which helices and strands are being degraded first, and I will compare that to their relative surface accessibility. The way I have gone about this is to use the Chimera command per frame scripts KSDSSP, sel hex, and writesel to attempt to generate files for each frame. With a short python code, we could loop over the files to see which residue numbers disappear first and the progression of the destruction of helices, strands, etc. I haven't been able to get the dynamic file writing to work though, so I always write over the original file instead of saving it as a new one. While I could probably figure out the dynamic file writing, this seems inefficient, and I was wondering if you all had a better script this process.
Thank you,
-- Harrison Helmick Graduate Research Assistant, Ross Fellowship Kokini Lab, Purdue University Philip E. Nelson Hall of Food Science 745 Agriculture Mall Dr. West Lafayette, IN 47907-2009 _______________________________________________ Chimera-users mailing list: Chimera-users@cgl.ucsf.edu <mailto:Chimera-users@cgl.ucsf.edu> Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users <https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users>

Eric, Hey thank you so much for sending this over, this is a great little bit of code! If I were to want to run and save a new file per frame, how would I do that? I didn't put a ton of time into exploring it today, working on a code to loop through the files I got and show which helices are degrading first, but my initial attempts for the % helix code you sent over wouldn't write to individual files. Here is what I had tried. from chimera import runCommand as rc from chimera import openModels, Molecule outf = open("r'path\to\output\<FRAME>helix.txt", "w") m = openModels.list(modelTypes=[Molecule])[0] for i, cs in enumerate(m.coordSets): m.activeCoordSet = cs numHelix = 0 for r in m.residues: if r.isHelix: numHelix += 1 print>>outf, "frame %d, %.1f%% helix" % (I, numHelix * 100.0 / len(m.residues)) outf.close() My issue on it is that the <FRAME> built in command from writesel did not translate into the python shell. When I tried to run my helix extraction to get the information about which helices were disappearing first I used: from chimera import runCommand as rc rc('ksdssp') rc('sel helix') rc('writesel (r'path\to\output\<FRAME>helix.txt') but then this said that the <FRAME> (or maybe the writesel) command won't work in the python per script editor, so I used it in the chimera command per script piece and it worked great to get a new file per frame. I also played around with things like: #append list of % for all frames outf = open(r'path\to\output\<FRAME>helix.txt','a') #wirte new file for each frame rc('writesel (r'path\to\output\%helix.txt') But that also did not work. Basically, I haven't been able to get the writing a new file per frame work in the the python shell yet. Thank you, Harrison ________________________________ From: Eric Pettersen <pett@cgl.ucsf.edu> Sent: Thursday, July 30, 2020 7:44 PM To: Helmick, Harrison Dale Brent <hhelmick@purdue.edu> Cc: chimera-users@cgl.ucsf.edu <chimera-users@cgl.ucsf.edu> Subject: Re: [Chimera-users] Scripting Question Hi Harrison, Elaine covered the writesel issue. Sounds like you are proficient with Python, so here's a short script that writes the percentage of residues that are helix each frame to a file: outf = open("/Users/myself/location/helix_percent.txt", "w") from chimera import openModels, Molecule m = openModels.list(modelTypes=[Molecule])[0] for i, cs in enumerate(m.coordSets): m.activeCoordSet = cs numHelix = 0 for r in m.residues: if r.isHelix: numHelix += 1 print>>outf, "frame %d, %.1f%% helix" % (I, numHelix * 100.0 / len(m.residues)) outf.close() You can use Chimera's Python shell (Tools→General Controls→IDLE) to nose around, use dir() on things to find attributes, and to try things out. Feel free to ask more questions if needed. --Eric Eric Pettersen UCSF Computer Graphics Lab On Jul 30, 2020, at 10:07 AM, Helmick, Harrison Dale Brent <hhelmick@purdue.edu<mailto:hhelmick@purdue.edu>> wrote: To the Chimera Team, Hello, my name is Harrison Helmick, and I am a PhD student in Purdue University's department of food science. I hope that you all are doing well. I am interested in developing more relationships between bioinformatic models and end use properties of foods, helping us understand and predict characteristics like emulsification, gelling, denaturation, etc. I have been using Chimera to run molecular dynamic simulations, as well as analyze the protein structures and compare those to experimental properties. I'd like to see if there are predictable functional differences based on intermediate steps of denaturation of common seed storage proteins used in food. I have found Chimera to be super interesting and helpful in terms of my learning so far. One of the characteristics I'd like to quantify is the change in secondary structure over the course of denaturation. I would like to have a script that returns the number of residues that are identified as the basic secondary structures so that I can graph the relative proportion of these structures of the course of the simulation. I'd also like to see which helices and strands are being degraded first, and I will compare that to their relative surface accessibility. The way I have gone about this is to use the Chimera command per frame scripts KSDSSP, sel hex, and writesel to attempt to generate files for each frame. With a short python code, we could loop over the files to see which residue numbers disappear first and the progression of the destruction of helices, strands, etc. I haven't been able to get the dynamic file writing to work though, so I always write over the original file instead of saving it as a new one. While I could probably figure out the dynamic file writing, this seems inefficient, and I was wondering if you all had a better script this process. Thank you, -- Harrison Helmick Graduate Research Assistant, Ross Fellowship Kokini Lab, Purdue University Philip E. Nelson Hall of Food Science 745 Agriculture Mall Dr. West Lafayette, IN 47907-2009 _______________________________________________ Chimera-users mailing list: Chimera-users@cgl.ucsf.edu<mailto:Chimera-users@cgl.ucsf.edu> Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

Hi Harrison, The script I send is designed to be placed in a .py file and run directly (after you've created that trajectory of course). You run it simply by opening the .py file with the "open" command or File→Open. The script creates one file, with one line per frame indicting the helix percentage for that frame. It was meant as a jumping off point for writing whatever kind of analysis script you ultimately want. Your modified version has a couple of misconceptions/problems. One is the "<FRAME>" is only defined within the MD Movie's dialog's Per-Frame scripting dialog, and only for Chimera-command scripts, not Python scripts (for Python scripts within that dialog it's "mdInfo['frame']"). The script I sent is not designed to run within the MD Movie dialog, so neither of those is relevant. If you really want one file per frame instead of a single combined file, you would need to move the open() (and close()) calls into the loop and base the file name off the 'i' variable. --Eric
On Jul 31, 2020, at 4:05 PM, Helmick, Harrison Dale Brent <hhelmick@purdue.edu> wrote:
Eric,
Hey thank you so much for sending this over, this is a great little bit of code! If I were to want to run and save a new file per frame, how would I do that? I didn't put a ton of time into exploring it today, working on a code to loop through the files I got and show which helices are degrading first, but my initial attempts for the % helix code you sent over wouldn't write to individual files. Here is what I had tried.
from chimera import runCommand as rc from chimera import openModels, Molecule
outf = open("r'path\to\output\<FRAME>helix.txt", "w") m = openModels.list(modelTypes=[Molecule])[0] for i, cs in enumerate(m.coordSets): m.activeCoordSet = cs numHelix = 0 for r in m.residues: if r.isHelix: numHelix += 1 print>>outf, "frame %d, %.1f%% helix" % (I, numHelix * 100.0 / len(m.residues)) outf.close()
My issue on it is that the <FRAME> built in command from writesel did not translate into the python shell. When I tried to run my helix extraction to get the information about which helices were disappearing first I used:
from chimera import runCommand as rc
rc('ksdssp') rc('sel helix') rc('writesel (r'path\to\output\<FRAME>helix.txt')
but then this said that the <FRAME> (or maybe the writesel) command won't work in the python per script editor, so I used it in the chimera command per script piece and it worked great to get a new file per frame. I also played around with things like:
#append list of % for all frames outf = open(r'path\to\output\<FRAME>helix.txt','a')
#wirte new file for each frame rc('writesel (r'path\to\output\%helix.txt')
But that also did not work. Basically, I haven't been able to get the writing a new file per frame work in the the python shell yet.
Thank you,
Harrison
From: Eric Pettersen <pett@cgl.ucsf.edu> Sent: Thursday, July 30, 2020 7:44 PM To: Helmick, Harrison Dale Brent <hhelmick@purdue.edu> Cc: chimera-users@cgl.ucsf.edu <chimera-users@cgl.ucsf.edu> Subject: Re: [Chimera-users] Scripting Question
Hi Harrison, Elaine covered the writesel issue. Sounds like you are proficient with Python, so here's a short script that writes the percentage of residues that are helix each frame to a file:
outf = open("/Users/myself/location/helix_percent.txt", "w") from chimera import openModels, Molecule m = openModels.list(modelTypes=[Molecule])[0] for i, cs in enumerate(m.coordSets): m.activeCoordSet = cs numHelix = 0 for r in m.residues: if r.isHelix: numHelix += 1 print>>outf, "frame %d, %.1f%% helix" % (I, numHelix * 100.0 / len(m.residues)) outf.close()
You can use Chimera's Python shell (Tools→General Controls→IDLE) to nose around, use dir() on things to find attributes, and to try things out. Feel free to ask more questions if needed.
--Eric
Eric Pettersen UCSF Computer Graphics Lab
On Jul 30, 2020, at 10:07 AM, Helmick, Harrison Dale Brent <hhelmick@purdue.edu <mailto:hhelmick@purdue.edu>> wrote:
To the Chimera Team,
Hello, my name is Harrison Helmick, and I am a PhD student in Purdue University's department of food science. I hope that you all are doing well. I am interested in developing more relationships between bioinformatic models and end use properties of foods, helping us understand and predict characteristics like emulsification, gelling, denaturation, etc. I have been using Chimera to run molecular dynamic simulations, as well as analyze the protein structures and compare those to experimental properties. I'd like to see if there are predictable functional differences based on intermediate steps of denaturation of common seed storage proteins used in food. I have found Chimera to be super interesting and helpful in terms of my learning so far. One of the characteristics I'd like to quantify is the change in secondary structure over the course of denaturation. I would like to have a script that returns the number of residues that are identified as the basic secondary structures so that I can graph the relative proportion of these structures of the course of the simulation. I'd also like to see which helices and strands are being degraded first, and I will compare that to their relative surface accessibility. The way I have gone about this is to use the Chimera command per frame scripts KSDSSP, sel hex, and writesel to attempt to generate files for each frame. With a short python code, we could loop over the files to see which residue numbers disappear first and the progression of the destruction of helices, strands, etc. I haven't been able to get the dynamic file writing to work though, so I always write over the original file instead of saving it as a new one. While I could probably figure out the dynamic file writing, this seems inefficient, and I was wondering if you all had a better script this process.
Thank you,
-- Harrison Helmick Graduate Research Assistant, Ross Fellowship Kokini Lab, Purdue University Philip E. Nelson Hall of Food Science 745 Agriculture Mall Dr. West Lafayette, IN 47907-2009 _______________________________________________ Chimera-users mailing list: Chimera-users@cgl.ucsf.edu <mailto:Chimera-users@cgl.ucsf.edu> Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users <https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users>
Chimera-users mailing list: Chimera-users@cgl.ucsf.edu <mailto:Chimera-users@cgl.ucsf.edu> Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users <https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users>
participants (3)
-
Elaine Meng
-
Eric Pettersen
-
Helmick, Harrison Dale Brent