import jalview.datamodel.SequenceI;
import jalview.io.gff.GffConstants;
import jalview.util.MessageManager;
+import jalview.util.StringUtils;
import jalview.util.UrlLink;
import java.util.Arrays;
/*
* Comparator to order DBRefEntry by Source + accession id (case-insensitive),
- * with 'Primary' sources placed before others
+ * with 'Primary' sources placed before others, and 'chromosome' first of all
*/
private static Comparator<DBRefEntry> comparator = new Comparator<DBRefEntry>()
{
@Override
public int compare(DBRefEntry ref1, DBRefEntry ref2)
{
+ if (ref1.isChromosome())
+ {
+ return -1;
+ }
+ if (ref2.isChromosome())
+ {
+ return 1;
+ }
String s1 = ref1.getSource();
String s2 = ref2.getSource();
boolean s1Primary = isPrimarySource(s1);
sb.append(" ").append(feature.end);
}
- if (feature.getDescription() != null
- && !feature.description.equals(feature.getType()))
+ String description = feature.getDescription();
+ if (description != null && !description.equals(feature.getType()))
{
- String tmpString = feature.getDescription();
- String tmp2up = tmpString.toUpperCase();
- int startTag = tmp2up.indexOf("<HTML>");
- if (startTag > -1)
- {
- tmpString = tmpString.substring(startTag + 6);
- tmp2up = tmp2up.substring(startTag + 6);
- }
- int endTag = tmp2up.indexOf("</BODY>");
- if (endTag > -1)
- {
- tmpString = tmpString.substring(0, endTag);
- tmp2up = tmp2up.substring(0, endTag);
- }
- endTag = tmp2up.indexOf("</HTML>");
- if (endTag > -1)
- {
- tmpString = tmpString.substring(0, endTag);
- }
-
- if (startTag > -1)
- {
- sb.append("; ").append(tmpString);
- }
- else
- {
- if (tmpString.indexOf("<") > -1 || tmpString.indexOf(">") > -1)
- {
- // The description does not specify html is to
- // be used, so we must remove < > symbols
- tmpString = tmpString.replaceAll("<", "<");
- tmpString = tmpString.replaceAll(">", ">");
-
- sb.append("; ");
- sb.append(tmpString);
- }
- else
- {
- sb.append("; ").append(tmpString);
- }
- }
+ description = StringUtils.stripHtmlTags(description);
+ sb.append("; ").append(description);
}
// check score should be shown
if (!Float.isNaN(feature.getScore()))