X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fensembl%2FEnsemblGene.java;h=ad013241c136a5478645c24b94fb18073b2aecd4;hb=89c708e1eef23578fe57be6eeda5379becfd3afa;hp=df4e45a7e07fdb9f0d11a836755e10964c11ace8;hpb=c406d789d51e6ac1ff45e3568d37e9ed53025f03;p=jalview.git
diff --git a/src/jalview/ext/ensembl/EnsemblGene.java b/src/jalview/ext/ensembl/EnsemblGene.java
index df4e45a..ad01324 100644
--- a/src/jalview/ext/ensembl/EnsemblGene.java
+++ b/src/jalview/ext/ensembl/EnsemblGene.java
@@ -1,16 +1,41 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see
+ * Transcript features are those of type "transcript", or any of its sub-types
+ * in the Sequence Ontology e.g. "mRNA", "processed_transcript". We also
+ * include "NMD_transcript_variant", because this type behaves like a
+ * transcript identifier in Ensembl, although strictly speaking it is not in
+ * the SO.
*
* @param accId
* @param geneSequence
@@ -295,20 +445,18 @@ public class EnsemblGene extends EnsemblSeqProxy
List
+ *
+ */
@Override
- public FeatureSettingsI getFeatureColourScheme()
+ public FeatureSettingsModelI getFeatureColourScheme()
{
- return FeatureColourScheme.EnsemblVariants;
+ return new FeatureSettingsAdapter()
+ {
+ SequenceOntologyI so = SequenceOntologyFactory.getInstance();
+
+ @Override
+ public boolean isFeatureDisplayed(String type)
+ {
+ return (so.isA(type, SequenceOntologyI.EXON)
+ || so.isA(type, SequenceOntologyI.SEQUENCE_VARIANT));
+ }
+
+ @Override
+ public FeatureColourI getFeatureColour(String type)
+ {
+ if (so.isA(type, SequenceOntologyI.EXON))
+ {
+ return new FeatureColour()
+ {
+ @Override
+ public boolean isColourByLabel()
+ {
+ return true;
+ }
+ };
+ }
+ if (so.isA(type, SequenceOntologyI.SEQUENCE_VARIANT))
+ {
+ return new FeatureColour()
+ {
+
+ @Override
+ public Color getColour()
+ {
+ return Color.RED;
+ }
+ };
+ }
+ return null;
+ }
+
+ /**
+ * order to render sequence_variant after exon after the rest
+ */
+ @Override
+ public int compare(String feature1, String feature2)
+ {
+ if (so.isA(feature1, SequenceOntologyI.SEQUENCE_VARIANT))
+ {
+ return +1;
+ }
+ if (so.isA(feature2, SequenceOntologyI.SEQUENCE_VARIANT))
+ {
+ return -1;
+ }
+ if (so.isA(feature1, SequenceOntologyI.EXON))
+ {
+ return +1;
+ }
+ if (so.isA(feature2, SequenceOntologyI.EXON))
+ {
+ return -1;
+ }
+ return 0;
+ }
+ };
}
}