From: Jim Procter Date: Mon, 22 Aug 2016 12:01:35 +0000 (+0100) Subject: JAL-2154 verify recovered xref sequence not already in dataset before adding it X-Git-Tag: Release_2_10_0~47^2~4^2~43^2~22 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b135a253684e74d75c4050d9a1b70157e977c438;p=jalview.git JAL-2154 verify recovered xref sequence not already in dataset before adding it --- diff --git a/src/jalview/analysis/CrossRef.java b/src/jalview/analysis/CrossRef.java index 81fad27..ddfd7ff 100644 --- a/src/jalview/analysis/CrossRef.java +++ b/src/jalview/analysis/CrossRef.java @@ -438,8 +438,11 @@ public class CrossRef } else { - dataset.addSequence(map.getTo()); - matcher.add(map.getTo()); + if (dataset.findIndex(map.getTo()) == -1) + { + dataset.addSequence(map.getTo()); + matcher.add(map.getTo()); + } } try { @@ -509,8 +512,11 @@ public class CrossRef } retrievedSequence.updatePDBIds(); rseqs.add(retrievedDss); - dataset.addSequence(retrievedDss); - matcher.add(retrievedDss); + if (dataset.findIndex(retrievedDss) == -1) + { + dataset.addSequence(retrievedDss); + matcher.add(retrievedDss); + } } } }