X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FTCoffeeColourScheme.java;h=19c92a000af18e41428970fda4b5b7ef512219e0;hb=b0cee3aaf7d8873910939f97b6acb217d518968d;hp=bc56281cd2d62604f7d5956286589a58b08331e8;hpb=17e77c3f2949a0729322b4a8d907f3f34b6a9914;p=jalview.git diff --git a/src/jalview/schemes/TCoffeeColourScheme.java b/src/jalview/schemes/TCoffeeColourScheme.java index bc56281..19c92a0 100644 --- a/src/jalview/schemes/TCoffeeColourScheme.java +++ b/src/jalview/schemes/TCoffeeColourScheme.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -86,6 +86,10 @@ public class TCoffeeColourScheme extends ResidueColourScheme seqMap = new IdentityHashMap(); AnnotatedCollectionI alcontext = alignment instanceof AlignmentI ? alignment : alignment.getContext(); + if (alcontext == null) + { + return; + } int w = 0; for (AlignmentAnnotation al : alcontext .findAnnotation(TCoffeeScoreFile.TCOFFEE_SCORE)) @@ -137,4 +141,35 @@ public class TCoffeeColourScheme extends ResidueColourScheme { return new TCoffeeColourScheme(sg); } + + /** + * Answers true if the annotated data has TCoffee score annotation + */ + @Override + public boolean isApplicableTo(AnnotatedCollectionI ac) + { + if (ac.getContext() != null) + { + ac = ac.getContext(); + } + AlignmentAnnotation[] anns = ac.getAlignmentAnnotation(); + if (anns == null) + { + return false; + } + for (AlignmentAnnotation ann : anns) + { + if (TCoffeeScoreFile.TCOFFEE_SCORE.equals(ann.getCalcId())) + { + return true; + } + } + return false; + } + + @Override + public String getSchemeName() + { + return JalviewColourScheme.TCoffee.toString(); + } }