From: gmungoc Date: Thu, 19 Oct 2017 14:01:56 +0000 (+0100) Subject: JAL-2755 put chromosomal dbref first in report X-Git-Tag: Release_2_11_0~191 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=664a775152a1ed48b706038423627e79fd14e572;p=jalview.git JAL-2755 put chromosomal dbref first in report --- diff --git a/src/jalview/io/SequenceAnnotationReport.java b/src/jalview/io/SequenceAnnotationReport.java index f1ebcac..13f41d4 100644 --- a/src/jalview/io/SequenceAnnotationReport.java +++ b/src/jalview/io/SequenceAnnotationReport.java @@ -58,7 +58,7 @@ public class SequenceAnnotationReport /* * 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 comparator = new Comparator() { @@ -66,6 +66,14 @@ public class SequenceAnnotationReport @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);