
Hi Chimera Team, I've been experiencing issues with the "Align Chains" tools that connect to Clustal and Muscle - I think ostensibly this might be because the servers are no longer available or something. I'm happy to make the alignments myself, but to do this I'd like to try and simply export the sequences of all open models to a fasta file or similar. I know this can be done manually sequence-by-sequence thtrough the GUI. Could you tell me what the python (or chimera syntax) would be to do this if it's possible? I'm envisaging something to the effect of this, but I can't quite get what I need back in terms of the sequence (it returns a `bound object'?): ``` from chimera import openModels all_mods = chimera.openModels.list(modelTypes=[chimera.Molecule]) with open('output.fasta', 'w') as ofh: for mod in all_mods: ofh.write('>%s\n%s' % (mod.name, mod.sequence) ``` Thanks, Joe Healey M.Sc. B.Sc. (Hons) MRSB PhD Student MOAC CDT, Senate House University of Warwick Coventry CV47AL Mob: +44 (0) 7536 042620 | Email: J.R.J.Healey@warwick.ac.uk Jointly working in: Waterfield Lab<http://www2.warwick.ac.uk/fac/med/research/tsm/microinfect/staff/waterfieldlab/> (WMS Microbiology and Infection Unit) and the Gibson Lab<http://www2.warwick.ac.uk/fac/sci/chemistry/research/gibson/gibsongroup/> (Warwick Chemistry) Twitter: @JRJHealey<https://twitter.com/JRJHealey> | Website: MOAC Page<http://www2.warwick.ac.uk/fac/sci/moac/people/students/2013/joseph_healey> | ORCID: orcid.org/0000-0002-9569-6738

Hi Joe, I can’t advise on the python, but our system was down for several days recently. It’s up now, and I just used the Align Chains service successfully. Saving fasta for structure chains might be slightly easier in ChimeraX, although still one-by-one. When you open a structure, there are links in the Log to show each chain sequence with a single click, and then you can save fasta using the context menu within each sequence window. <http://rbvi.ucsf.edu/chimerax/docs/user/tools/sequenceviewer.html> Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jul 10, 2018, at 4:48 AM, Healey, Joe <J.R.J.Healey@warwick.ac.uk> wrote:
Hi Chimera Team,
I've been experiencing issues with the "Align Chains" tools that connect to Clustal and Muscle - I think ostensibly this might be because the servers are no longer available or something.
I'm happy to make the alignments myself, but to do this I'd like to try and simply export the sequences of all open models to a fasta file or similar. I know this can be done manually sequence-by-sequence thtrough the GUI.
Could you tell me what the python (or chimera syntax) would be to do this if it's possible?
I'm envisaging something to the effect of this, but I can't quite get what I need back in terms of the sequence (it returns a `bound object'?):
``` from chimera import openModels all_mods = chimera.openModels.list(modelTypes=[chimera.Molecule]) with open('output.fasta', 'w') as ofh: for mod in all_mods: ofh.write('>%s\n%s' % (mod.name, mod.sequence) ```

Hi Elaine, That's strange in that case. I still receive this error (and I reinstalled the latest stable version of Chimera today too). I'm familiar with this type of Python error, but not sure what it means in the context of not being able to communicate with the servers. The error: ValueError: Too make values to unpack File "/Applications/Chimera.app/Contents/Resources/share/AlignChains/gui.py, line 109, in __init__ serviceName, inOutFlags, serviceOptions = serviceinfo Joe Healey M.Sc. B.Sc. (Hons) MRSB PhD Student MOAC CDT, Senate House University of Warwick Coventry CV47AL Mob: +44 (0) 7536 042620 | Email: J.R.J.Healey@warwick.ac.uk Jointly working in: Waterfield Lab<http://www2.warwick.ac.uk/fac/med/research/tsm/microinfect/staff/waterfieldlab/> (WMS Microbiology and Infection Unit) and the Gibson Lab<http://www2.warwick.ac.uk/fac/sci/chemistry/research/gibson/gibsongroup/> (Warwick Chemistry) Twitter: @JRJHealey<https://twitter.com/JRJHealey> | Website: MOAC Page<http://www2.warwick.ac.uk/fac/sci/moac/people/students/2013/joseph_healey> | ORCID: orcid.org/0000-0002-9569-6738 ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: 10 July 2018 18:00:39 To: Healey, Joe Cc: chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] Output chain sequences Hi Joe, I can’t advise on the python, but our system was down for several days recently. It’s up now, and I just used the Align Chains service successfully. Saving fasta for structure chains might be slightly easier in ChimeraX, although still one-by-one. When you open a structure, there are links in the Log to show each chain sequence with a single click, and then you can save fasta using the context menu within each sequence window. <http://rbvi.ucsf.edu/chimerax/docs/user/tools/sequenceviewer.html> Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jul 10, 2018, at 4:48 AM, Healey, Joe <J.R.J.Healey@warwick.ac.uk> wrote:
Hi Chimera Team,
I've been experiencing issues with the "Align Chains" tools that connect to Clustal and Muscle - I think ostensibly this might be because the servers are no longer available or something.
I'm happy to make the alignments myself, but to do this I'd like to try and simply export the sequences of all open models to a fasta file or similar. I know this can be done manually sequence-by-sequence thtrough the GUI.
Could you tell me what the python (or chimera syntax) would be to do this if it's possible?
I'm envisaging something to the effect of this, but I can't quite get what I need back in terms of the sequence (it returns a `bound object'?):
``` from chimera import openModels all_mods = chimera.openModels.list(modelTypes=[chimera.Molecule]) with open('output.fasta', 'w') as ofh: for mod in all_mods: ofh.write('>%s\n%s' % (mod.name, mod.sequence) ```

Hi Joe, Ahem, something must have gone awry. I also get the error with the 1.13 release but not with a 1.13 daily build from April 25 or the 1.12 release. I’ll create a bug ticket for this…. good thing you mentioned it. Cases I tried in the April 25 daily build, using “Align Chain Sequences” with default settings (both ran instantly with no problems): (1) all 4 chains of 4hhb to each other (2) the A chains of 2mnr, 4enl, and 1muc The April 25 build is just the one I happened to have handy… newer ones might work too. From the 1.13 release it still works to use the same web service via “realign sequences” in the Edit menu of an existing alignment, but apparently not via Align Chain Sequences. In the meanwhile, maybe you can use an older version for that. Sorry for the problems, Elaine
On Jul 10, 2018, at 10:33 AM, Healey, Joe <J.R.J.Healey@warwick.ac.uk> wrote:
Hi Elaine,
That's strange in that case. I still receive this error (and I reinstalled the latest stable version of Chimera today too).
I'm familiar with this type of Python error, but not sure what it means in the context of not being able to communicate with the servers.
The error: ValueError: Too make values to unpack
File "/Applications/Chimera.app/Contents/Resources/share/AlignChains/gui.py, line 109, in __init__ serviceName, inOutFlags, serviceOptions = serviceinfo
Joe Healey

Hi Elaine, Ok good to know, thanks. For reference, it wasn't working for me on a 1.11 install either (though timing wise that may have been due to server downtime and not a bug). I'll try a couple of other builds and see what I get. Joe Healey M.Sc. B.Sc. (Hons) MRSB PhD Student MOAC CDT, Senate House University of Warwick Coventry CV47AL Mob: +44 (0) 7536 042620 | Email: J.R.J.Healey@warwick.ac.uk Jointly working in: Waterfield Lab<http://www2.warwick.ac.uk/fac/med/research/tsm/microinfect/staff/waterfieldlab/> (WMS Microbiology and Infection Unit) and the Gibson Lab<http://www2.warwick.ac.uk/fac/sci/chemistry/research/gibson/gibsongroup/> (Warwick Chemistry) Twitter: @JRJHealey<https://twitter.com/JRJHealey> | Website: MOAC Page<http://www2.warwick.ac.uk/fac/sci/moac/people/students/2013/joseph_healey> | ORCID: orcid.org/0000-0002-9569-6738 ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: 10 July 2018 19:04:02 To: Healey, Joe Cc: chimera-users@cgl.ucsf.edu BB Subject: Re: [Chimera-users] Output chain sequences Hi Joe, Ahem, something must have gone awry. I also get the error with the 1.13 release but not with a 1.13 daily build from April 25 or the 1.12 release. I’ll create a bug ticket for this…. good thing you mentioned it. Cases I tried in the April 25 daily build, using “Align Chain Sequences” with default settings (both ran instantly with no problems): (1) all 4 chains of 4hhb to each other (2) the A chains of 2mnr, 4enl, and 1muc The April 25 build is just the one I happened to have handy… newer ones might work too. From the 1.13 release it still works to use the same web service via “realign sequences” in the Edit menu of an existing alignment, but apparently not via Align Chain Sequences. In the meanwhile, maybe you can use an older version for that. Sorry for the problems, Elaine
On Jul 10, 2018, at 10:33 AM, Healey, Joe <J.R.J.Healey@warwick.ac.uk> wrote:
Hi Elaine,
That's strange in that case. I still receive this error (and I reinstalled the latest stable version of Chimera today too).
I'm familiar with this type of Python error, but not sure what it means in the context of not being able to communicate with the servers.
The error: ValueError: Too make values to unpack
File "/Applications/Chimera.app/Contents/Resources/share/AlignChains/gui.py, line 109, in __init__ serviceName, inOutFlags, serviceOptions = serviceinfo
Joe Healey

Hi Joe, In fixing a problem with the “Realign Chains” feature of MultAlignViewer, I created this problem in Align Chains. I’ve fixed the latter now and the fix will be in tomorrow’s daily build (and in the 1.13.1 and/or 1.14 release). —Eric Eric Pettersen UCSF Computer Graphics Lab
On Jul 10, 2018, at 11:53 AM, Healey, Joe <J.R.J.Healey@warwick.ac.uk> wrote:
Hi Elaine,
Ok good to know, thanks. For reference, it wasn't working for me on a 1.11 install either (though timing wise that may have been due to server downtime and not a bug).
I'll try a couple of other builds and see what I get.
Joe Healey
M.Sc. B.Sc. (Hons) MRSB PhD Student MOAC CDT, Senate House University of Warwick Coventry CV47AL Mob: +44 (0) 7536 042620 | Email: J.R.J.Healey@warwick.ac.uk <mailto:J.R.J.Healey@warwick.ac.uk>
Jointly working in: Waterfield Lab <http://www2.warwick.ac.uk/fac/med/research/tsm/microinfect/staff/waterfieldlab/> (WMS Microbiology and Infection Unit) and the Gibson Lab <http://www2.warwick.ac.uk/fac/sci/chemistry/research/gibson/gibsongroup/> (Warwick Chemistry)
Twitter: @JRJHealey <https://twitter.com/JRJHealey> | Website: MOAC Page <http://www2.warwick.ac.uk/fac/sci/moac/people/students/2013/joseph_healey> | ORCID: orcid.org/0000-0002-9569-6738 <http://orcid.org/0000-0002-9569-6738> From: Elaine Meng <meng@cgl.ucsf.edu> Sent: 10 July 2018 19:04:02 To: Healey, Joe Cc: chimera-users@cgl.ucsf.edu BB Subject: Re: [Chimera-users] Output chain sequences
Hi Joe, Ahem, something must have gone awry. I also get the error with the 1.13 release but not with a 1.13 daily build from April 25 or the 1.12 release. I’ll create a bug ticket for this…. good thing you mentioned it.
Cases I tried in the April 25 daily build, using “Align Chain Sequences” with default settings (both ran instantly with no problems):
(1) all 4 chains of 4hhb to each other (2) the A chains of 2mnr, 4enl, and 1muc
The April 25 build is just the one I happened to have handy… newer ones might work too. From the 1.13 release it still works to use the same web service via “realign sequences” in the Edit menu of an existing alignment, but apparently not via Align Chain Sequences. In the meanwhile, maybe you can use an older version for that. Sorry for the problems, Elaine
On Jul 10, 2018, at 10:33 AM, Healey, Joe <J.R.J.Healey@warwick.ac.uk> wrote:
Hi Elaine,
That's strange in that case. I still receive this error (and I reinstalled the latest stable version of Chimera today too).
I'm familiar with this type of Python error, but not sure what it means in the context of not being able to communicate with the servers.
The error: ValueError: Too make values to unpack
File "/Applications/Chimera.app/Contents/Resources/share/AlignChains/gui.py, line 109, in __init__ serviceName, inOutFlags, serviceOptions = serviceinfo
Joe Healey
_______________________________________________ Chimera-users mailing list: Chimera-users@cgl.ucsf.edu Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

Just to follow up on the Python question here, a model can have multiple sequences (one per chain), so your code should be: from chimera import openModels all_mods = chimera.openModels.list(modelTypes=[chimera.Molecule]) with open('output.fasta', 'w') as ofh: for mod in all_mods: for seq in mod.sequences(): ofh.write('>%s.%s\n%s' % (mod.name, seq.chainID, seq) What you were trying to use, mod.sequence, is a method that takes a chain ID as an argument and returns the Sequence object corresponding to that chain ID (e.g. mod.sequence(‘A’) returns the Sequence for chain A). —Eric
On Jul 10, 2018, at 4:48 AM, Healey, Joe <J.R.J.Healey@warwick.ac.uk> wrote:
Hi Chimera Team,
I've been experiencing issues with the "Align Chains" tools that connect to Clustal and Muscle - I think ostensibly this might be because the servers are no longer available or something.
I'm happy to make the alignments myself, but to do this I'd like to try and simply export the sequences of all open models to a fasta file or similar. I know this can be done manually sequence-by-sequence thtrough the GUI.
Could you tell me what the python (or chimera syntax) would be to do this if it's possible?
I'm envisaging something to the effect of this, but I can't quite get what I need back in terms of the sequence (it returns a `bound object'?):
``` from chimera import openModels all_mods = chimera.openModels.list(modelTypes=[chimera.Molecule]) with open('output.fasta', 'w') as ofh: for mod in all_mods: ofh.write('>%s\n%s' % (mod.name, mod.sequence) ```
Thanks,
Joe Healey
M.Sc. B.Sc. (Hons) MRSB PhD Student MOAC CDT, Senate House University of Warwick Coventry CV47AL Mob: +44 (0) 7536 042620 | Email: J.R.J.Healey@warwick.ac.uk <mailto:J.R.J.Healey@warwick.ac.uk>
Jointly working in: Waterfield Lab <http://www2.warwick.ac.uk/fac/med/research/tsm/microinfect/staff/waterfieldlab/> (WMS Microbiology and Infection Unit) and the Gibson Lab <http://www2.warwick.ac.uk/fac/sci/chemistry/research/gibson/gibsongroup/> (Warwick Chemistry)
Twitter: @JRJHealey <https://twitter.com/JRJHealey> | Website: MOAC Page <http://www2.warwick.ac.uk/fac/sci/moac/people/students/2013/joseph_healey> | ORCID: orcid.org/0000-0002-9569-6738 <http://orcid.org/0000-0002-9569-6738>_______________________________________________ Chimera-users mailing list: Chimera-users@cgl.ucsf.edu <mailto:Chimera-users@cgl.ucsf.edu> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users <http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users>
participants (3)
-
Elaine Meng
-
Eric Pettersen
-
Healey, Joe