better check for molecule type when identifying internal sequence cross-references
authorjprocter <Jim Procter>
Tue, 19 Aug 2008 09:38:38 +0000 (09:38 +0000)
committerjprocter <Jim Procter>
Tue, 19 Aug 2008 09:38:38 +0000 (09:38 +0000)
src/jalview/analysis/CrossRef.java

index d063eed..159d96a 100644 (file)
@@ -445,6 +445,7 @@ public class CrossRef
           boolean direct, boolean dna)\r
   {\r
     boolean found = false;\r
+    SequenceI[] typer=new SequenceI[1];\r
     if (dataset == null)\r
       return false;\r
     if (dataset.getSequences() == null)\r
@@ -465,6 +466,17 @@ public class CrossRef
         }\r
         if (nxt != sequenceI && nxt != sequenceI.getDatasetSequence())\r
         {\r
+          // check if this is the correct sequence type\r
+          {\r
+            typer[0] = nxt;\r
+            boolean isDna = jalview.util.Comparison.isNucleotide(typer);\r
+            if ((direct && isDna == dna) || (!direct && isDna!=dna))\r
+            {\r
+              // skip this sequence because it is same molecule type\r
+              continue;\r
+            }\r
+          }\r
+\r
           // look for direct or indirect references in common\r
           DBRefEntry[] poss = null, cands = null;\r
           if (direct)\r