import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
import jalview.datamodel.GeneLociI;
+import jalview.datamodel.MappedFeatures;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.util.MessageManager;
* Comparator to order DBRefEntry by Source + accession id (case-insensitive),
* with 'Primary' sources placed before others, and 'chromosome' first of all
*/
- private static Comparator<DBRefEntry> comparator = new Comparator<DBRefEntry>()
+ private static Comparator<DBRefEntry> comparator = new Comparator<>()
{
@Override
* Append text for the list of features to the tooltip
*
* @param sb
- * @param rpos
+ * @param residuePos
* @param features
* @param minmax
*/
- public void appendFeatures(final StringBuilder sb, int rpos,
+ public void appendFeatures(final StringBuilder sb, int residuePos,
List<SequenceFeature> features, FeatureRendererModel fr)
{
- if (features != null)
+ for (SequenceFeature feature : features)
{
- for (SequenceFeature feature : features)
- {
- appendFeature(sb, rpos, fr, feature);
- }
+ appendFeature(sb, residuePos, fr, feature, null);
+ }
+ }
+
+ /**
+ * Appends text for mapped features (e.g. CDS feature for peptide or vice versa)
+ *
+ * @param sb
+ * @param residuePos
+ * @param mf
+ * @param fr
+ */
+ public void appendFeatures(StringBuilder sb, int residuePos,
+ MappedFeatures mf, FeatureRendererModel fr)
+ {
+ for (SequenceFeature feature : mf.features)
+ {
+ appendFeature(sb, residuePos, fr, feature, mf);
}
}
* @param feature
*/
void appendFeature(final StringBuilder sb, int rpos,
- FeatureRendererModel fr, SequenceFeature feature)
+ FeatureRendererModel fr, SequenceFeature feature,
+ MappedFeatures mf)
{
if (feature.isContactFeature())
{
}
}
}
+
+ if (mf != null)
+ {
+ String variants = mf.findProteinVariants(feature);
+ if (!variants.isEmpty())
+ {
+ sb.append(" ").append(variants);
+ }
+ }
}
}
.getNonPositionalFeatures())
{
int sz = -sb.length();
- appendFeature(sb, 0, fr, sf);
+ appendFeature(sb, 0, fr, sf, null);
sz += sb.length();
maxWidth = Math.max(maxWidth, sz);
}