From ae502ace910e7b00b5f47501c3ccfc6d19848dd2 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 29 Jun 2020 09:37:56 +0100 Subject: [PATCH] JAL-3390 improved 'hide chain' commands --- src/jalview/ext/rbvi/chimera/ChimeraCommands.java | 4 ++-- src/jalview/ext/rbvi/chimera/ChimeraXCommands.java | 3 ++- test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java | 2 +- test/jalview/ext/rbvi/chimera/ChimeraXCommandsTest.java | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/jalview/ext/rbvi/chimera/ChimeraCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraCommands.java index a4f4cff..c88e71e 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraCommands.java @@ -406,8 +406,8 @@ public class ChimeraCommands extends StructureCommandsBase @Override public StructureCommandI hideChain(String modelId, String chainId) { - String cmd = "~ribbon #" + modelId + ":." + chainId; - return new StructureCommand(cmd); + String what = "#" + modelId + ":." + chainId; + return new StructureCommand("~ribbon " + what + ";~display " + what); } @Override diff --git a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java index 42f15ca..4abe6ef 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java @@ -235,7 +235,8 @@ public class ChimeraXCommands extends ChimeraCommands @Override public StructureCommandI hideChain(String modelId, String chainId) { - String cmd = "~ribbon #" + modelId + "/" + chainId; + // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/show.html + String cmd = "hide #" + modelId + "/" + chainId + " target acr"; return new StructureCommand(cmd); } diff --git a/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java b/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java index 8bfb677..f852c40 100644 --- a/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java +++ b/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java @@ -352,7 +352,7 @@ public class ChimeraCommandsTest public void testHideChain() { StructureCommandI cmd = testee.hideChain("1.1", "B"); - assertEquals(cmd.getCommand(), "~ribbon #1.1:.B"); + assertEquals(cmd.getCommand(), "~ribbon #1.1:.B;~display #1.1:.B"); } @Test(groups = "Functional") diff --git a/test/jalview/ext/rbvi/chimera/ChimeraXCommandsTest.java b/test/jalview/ext/rbvi/chimera/ChimeraXCommandsTest.java index bf5ea07..d50e450 100644 --- a/test/jalview/ext/rbvi/chimera/ChimeraXCommandsTest.java +++ b/test/jalview/ext/rbvi/chimera/ChimeraXCommandsTest.java @@ -329,7 +329,7 @@ public class ChimeraXCommandsTest public void testHideChain() { StructureCommandI cmd = testee.hideChain("1.1", "B"); - assertEquals(cmd.getCommand(), "~ribbon #1.1/B"); + assertEquals(cmd.getCommand(), "hide #1.1/B target acr"); } @Test(groups = "Functional") -- 1.7.10.2