+ return begin == 0 && end == 0;
+ }
+
+ /**
+ * Answers an html-formatted report of feature details. If parameter
+ * {@code mf} is not null, the feature is a virtual linked feature, and
+ * details included both the original location and the mapped location
+ * (CDS/peptide).
+ *
+ * @param seqName
+ * @param mf
+ *
+ * @return
+ */
+ public String getDetailsReport(String seqName, MappedFeatures mf)
+ {
+ FeatureSourceI metadata = FeatureSources.getInstance()
+ .getSource(source);
+
+ StringBuilder sb = new StringBuilder(128);
+ sb.append("<br>");
+ sb.append("<table>");
+ String name = mf == null ? seqName : mf.getLinkedSequenceName();
+ sb.append(String.format(ROW_DATA, "Location", name, begin == end ? begin
+ : begin + (isContactFeature() ? ":" : "-") + end));
+
+ String consequence = "";
+ if (mf != null)
+ {
+ int[] localRange = mf.getMappedPositions(begin, end);
+ int from = localRange[0];
+ int to = localRange[localRange.length - 1];
+ String s = mf.isFromCds() ? "Peptide Location" : "Coding location";
+ sb.append(String.format(ROW_DATA, s, seqName, from == to ? from
+ : from + (isContactFeature() ? ":" : "-") + to));
+ if (mf.isFromCds())
+ {
+ consequence = mf.findProteinVariants(this);
+ }
+ }
+ sb.append(String.format(ROW_DATA, "Type", type, ""));
+ String desc = StringUtils.stripHtmlTags(description);
+ sb.append(String.format(ROW_DATA, "Description", desc, ""));
+ if (!Float.isNaN(score) && score != 0f)
+ {
+ sb.append(String.format(ROW_DATA, "Score", score, ""));
+ }
+ if (featureGroup != null)
+ {
+ sb.append(String.format(ROW_DATA, "Group", featureGroup, ""));
+ }
+
+ if (!consequence.isEmpty())
+ {
+ sb.append(String.format(ROW_DATA, "Consequence",
+ "<i>Translated by Jalview</i>", consequence));
+ }
+