/*
* 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
* Method:
*
* 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
* @return
*/
protected List
*
*/
@Override
public FeatureSettingsModelI getFeatureColourScheme()
{
return new FeatureSettingsAdapter()
{
SequenceOntologyI so = SequenceOntologyFactory.getSequenceOntology();
@Override
public boolean isFeatureHidden(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;
}
};
}
}