+ names = new HashMap<SeqIdName, SequenceI>();
+ addAll(seqs);
+ }
+
+ /**
+ * Adds sequences to this matcher
+ *
+ * @param seqs
+ */
+ public void addAll(List<SequenceI> seqs)
+ {
+ for (SequenceI seq : seqs)
+ {
+ add(seq);
+ }
+ }
+
+ /**
+ * Adds one sequence to this matcher
+ *
+ * @param seq
+ */
+ public void add(SequenceI seq)
+ {
+ // TODO: deal with ID collisions - SequenceI should be appended to list
+ // associated with this key.
+ names.put(new SeqIdName(seq.getDisplayId(true)), seq);
+ SequenceI dbseq = seq;
+ while (dbseq.getDatasetSequence() != null)
+ {
+ dbseq = dbseq.getDatasetSequence();
+ }
+ // add in any interesting identifiers
+ if (dbseq.getDBRefs() != null)