<li>
<!-- JAL-2666 -->Linked scrolling via protein horizontal scroll bar doesn't work for some CDS/Protein views
</li>
+ <li><!-- JAL-2930 -->Trackpad scrolling is broken on OSX on Java 1.8u153 onwards and Java 1.9u4+.</li>
+ <li><!-- JAL-2924 -->Tooltip shouldn't be displayed for empty columns in annotation row</li>
+ <li><!-- JAL-2913 -->Preferences panel's ID Width control is honored in interactive and batch mode</li>
+ </ul><em>Applet</em><ul>
+ <li><!-- JAL-2926 -->Copy consensus sequence option in applet should copy the group consensus when popup is opened on it</li>
+
</ul>
</div>
</td>
* <li>FIGURE_AUTOIDWIDTH (false) Expand the left hand column of an exported
* alignment figure to accommodate even the longest sequence ID or annotation
* label.</li>
- * <li>FIGURE_USERIDWIDTH Specifies the width to use for the left-hand column
+ * <li>FIGURE_FIXEDIDWIDTH Specifies the width to use for the left-hand column
* when exporting an alignment as a figure (setting FIGURE_AUTOIDWIDTH to true
* will override this).</li>
* <li>STRUCT_FROM_PDB (false) derive secondary structure annotation from PDB
* List of databases whose sequences might have coding regions annotated
*/
public static final String[] DNACODINGDBS = { EMBL, EMBLCDS, GENEDB,
- ENSEMBL };
+ ENSEMBL, ENSEMBLGENOMES };
public static final String[] CODINGDBS = { EMBLCDS, GENEDB, ENSEMBL };
public static String[] allSources()
{
- List<String> src = new ArrayList<String>();
+ List<String> src = new ArrayList<>();
for (Field f : DBRefSource.class.getFields())
{
if (String.class.equals(f.getType()))
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;
}
}
private static final String SPECIES = "species";
/**
- * keep track of last identifier retrieved to break loops
- */
- private String lastId;
-
- /**
* Default constructor (to use rest.ensembl.org)
*/
public EnsemblLookup()
BufferedReader br = null;
try
{
-
URL url = getUrl(identifier, objectType);
- if (identifier.equals(lastId))
- {
- System.err.println("** Ensembl lookup " + url.toString()
- + " looping on Parent!");
- return null;
- }
-
- lastId = identifier;
-
if (url != null)
{
br = getHttpResponse(url, ids);
}
/**
- * Parses the JSON response and returns the gene identifier, or null if not
- * found. If the returned object_type is Gene, returns the id, if Transcript
- * returns the Parent. If it is Translation (peptide identifier), then the
- * Parent is the transcript identifier, so we redo the search with this value,
- * specifying that object_type should be Transcript.
- *
- * @param jsonObject
- * @return
- */
- protected String parseGeneId(JSONObject json)
- {
- if (json == null)
- {
- // e.g. lookup failed with 404 not found
- return null;
- }
-
- String geneId = null;
- String type = json.get(OBJECT_TYPE).toString();
- if (OBJECT_TYPE_GENE.equalsIgnoreCase(type))
- {
- // got the gene - just returns its id
- geneId = json.get(JSON_ID).toString();
- }
- else if (OBJECT_TYPE_TRANSCRIPT.equalsIgnoreCase(type))
- {
- // got the transcript - return its (Gene) Parent
- geneId = json.get(PARENT).toString();
- }
- else if (OBJECT_TYPE_TRANSLATION.equalsIgnoreCase(type))
- {
- // got the protein - look up its Parent, restricted to type Transcript
- String transcriptId = json.get(PARENT).toString();
- geneId = parseGeneId(getResult(transcriptId, OBJECT_TYPE_TRANSCRIPT));
- }
-
- return geneId;
- }
-
- /**
* Calls the /lookup/id rest service for the given id, and if successful,
* parses and returns the gene's chromosomal coordinates
*
}
Integer idwidth = null;
if (onscreen || (idwidth = Cache
- .getIntegerProperty("FIGURE_USERIDWIDTH")) == null)
+ .getIntegerProperty("FIGURE_FIXEDIDWIDTH")) == null)
{
int w = getIdPanel().getWidth();
return (w > 0 ? w : calculateIdWidth().width + 4);
Object[][] data = ((FeatureTableModel) table.getModel()).getData();
for (int i = 0; i < data.length; i++)
{
- data[i][2] = !(Boolean) data[i][2];
+ data[i][SHOW_COLUMN] = !(Boolean) data[i][SHOW_COLUMN];
}
- af.alignPanel.paintAlignment(true, true);
+ updateFeatureRenderer(data, true);
+ table.repaint();
}
public void orderByAvWidth()
autoIdWidth.setSelected(Cache.getDefault("FIGURE_AUTOIDWIDTH", false));
userIdWidth.setEnabled(!autoIdWidth.isSelected());
userIdWidthlabel.setEnabled(!autoIdWidth.isSelected());
- Integer wi = Cache.getIntegerProperty("FIGURE_USERIDWIDTH");
+ Integer wi = Cache.getIntegerProperty("FIGURE_FIXEDIDWIDTH");
userIdWidth.setText(wi == null ? "" : wi.toString());
// TODO: refactor to use common enum via FormatAdapter and allow extension
// for new flat file formats
Cache.applicationProperties.setProperty("FIGURE_AUTOIDWIDTH",
Boolean.toString(autoIdWidth.isSelected()));
userIdWidth_actionPerformed();
- Cache.applicationProperties.setProperty("FIGURE_USERIDWIDTH",
+ Cache.applicationProperties.setProperty("FIGURE_FIXEDIDWIDTH",
userIdWidth.getText());
/*
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:
if (raiseAssert)
{
Assert.fail(message
- + " DBRefEntry for sequence in alignment had map to sequence not in dataset");
+ + " DBRefEntry " + dbr + " for sequence "
+ + seqds
+ + " in alignment has map to sequence not in dataset");
}
return false;
}
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<>();
Map<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)