package jalview.ext.ensembl;
import jalview.bin.Cache;
+import jalview.datamodel.DBRefSource;
/**
* A class to behave much like EnsemblGene but referencing the ensemblgenomes
@Override
public String getDbName()
{
- return "EnsemblGenomes";
+ return DBRefSource.ENSEMBLGENOMES;
}
@Override
@Override
public String getDbSource()
{
- return "EnsemblGenomes";
+ return DBRefSource.ENSEMBLGENOMES;
}
}
public void testFindXrefSourcesForSequence_proteinToDna()
{
SequenceI seq = new Sequence("Seq1", "MGKYQARLSS");
- List<String> sources = new ArrayList<String>();
+ List<String> sources = new ArrayList<>();
AlignmentI al = new Alignment(new SequenceI[] {});
/*
sources = new CrossRef(new SequenceI[] { seq }, al)
.findXrefSourcesForSequences(false);
// method is patched to remove EMBL from the sources to match
- assertEquals(3, sources.size());
- assertEquals("[EMBLCDS, GENEDB, ENSEMBL]", sources.toString());
+ assertEquals(4, sources.size());
+ assertEquals("[EMBLCDS, GENEDB, ENSEMBL, ENSEMBLGENOMES]",
+ sources.toString());
/*
* add a sequence to the alignment which has a dbref to UNIPROT|A1234
pep1.addDBRef(new DBRefEntry("UNIPROT", "0", "Q9ZTS2"));
AlignmentI al = new Alignment(new SequenceI[] { dna1, pep1 });
- List<SequenceI> result = new ArrayList<SequenceI>();
+ List<SequenceI> result = new ArrayList<>();
/*
* first search for a dbref nowhere on the alignment:
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@Test(singleThreaded = true)
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
}
+ @DataProvider(name = "initialAccessions")
+ static Object[][] getAccessions()
+ {
+ return new String[][] { { "UNIPROT", "P00338" },
+ { "UNIPROT", "Q8Z9G6" },
+ { "ENSEMBLGENOMES", "CAD01290" } };
+ }
+
/**
* test store and recovery of all reachable cross refs from all reachable
* crossrefs for one or more fetched db refs. Currently, this test has a known
*
* @throws Exception
*/
- @Test(groups = { "Operational" }, enabled = true)
- public void testRetrieveAndShowCrossref() throws Exception
+ @Test(
+ groups =
+ { "Operational" },
+ dataProvider = "initialAccessions",
+ enabled = true)
+ public void testRetrieveAndShowCrossref(String forSource,
+ String forAccession) throws Exception
{
List<String> failedDBRetr = new ArrayList<>();
List<String> keyseq = new ArrayList<>();
HashMap<String, File> savedProjects = new HashMap<>();
- for (String[] did : new String[][] { { "UNIPROT", "P00338" } })
- {
+// for (String[] did : new String[][] { { "UNIPROT", "P00338" } })
+// {
// pass counters - 0 - first pass, 1 means retrieve project rather than
// perform action
int pass1 = 0, pass2 = 0, pass3 = 0;
// { pass 2 = 0 { pass 3 = 0 } }
do
{
- String first = did[0] + " " + did[1];
+ String first = forSource + " " + forAccession;//did[0] + " " + did[1];
AlignFrame af = null;
boolean dna;
AlignmentI retral;
// retrieve dbref
List<AlignFrame> afs = jalview.gui.SequenceFetcher.fetchAndShow(
- did[0], did[1]);
+ forSource, forAccession);
+ // did[0], did[1]);
if (afs.size() == 0)
{
failedDBRetr.add("Didn't retrieve " + first);
pass1++;
}
} while (pass1 < 3);
- }
+
if (failedXrefMenuItems.size() > 0)
{
for (String s : failedXrefMenuItems)