X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Frbvi%2Fchimera%2FChimeraXCommands.java;h=4e45ac82236bdce841f7851e924664fabf859200;hb=a777a323d548a3e63025c911ccc35f86a2a01cee;hp=f1a8b5fd64051001d6ba4c634d1aba63c3d2385b;hpb=4994aa94fd62af0058f2db96f0ea6c4ca1abe80b;p=jalview.git diff --git a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java index f1a8b5f..4e45ac8 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java @@ -28,24 +28,35 @@ import java.util.List; import jalview.structure.AtomSpecModel; import jalview.structure.StructureCommand; import jalview.structure.StructureCommandI; -import jalview.util.ColorUtils; /** * Routines for generating ChimeraX commands for Jalview/ChimeraX binding */ public class ChimeraXCommands extends ChimeraCommands { - private static final StructureCommand CLOSE_CHIMERAX = new StructureCommand("exit"); + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/info.html#resattr + private static final StructureCommand LIST_RESIDUE_ATTRIBUTES = new StructureCommand( + "info resattr"); - private static final StructureCommand STOP_NOTIFY_SELECTION = new StructureCommand("info notify stop selection jalview"); + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/exit.html + private static final StructureCommand CLOSE_CHIMERAX = new StructureCommand( + "exit"); - private static final StructureCommand STOP_NOTIFY_MODELS = new StructureCommand("info notify stop models jalview"); + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/info.html#notify + private static final StructureCommand STOP_NOTIFY_SELECTION = new StructureCommand( + "info notify stop selection jalview"); - private static final StructureCommand GET_SELECTION = new StructureCommand("info selection level residue"); + private static final StructureCommand STOP_NOTIFY_MODELS = new StructureCommand( + "info notify stop models jalview"); + + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/info.html#selection + private static final StructureCommand GET_SELECTION = new StructureCommand( + "info selection level residue"); private static final StructureCommand SHOW_BACKBONE = new StructureCommand( "~display all;~ribbon;show @CA|P atoms"); + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/view.html private static final StructureCommand FOCUS_VIEW = new StructureCommand( "view"); @@ -76,7 +87,6 @@ public class ChimeraXCommands extends ChimeraCommands @Override public StructureCommandI focusView() { - // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/view.html return FOCUS_VIEW; } @@ -92,8 +102,8 @@ public class ChimeraXCommands extends ChimeraCommands } /** - * Returns a viewer command to set the given residue attribute value on - * residues specified by the AtomSpecModel, for example + * Returns a viewer command to set the given residue attribute value on residues + * specified by the AtomSpecModel, for example * *
    * setattr #0/A:3-9,14-20,39-43 res jv_strand 'strand' create true
@@ -135,6 +145,10 @@ public class ChimeraXCommands extends ChimeraCommands
    * Returns the range(s) formatted as a ChimeraX atomspec, for example
    * 

* #1/A:2-20,30-40/B:10-20|#2/A:12-30 + *

+ * Note there is no need to explicitly exclude ALTLOC atoms when + * {@code alphaOnly == true}, as this is the default behaviour of ChimeraX (a + * change from Chimera) * * @return */ @@ -156,7 +170,6 @@ public class ChimeraXCommands extends ChimeraCommands // TODO @P if RNA - add nucleotide flag to AtomSpecModel? sb.append("@CA"); } - // todo: is there ChimeraX syntax to exclude altlocs? } return sb.toString(); } @@ -236,24 +249,25 @@ public class ChimeraXCommands extends ChimeraCommands @Override public StructureCommandI closeViewer() { - // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/exit.html return CLOSE_CHIMERAX; } @Override public List startNotifications(String uri) { - // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/info.html#notify List cmds = new ArrayList<>(); - cmds.add(new StructureCommand("info notify start models prefix ModelChanged jalview url " + uri)); - cmds.add(new StructureCommand("info notify start selection jalview prefix SelectionChanged url " + uri)); + cmds.add(new StructureCommand( + "info notify start models jalview prefix ModelChanged url " + + uri)); + cmds.add(new StructureCommand( + "info notify start selection jalview prefix SelectionChanged url " + + uri)); return cmds; } @Override public List stopNotifications() { - // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/info.html#notify List cmds = new ArrayList<>(); cmds.add(STOP_NOTIFY_MODELS); cmds.add(STOP_NOTIFY_SELECTION); @@ -265,4 +279,10 @@ public class ChimeraXCommands extends ChimeraCommands { return GET_SELECTION; } + + @Override + public StructureCommandI listResidueAttributes() + { + return LIST_RESIDUE_ATTRIBUTES; + } }