Vector refs = new Vector();\r
for (int s = 0; s < seqs.length; s++)\r
{\r
- SequenceI dss = seqs[s];\r
- while (dss.getDatasetSequence() != null)\r
+ if (seqs[s] != null)\r
{\r
- dss = dss.getDatasetSequence();\r
- }\r
- DBRefEntry[] rfs = findXDbRefs(dna, dss.getDBRef());\r
- for (int r = 0; rfs != null && r < rfs.length; r++)\r
- {\r
- if (!refs.contains(rfs[r].getSource()))\r
+\r
+ SequenceI dss = seqs[s];\r
+ while (dss.getDatasetSequence() != null)\r
{\r
- refs.addElement(rfs[r].getSource());\r
+ dss = dss.getDatasetSequence();\r
}\r
- }\r
- if (dataset != null)\r
- {\r
- // search for references to this sequence's direct references.\r
- DBRefEntry[] lrfs = CrossRef.findXDbRefs(!dna, seqs[s].getDBRef());\r
- Vector rseqs = new Vector();\r
- CrossRef.searchDatasetXrefs(seqs[s], !dna, lrfs, dataset, rseqs,\r
- null); // don't need to specify codon frame for mapping here\r
- Enumeration lr = rseqs.elements();\r
- while (lr.hasMoreElements())\r
+ DBRefEntry[] rfs = findXDbRefs(dna, dss.getDBRef());\r
+ for (int r = 0; rfs != null && r < rfs.length; r++)\r
{\r
- SequenceI rs = (SequenceI) lr.nextElement();\r
- DBRefEntry[] xrs = findXDbRefs(dna, rs.getDBRef());\r
- for (int r = 0; rfs != null && r < rfs.length; r++)\r
+ if (!refs.contains(rfs[r].getSource()))\r
{\r
- if (!refs.contains(rfs[r].getSource()))\r
+ refs.addElement(rfs[r].getSource());\r
+ }\r
+ }\r
+ if (dataset != null)\r
+ {\r
+ // search for references to this sequence's direct references.\r
+ DBRefEntry[] lrfs = CrossRef\r
+ .findXDbRefs(!dna, seqs[s].getDBRef());\r
+ Vector rseqs = new Vector();\r
+ CrossRef.searchDatasetXrefs(seqs[s], !dna, lrfs, dataset, rseqs,\r
+ null); // don't need to specify codon frame for mapping here\r
+ Enumeration lr = rseqs.elements();\r
+ while (lr.hasMoreElements())\r
+ {\r
+ SequenceI rs = (SequenceI) lr.nextElement();\r
+ DBRefEntry[] xrs = findXDbRefs(dna, rs.getDBRef());\r
+ for (int r = 0; rfs != null && r < rfs.length; r++)\r
{\r
- refs.addElement(rfs[r].getSource());\r
+ if (!refs.contains(rfs[r].getSource()))\r
+ {\r
+ refs.addElement(rfs[r].getSource());\r
+ }\r
}\r
}\r
}\r
try\r
{\r
retrieved = sftch.getSequences(xrfs); // problem here is we don't\r
- // know which of xrfs\r
- // resulted in which\r
- // retrieved element\r
+ // know which of xrfs\r
+ // resulted in which\r
+ // retrieved element\r
} catch (Exception e)\r
{\r
System.err\r