Skip to content

Commit

Permalink
Allow "info chains" to report on particular chains in a model, rather…
Browse files Browse the repository at this point in the history
… than always all the chains
  • Loading branch information
e-pettersen committed Nov 21, 2023
1 parent 37ad976 commit 896bb72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/bundles/list_info/bundle_info.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<BundleInfo name="ChimeraX-ListInfo" version="1.2.1"
<BundleInfo name="ChimeraX-ListInfo" version="1.2.2"
package="chimerax.list_info"
minSessionVersion="1" maxSessionVersion="1">

Expand Down
15 changes: 8 additions & 7 deletions src/bundles/list_info/src/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,14 @@ def info_chains(session, atoms=None, attribute="chain_id", *, return_json=False,
from chimerax.core.commands import atomspec
atoms = atomspec.everything(session)
results = atoms.evaluate(session)
chains = []
for m in results.models:
try:
chains.extend(m.chains)
except AttributeError:
# No chains, no problem
pass
chains = results.atoms.unique_residues.unique_chains
#chains = []
#for m in results.models:
# try:
# chains.extend(m.chains)
# except AttributeError:
# # No chains, no problem
# pass
return report_chains(session.logger, chains, attribute, return_json=return_json, save_file=save_file)
info_chains_desc = CmdDesc(required=[("atoms", Or(AtomSpecArg, EmptyArg))],
keyword=[("attribute", StringArg), ('save_file', SaveFileNameArg)],
Expand Down

0 comments on commit 896bb72

Please sign in to comment.