X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FCrossRef.java;h=94aa5c9f6c4b663c07f2f59f469fe6b87f68ad39;hb=171ca8730ea146d50b2eb00701d8df986d88f519;hp=629850511fefc57400d34c9e07753c938e442c3e;hpb=797df64fa2a0a30773d0f48f5494d4155e5a8be3;p=jalview.git
diff --git a/src/jalview/analysis/CrossRef.java b/src/jalview/analysis/CrossRef.java
index 6298505..94aa5c9 100644
--- a/src/jalview/analysis/CrossRef.java
+++ b/src/jalview/analysis/CrossRef.java
@@ -1,23 +1,24 @@
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
* Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
- *
+ *
* This file is part of Jalview.
- *
+ *
* Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
+ * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * Jalview is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with Jalview. If not, see .
*/
package jalview.analysis;
import java.util.Enumeration;
+import java.util.List;
import java.util.Vector;
import java.util.Hashtable;
@@ -34,15 +35,15 @@ import jalview.ws.seqfetcher.ASequenceFetcher;
/**
* Functions for cross-referencing sequence databases. user must first specify
* if cross-referencing from protein or dna (set dna==true)
- *
+ *
* @author JimP
- *
+ *
*/
public class CrossRef
{
/**
* get the DNA or protein references for a protein or dna sequence
- *
+ *
* @param dna
* @param rfs
* @return
@@ -90,7 +91,7 @@ public class CrossRef
/**
* Indirect references are references from other sequences from the dataset to
* any of the direct DBRefEntrys on the given sequences.
- *
+ *
* @param dna
* true if seqs are DNA seqs
* @param seqs
@@ -201,7 +202,7 @@ public class CrossRef
}
/**
- *
+ *
* @param dna
* @param seqs
* @return
@@ -213,7 +214,7 @@ public class CrossRef
}
/**
- *
+ *
* @param seqs
* @param dna
* @param source
@@ -415,7 +416,7 @@ public class CrossRef
* find references to lrfs in the cross-reference set of each sequence in
* dataset (that is not equal to sequenceI) Identifies matching DBRefEntry
* based on source and accession string only - Map and Version are nulled.
- *
+ *
* @param sequenceI
* @param lrfs
* @param dataset
@@ -443,7 +444,7 @@ public class CrossRef
/**
* search a given sequence dataset for references matching cross-references to
* the given sequence
- *
+ *
* @param sequenceI
* @param xrf
* @param dataset
@@ -462,7 +463,7 @@ public class CrossRef
* TODO: generalise to different protein classifications Search dataset for
* DBRefEntrys matching the given one (xrf) and add the associated sequence to
* rseq.
- *
+ *
* @param sequenceI
* @param xrf
* @param dataset
@@ -486,10 +487,10 @@ public class CrossRef
System.err.println("Empty dataset sequence set - NO VECTOR");
return false;
}
- Enumeration e = dataset.getSequences().elements();
- while (e.hasMoreElements())
+ List ds;
+ synchronized (ds=dataset.getSequences())
{
- SequenceI nxt = (SequenceI) e.nextElement();
+ for (SequenceI nxt:ds)
if (nxt != null)
{
if (nxt.getDatasetSequence() != null)
@@ -566,7 +567,7 @@ public class CrossRef
/**
* precalculate different products that can be found for seqs in dataset and
* return them.
- *
+ *
* @param dna
* @param seqs
* @param dataset