import jalview.gui.Desktop;
import jalview.gui.Jalview2XML;
import jalview.gui.JvOptionPane;
+import jalview.util.DBRefUtils;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
List<String> failedDBRetr = new ArrayList<>();
List<String> failedXrefMenuItems = new ArrayList<>();
List<String> failedProjectRecoveries = new ArrayList<>();
+ // only search for ensembl or Uniprot crossrefs
+ List<String> limit=Arrays.asList(new String[] {
+ DBRefUtils.getCanonicalName("ENSEMBL"),
+ DBRefUtils.getCanonicalName("Uniprot")});
// for every set of db queries
// retrieve db query
// verify presence of expected xrefs
List<String> keyseq = new ArrayList<>();
HashMap<String, File> savedProjects = new HashMap<>();
- for (String[] did : new String[][] { { "ENSEMBL", "ENSG00000157764" },
- { "UNIPROT", "P01731" } })
+ for (String[] did : new String[][] { { "UNIPROT", "P00338" } })
{
// pass counters - 0 - first pass, 1 means retrieve project rather than
// perform action
ptypes = (seqs == null || seqs.length == 0) ? null : new CrossRef(
seqs, dataset).findXrefSourcesForSequences(dna);
-
+ filterDbRefs(ptypes, limit);
+
// start of pass2: retrieve each cross-ref for fetched or restored
// project.
do // first cross ref and recover crossref loop
}
}
+ private void filterDbRefs(List<String> ptypes, List<String> limit)
+ {
+ if (limit != null)
+ {
+ int p = 0;
+ while (ptypes.size() > p)
+ {
+ if (!limit.contains(ptypes.get(p)))
+ {
+ ptypes.remove(p);
+ }
+ else
+ {
+ p++;
+ }
+ }
+ }
+ }
+
/**
* wrapper to trap known defect for AH002001 testcase
*