public List<String> findProteinVariants()
{
List<String> vars = new ArrayList<>();
+ if (features.isEmpty())
+ {
+ return vars;
+ }
/*
* determine canonical codon
: seq.getDatasetSequence();
MappedFeatures mf = fr2
.findComplementFeaturesAtResidue(ds, pos);
- List<String> pv = mf.findProteinVariants();
- for (String s : pv)
+ if (mf != null)
{
- if (!infos.contains(s))
+ List<String> pv = mf.findProteinVariants();
+ for (String s : pv)
{
- infos.addAll(pv);
+ if (!infos.contains(s))
+ {
+ infos.addAll(pv);
+ }
}
}
}
FeatureRendererModel fr2 = af.getFeatureRenderer();
MappedFeatures mf = fr2.findComplementFeaturesAtResidue(sequence,
pos);
- seqARep.appendFeatures(tooltipText, pos, mf.features, fr2);
+ if (mf != null)
+ {
+ seqARep.appendFeatures(tooltipText, pos, mf.features, fr2);
+ }
}
}
}
int column = seq.findIndex(pos);
MappedFeatures mf = fr2
.findComplementFeaturesAtResidue(seq, pos);
- for (SequenceFeature sf : mf.features)
+ if (mf != null)
{
- FeatureColourI fc = fr2.getFeatureStyle(sf.getType());
- Color featureColour = fr2.getColor(sf, fc);
- renderFeature(g, seq, column - 1, column - 1, featureColour,
- start, end, y1, colourOnly);
- drawnColour = featureColour;
+ for (SequenceFeature sf : mf.features)
+ {
+ FeatureColourI fc = fr2.getFeatureStyle(sf.getType());
+ Color featureColour = fr2.getColor(sf, fc);
+ renderFeature(g, seq, column - 1, column - 1, featureColour,
+ start, end, y1, colourOnly);
+ drawnColour = featureColour;
+ }
}
}
return drawnColour;
FeatureRendererModel fr2 = af.getFeatureRenderer();
MappedFeatures mf = fr2.findComplementFeaturesAtResidue(
seq, seq.findPosition(column - 1));
-
+ if (mf == null)
+ {
+ return null;
+ }
ReverseListIterator<SequenceFeature> it = new ReverseListIterator<>(
mf.features);
while (it.hasNext())
}
/**
- * Answers a (possibly empty) list of features in this alignment at a position
- * (or range) which is mappable from the given sequence residue position in a
- * mapped alignment. Features are returned in render order of feature type (on
- * top last), with order within feature type undefined.
+ * Answers a bean containing a mapping, and a list of features in this
+ * alignment at a position (or range) which is mappable from the given
+ * sequence residue position in a mapped alignment. Features are returned in
+ * render order of feature type (on top last), with order within feature type
+ * undefined. If no features or mapping are found, answers null.
*
* @param sequence
* @param pos
break;
}
}
+ if (found.isEmpty())
+ {
+ return null;
+ }
/*
* sort by renderorder, inefficiently