X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fext%2Frbvi%2Fchimera%2FChimeraXCommands.java;h=66ecaeafb653deb1c0dea064d959d217c9082686;hb=ae3fad8019274ca3ab1258a480ba15dd9adac1e9;hp=ad04fc9d4d3ffe754004cedf9aec1c41bb2f48ba;hpb=8b5473a7ae1f9175c6ff66a013fa342636bdfd11;p=jalview.git diff --git a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java index ad04fc9..66ecaea 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java @@ -28,6 +28,7 @@ import java.util.List; import jalview.structure.AtomSpecModel; import jalview.structure.StructureCommand; import jalview.structure.StructureCommandI; +import jalview.structure.StructureCommandsI.AtomSpecType; /** * Routines for generating ChimeraX commands for Jalview/ChimeraX binding @@ -35,15 +36,19 @@ import jalview.structure.StructureCommandI; public class ChimeraXCommands extends ChimeraCommands { // 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 LIST_RESIDUE_ATTRIBUTES = new StructureCommand( + "info resattr"); // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/exit.html - private static final StructureCommand CLOSE_CHIMERAX = new StructureCommand("exit"); + private static final StructureCommand CLOSE_CHIMERAX = new StructureCommand( + "exit"); // 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 STOP_NOTIFY_SELECTION = new StructureCommand( + "info notify stop selection jalview"); - private static final StructureCommand STOP_NOTIFY_MODELS = new StructureCommand("info notify stop models jalview"); + 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( @@ -115,7 +120,8 @@ public class ChimeraXCommands extends ChimeraCommands String attributeValue, AtomSpecModel atomSpecModel) { StringBuilder sb = new StringBuilder(128); - sb.append("setattr ").append(getAtomSpec(atomSpecModel, false)); + sb.append("setattr ") + .append(getAtomSpec(atomSpecModel, AtomSpecType.RESIDUE_ONLY)); sb.append(" res ").append(attributeName).append(" '") .append(attributeValue).append("'"); sb.append(" create true"); @@ -141,11 +147,15 @@ 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
*/
@Override
- public String getAtomSpec(AtomSpecModel atomSpec, boolean alphaOnly)
+ public String getAtomSpec(AtomSpecModel atomSpec, AtomSpecType specType)
{
StringBuilder sb = new StringBuilder(128);
boolean firstModel = true;
@@ -157,12 +167,14 @@ public class ChimeraXCommands extends ChimeraCommands
}
firstModel = false;
appendModel(sb, model, atomSpec);
- if (alphaOnly)
+ if (specType == AtomSpecType.ALPHA)
{
- // TODO @P if RNA - add nucleotide flag to AtomSpecModel?
sb.append("@CA");
}
- // todo: is there ChimeraX syntax to exclude altlocs?
+ if (specType == AtomSpecType.PHOSPHATE)
+ {
+ sb.append("@P");
+ }
}
return sb.toString();
}
@@ -206,7 +218,7 @@ public class ChimeraXCommands extends ChimeraCommands
@Override
public List