X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fstructure%2FStructureSelectionManager.java;h=cf5054de0079923f0762d6e38cb9f40d05beb5cc;hb=f01d9453eff16cb42d6dd5780b528d3ae10247ef;hp=c0ab6f9b50b7ffc682c88f18dc0b423b56b79487;hpb=f72e829fdbcb33664d4fa687a8a5a6f66759d013;p=jalview.git diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index c0ab6f9..cf5054d 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -69,9 +69,11 @@ public class StructureSelectionManager There will be better ways of doing this in the future, for now we'll use the tried and tested MCview pdb mapping */ - synchronized public MCview.PDBfile setMapping(SequenceI[] sequence, - String pdbFile, - String protocol) + synchronized public MCview.PDBfile setMapping( + SequenceI[] sequence, + String[] targetChains, + String pdbFile, + String protocol) { MCview.PDBfile pdb = null; try @@ -84,15 +86,19 @@ public class StructureSelectionManager return null; } + String targetChain; for (int s = 0; s < sequence.length; s++) { - String targetChain = ""; - - if (sequence[s].getName().indexOf("|") > -1) + if(targetChains!=null && targetChains[s]!=null) + targetChain = targetChains[s]; + else if (sequence[s].getName().indexOf("|") > -1) { targetChain = sequence[s].getName().substring( sequence[s].getName().lastIndexOf("|") + 1); } + else + targetChain = ""; + int max = -10; AlignSeq maxAlignseq = null; @@ -188,6 +194,7 @@ public class StructureSelectionManager mappings[mappings.length - 1] = new StructureMapping(sequence[s], pdbFile, pdb.id, maxChainId, mapping, mappingDetails.toString()); + maxChain.transferResidueAnnotation(mappings[mappings.length-1]); } ///////// @@ -233,23 +240,30 @@ public class StructureSelectionManager public void mouseOverStructure(int pdbResNum, String chain, String pdbfile) { SequenceListener sl; + SearchResults results = new SearchResults(); for (int i = 0; i < listeners.size(); i++) { if (listeners.elementAt(i) instanceof SequenceListener) { - sl = (SequenceListener) listeners.elementAt(i); for (int j = 0; j < mappings.length; j++) { if (mappings[j].pdbfile.equals(pdbfile) && mappings[j].pdbchain.equals(chain)) { - sl.highlightSequence(mappings[j].sequence, - mappings[j].getSeqPos(pdbResNum)); + results.addResult(mappings[j].sequence, + mappings[j].getSeqPos(pdbResNum), + mappings[j].getSeqPos(pdbResNum) + ); } } - sl.highlightSequence(null, pdbResNum); + if(results.getSize()>0) + { + ( (SequenceListener) listeners.elementAt(i)) + .highlightSequence(results); + } + } } } @@ -285,7 +299,10 @@ public class StructureSelectionManager public Annotation[] colourSequenceFromStructure(SequenceI seq, String pdbid) { - Annotation [] annotations = new Annotation[seq.getLength()]; + return null; + //THIS WILL NOT BE AVAILABLE IN JALVIEW 2.3, + //UNTIL THE COLOUR BY ANNOTATION IS REWORKED + /* Annotation [] annotations = new Annotation[seq.getLength()]; StructureListener sl; int atomNo = 0; @@ -319,9 +336,6 @@ public class StructureSelectionManager mappings[j].getPDBResNum(index), mappings[j].pdbchain, mappings[j].pdbfile); - - // System.out.println(atomNo+" "+mappings[j].getPDBResNum(index) - // +" "+index+" "+col); } annotations[index] = new Annotation("X",null,' ',0,col); @@ -332,27 +346,15 @@ public class StructureSelectionManager } } - return annotations; + return annotations;*/ } public void structureSelectionChanged() - { - StructureListener svl; - for (int i = 0; i < listeners.size(); i++) - { - svl = (StructureListener) listeners.elementAt(i); - } - } + { } public void sequenceSelectionChanged() - { - StructureListener svl; - for (int i = 0; i < listeners.size(); i++) - { - svl = (StructureListener) listeners.elementAt(i); - } - } + { } public void sequenceColoursChanged(Object source) {