Opened 9 years ago

Closed 9 years ago

#536 closed defect (fixed)

"split atoms atomspec" gives traceback

Reported by: Elaine Meng Owned by: Tom Goddard
Priority: major Milestone:
Component: Structure Editing Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

I was originally testing whether the "atoms" keyword could be given multiple times like it can in Chimera (see http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/split.html ), but that gives an error. Then I tried just using it once, but that gives a traceback. (This command may be experimental anyway, prioritize as desired.) Example:

open 2gbp
split atoms :1-10

Traceback (most recent call last):
File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/cmd_line/tool.py", line 158, in execute
cmd.run(cmd_text)
File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/cli.py", line 2255, in run
result = ci.function(session, kw_args)
File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/split.py", line 47, in split
clist = split_molecule(m, chains, ligands, connected, atoms)
File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/split.py", line 78, in split_molecule
pieces = split_pieces(pieces, lambda a,atoms=atoms: split_atoms(a,atoms))
File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/split.py", line 92, in split_pieces
splist = split_function(atoms)
File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/split.py", line 78, in <lambda>
pieces = split_pieces(pieces, lambda a,atoms=atoms: split_atoms(a,atoms))
File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/split.py", line 166, in split_atoms
asubsets = [tuple(a for a in asub if a in aset) for asub in asubsets]
File "/Users/meng/Desktop/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/split.py", line 166, in <listcomp>
asubsets = [tuple(a for a in asub if a in aset) for asub in asubsets]
TypeError: 'Atom' object is not iterable

Change History (1)

comment:1 by Tom Goddard, 9 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

Also made split accept multiple atoms options.

Note: See TracTickets for help on using tickets.