From 213312e8ad1e085a1075be810473d359b795bf2e Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Sun, 24 Jul 2016 14:04:15 +0100 Subject: [PATCH] =?utf8?q?JAL-2154=20keep=20track=20of=20incomplete=20sequen?= =?utf8?q?ces=20and=20report=20if=20they=20weren=E2=80=99t=20resolved?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/gui/Jalview2XML.java | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) 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); } -- 1.7.10.2