From 642d5e474b3ab4c98837cfe8eb2d354d2733133e Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 24 May 2012 18:51:24 +0100 Subject: [PATCH] JAL-1065 - ensure null entries in annotation row so T-COFFEE annotation can be relocated as alignment is edited. --- src/jalview/io/TCoffeeScoreFile.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/jalview/io/TCoffeeScoreFile.java b/src/jalview/io/TCoffeeScoreFile.java index ed0f1d9..0da4628 100644 --- a/src/jalview/io/TCoffeeScoreFile.java +++ b/src/jalview/io/TCoffeeScoreFile.java @@ -470,17 +470,29 @@ public class TCoffeeScoreFile extends AlignFile { Annotation[] annotations=new Annotation[al.getWidth()]; for (int j=0;j= 0 && val < colors.length ? colors[val] : Color.white); + if (s!=null && jalview.util.Comparison.isGap(s.getCharAt(j))) + { + annotations[j]=null; + if (val>0) + { + System.err.println("Warning: non-zero value for positional T-COFFEE score for gap at "+j+" in sequence "+s.getName()); + } + } else { + annotations[j]=new Annotation(s==null ? ""+val:null,s==null ? ""+val:null,'\0',val*1f,val >= 0 && val < colors.length ? colors[val] : Color.white); + } } // this will overwrite any existing t-coffee scores for the alignment AlignmentAnnotation aa=al.findOrCreateAnnotation(TCOFFEE_SCORE,false,s,null); if (s!=null) { aa.label="T-COFFEE"; - aa.description="Score for "+id.getKey(); + aa.description=""+id.getKey(); aa.annotations=annotations; aa.visible=false; aa.belowAlignment=false; + aa.createSequenceMapping(s, s.getStart(),true); + s.addAlignmentAnnotation(aa); + aa.adjustForAlignment(); } else { aa.graph=AlignmentAnnotation.NO_GRAPH; aa.label="T-COFFEE"; @@ -490,7 +502,6 @@ public class TCoffeeScoreFile extends AlignFile { aa.visible=true; } aa.showAllColLabels=true; - aa.setSequenceRef(s); aa.validateRangeAndDisplay(); added=true; } -- 1.7.10.2