From: Jim Procter Date: Sun, 24 Jul 2016 13:04:15 +0000 (+0100) Subject: JAL-2154 keep track of incomplete sequences and report if they weren’t resolved X-Git-Tag: Release_2_10_0~125^2~6 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=213312e8ad1e085a1075be810473d359b795bf2e;p=jalview.git JAL-2154 keep track of incomplete sequences and report if they weren’t resolved --- diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index c0e1ebe..9b2b04a 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -165,6 +165,8 @@ public class Jalview2XML */ Map seqRefIds = null; + Map incompleteSeqs = null; + List frefedSequence = null; boolean raiseGUI = true; // whether errors are raised in dialog boxes or not @@ -220,6 +222,10 @@ public class Jalview2XML { seqsToIds.clear(); } + if (incompleteSeqs != null) + { + incompleteSeqs.clear(); + } // seqRefIds = null; // seqsToIds = null; } @@ -242,6 +248,10 @@ public class Jalview2XML { seqRefIds = new HashMap(); } + if (incompleteSeqs == null) + { + incompleteSeqs = new HashMap(); + } if (frefedSequence == null) { frefedSequence = new ArrayList(); @@ -393,6 +403,24 @@ public class Jalview2XML System.err.println("SERIOUS! " + failedtoresolve + " resolvable forward references failed to resolve."); } + if (incompleteSeqs != null && incompleteSeqs.size() > 0) + { + System.err.println("Jalview Project Import: There are " + + incompleteSeqs.size() + + " sequences which may have incomplete metadata."); + if (incompleteSeqs.size() < 10) + { + for (SequenceI s : incompleteSeqs.values()) + { + System.err.println(s.toString()); + } + } + else + { + System.err + .println("Too many to report. Skipping output of incomplete sequences."); + } + } } /** @@ -2743,6 +2771,18 @@ public class Jalview2XML SequenceI tmpSeq = seqRefIds.get(seqId); if (tmpSeq != null) { + if (!incompleteSeqs.containsKey(seqId)) + { + // may not need this check, but keep it for at least 2.9,1 release + if (tmpSeq.getStart()!=jseqs[i].getStart() || tmpSeq.getEnd()!=jseqs[i].getEnd()) + { + System.err + .println("Warning JAL-2154 regression: updating start/end for sequence " + + tmpSeq.toString()); + } + } else { + incompleteSeqs.remove(seqId); + } tmpSeq.setStart(jseqs[i].getStart()); tmpSeq.setEnd(jseqs[i].getEnd()); tmpseqs.add(tmpSeq); @@ -5103,6 +5143,7 @@ public class Jalview2XML djs.setEnd(jmap.getMap().getToHighest()); djs.setVamsasId(uniqueSetSuffix + sqid); jmap.setTo(djs); + incompleteSeqs.put(sqid, djs); seqRefIds.put(sqid, djs); }