X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=src%2Fjalview%2Fext%2Frbvi%2Fchimera%2FChimeraXCommands.java;h=780d2922708d8ec6b282f9e39bd233599fedae3a;hp=74e7f08f7d894ec7ce214aa3c1f76bd4424d5689;hb=f9062df1303c1ff071075256cf4b7ad7c9db9658;hpb=7af7ccb2d58a22ffabe1f3129d9f33348efb2534 diff --git a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java index 74e7f08..780d292 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 @@ -119,7 +120,7 @@ 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"); @@ -153,7 +154,7 @@ public class ChimeraXCommands extends ChimeraCommands * @return */ @Override - public String getAtomSpec(AtomSpecModel atomSpec, boolean alphaOnly) + public String getAtomSpec(AtomSpecModel atomSpec, AtomSpecType specType) { StringBuilder sb = new StringBuilder(128); boolean firstModel = true; @@ -165,11 +166,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"); } + if (specType == AtomSpecType.PHOSPHATE) + { + sb.append("@P"); + } } return sb.toString(); } @@ -213,7 +217,7 @@ public class ChimeraXCommands extends ChimeraCommands @Override public List superposeStructures(AtomSpecModel ref, - AtomSpecModel spec, boolean isNucleotide) + AtomSpecModel spec, AtomSpecType backbone) { /* * Form ChimeraX match command to match spec to ref @@ -223,8 +227,8 @@ public class ChimeraXCommands extends ChimeraCommands * @see https://www.cgl.ucsf.edu/chimerax/docs/user/commands/align.html */ StringBuilder cmd = new StringBuilder(); - String atomSpec = getAtomSpec(spec, true); - String refSpec = getAtomSpec(ref, true); + String atomSpec = getAtomSpec(spec, backbone); + String refSpec = getAtomSpec(ref, backbone); cmd.append("align ").append(atomSpec).append(" toAtoms ") .append(refSpec); @@ -232,8 +236,8 @@ public class ChimeraXCommands extends ChimeraCommands * show superposed residues as ribbon, others as chain */ cmd.append("; ribbon "); - cmd.append(getAtomSpec(spec, false)).append("|"); - cmd.append(getAtomSpec(ref, false)).append("; view"); + cmd.append(getAtomSpec(spec, AtomSpecType.RESIDUE_ONLY)).append("|"); + cmd.append(getAtomSpec(ref, AtomSpecType.RESIDUE_ONLY)).append("; view"); return Arrays.asList(new StructureCommand(cmd.toString())); }