def _getAtoms(m, subSelection):if not subSelection:#atoms = m.sortedAtoms()atoms = m.atomselse:osl = '%s%s' % (m.oslIdent(), subSelection)s = selection.OSLSelection(osl)wanted = s.vertices(asDict=True)#atoms = [ a for a in m.sortedAtoms() if a in wanted ]atoms = [ a for a in m.atoms if a in wanted ]return atoms
Computing secondary structure assignments...Computed secondary structure assignments (see reply log)Model 0.250 (3c4s.test.pdb) has no secondary structure assignments. Running ksdssp.
Computing secondary structure assignments...Computed secondary structure assignments (see reply log)Compiling cluster.py...Compiling cluster.py succeededExecuting cluster.py...Computing distance matrix0.02: created distance matrix
Traceback (most recent call last):File "/opt/UCSF/Chimera64-1.15rc/share/chimeraInit.py", line 760, in initchimera.openModels.open(a, prefixableType=1)File "/opt/UCSF/Chimera64-1.15rc/share/chimera/__init__.py", line 1960, in openmodels = func(filename, *args, **kw)File "/opt/UCSF/Chimera64-1.15rc/share/chimera/__init__.py", line 1330, in _openPythonloadFunc(sandboxName, fileName, f)File "cluster.py", line 113, in <module>main()File "cluster.py", line 12, in mainclusterInfo = _cluster(modelList, subSelection)File "cluster.py", line 23, in _clusterfor m in modelList ]File "cluster.py", line 100, in _getAtomss = selection.OSLSelection(osl)NameError: global name 'selection' is not defined
Error while processing cluster.py:NameError: global name 'selection' is not defined
File "cluster.py", line 100, in _getAtomss = selection.OSLSelection(osl)
See reply log for Python traceback.
-----
Laura C. Morris
Scientific Computing Professional
Edison & Prestegard Labs
Complex Carbohydrate Research Center
706-542-6286 (lab 1075)
On Jun 4, 2021, at 8:07 AM, Laura Morris via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
Recently I've been clustering in Chimera but running into memory limitations on my system. I'd like to do the clustering on a computer with more RAM, but I need to be able to do this using only the command line. I found an old post (http://plato.cgl.ucsf.edu/pipermail/chimera-users/2010-May/005166.html) that includes an example script to do the clustering, but I don't know how to change the subSection to the residues and atoms I want. Here's the portion of relevant code:
The "Change this to CAs or heavy atoms" is exactly what I want to do, but I have no idea how to do it. If this were command line in Chimera, I'd use something like "select #0:3-55@CA". I know there's a "runCommand" function that can be included (using "from chimera import runCommand"). Is this used in some way to set subSelection, and if so, how?def main():import chimeramodelList = chimera.openModels.list(modelTypes=[chimera.Molecule])subSelection = None # Change this to CAs or heavy atomsclusterInfo = _cluster(modelList, subSelection)saveReps(clusterInfo, "reps.pdb") # Change file name if needed
_______________________________________________
Any help is appreciated.
Regards,
Laura
-----Laura C. MorrisScientific Computing ProfessionalEdison & Prestegard LabsComplex Carbohydrate Research Center706-542-6286 (lab 1075)
Chimera-users mailing list: Chimera-users@cgl.ucsf.edu
Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users