X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FDna.java;h=5096ae82bf269fd24d797afd08b1970f20c858bc;hb=ff385fde554b8fe517dbb734ca687ef7552f2350;hp=836c39ef2f9a96462ce454a7d7ed4efec1af9785;hpb=4484ac6bdcc92f0e0e430f64d3587f026fafb476;p=jalview.git diff --git a/src/jalview/analysis/Dna.java b/src/jalview/analysis/Dna.java index 836c39e..5096ae8 100644 --- a/src/jalview/analysis/Dna.java +++ b/src/jalview/analysis/Dna.java @@ -197,28 +197,36 @@ public class Dna { if (annotations[i].autoCalculated) { continue; } - - aSize = aslen; // aa alignment width. - jalview.datamodel.Annotation[] anots = - new jalview.datamodel.Annotation[aSize]; - for (a = 0; a < aSize; a++) + aSize = aslen; // aa alignment width. + jalview.datamodel.Annotation[] anots = + (annotations[i].annotations==null) + ? null : + new jalview.datamodel.Annotation[aSize]; + if (anots!=null) { - // process through codon map. - if (codons[a]!=null && codons[a][0]==(codons[a][2]-2)) + for (a = 0; a < aSize; a++) { - pos = codons[a][0]; - if (annotations[i].annotations[pos] == null - || annotations[i].annotations[pos] == null) - continue; + // process through codon map. + if (codons[a]!=null && codons[a][0]==(codons[a][2]-2)) + { + pos = codons[a][0]; + if (annotations[i].annotations[pos] == null + || annotations[i].annotations[pos] == null) + continue; - anots[a] = new Annotation(annotations[i].annotations[pos]); + anots[a] = new Annotation(annotations[i].annotations[pos]); + } } } jalview.datamodel.AlignmentAnnotation aa = new jalview.datamodel.AlignmentAnnotation(annotations[i].label, annotations[i].description, anots); + if (annotations[i].hasScore) + { + aa.setScore(annotations[i].getScore()); + } al.addAnnotation(aa); } }