From a6efd564c6d2d7b09825f9825846903b8e3ac680 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 13 Nov 2015 12:47:16 +0000 Subject: [PATCH] JAL-1965 formatting --- src/jalview/analysis/SequenceIdMatcher.java | 44 +++++++++++++-------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/src/jalview/analysis/SequenceIdMatcher.java b/src/jalview/analysis/SequenceIdMatcher.java index 17ff216..0fde224 100755 --- a/src/jalview/analysis/SequenceIdMatcher.java +++ b/src/jalview/analysis/SequenceIdMatcher.java @@ -90,8 +90,7 @@ public class SequenceIdMatcher * - when true, "myseq" matches "X|myseq" and "myseq" * @param seqs */ - public SequenceIdMatcher(boolean wordBasedMatch, - List seqs) + public SequenceIdMatcher(boolean wordBasedMatch, List seqs) { wordBased = wordBasedMatch; names = new HashMap>(); @@ -124,39 +123,38 @@ public class SequenceIdMatcher public void addSeq(SequenceI seq) { - // TODO: deal with ID collisions - SequenceI should be appended to list - // associated with this key. + // TODO: deal with ID collisions - SequenceI should be appended to list + // associated with this key. addSeqIdName(new SeqIdName(seq.getDisplayId(true)), seq); - if (wordBased) + if (wordBased) + { + for (SeqIdName key : getWordsFor(seq)) { - for (SeqIdName key : getWordsFor(seq)) - { addSeqIdName(key, seq); - } } - SequenceI dbseq = seq; + } + SequenceI dbseq = seq; // TODO add test for database xref resolution - while (dbseq.getDatasetSequence() != null) - { - dbseq = dbseq.getDatasetSequence(); - } - // add in any interesting identifiers - if (dbseq.getDBRefs() != null) + while (dbseq.getDatasetSequence() != null) + { + dbseq = dbseq.getDatasetSequence(); + } + // add in any interesting identifiers + if (dbseq.getDBRefs() != null) + { + DBRefEntry dbr[] = dbseq.getDBRefs(); + SeqIdName sid = null; + for (int r = 0; r < dbr.length; r++) { - DBRefEntry dbr[] = dbseq.getDBRefs(); - SeqIdName sid = null; - for (int r = 0; r < dbr.length; r++) + sid = new SeqIdName(dbr[r].getAccessionId()); + if (!names.containsKey(sid)) { - sid = new SeqIdName(dbr[r].getAccessionId()); - if (!names.containsKey(sid)) - { addSeqIdName(sid, seq); - } } + } } } - /** * generate word based keys for the given sequence * -- 1.7.10.2