<tstamp prefix="build">
<format property="date" pattern="dd MMMM yyyy" />
</tstamp>
+ <exec executable="/usr/bin/git" outputproperty="git.commit" failifexecutionfails="false">
+ <arg value="rev-parse"/>
+ <arg value="--short"/>
+ <arg value="HEAD"/>
+ </exec>
+ <exec executable="/usr/bin/git" outputproperty="git.branch" failifexecutionfails="false">
+ <arg value="rev-parse"/>
+ <arg value="--abbrev-ref"/>
+ <arg value="HEAD"/>
+ </exec>
<properties file="${outputDir}/.build_properties">
<header>
---Jalview Build Details---
</header>
<property name="VERSION" value="${JALVIEW_VERSION}" />
- <property name="INSTALLATION" value="${INSTALLATION}" />
+ <property name="INSTALLATION" value="${INSTALLATION} git-commit:${git.commit} [${git.branch}]" />
<property name="BUILD_DATE" value="${build.date}" />
</properties>
</target>
<script src="javascript/deployJava.js"></script>
-<script src="jmol/Jmol.js"></script>
+<script src="jmol/Jmol2.js"></script>
<script src="javascript/jquery-1.4.4.min.js"></script>
<script src="javascript/jquery.timer.js"></script>
<script src="javascript/jquery.blockUI.js"></script>
<script language="JavaScript">
+// instead of this, we use a custom JmolApplet spec
+// jmolInitialize('jmol');
jmolInitialize("","JmolApplet-14.2.14_2015.06.11.jar");
-function genHref()
-{
- var s1 = "ml:i@midd..", s2 = "atelcpoueau", s3 = "iomyob.neck", href="";
- for(i=0; i<11; i++)
- { href = href + s1.charAt(i) + s2.charAt(i) + s3.charAt(i);
- }
- window.location=href;
-}
-
+</script>
+<script>
var loglevel=1;
function dbg(lvl,string) {
if (_console && lvl<=loglevel) {_console.value += string + "\n";}
//jvfollower = document.getElementById("jvA");
//setConsole(document.getElementById("stdout"));
- //sep = jvfollower.getSeparator();
+ // sep = jvfollower.getSeparator();
//jvapp.setSeparator(""+jvapp.getSeparator());
// linkJvJmol(jvfollower, "jmolView", modeltofiles);
// };
var sep = applet.getSeparator();
var oldjm=jmolView;
// recover full id of Jmol applet
- jmolView=_jmolGetApplet(jmolView).id;
+// jmolView=_jmolGetApplet(jmolView).id; // Jmol 12.4
+ jmolView=jmolFindTarget(jmolView).id; // Jmol 14.2.14
var jmbinding=_jvjmols.get(jmolView);
if (!jmbinding)
{
--- /dev/null
+/* \r
+\r
+Jmol2.js (JSmol version)\r
+author: Bob Hanson hansonr@stolaf.edu 5/24/2013 12:06:25 PM\r
+\r
+Script replacement for legacy Jmol.js that uses JSmol instead.\r
+Can be used to turn most legacy Jmol.js-based sites to JSmol.\r
+\r
+BH 1/16/2014 10:33:46 PM adding serverURL indication, more notes\r
+BH 1/13/2014 11:14:12 AM incorrect default for missing jmolInitialize() (should be ".")\r
+BH 1/8/2014 5:56:15 AM simplified instructions; removed option for self.Info\r
+BH 11/12/2013 6:34:22 AM adds jmolAppletInline()\r
+BH 9/23/2013 10:07:16 PM adds set of loadInline functions\r
+BH 9/19/2013 7:09:41 AM fixed jmolSetTarget() to accept "0" as a suffix; use of undefined --> null\r
+\r
+Summary:\r
+\r
+You should not have to change any of your HTML pages.\r
+You are going to replace Jmol.js, wherever that is, with this file.\r
+You are going to replace all your JAR file with the ones in this distribution.\r
+You are going to add about 1000 files in the jsmol/j2s directory to your website. \r
+ Don't worry; only a few will be called. But you won't know which ones.\r
+You will be able to switch from HTML5 to JAVA using ?_USE=SIGNED in the URL\r
+\r
+Procedure:\r
+\r
+1a) If you want to use HTML5, copy all jsmol/j2s/* files into a j2s subdirectory \r
+ in the directory that contains Jmol.js and your old Jmol jar files.\r
+\r
+1b) If you are not using HTML5, change the "use" parameter below from "HTML5" to "JAVA" and save this file.\r
+ Copy all the jsmol/java/* files into the directory containing your current JAR files. This adds\r
+ four JNLP files as well and will replace all your JAR files.\r
+\r
+2) Rename your current Jmol.js file Jmol_old.js in case you want to undo this.\r
+\r
+3) Concatenate Jmol.min.js if you are not using jQuery (or Jmol.min.nojq.js if you are)\r
+ with this file to form a new file (Jmol.min.js first, then Jmol2.js) and replace your\r
+ current Jmol.js with it. Note that if you are using your own version of jQuery, it\r
+ must be version 1.9 or higher, and note that 2.0 or higher will not work with MSIE\r
+ used locally but accessing remote resources. See http://bugs.jquery.com/ticket/14876\r
+ \r
+4) Try your page and see how it goes. You may still have some problems, because not all of the \r
+ methods in the original Jmol.js are included here. Let me know if that's the case.\r
+\r
+If you wish to change the directories your j2s or JAR files and override the default settings\r
+(old JAR file location; j2s directory in the directory of those JAR files) and thus override\r
+your current settings in your HTML files, then you can to that three ways:\r
+\r
+a) You can change the parameters below to override what your pages already use by uncommenting\r
+ one or the other of the jarPath and j2sPath definitions. This will override jmolInitialize\r
+ in ALL your HTML files. \r
+ \r
+b) You can change your jmolInitialization call in an individual HTML file. This sets both \r
+ the JAR path and the j2s path (as [jarPath]/j2s) together.\r
+\r
+c) You can add lines to an individual HTML file along the lines of:\r
+\r
+ Jmol.Info.jarPath = "../../Jmol"\r
+ Jmol.Info.j2sPath = "../../JSmol"\r
+\r
+ or whatever. This will override jmolInitialize in that specific HTML file only. \r
+ \r
+Note that: \r
+\r
+ -- FireFox works great. You will be able to read binary files from your local machine\r
+ -- Chrome can only read local files if started with the --allow-file-access-from-files flag\r
+ and even then the files must be ASCII, not binary.\r
+ -- MSIE and Safari cannot work with local pages\r
+\r
+*/\r
+\r
+Jmol.Info = { \r
+ // uncomment one or more of these next lines only if you want to override jmolInitialize()\r
+ //jarPath: "java", \r
+ //jarFile: "JmolAppletSigned0.jar", \r
+ //j2sPath: "j2s", \r
+ use: "HTML5", // could be JAVA or HTML5\r
+ // the serverURL path is only used to load binary files in Safari, Chrome, and MSIE\r
+ serverURL: "http://your.server.here/jsmol.php", // required for binary file loading (Spartan, .gz, .map, etc.)\r
+ disableJ2SLoadMonitor: false,\r
+ disableInitialConsole: true\r
+\r
+}\r
+\r
+////////// private functions /////////////\r
+\r
+var _jmol = {\r
+ appletCount: 0,\r
+ applets: {},\r
+ allowedJmolSize: [25, 2048, 300], // min, max, default (pixels)\r
+ codebase: ".",\r
+ targetSuffix: 0,\r
+ target: "jmolApplet0",\r
+ buttonCount: 0,\r
+ checkboxCount: 0,\r
+ linkCount: 0,\r
+ cmdCount: 0,\r
+ menuCount: 0,\r
+ radioCount: 0,\r
+ radioGroupCount: 0,\r
+ initialized: false,\r
+ initChecked: false,\r
+ archivePath: "JmolAppletSigned0.jar"\r
+}\r
+\r
+function _jmolApplet(size, inlineModel, script, nameSuffix) {\r
+ nameSuffix == null && (nameSuffix = _jmol.appletCount);\r
+ var id = "jmolApplet" + nameSuffix;\r
+ jmolSetTarget(nameSuffix);\r
+ ++_jmol.appletCount;\r
+ script || (script = "select *");\r
+ inlineModel && (script = 'load DATA "inline"\n' + inlineModel + '\nEND "inline";' + script); \r
+ var Info = {}\r
+ for (var i in Jmol.Info)\r
+ Info[i] = Jmol.Info[i]\r
+ Info.jarFile || (Info.jarFile = _jmol.archivePath);\r
+ Info.jarPath || (Info.jarPath = _jmol.codebase);\r
+ Info.j2sPath || (Info.j2sPath = Info.jarPath + "/j2s"); \r
+ var sz = _jmolGetAppletSize(size);\r
+ Info.width || (Info.width = sz[0]);\r
+ Info.height || (Info.height = sz[1]); \r
+ Info.script || (Info.script = script);\r
+ Info.isSigned == null && (Info.isSigned = (Info.jarFile.indexOf("Signed") >= 0));\r
+ for (var i in _jmol.params)\r
+ if(_jmol.params[i]!="")\r
+ Info[i] || (Info[i] = _jmol.params[i]);\r
+// alert(JSON.stringify(Info).replace(/\,/g,"\n\n\n\n"))\r
+ return _jmol.applets[id] = Jmol.getApplet(id, Info)\r
+}\r
+\r
+function _jmolGetJarFilename(fileNameOrFlag) {\r
+ _jmol.archivePath =\r
+ (typeof(fileNameOrFlag) == "string" ? fileNameOrFlag : (fileNameOrFlag ? "JmolAppletSigned" : "JmolApplet") + "0.jar");\r
+}\r
+\r
+////////////////////////////////////////////////////////////////\r
+// Legacy Scripting API\r
+////////////////////////////////////////////////////////////////\r
+\r
+function jmolSetParameter(key,value) {\r
+ Jmol.Info[key] = value;\r
+}\r
+\r
+function jmolSetXHTML(id) {\r
+ Jmol.setXHTML(id);\r
+}\r
+\r
+function jmolSetTranslation(TF) {\r
+ // n/a\r
+}\r
+\r
+function jmolInitialize(codebaseDirectory, fileNameOrUseSignedApplet) {\r
+ if (_jmol.initialized)\r
+ return;\r
+ _jmol.initialized = true;\r
+ if(_jmol.jmoljar) {\r
+ var f = _jmol.jmoljar;\r
+ if (f.indexOf("/") >= 0) {\r
+ alert ("This web page URL is requesting that the applet used be " + f + ". This is a possible security risk, particularly if the applet is signed, because signed applets can read and write files on your local machine or network.")\r
+ var ok = prompt("Do you want to use applet " + f + "? ","yes or no")\r
+ if (ok == "yes") {\r
+ codebaseDirectory = f.substring(0, f.lastIndexOf("/"));\r
+ fileNameOrUseSignedApplet = f.substring(f.lastIndexOf("/") + 1);\r
+ } else {\r
+ _jmolGetJarFilename(fileNameOrUseSignedApplet);\r
+ alert("The web page URL was ignored. Continuing using " + _jmol.archivePath + ' in directory "' + codebaseDirectory + '"');\r
+ }\r
+ } else {\r
+ fileNameOrUseSignedApplet = f;\r
+ }\r
+ }\r
+ _jmol.codebase = codebaseDirectory;\r
+ _jmolGetJarFilename(fileNameOrUseSignedApplet);\r
+}\r
+\r
+function jmolSetDocument(doc) {\r
+ _jmol.currentDocument = doc;\r
+}\r
+\r
+function jmolSetAppletColor(boxbgcolor, boxfgcolor, progresscolor) {\r
+ Jmol.Info.color = boxbgcolor ? boxbgcolor : "black";\r
+}\r
+\r
+function jmolSetAppletWindow(w) {\r
+ _jmol.appletWindow = w;\r
+}\r
+\r
+function jmolApplet(size, script, nameSuffix) {\r
+ return _jmolApplet(size, null, script, nameSuffix);\r
+}\r
+\r
+function jmolAppletInline(size, inlineModel, script, nameSuffix) {\r
+ return _jmolApplet(size, inlineModel, script, nameSuffix);\r
+}\r
+\r
+\r
+\r
+////////////////////////////////////////////////////////////////\r
+// Basic controls\r
+////////////////////////////////////////////////////////////////\r
+\r
+function jmolButton(script, label, id, title) {\r
+ return Jmol.jmolButton(_jmol.target, script, label, id, title);\r
+}\r
+\r
+function jmolCheckbox(scriptWhenChecked, scriptWhenUnchecked, labelHtml, isChecked, id, title) {\r
+ return Jmol.jmolCheckbox(_jmol.target, scriptWhenChecked, scriptWhenUnchecked, labelHtml, isChecked, id, title)\r
+}\r
+\r
+function jmolRadioGroup(arrayOfRadioButtons, separatorHtml, groupName, id, title) {\r
+ return Jmol.jmolRadioGroup(_jmol.target, arrayOfRadioButtons, separatorHtml, groupName, id, title)\r
+}\r
+\r
+\r
+function jmolRadio(script, labelHtml, isChecked, separatorHtml, groupName, id, title) {\r
+ return Jmol.jmolRadio(_jmol.target, script, labelHtml, isChecked, separatorHtml, groupName, id, title)\r
+}\r
+\r
+function jmolLink(script, label, id, title) {\r
+ return Jmol.jmolLink(_jmol.target, script, label, id, title)\r
+}\r
+\r
+function jmolCommandInput(label, size, id, title) {\r
+ return Jmol.jmolCommandInput(_jmol.target, label, size, id, title);\r
+}\r
+\r
+function jmolMenu(arrayOfMenuItems, size, id, title) {\r
+ return Jmol.jmolMenu(_jmol.target, arrayOfMenuItems, size, id, title);\r
+}\r
+\r
+function jmolHtml(html) {\r
+ return Jmol._documentWrite(html);\r
+}\r
+\r
+function jmolBr() {\r
+ return Jmol._documentWrite("<br />");\r
+}\r
+\r
+////////////////////////////////////////////////////////////////\r
+// advanced scripting functions\r
+////////////////////////////////////////////////////////////////\r
+\r
+function jmolDebugAlert(enableAlerts) {\r
+ // n/a\r
+}\r
+\r
+\r
+function jmolLoadInline(model, targetSuffix) {\r
+ return jmolLoadInlineScript(model, null, targetSuffix, false)\r
+}\r
+\r
+function jmolLoadInlineArray(ModelArray, script, targetSuffix) {\r
+ return jmolLoadInlineScript(ModelArray.join("\n"), script, targetSuffix, false)\r
+}\r
+\r
+function jmolAppendInlineArray(ModelArray, script, targetSuffix) {\r
+ return jmolLoadInlineScript(ModelArray.join("\n"), script, targetSuffix, true)\r
+}\r
+\r
+function jmolAppendInlineScript(model, script, targetSuffix) {\r
+ return jmolLoadInlineScript(model, script, targetSuffix, true)\r
+}\r
+\r
+function jmolLoadInlineScript(model, script, targetSuffix, isAppend) {\r
+ Jmol.script(jmolFindTarget(targetSuffix),\r
+ "load " \r
+ + (isAppend ? "APPEND " : "") \r
+ + "DATA 'mydata'\n" + model.replace(/\"/g,'\\"') + "\nEND 'mydata'\n")\r
+}\r
+\r
+function jmolSetTarget(targetSuffix) {\r
+ targetSuffix == null || (_jmol.targetSuffix = targetSuffix);\r
+ return _jmol.target = "jmolApplet" + _jmol.targetSuffix;\r
+}\r
+\r
+function jmolFindTarget(targetSuffix) {\r
+ return _jmol.applets[jmolSetTarget(targetSuffix)];\r
+}\r
+\r
+function jmolScript(script, targetSuffix) {\r
+ Jmol.script(jmolFindTarget(targetSuffix), script)\r
+}\r
+\r
+function jmolCheckBrowser(action, urlOrMessage, nowOrLater) {\r
+ // unnecessary\r
+}\r
+\r
+////////////////////////////////////////////////////////////////\r
+// Cascading Style Sheet Class support\r
+////////////////////////////////////////////////////////////////\r
+\r
+function jmolSetAppletCssClass(appletCssClass) {\r
+ Jmol.setAppletCss(appletCssClass)\r
+}\r
+\r
+function jmolSetButtonCssClass(s) {\r
+ Jmol.setButtonCss(s)\r
+}\r
+\r
+function jmolSetCheckboxCssClass(s) {\r
+ Jmol.setCheckboxCss(s)\r
+}\r
+\r
+function jmolSetRadioCssClass(s) {\r
+ Jmol.setRadioCss(s)\r
+}\r
+\r
+function jmolSetLinkCssClass(s) {\r
+ Jmol.setLinkCss(s)\r
+}\r
+\r
+function jmolSetMenuCssClass(s) {\r
+ Jmol.setMenuCss(s)\r
+}\r
+\r
+function jmolSetMemoryMb(nMb) {\r
+ // n/a\r
+}\r
+\r
+\r
+function jmolSetCallback(callbackName,funcName) {\r
+//if(!self[funcName])alert(funcName + " is not defined yet in jmolSetCallback")\r
+ Jmol.Info[callbackName] = funcName\r
+ //document.title=("jmolSetCallback " + callbackName + "/" + funcName + " must be included in Info definition")\r
+}\r
+\r
+function jmolSetSyncId(n) {\r
+ alert("jmolSetSyncId " + n + " must be included in Info definition")\r
+}\r
+\r
+function jmolSetLogLevel(n) {\r
+ Jmol.script(_jmol.target, "set loglevel " + n)\r
+}\r
+\r
+function _jmolGetAppletSize(size, units) {\r
+ var width, height;\r
+ if ( (typeof size) == "object" && size != null ) {\r
+ width = size[0]; height = size[1];\r
+ } else {\r
+ width = height = size;\r
+ }\r
+ return [_jmolFixDim(width, units), _jmolFixDim(height, units)];\r
+}\r
+\r
+function _jmolFixDim(x, units) {\r
+ var sx = "" + x;\r
+ return (sx.length == 0 ? (units ? "" : _jmol.allowedJmolSize[2])\r
+ : sx.indexOf("%") == sx.length-1 ? sx\r
+ : (x = parseFloat(x)) <= 1 && x > 0 ? x * 100 + "%"\r
+ : (isNaN(x = Math.floor(x)) ? _jmol.allowedJmolSize[2]\r
+ : x < _jmol.allowedJmolSize[0] ? _jmol.allowedJmolSize[0]\r
+ : x > _jmol.allowedJmolSize[1] ? _jmol.allowedJmolSize[1]\r
+ : x) + (units ? units : ""));\r
+}\r
+\r
+//////////user property/status functions/////////\r
+\r
+function jmolGetStatus(strStatus,targetSuffix){\r
+ return Jmol.getStatus(jmolFindTarget(targetSuffix), strStatus)\r
+}\r
+\r
+function jmolGetPropertyAsArray(sKey,sValue,targetSuffix) {\r
+ return Jmol.getPropertyAsArray(jmolFindTarget(targetSuffix), sKey, sValue)\r
+}\r
+\r
+function jmolGetPropertyAsString(sKey,sValue,targetSuffix) {\r
+ return Jmol.getPropertyAsString(jmolFindTarget(targetSuffix), sKey, sValue)\r
+}\r
+\r
+function jmolGetPropertyAsJSON(sKey,sValue,targetSuffix) {\r
+ return Jmol.getPropertyAsJSON(jmolFindTarget(targetSuffix), sKey, sValue)\r
+}\r
+\r
+function jmolGetPropertyAsJavaObject(sKey,sValue,targetSuffix) {\r
+ return Jmol.getPropertyAsJavaObject(jmolFindTarget(targetSuffix), sKey, sValue)\r
+}\r
+\r
+///////// synchronous scripting ////////\r
+\r
+function jmolScriptWait(script, targetSuffix) {\r
+ return Jmol.scriptWait(jmolFindTarget(targetSuffix), script)\r
+}\r
+\r
+function jmolScriptWaitOutput(script, targetSuffix) {\r
+ return Jmol.scriptWaitOutput(jmolFindTarget(targetSuffix), script)\r
+}\r
+\r
+function jmolEvaluate(molecularMath, targetSuffix) {\r
+ return Jmol.evaluate(jmolFindTarget(targetSuffix), molecularMath)\r
+}\r
+\r
+function jmolScriptEcho(script, targetSuffix) {\r
+ return Jmol.scriptEcho(jmolFindTarget(targetSuffix), script)\r
+}\r
+\r
+\r
+function jmolScriptMessage(script, targetSuffix) {\r
+ return Jmol.scriptMessage(jmolFindTarget(targetSuffix), script)\r
+}\r
+\r
+\r
+function jmolScriptWaitAsArray(script, targetSuffix) {\r
+ return Jmol.scriptWait(jmolFindTarget(targetSuffix), script)\r
+}\r
+\r
+\r
+\r
+//////////// save/restore orientation /////////////\r
+\r
+function jmolSaveOrientation(id, targetSuffix) {\r
+ return Jmol.saveOrientation(jmolFindTarget(targetSuffix), id)\r
+}\r
+\r
+function jmolRestoreOrientation(id, targetSuffix) {\r
+ return Jmol.restoreOrientation(jmolFindTarget(targetSuffix), id)\r
+}\r
+\r
+function jmolRestoreOrientationDelayed(id, delay, targetSuffix) {\r
+ return Jmol.restoreOrientationDelayed(jmolFindTarget(targetSuffix), id, delay)\r
+}\r
+\r
+function jmolResizeApplet(size, targetSuffix) {\r
+ return Jmol.resizeApplet(jmolFindTarget(targetSuffix), size);\r
+}\r
+\r
+\r
+//////////// add parameter /////////////\r
+\r
+function jmolAppletAddParam(appletCode,name,value){\r
+ alert ("use Info to add a parameter: " + name + "/" + value)\r
+}\r
+\r
<li><a href="#annrowprops">ROWPROPERTIES</a> control the display of individual annotation rows</li>
<li><a href="#groupdefs">SEQUENCE_GROUP</a> to define groups of sequences for further annotation</li>
<li><a href="#groupprops">PROPERTIES</a> to set visualisation properties for sequence groups</li>
-<li><a href="#seqgrprefs">SEQUENCE_REF and GROUP_REF</a> for attaching annotation to sequences and groups</li>
+<li><a href="#seqgrprefs">SEQUENCE_REF and GROUP_REF</a> for specifying target sequences and groups for annotation, reference sequence and column visibilty commands.</li>
<li><a href="#refsandviews">VIEW_SETREF, VIEW_HIDECOLS and HIDE_INSERTIONS</a>
- for defining a reference sequence on the alignment and hiding regions
- based on gaps in a reference sequence</li>
+ for assigning the reference sequence on the alignment and hiding columns.</li>
</ul>
<p>
At the end of this document, you can also find notes on <a
<ul><em>Please note: URL links embedded in HTML descriptions are not yet supported.</em>
</ul>
</p>
- <p>The final <em>Values</em>
- field contains a series of "|" separated value fields. Each
- value field is itself a comma separated list of fields of a particular
- type defined by the annotation row's <em>GRAPH_TYPE</em>. The allowed values of
- <em>GRAPH_TYPE</em> and corresponding interpretation of each <em>Value</em> are shown below:
+ <p>
+ The final <em>Values</em> field contains a series of "|"
+ separated value fields. Each value field is itself a comma separated
+ list of fields of a particular type defined by the annotation row's <em>GRAPH_TYPE</em>.
+ The allowed values of <em>GRAPH_TYPE</em> and corresponding
+ interpretation of each <em>Value</em> are shown below:
<ul>
- <li><strong>BAR_GRAPH</strong><br> Plots a histogram with labels below each
- bar.<br> <em>number</em>,<em>text character</em>,<em>Tooltip
- text</em>
- </li>
- <li><strong>LINE_GRAPH</strong><br> Draws a line between values on the
- annotation row.<br> <em>number</em>
- </li>
- <li><strong>NO_GRAPH</strong><br>For a row consisting of text labels and/or
- secondary structure symbols.<br><em>{Secondary Structure
- Symbol}</em>,<em>text label</em>,<em>Tooltip text</em><br/><br/>The type of secondary structure symbol depends on the alignment being annotated being either Protein or RNA. <br/>For proteins, structure symbols are <em>H</em> (for
- helix) and <em>E</em> (for strand)<br/><br/>For RNA, VIENNA, WUSS or extended notation can be used to specify positions that are paired (e.g. "(|(||)|)" or "|A|A|A|(|a|a|a|)")</li>
+ <li><strong>BAR_GRAPH</strong><br> Plots a histogram with
+ labels below each bar.<br> <em>number</em>,<em>text
+ character</em>,<em>Tooltip text</em></li>
+ <li><strong>LINE_GRAPH</strong><br> Draws a line between
+ values on the annotation row.<br> <em>number</em></li>
+ <li><strong>NO_GRAPH</strong><br>For a row consisting of
+ text labels and/or secondary structure symbols.<br> <em>{Secondary
+ Structure Symbol}</em>,<em>text label</em>,<em>Tooltip text</em><br /> <br />The
+ type of secondary structure symbol depends on the alignment being
+ annotated being either Protein or RNA. <br />For proteins, structure
+ symbols are <em>H</em> (for helix) and <em>E</em> (for strand)<br />
+ <br />For RNA structures, VIENNA, WUSS, and extended notations can
+ be used to specify paired positions.
+ <ul>e.g. "(|(||)|)" or "|A|A|A|(|a|a|a|)")
+ </ul></li>
</ul>
Any or all value fields may be left empty, as well as the BAR_GRAPH's
-text character field, and either or both of the text-label and secondary
-structure symbol fields of the NO_GRAPH type annotation rows.</p>
+ text character field, and either or both of the text-label and
+ secondary structure symbol fields of the NO_GRAPH type annotation rows.
+ </p>
<p>Color strings can be embedded in a value field by enclosing an RGB triplet in square brackets to colour that position in an annotation row.
</p>
<hr/>
</p>
<hr/>
<p><strong><a name="refsandviews">VIEW_SETREF, VIEW_HIDECOL and HIDE_INSERTIONS</a></strong><br/>
-Since Jalview 2.9, the Annotations file has also supported the definition of reference sequences and hidden regions for an alignment view.</p>
+Since Jalview 2.9, the Annotations file has also supported the definition of reference sequences and hidden regions for an alignment view.</p>
<!-- <p>
<em>VIEW_DEF</em> allows the current view to be named according to the
first argument after the tab character. If a second argument is
properties.
</p> -->
<p>
- <em>VIEW_SETREF</em> takes either a single sequence ID string, or a
- numeric index (second argument), and attempts to assign a
- corresponding sequence as the <a href="../features/refsequence.html">reference
+ <em>VIEW_SETREF</em> marks the first sequence in the alignment, or
+ alternately, the one specified by the most recent <em>SEQUENCE_REF</em>
+ statement, as the <a href="../features/refsequence.html">reference
sequence</a> for the alignment.
</p>
- <em>VIEW_HIDECOLS</em> takes either a single argument consisting of a
- comma separated series of integer pairs like
- <em>3-4</em>. These integer pairs define columns (starting from the
- left-hand column 0) that should be marked as hidden in the alignment
- view.
+ <p>
+ <em>HIDE_INSERTIONS</em>This command hides all gapped positions in the
+ current target sequence. Any columns already hidden will be
+ re-displayed.<br />
+ <br>The current target sequence is either the one specified by
+ the most recent <em>SEQUENCE_REF</em> statement, the alignment's
+ reference sequence, or the first sequence in the alignment.
</p>
<p>
- <em>HIDE_INSERTIONS</em> takes a either a single sequence ID or a
- numeric index, or no arguments. This command marks all gapped
- positions in a specified sequence (either the one located by the
- arguments, the current SEQUENCE_REF, or the reference sequence for the
- view).
+ <em>VIEW_HIDECOLS</em> modifies the visibility of columns in the view.
+ The statement is followed by a single argument consisting of a comma
+ separated series of single integers or integer pairs (like <em>3-4</em>).
+ These define columns (starting from the left-hand column 0) that
+ should be marked as hidden in the alignment view.
+ </p>
+
<hr/>
<p><strong><a name="compatibility">COMPATIBILITY NOTES</a></strong><br/>
The interpretation of the COMBINE statement in <em>Version 2.8.1</em> was refined
<p/>If compatible sequences are present in the input alignments, Jalview will open a Split Frame view.<br/>
If not, only the first alignment will be opened (an error message is written to the Java console).
-<p><em>Split Frame Views were introduced in Jalview 2.9</em></p>
+ <p>
+ <em>Split Frame Views were introduced in Jalview 2.9</em>
+ </p>
+ <p>
+ Example files for cDNA/Protein: <a
+ href="http://www.jalview.org/builds/nextrel/examples/estrogenReceptorProtein.fa">estrogenReceptorProtein.fa</a>
+ and <a
+ href="http://www.jalview.org/builds/nextrel/examples/estrogenReceptorCdna.fa">estrogenReceptorCdna.fa</a>
+ taken from xxx.
+ </p>
</body>
</html>
action.save_image = Save Image
action.paste = Paste
action.show_html_source = Show HTML Source
-action.print = Print
+action.print = Print...
action.web_service = Web Service
action.cancel_job = Cancel Job
action.start_job = Start Job
action.quit = Quit
action.expand_views = Expand Views
action.gather_views = Gather Views
-action.page_setup = Page Setup
+action.page_setup = Page Setup...
action.reload = Reload
action.load = Load
action.open = Open
action.right_justify_alignment = Right Justify Alignment
action.boxes = Boxes
action.text = Text
-action.by_pairwise_id = by Pairwise Identity
-action.by_id = by Id
-action.by_length = by Length
-action.by_group = by Group
+action.by_pairwise_id = By Pairwise Identity
+action.by_id = By Id
+action.by_length = By Length
+action.by_group = By Group
action.unmark_as_reference = Unmark as Reference
action.set_as_reference = Set as Reference
action.remove = Remove
action.remove_redundancy = Remove Redundancy...
-action.pairwise_alignment = Pairwise Alignments...
-action.by_rna_helixes = by RNA Helices
+action.pairwise_alignment = Pairwise Alignment
+action.by_rna_helixes = By RNA Helices
action.user_defined = User Defined...
action.by_conservation = By Conservation
action.wrap = Wrap
action.sort = Sort
action.calculate_tree = Calculate Tree
action.help = Help
-action.by_annotation = by Annotation...
+action.by_annotation = By Annotation...
action.invert_sequence_selection = Invert Sequence Selection
action.invert_column_selection = Invert Column Selection
action.show = Show
action.close = Close
action.add = Add
action.save_as_default = Save as default
-action.save_as = Save as
+action.save_as = Save as...
action.save = Save
action.cancel_fetch = Cancel Fetch
action.save_omit_hidden_columns = Save / Omit Hidden Regions
label.documentation = Documentation
label.about = About...
label.show_sequence_limits = Show Sequence Limits
-label.feature_settings = Feature Settings...
+action.feature_settings = Feature Settings...
+label.feature_settings = Feature Settings
label.all_columns = All Columns
label.all_sequences = All Sequences
label.selected_columns = Selected Columns
label.select_das_service_from_table = Select a DAS service from the table to read a full description here.</font></html>
label.session_update = Session Update
label.new_vamsas_session = New Vamsas Session
-label.load_vamsas_session = Load Vamsas Session
-label.save_vamsas_session = Save Vamsas Session
+action.load_vamsas_session = Load Vamsas Session...
+action.save_vamsas_session = Save Vamsas Session
label.select_vamsas_session_opened_as_new_vamsas_session= Select a vamsas session to be opened as a new vamsas session.
label.open_saved_vamsas_session = Open a saved VAMSAS session
label.groovy_console = Groovy Console...
label.structure_type = Structure type
label.settings_for_type = Settings for {0}
label.view_full_application = View in Full Application
-label.load_associated_tree = Load Associated Tree ...
-label.load_features_annotations = Load Features/Annotations ...
-label.export_features = Export Features ...
-label.export_annotations = Export Annotations ...
+label.load_associated_tree = Load Associated Tree...
+label.load_features_annotations = Load Features/Annotations...
+label.export_features = Export Features...
+label.export_annotations = Export Annotations...
label.to_upper_case = To Upper Case
label.to_lower_case = To Lower Case
label.toggle_case = Toggle Case
-label.edit_name_description = Edit Name/Description ...
-label.create_sequence_feature = Create Sequence Feature ...
+label.edit_name_description = Edit Name/Description...
+label.create_sequence_feature = Create Sequence Feature...
label.edit_sequence = Edit Sequence
label.edit_sequences = Edit Sequences
label.sequence_details = Sequence Details
label.window = Window
label.preferences = Preferences
label.tools = Tools
-label.fetch_sequences = Fetch Sequence(s)
+label.fetch_sequences = Fetch Sequences
+action.fetch_sequences = Fetch Sequences...
label.stop_vamsas_session = Stop Vamsas Session
label.collect_garbage = Collect Garbage
label.show_memory_usage = Show Memory Usage
label.view_all_representative_structures = View all {0} representative structures.
label.open_new_jmol_view_with_all_representative_structures_associated_current_selection_superimpose_using_alignment = Opens a new structure viewer with all representative structures\nassociated with the current selection\nsuperimposed with the current alignment.
label.associate_structure_with_sequence = Associate Structure with Sequence
-label.from_file = from file
+label.from_file = From File
label.enter_pdb_id = Enter PDB Id
-label.discover_pdb_ids = Discover PDB ids
+label.discover_pdb_ids = Discover PDB IDs
label.text_colour = Text Colour
+action.set_text_colour = Text Colour...
label.structure = Structure
label.view_structure = View Structure
label.view_protein_structure = View Protein Structure
-label.show_pdbstruct_dialog = 3D Structure Data ...
+label.show_pdbstruct_dialog = 3D Structure Data...
label.view_rna_structure = VARNA 2D Structure
label.clustalx_colours = Clustalx colours
label.above_identity_percentage = Above % Identity
label.set_as_default = Set as Default
label.show_labels = Show labels
label.background_colour = Background Colour
+action.background_colour = Background Colour...
label.associate_nodes_with = Associate Nodes With
label.jalview_pca_calculation = Jalview PCA Calculation
label.link_name = Link Name
label.pdb_file = PDB file
label.colour_with_jmol = Colour with Jmol
label.colour_with_chimera = Colour with Chimera
-label.align_structures = Align structures
+label.align_structures = Align Structures
label.jmol = Jmol
label.chimera = Chimera
label.sort_alignment_by_tree = Sort Alignment By Tree
label.save_colour_scheme_with_unique_name_added_to_colour_menu = Save your colour scheme with a unique name and it will be added to the Colour menu
label.case_sensitive = Case Sensitive
label.lower_case_colour = Lower Case Colour
-label.index_by_host = Index by host
-label.index_by_type = Index by type
+label.index_by_host = Index by Host
+label.index_by_type = Index by Type
label.enable_jabaws_services = Enable JABAWS Services
-label.display_warnings = Display warnings
-label.move_url_up = Move URL up
-label.move_url_down = Move URL down
-label.add_sbrs_definition = Add a SBRS definition
-label.edit_sbrs_definition = Edit SBRS definition
-label.delete_sbrs_definition = Delete SBRS definition
+label.display_warnings = Display Warnings
+label.move_url_up = Move URL Up
+label.move_url_down = Move URL Down
+label.add_sbrs_definition = Add a SBRS Definition
+label.edit_sbrs_definition = Edit SBRS Definition
+label.delete_sbrs_definition = Delete SBRS Definition
label.your_sequences_have_been_verified = Your sequences have been verified against known sequence databases. Some of the ids have been\n altered, most likely the start/end residue will have been updated.\n Save your alignment to maintain the updated id.\n\n
label.sequence_names_updated = Sequence names updated
label.dbref_search_completed = DBRef search completed
label.paste_new_window = Paste To New Window
label.settings_for_param = Settings for {0}
label.view_params = View {0}
+label.aacon_calculations = AACon Calculations
+label.aacon_settings = Change AACon Settings...
+tooltip.aacon_calculations = When checked, AACon calculations are updated automatically.
+tooltip.aacon_settings = Modify settings for AACon calculations.
+label.rnalifold_calculations = RNAAliFold Prediction
+label.rnalifold_settings = Change RNAAliFold settings...
+tooltip.rnalifold_calculations = When checked, RNA secondary structure predictions will be calculated for the alignment, and updated when edits are made.
+tooltip.rnalifold_settings = Modify settings for the RNAAliFold prediction. Use this to hide or show different results of the RNA calculation, and change RNA folding parameters.
label.all_views = All Views
label.align_sequences_to_existing_alignment = Align sequences to an existing alignment
label.realign_with_params = Realign with {0}
label.run_with_preset = Run {0} with preset
label.view_service_doc_url = <html>View <a href="{0}">{1}</a></html>
label.submit_sequence = <html>Submit {0} {1} {2} {3} to<br/>{4}</html>
-action.by_title_param = by {0}
+action.by_title_param = By {0}
label.alignment = Alignment
label.secondary_structure_prediction = Secondary Structure Prediction
label.sequence_database_search = Sequence Database Search
label.protein_disorder = Protein Disorder
label.source_from_db_source = Sources from {0}
label.from_msname = from {0}
-label.superpose_with = Superpose with ...
+label.superpose_with = Superpose with
action.do = Do
label.scale_label_to_column = Scale Label to Column
label.add_new_row = Add New Row
label.delete_all = Delete all sequences
warn.delete_all = <html>Deleting all sequences will close the alignment window.<br>Confirm deletion or Cancel.
label.add_annotations_for = Add annotations for
-label.choose_annotations = Choose annotations
+action.choose_annotations = Choose Annotations...
+label.choose_annotations = Choose Annotations
label.find = Find
label.invalid_search = Search string invalid
error.invalid_regex = Invalid regular expression
}
});
viewMenu.setText(MessageManager.getString("action.view"));
- background.setText(MessageManager.getString("label.background_colour")
- + "...");
+ background.setText(MessageManager.getString("action.background_colour"));
background.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
final String translated = ResidueProperties.codonTranslate(
codon);
/*
- * ? allow X in protein to match untranslatable in dna ?
+ * allow * in protein to match untranslatable in dna
*/
final char aaRes = aaSeqChars[aaResidue];
- if ((translated == null || "STOP".equals(translated)) && aaRes == 'X')
+ if ((translated == null || "STOP".equals(translated)) && aaRes == '*')
{
continue;
}
return 1;
}
+ // TODO how to treat sequence-related autocalculated annotation
+ boolean o1auto = o1.autoCalculated && o1.sequenceRef == null;
+ boolean o2auto = o2.autoCalculated && o2.sequenceRef == null;
/*
* Ignore label (keep existing ordering) for
* Conservation/Quality/Consensus etc
*/
- if (o1.sequenceRef == null && o2.sequenceRef == null)
+ if (o1auto && o2auto)
{
return 0;
}
+
+ /*
+ * Sort autocalculated before or after sequence-related.
+ */
+ if (o1auto)
+ {
+ return showAutocalcAbove ? -1 : 1;
+ }
+ if (o2auto)
+ {
+ return showAutocalcAbove ? 1 : -1;
+ }
int sequenceOrder = compareSequences(o1, o2);
return sequenceOrder == 0 ? compareLabels(o1, o2) : sequenceOrder;
}
+
+ @Override
+ public String toString()
+ {
+ return "Sort by sequence and label";
+ }
};
/**
return 1;
}
+ // TODO how to treat sequence-related autocalculated annotation
+ boolean o1auto = o1.autoCalculated && o1.sequenceRef == null;
+ boolean o2auto = o2.autoCalculated && o2.sequenceRef == null;
/*
* Ignore label (keep existing ordering) for
* Conservation/Quality/Consensus etc
*/
- if (o1.sequenceRef == null && o2.sequenceRef == null)
+ if (o1auto && o2auto)
{
return 0;
}
/*
- * Sort non-sequence-related before or after sequence-related.
+ * Sort autocalculated before or after sequence-related.
*/
- if (o1.sequenceRef == null)
+ if (o1auto)
{
return showAutocalcAbove ? -1 : 1;
}
- if (o2.sequenceRef == null)
+ if (o2auto)
{
return showAutocalcAbove ? 1 : -1;
}
int labelOrder = compareLabels(o1, o2);
return labelOrder == 0 ? compareSequences(o1, o2) : labelOrder;
}
+
+ @Override
+ public String toString()
+ {
+ return "Sort by label and sequence";
+ }
};
/**
- * noSort leaves sort order unchanged, within sequence- and
- * non-sequence-related annotations, but may switch the ordering of these
- * groups. Note this is guaranteed (at least in Java 7) as Arrays.sort() is
- * guaranteed to be 'stable' (not change ordering of equal items).
+ * noSort leaves sort order unchanged, within sequence- and autocalculated
+ * annotations, but may switch the ordering of these groups. Note this is
+ * guaranteed (at least in Java 7) as Arrays.sort() is guaranteed to be
+ * 'stable' (not change ordering of equal items).
*/
private Comparator<? super AlignmentAnnotation> noSort = new Comparator<AlignmentAnnotation>()
{
@Override
public int compare(AlignmentAnnotation o1, AlignmentAnnotation o2)
{
+ // TODO how to treat sequence-related autocalculated annotation
+ boolean o1auto = o1.autoCalculated && o1.sequenceRef == null;
+ boolean o2auto = o2.autoCalculated && o2.sequenceRef == null;
+ // TODO skip this test to allow customised ordering of all annotations
+ // - needs a third option: place autocalculated first / last / none
if (o1 != null && o2 != null)
{
- if (o1.sequenceRef == null && o2.sequenceRef != null)
+ if (o1auto && !o2auto)
{
return showAutocalcAbove ? -1 : 1;
}
- if (o1.sequenceRef != null && o2.sequenceRef == null)
+ if (!o1auto && o2auto)
{
return showAutocalcAbove ? 1 : -1;
}
}
return 0;
}
+
+ @Override
+ public String toString()
+ {
+ return "No sort";
+ }
};
/**
*/
package jalview.analysis;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-
import jalview.api.AlignViewportI;
import jalview.datamodel.AlignedCodon;
import jalview.datamodel.AlignedCodonFrame;
import jalview.util.MapList;
import jalview.util.ShiftList;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+
public class Dna
{
- private static final String STOP_X = "X";
+ private static final String STOP_ASTERIX = "*";
private static final Comparator<AlignedCodon> comparator = new CodonComparator();
}
if (aa.equals("STOP"))
{
- aa = STOP_X;
+ aa = STOP_ASTERIX;
}
resSize++;
}
MessageManager.getString("label.edit_sequence"));
MenuItem sequenceDetails = new MenuItem(
- MessageManager.getString("label.sequence_details") + "...");
+ MessageManager.getString("label.sequence_details"));
MenuItem selSeqDetails = new MenuItem(
- MessageManager.getString("label.sequence_details") + "...");
+ MessageManager.getString("label.sequence_details"));
MenuItem makeReferenceSeq = new MenuItem();
public void changeColour(ColourSchemeI cs)
{
- int threshold = 0;
if (cs != null)
{
}
viewport.setGlobalColourScheme(cs);
- if (alignPanel.getOverviewPanel() != null)
- {
- alignPanel.getOverviewPanel().updateOverviewImage();
- }
-
- jalview.structure.StructureSelectionManager
- .getStructureSelectionManager(viewport.applet)
- .sequenceColoursChanged(alignPanel);
-
alignPanel.paintAlignment(true);
}
MessageManager.getString("label.load_features_annotations"));
MenuItem outputFeatures = new MenuItem(
- MessageManager.getString("label.export_features").concat("..."));
+ MessageManager.getString("label.export_features"));
MenuItem outputAnnotations = new MenuItem(
- MessageManager.getString("label.export_annotations").concat("..."));
+ MessageManager.getString("label.export_annotations"));
MenuItem closeMenuItem = new MenuItem(
MessageManager.getString("action.close"));
removeAllGapsMenuItem.setLabel(MessageManager
.getString("action.remove_all_gaps"));
removeAllGapsMenuItem.addActionListener(this);
- removeRedundancyMenuItem.setLabel(MessageManager.getString(
- "action.remove_redundancy").concat("..."));
+ removeRedundancyMenuItem.setLabel(MessageManager
+ .getString("action.remove_redundancy"));
removeRedundancyMenuItem.addActionListener(this);
/*
grpsFromSelection.addActionListener(this);
createGroup.setLabel(MessageManager.getString("action.create_group"));
unGroup.setLabel(MessageManager.getString("action.remove_group"));
- annotationColumnSelection.setLabel("Select by Annotation");
+ annotationColumnSelection.setLabel(MessageManager
+ .getString("action.select_by_annotation"));
annotationColumnSelection.addActionListener(this);
/*
hideAllSelection.addActionListener(this);
showAllHidden.addActionListener(this);
featureSettings.setLabel(MessageManager
- .getString("label.feature_settings"));
+ .getString("action.feature_settings"));
featureSettings.addActionListener(this);
sequenceFeatures.setLabel(MessageManager
.getString("label.show_sequence_features"));
if (updateOverview)
{
+ // TODO: determine if this paintAlignment changed structure colours
jalview.structure.StructureSelectionManager
.getStructureSelectionManager(av.applet)
.sequenceColoursChanged(this);
}
else if (evt.getSource() == ok)
{
- changeColour();
frame.setVisible(false);
}
else if (evt.getSource() == cancel)
});
- displayName.setLabel(MessageManager.getString("label.display_name"));
+ displayName.setLabel(MessageManager.getString("label.label"));
displayName.setEnabled(false);
displayName.addItemListener(this);
height = Math.min(400, height);
int width = 300;
jalview.bin.JalviewLite.addFrame(frame,
- MessageManager.getString("label.feature_settings"), width,
+ MessageManager.getString("label.sequence_feature_settings"),
+ width,
height);
}
}
else
{
- residue = "X".equalsIgnoreCase(displayChar) ? "X"
- : ResidueProperties.aa2Triplet.get(displayChar);
+ residue = "X".equalsIgnoreCase(displayChar) ? "X" : ("*"
+ .equals(displayChar) ? "STOP" : ResidueProperties.aa2Triplet
+ .get(displayChar));
if (residue != null)
{
text.append(" Residue: ").append(residue);
{
builddate = "unknown";
version = "test";
- installation = "Webstart";
+ installation = "applet";
java.net.URL url = JalviewLite.class
.getResource("/.build_properties");
if (url != null)
*/
package jalview.gui;
-import jalview.analysis.AAFrequency;
import jalview.analysis.AlignmentSorter;
import jalview.analysis.AlignmentUtils;
-import jalview.analysis.Conservation;
import jalview.analysis.CrossRef;
import jalview.analysis.Dna;
import jalview.analysis.ParseProperties;
}
}
});
- formatMenu.add(vsel);
+ if (Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase()
+ .indexOf("devel") > -1
+ || Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase()
+ .indexOf("test") > -1)
+ {
+ formatMenu.add(vsel);
+ }
}
*/
public void changeColour(ColourSchemeI cs)
{
- // TODO: compare with applet and pull up to model method
- int threshold = 0;
+ // TODO: pull up to controller method
if (cs != null)
{
+ // Make sure viewport is up to date w.r.t. any sliders
if (viewport.getAbovePIDThreshold())
{
- threshold = SliderPanel.setPIDSliderSource(alignPanel, cs,
+ int threshold = SliderPanel.setPIDSliderSource(alignPanel, cs,
"Background");
- cs.setThreshold(threshold, viewport.isIgnoreGapsConsensus());
- }
- else
- {
- cs.setThreshold(0, viewport.isIgnoreGapsConsensus());
+ viewport.setThreshold(threshold);
}
if (viewport.getConservationSelected())
{
-
- Alignment al = (Alignment) viewport.getAlignment();
- Conservation c = new Conservation("All",
- ResidueProperties.propHash, 3, al.getSequences(), 0,
- al.getWidth() - 1);
-
- c.calculate();
- c.verdict(false, viewport.getConsPercGaps());
-
- cs.setConservation(c);
-
cs.setConservationInc(SliderPanel.setConservationSlider(alignPanel,
cs, "Background"));
}
- else
- {
- cs.setConservation(null);
- }
-
- cs.setConsensus(viewport.getSequenceConsensusHash());
}
viewport.setGlobalColourScheme(cs);
- if (viewport.getColourAppliesToAllGroups())
- {
-
- for (SequenceGroup sg : viewport.getAlignment().getGroups())
- {
- if (cs == null)
- {
- sg.cs = null;
- continue;
- }
-
- if (cs instanceof ClustalxColourScheme)
- {
- sg.cs = new ClustalxColourScheme(sg,
- viewport.getHiddenRepSequences());
- }
- else if (cs instanceof UserColourScheme)
- {
- sg.cs = new UserColourScheme(((UserColourScheme) cs).getColours());
- }
- else
- {
- try
- {
- sg.cs = cs.getClass().newInstance();
- } catch (Exception ex)
- {
- }
- }
-
- if (viewport.getAbovePIDThreshold()
- || cs instanceof PIDColourScheme
- || cs instanceof Blosum62ColourScheme)
- {
- sg.cs.setThreshold(threshold, viewport.isIgnoreGapsConsensus());
-
- sg.cs.setConsensus(AAFrequency.calculate(
- sg.getSequences(viewport.getHiddenRepSequences()),
- sg.getStartRes(), sg.getEndRes() + 1));
- }
- else
- {
- sg.cs.setThreshold(0, viewport.isIgnoreGapsConsensus());
- }
-
- if (viewport.getConservationSelected())
- {
- Conservation c = new Conservation("Group",
- ResidueProperties.propHash, 3, sg.getSequences(viewport
- .getHiddenRepSequences()), sg.getStartRes(),
- sg.getEndRes() + 1);
- c.calculate();
- c.verdict(false, viewport.getConsPercGaps());
- sg.cs.setConservation(c);
- }
- else
- {
- sg.cs.setConservation(null);
- }
- }
- }
-
- if (alignPanel.getOverviewPanel() != null)
- {
- alignPanel.getOverviewPanel().updateOverviewImage();
- }
-
alignPanel.paintAlignment(true);
}
if (updateOverview)
{
+ // TODO: determine if this paintAlignment changed structure colours
av.getStructureSelectionManager().sequenceColoursChanged(this);
if (overviewPanel != null)
public void ok_actionPerformed(ActionEvent e)
{
- updateView();
try
{
frame.setClosed(true);
jmb.updateColours(ap);
}
// do superposition if asked to
- if (alignAddedStructures)
+ if (Cache.getDefault("AUTOSUPERIMPOSE", true) && alignAddedStructures)
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
jmb.updateColours(ap);
}
// do superposition if asked to
- if (alignAddedStructures)
+ if (Cache.getDefault("AUTOSUPERIMPOSE", true) && alignAddedStructures)
{
new Thread(new Runnable()
{
}
});
chooseAnnotations.setText(MessageManager
- .getString("label.choose_annotations") + "...");
+ .getString("action.choose_annotations"));
chooseAnnotations.addActionListener(new java.awt.event.ActionListener()
{
@Override
}
});
sequenceDetails.setText(MessageManager
- .getString("label.sequence_details") + "...");
+ .getString("label.sequence_details"));
sequenceDetails.addActionListener(new java.awt.event.ActionListener()
{
@Override
}
});
sequenceSelDetails.setText(MessageManager
- .getString("label.sequence_details") + "...");
+ .getString("label.sequence_details"));
sequenceSelDetails
.addActionListener(new java.awt.event.ActionListener()
{
}
else
{
- residue = "X".equalsIgnoreCase(displayChar) ? "X"
- : ResidueProperties.aa2Triplet.get(displayChar);
+ residue = "X".equalsIgnoreCase(displayChar) ? "X" : ("*"
+ .equals(displayChar) ? "STOP" : ResidueProperties.aa2Triplet
+ .get(displayChar));
if (residue != null)
{
text.append(" Residue: ").append(residue);
}
final JRadioButtonMenuItem itemf = new JRadioButtonMenuItem(
- "label.all_views");
+ MessageManager.getString("label.all_views"));
buttonGroup.add(itemf);
itemf.setSelected(treeCanvas.applyToAllViews);
itemf.addActionListener(new ActionListener()
}
}
if (hasSymbols
- && (token.equals("H") || token.equals("E")
- || token.equals("S") || token.equals(" ")))
+ && (token.length() == 1 && "()<>[]{}AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"
+ .contains(token)))
{
// Either this character represents a helix or sheet
// or an integer which can be displayed
try
{
- content = doc.getElementById("seqData");
+ boolean contentFromDiv = true;
+ // search for BioJSON data in div element with id seqData
+ content = doc.select("div[id=seqData]").first();
+ if (content == null)
+ {
+ contentFromDiv = false;
+ // search for BioJSON data in input element with id seqData
+ content = doc.getElementById("seqData");
+ }
+
if (content == null)
{
errormessage = "The html document is not embedded with BioJSON data";
throw new IOException(errormessage);
}
- JSONFile jsonFile = new JSONFile().parse(new StringReader(content
+ JSONFile jsonFile = new JSONFile().parse(new StringReader(
+ contentFromDiv ? content.text() : content
.val()));
this.seqs = jsonFile.getSeqs();
this.seqGroups = jsonFile.getSeqGroups();
htmlSvg.append("<html>\n");
if (jsonData != null)
{
- htmlSvg.append("<button onclick=\"javascipt:openJalviewUsingCurrentUrl();\">Launch in Jalview</button>");
- htmlSvg.append("<input type=\"hidden\" name=\"seqData\" id=\"seqData\" value='"
- + jsonData + "'>");
+ htmlSvg.append("<button onclick=\"javascipt:openJalviewUsingCurrentUrl();\">Launch in Jalview</button> ");
+ htmlSvg.append("<input type=\"submit\" value=\"View raw BioJSON Data\" onclick=\"jQuery.facebox({ div:'#seqData' }); return false;\" />");
+ htmlSvg.append("<div style=\"display: none;\" name=\"seqData\" id=\"seqData\" >"
+ + jsonData + "</div>");
+ htmlSvg.append("<br/> ");
}
htmlSvg.append("\n<style type=\"text/css\"> "
+ "div.parent{ width:100%;<!-- overflow: auto; -->}\n"
+ "div.titlex{ width:11%; float: left; }\n"
+ "div.align{ width:89%; float: right; }\n"
+ + "div.main-container{ border: 2px solid blue; border: 2px solid blue; width: 99%; min-height: 99%; }\n"
+ ".sub-category-container {overflow-y: scroll; overflow-x: hidden; width: 100%; height: 100%;}\n"
- + "object {pointer-events: none;}"
- + "</style>");
- htmlSvg.append("<div>");
- htmlSvg.append(
-"<div class=\"titlex\">");
- htmlSvg.append(
-"<div class=\"sub-category-container\"> ")
- .append(titleSvg)
- .append("</div>")
- .append("</div>\n\n<!-- ========================================================================================== -->\n\n");
- htmlSvg.append(
-"<div class=\"align\" >");
+ + "object {pointer-events: none;}");
+ if (jsonData != null)
+ {
+ // facebox style sheet for displaying raw BioJSON data
+ htmlSvg.append("#facebox { position: absolute; top: 0; left: 0; z-index: 100; text-align: left; }\n"
+ + "#facebox .popup{ position:relative; border:3px solid rgba(0,0,0,0); -webkit-border-radius:5px;"
+ + "-moz-border-radius:5px; border-radius:5px; -webkit-box-shadow:0 0 18px rgba(0,0,0,0.4); -moz-box-shadow:0 0 18px rgba(0,0,0,0.4);"
+ + "box-shadow:0 0 18px rgba(0,0,0,0.4); }\n"
+ + "#facebox .content { display:table; width: 98%; padding: 10px; background: #fff; -webkit-border-radius:4px; -moz-border-radius:4px;"
+ + " border-radius:4px; }\n"
+ + "#facebox .content > p:first-child{ margin-top:0; }\n"
+ + "#facebox .content > p:last-child{ margin-bottom:0; }\n"
+ + "#facebox .close{ position:absolute; top:5px; right:5px; padding:2px; background:#fff; }\n"
+ + "#facebox .close img{ opacity:0.3; }\n"
+ + "#facebox .close:hover img{ opacity:1.0; }\n"
+ + "#facebox .loading { text-align: center; }\n"
+ + "#facebox .image { text-align: center;}\n"
+ + "#facebox img { border: 0; margin: 0; }\n"
+ + "#facebox_overlay { position: fixed; top: 0px; left: 0px; height:100%; width:100%; }\n"
+ + ".facebox_hide { z-index:-100; }\n"
+ + ".facebox_overlayBG { background-color: #000; z-index: 99; }");
+ }
+
+ htmlSvg.append("</style>");
+ htmlSvg.append("<div class=\"main-container\" \n>");
+ htmlSvg.append("<div class=\"titlex\">\n");
+ htmlSvg.append("<div class=\"sub-category-container\"> \n");
+ htmlSvg.append(titleSvg);
+ htmlSvg.append("</div>");
+ htmlSvg.append("</div>\n\n<!-- ========================================================================================== -->\n\n");
+ htmlSvg.append("<div class=\"align\" >");
htmlSvg.append(
"<div class=\"sub-category-container\"> <div style=\"overflow-x: scroll;\">")
.append(alignmentSvg)
htmlSvg.append("</div>");
htmlSvg.append("<script language=\"JavaScript\" type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js\"></script>\n"
- + "<script language=\"JavaScript\" type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js\"></script>\n"
+ + "<script language=\"JavaScript\" type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js\"></script>\n"
+ "<script>\n"
+ "var subCatContainer = $(\".sub-category-container\");\n"
+ "subCatContainer.scroll(\nfunction() {\n"
htmlSvg.append("<script language=\"JavaScript\">\n");
htmlSvg.append("function openJalviewUsingCurrentUrl(){\n");
- htmlSvg.append(" var json = JSON.parse(document.getElementById(\"seqData\").value);\n");
+ htmlSvg.append(" var json = JSON.parse(document.getElementById(\"seqData\").innerHTML);\n");
htmlSvg.append(" var jalviewVersion = json['appSettings'].version;\n");
htmlSvg.append(" var url = json['appSettings'].webStartUrl;\n");
htmlSvg.append(" var myForm = document.createElement(\"form\");\n\n");
htmlSvg.append(" myForm.submit() ;\n");
htmlSvg.append(" document.body.removeChild(myForm);\n");
htmlSvg.append("}\n");
+
+ // jquery facebox for displaying raw BioJSON data");
+ if (jsonData != null)
+ {
+ htmlSvg.append("/* Facebox (for jQuery)\n");
+ htmlSvg.append("* version: 1.3\n");
+ htmlSvg.append(" * @requires jQuery v1.2 or later\n");
+ htmlSvg.append(" * @homepage https://github.com/defunkt/facebox\n");
+ htmlSvg.append(" * Licensed under the MIT:\n");
+ htmlSvg.append(" * http://www.opensource.org/licenses/mit-license.php\n");
+ htmlSvg.append(" * Copyright Forever Chris Wanstrath, Kyle Neath\n");
+ htmlSvg.append(" * Usage:\n");
+ htmlSvg.append(" * jQuery(document).ready(function() {\n");
+ htmlSvg.append(" * jQuery('a[rel*=facebox]').facebox()\n");
+ htmlSvg.append(" * })\n");
+ htmlSvg.append(" * <a href=\"#terms\" rel=\"facebox\">Terms</a>\n");
+ htmlSvg.append(" * Loads the #terms div in the box\n");
+ htmlSvg.append(" * <a href=\"terms.html\" rel=\"facebox\">Terms</a>\n");
+ htmlSvg.append(" * Loads the terms.html page in the box\n");
+ htmlSvg.append(" * <a href=\"terms.png\" rel=\"facebox\">Terms</a>\n");
+ htmlSvg.append(" * Loads the terms.png image in the box\n");
+ htmlSvg.append(" * You can also use it programmatically:\n");
+ htmlSvg.append(" * jQuery.facebox('some html')\n");
+ htmlSvg.append(" * jQuery.facebox('some html', 'my-groovy-style')\n");
+ htmlSvg.append(" * The above will open a facebox with \"some html\" as the content.\n");
+ htmlSvg.append(" * jQuery.facebox(function($) {\n");
+ htmlSvg.append(" * $.get('blah.html', function(data) { $.facebox(data) })\n");
+ htmlSvg.append(" * })\n");
+ htmlSvg.append(" * The above will show a loading screen before the passed function is called,\n");
+ htmlSvg.append(" * allowing for a better ajaxy experience.\n");
+ htmlSvg.append(" * The facebox function can also display an ajax page, an image, or the contents of a div:\n");
+ htmlSvg.append(" * jQuery.facebox({ ajax: 'remote.html' })\n");
+ htmlSvg.append(" * jQuery.facebox({ ajax: 'remote.html' }, 'my-groovy-style')\n");
+ htmlSvg.append(" * jQuery.facebox({ image: 'stairs.jpg' })\n");
+ htmlSvg.append(" * jQuery.facebox({ image: 'stairs.jpg' }, 'my-groovy-style')\n");
+ htmlSvg.append(" * jQuery.facebox({ div: '#box' })\n");
+ htmlSvg.append(" * jQuery.facebox({ div: '#box' }, 'my-groovy-style')\n");
+ htmlSvg.append(" * Want to close the facebox? Trigger the 'close.facebox' document event:\n");
+ htmlSvg.append(" * jQuery(document).trigger('close.facebox')\n");
+ htmlSvg.append(" * Facebox also has a bunch of other hooks:\n");
+ htmlSvg.append(" * loading.facebox\n");
+ htmlSvg.append(" * beforeReveal.facebox\n");
+ htmlSvg.append(" * reveal.facebox (aliased as 'afterReveal.facebox')\n");
+ htmlSvg.append(" * init.facebox\n");
+ htmlSvg.append(" * afterClose.facebox\n");
+ htmlSvg.append(" * Simply bind a function to any of these hooks:\n");
+ htmlSvg.append(" * $(document).bind('reveal.facebox', function() { ...stuff to do after the facebox and contents are revealed... })\n");
+ htmlSvg.append(" *\n");
+ htmlSvg.append(" */\n");
+ htmlSvg.append("(function($) {\n");
+ htmlSvg.append(" $.facebox = function(data, klass) {\n");
+ htmlSvg.append(" $.facebox.loading()\n");
+ htmlSvg.append(" if (data.ajax) fillFaceboxFromAjax(data.ajax, klass)\n");
+ htmlSvg.append(" else if (data.image) fillFaceboxFromImage(data.image, klass)\n");
+ htmlSvg.append(" else if (data.div) fillFaceboxFromHref(data.div, klass)\n");
+ htmlSvg.append(" else if ($.isFunction(data)) data.call($)\n");
+ htmlSvg.append(" else $.facebox.reveal(data, klass)\n");
+ htmlSvg.append(" }\n");
+
+ htmlSvg.append(" $.extend($.facebox, {\n");
+ htmlSvg.append(" settings: {\n");
+ htmlSvg.append(" opacity : 0.2,\n");
+ htmlSvg.append(" overlay : true,\n");
+ htmlSvg.append(" loadingImage : 'https://raw.githubusercontent.com/jalview/biojson/gh-pages/images/loading.gif',\n");
+ htmlSvg.append(" closeImage : 'https://raw.githubusercontent.com/jalview/biojson/gh-pages/images/cancel.png',\n");
+ htmlSvg.append(" imageTypes : [ 'png', 'jpg', 'jpeg', 'gif' ],\n");
+ htmlSvg.append(" faceboxHtml : '<div id=\"facebox\" style=\"display:none; width: 95%; height: 85%; overflow: auto;\"> ");
+ htmlSvg.append(" <div class=\"popup\"> ");
+ htmlSvg.append(" <div class=\"content\"> ");
+ htmlSvg.append(" </div> ");
+ htmlSvg.append(" <a href=\"#\" class=\"close\"></a> ");
+ htmlSvg.append(" </div> ");
+ htmlSvg.append(" </div>'\n");
+ htmlSvg.append(" }, \n");
+ htmlSvg.append(" loading: function() {\n");
+ htmlSvg.append(" init()\n");
+ htmlSvg.append(" if ($('#facebox .loading').length == 1) return true\n");
+ htmlSvg.append(" showOverlay() \n");
+ htmlSvg.append(" $('#facebox .content').empty().\n");
+ htmlSvg.append(" append('<div class=\"loading\"><img src=\"'+$.facebox.settings.loadingImage+'\"/></div>')\n");
+ htmlSvg.append(" $('#facebox').show().css({\n");
+ htmlSvg.append(" top: getPageScroll()[1] + (getPageHeight() / 10),\n");
+ htmlSvg.append(" left: $(window).width() / 2 - ($('#facebox .popup').outerWidth() / 2)\n");
+ htmlSvg.append(" }) \n");
+ htmlSvg.append(" $(document).bind('keydown.facebox', function(e) {\n");
+ htmlSvg.append(" if (e.keyCode == 27) $.facebox.close()\n");
+ htmlSvg.append(" return true\n");
+ htmlSvg.append(" })\n");
+ htmlSvg.append(" $(document).trigger('loading.facebox')\n");
+ htmlSvg.append(" },\n");
+ htmlSvg.append(" reveal: function(data, klass) {\n");
+ htmlSvg.append(" $(document).trigger('beforeReveal.facebox')\n");
+ htmlSvg.append(" if (klass) $('#facebox .content').addClass(klass)\n");
+ htmlSvg.append(" $('#facebox .content').empty().append('<pre><code>'+JSON.stringify(JSON.parse(data),null,4)+'</pre></code>')\n");
+ htmlSvg.append(" $('#facebox .popup').children().fadeIn('normal')\n");
+ htmlSvg.append(" $('#facebox').css('left', $(window).width() / 2 - ($('#facebox .popup').outerWidth() / 2))\n");
+ htmlSvg.append(" $(document).trigger('reveal.facebox').trigger('afterReveal.facebox')\n");
+ htmlSvg.append(" }, \n");
+ htmlSvg.append(" close: function() {\n");
+ htmlSvg.append(" $(document).trigger('close.facebox')\n");
+ htmlSvg.append(" return false\n");
+ htmlSvg.append(" }\n");
+ htmlSvg.append(" })\n");
+ htmlSvg.append(" $.fn.facebox = function(settings) {\n");
+ htmlSvg.append(" if ($(this).length == 0) return \n");
+ htmlSvg.append(" init(settings) \n");
+ htmlSvg.append(" function clickHandler() {\n");
+ htmlSvg.append(" $.facebox.loading(true) \n");
+ htmlSvg.append(" // support for rel=\"facebox.inline_popup\" syntax, to add a class\n");
+ htmlSvg.append(" // also supports deprecated \"facebox[.inline_popup]\" syntax\n");
+ htmlSvg.append(" var klass = this.rel.match(/facebox\\[?\\.(\\w+)\\]?/)\n");
+ htmlSvg.append(" if (klass) klass = klass[1]\n");
+ htmlSvg.append(" fillFaceboxFromHref(this.href, klass)\n");
+ htmlSvg.append(" return false\n");
+ htmlSvg.append(" } \n");
+ htmlSvg.append(" return this.bind('click.facebox', clickHandler)\n");
+ htmlSvg.append(" }\n");
+ htmlSvg.append(" // called one time to setup facebox on this page\n");
+ htmlSvg.append(" function init(settings) {\n");
+ htmlSvg.append(" if ($.facebox.settings.inited) return true\n");
+ htmlSvg.append(" else $.facebox.settings.inited = true\n");
+ htmlSvg.append(" $(document).trigger('init.facebox')\n");
+ htmlSvg.append(" makeCompatible()\n");
+ htmlSvg.append(" var imageTypes = $.facebox.settings.imageTypes.join('|')\n");
+ htmlSvg.append(" $.facebox.settings.imageTypesRegexp = new RegExp('\\\\.(' + imageTypes + ')(\\\\?.*)?$', 'i')\n");
+
+ htmlSvg.append(" if (settings) $.extend($.facebox.settings, settings)\n");
+ htmlSvg.append(" $('body').append($.facebox.settings.faceboxHtml)\n");
+
+ htmlSvg.append(" var preload = [ new Image(), new Image() ]\n");
+ htmlSvg.append(" preload[0].src = $.facebox.settings.closeImage\n");
+ htmlSvg.append(" preload[1].src = $.facebox.settings.loadingImage\n");
+
+ htmlSvg.append(" $('#facebox').find('.b:first, .bl').each(function() {\n");
+ htmlSvg.append(" preload.push(new Image())\n");
+ htmlSvg.append(" preload.slice(-1).src = $(this).css('background-image').replace(/url\\((.+)\\)/, '$1')\n");
+ htmlSvg.append(" })\n");
+
+ htmlSvg.append(" $('#facebox .close')\n");
+ htmlSvg.append(" .click($.facebox.close)\n");
+ htmlSvg.append(" .append('<img src=\"'\n");
+ htmlSvg.append(" + $.facebox.settings.closeImage\n");
+ htmlSvg.append(" + '\" class=\"close_image\" title=\"close\">')\n");
+ htmlSvg.append(" }\n");
+
+ htmlSvg.append(" // getPageScroll() by quirksmode.com\n");
+ htmlSvg.append(" function getPageScroll() {\n");
+ htmlSvg.append(" var xScroll, yScroll;\n");
+ htmlSvg.append(" if (self.pageYOffset) {\n");
+ htmlSvg.append(" yScroll = self.pageYOffset;\n");
+ htmlSvg.append(" xScroll = self.pageXOffset;\n");
+ htmlSvg.append(" } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict\n");
+ htmlSvg.append(" yScroll = document.documentElement.scrollTop;\n");
+ htmlSvg.append(" xScroll = document.documentElement.scrollLeft;\n");
+ htmlSvg.append(" } else if (document.body) {// all other Explorers\n");
+ htmlSvg.append(" yScroll = document.body.scrollTop;\n");
+ htmlSvg.append(" xScroll = document.body.scrollLeft;\n");
+ htmlSvg.append(" }\n");
+ htmlSvg.append(" return new Array(xScroll,yScroll)\n");
+ htmlSvg.append(" }\n");
+
+ // Adapted from getPageSize() by quirksmode.com");
+ htmlSvg.append(" function getPageHeight() {\n");
+ htmlSvg.append(" var windowHeight\n");
+ htmlSvg.append(" if (self.innerHeight) { // all except Explorer\n");
+ htmlSvg.append(" windowHeight = self.innerHeight;\n");
+ htmlSvg.append(" } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode\n");
+ htmlSvg.append(" windowHeight = document.documentElement.clientHeight;\n");
+ htmlSvg.append(" } else if (document.body) { // other Explorers\n");
+ htmlSvg.append(" windowHeight = document.body.clientHeight;\n");
+ htmlSvg.append(" }\n");
+ htmlSvg.append(" return windowHeight\n");
+ htmlSvg.append(" }\n");
+
+ htmlSvg.append(" // Backwards compatibility\n");
+ htmlSvg.append(" function makeCompatible() {\n");
+ htmlSvg.append(" var $s = $.facebox.settings \n");
+ htmlSvg.append(" $s.loadingImage = $s.loading_image || $s.loadingImage\n");
+ htmlSvg.append(" $s.closeImage = $s.close_image || $s.closeImage\n");
+ htmlSvg.append(" $s.imageTypes = $s.image_types || $s.imageTypes\n");
+ htmlSvg.append(" $s.faceboxHtml = $s.facebox_html || $s.faceboxHtml\n");
+ htmlSvg.append(" }\n");
+
+ htmlSvg.append(" // Figures out what you want to display and displays it\n");
+ htmlSvg.append(" // formats are:\n");
+ htmlSvg.append(" // div: #id\n");
+ htmlSvg.append(" // image: blah.extension\n");
+ htmlSvg.append(" // ajax: anything else\n");
+ htmlSvg.append(" function fillFaceboxFromHref(href, klass) {\n");
+ htmlSvg.append(" // div\n");
+ htmlSvg.append(" if (href.match(/#/)) {\n");
+ htmlSvg.append(" var url = window.location.href.split('#')[0]\n");
+ htmlSvg.append(" var target = href.replace(url,'')\n");
+ htmlSvg.append(" if (target == '#') return\n");
+ htmlSvg.append(" $.facebox.reveal($(target).html(), klass)\n");
+
+ htmlSvg.append(" // image\n");
+ htmlSvg.append(" } else if (href.match($.facebox.settings.imageTypesRegexp)) {\n");
+ htmlSvg.append(" fillFaceboxFromImage(href, klass)\n");
+ htmlSvg.append(" // ajax\n");
+ htmlSvg.append(" } else {\n");
+ htmlSvg.append(" fillFaceboxFromAjax(href, klass)\n");
+ htmlSvg.append(" }\n");
+ htmlSvg.append(" }\n");
+
+ htmlSvg.append(" function fillFaceboxFromImage(href, klass) {\n");
+ htmlSvg.append(" var image = new Image()\n");
+ htmlSvg.append(" image.onload = function() {\n");
+ htmlSvg.append(" $.facebox.reveal('<div class=\"image\"><img src=\"' + image.src + '\" /></div>', klass)\n");
+ htmlSvg.append(" }\n");
+ htmlSvg.append(" image.src = href\n");
+ htmlSvg.append(" }\n");
+
+ htmlSvg.append(" function fillFaceboxFromAjax(href, klass) {\n");
+ htmlSvg.append(" $.facebox.jqxhr = $.get(href, function(data) { $.facebox.reveal(data, klass) })\n");
+ htmlSvg.append(" }\n");
+
+ htmlSvg.append(" function skipOverlay() {\n");
+ htmlSvg.append(" return $.facebox.settings.overlay == false || $.facebox.settings.opacity === null\n");
+ htmlSvg.append(" }\n");
+
+ htmlSvg.append(" function showOverlay() {\n");
+ htmlSvg.append(" if (skipOverlay()) return\n");
+
+ htmlSvg.append(" if ($('#facebox_overlay').length == 0)\n");
+ htmlSvg.append(" $(\"body\").append('<div id=\"facebox_overlay\" class=\"facebox_hide\"></div>')\n");
+
+ htmlSvg.append(" $('#facebox_overlay').hide().addClass(\"facebox_overlayBG\")\n");
+ htmlSvg.append(" .css('opacity', $.facebox.settings.opacity)\n");
+ htmlSvg.append(" .click(function() { $(document).trigger('close.facebox') })\n");
+ htmlSvg.append(" .fadeIn(200)\n");
+ htmlSvg.append(" return false\n");
+ htmlSvg.append(" }\n");
+
+ htmlSvg.append(" function hideOverlay() {\n");
+ htmlSvg.append(" if (skipOverlay()) return \n");
+ htmlSvg.append(" $('#facebox_overlay').fadeOut(200, function(){\n");
+ htmlSvg.append(" $(\"#facebox_overlay\").removeClass(\"facebox_overlayBG\")\n");
+ htmlSvg.append(" $(\"#facebox_overlay\").addClass(\"facebox_hide\")\n");
+ htmlSvg.append(" $(\"#facebox_overlay\").remove()\n");
+ htmlSvg.append(" }) \n");
+ htmlSvg.append(" return false\n");
+ htmlSvg.append(" }\n");
+
+ htmlSvg.append(" $(document).bind('close.facebox', function() {\n");
+ htmlSvg.append(" if ($.facebox.jqxhr) {\n");
+ htmlSvg.append(" $.facebox.jqxhr.abort()\n");
+ htmlSvg.append(" $.facebox.jqxhr = null\n");
+ htmlSvg.append(" }\n");
+ htmlSvg.append(" $(document).unbind('keydown.facebox')\n");
+ htmlSvg.append(" $('#facebox').fadeOut(function() {\n");
+ htmlSvg.append(" $('#facebox .content').removeClass().addClass('content')\n");
+ htmlSvg.append(" $('#facebox .loading').remove()\n");
+ htmlSvg.append(" $(document).trigger('afterClose.facebox')\n");
+ htmlSvg.append(" })\n");
+ htmlSvg.append(" hideOverlay()\n");
+ htmlSvg.append(" })\n");
+
+ htmlSvg.append("})(jQuery);\n");
+
+ }
+
htmlSvg.append("</script>\n");
- htmlSvg.append("</hmtl>");
+ htmlSvg.append("</html>");
return htmlSvg.toString();
}
}
private void jbInit() throws Exception
{
JMenuItem saveAs = new JMenuItem(
- MessageManager.getString("action.save_as") + "...");
+ MessageManager.getString("action.save_as"));
ActionListener al = new ActionListener()
{
@Override
});
JMenuItem removeRedundancyMenuItem = new JMenuItem(MessageManager
- .getString("action.remove_redundancy").concat("..."));
+.getString("action.remove_redundancy"));
keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_D, Toolkit
.getDefaultToolkit().getMenuShortcutKeyMask(), false);
al = new ActionListener()
});
JMenuItem printMenuItem = new JMenuItem(
- MessageManager.getString("action.print") + "...");
+ MessageManager.getString("action.print"));
keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_P, Toolkit
.getDefaultToolkit().getMenuShortcutKeyMask(), false);
al = new ActionListener()
});
JMenuItem extractScores = new JMenuItem(
- MessageManager.getString("label.extract_scores") + "...");
+ MessageManager.getString("label.extract_scores"));
extractScores.addActionListener(new ActionListener()
{
@Override
showProducts.setText(MessageManager.getString("label.get_cross_refs"));
JMenuItem openFeatureSettings = new JMenuItem(
- MessageManager.getString("label.feature_settings"));
+ MessageManager.getString("action.feature_settings"));
openFeatureSettings.addActionListener(new ActionListener()
{
@Override
+ MessageManager.getString("label.rename_tab_eXpand_reGroup")
+ "</i></html>");
JMenuItem textColour = new JMenuItem(
- MessageManager.getString("label.colour_text") + "...");
+ MessageManager.getString("action.set_text_colour"));
textColour.addActionListener(new ActionListener()
{
@Override
addMenuActionAndAccelerator(keyStroke, expandViews, al);
JMenuItem pageSetup = new JMenuItem(
- MessageManager.getString("action.page_setup") + "...");
+ MessageManager.getString("action.page_setup"));
pageSetup.addActionListener(new ActionListener()
{
@Override
}
});
JMenuItem alignmentProperties = new JMenuItem(
- MessageManager.getString("label.alignment_props") + "...");
+ MessageManager.getString("label.alignment_props"));
alignmentProperties.addActionListener(new ActionListener()
{
@Override
});
this.getContentPane().setLayout(flowLayout1);
windowMenu.setText(MessageManager.getString("label.window"));
- preferences.setText(MessageManager.getString("label.preferences")
- + "...");
+ preferences.setText(MessageManager.getString("label.preferences"));
preferences.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
});
inputMenu.setText(MessageManager.getString("label.input_alignment"));
vamsasStart.setText(MessageManager
- .getString("label.new_vamsas_session") + "...");
+ .getString("label.new_vamsas_session"));
vamsasStart.setVisible(false);
vamsasStart.addActionListener(new ActionListener()
{
}
});
vamsasImport.setText(MessageManager
- .getString("label.load_vamsas_session") + "...");
+ .getString("action.load_vamsas_session"));
vamsasImport.setVisible(false);
vamsasImport.addActionListener(new ActionListener()
{
}
});
vamsasSave.setText(MessageManager
- .getString("label.save_vamsas_session") + "...");
+ .getString("action.save_vamsas_session"));
vamsasSave.setVisible(false);
vamsasSave.addActionListener(new ActionListener()
{
vamsasSave_actionPerformed(e);
}
});
- inputSequence.setText(MessageManager.getString("label.fetch_sequences")
- + "...");
+ inputSequence.setText(MessageManager
+ .getString("action.fetch_sequences"));
inputSequence.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
import jalview.util.MessageManager;
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.swing.*;
-import javax.swing.event.*;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JComboBox;
+import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.event.MenuEvent;
+import javax.swing.event.MenuListener;
public class GPCAPanel extends JInternalFrame
{
}
});
outputProjPoints.setText(MessageManager
- .getString("label.output_transformed_points") + "...");
+ .getString("label.output_transformed_points"));
outputProjPoints.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
print.setText(MessageManager.getString("action.print"));
- bgcolour.setText(MessageManager.getString("label.background_colour")
- + "...");
+ bgcolour.setText(MessageManager.getString("action.background_colour"));
bgcolour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
colourMenu.setText(MessageManager.getString("label.colours"));
JMenuItem backGround = new JMenuItem();
- backGround.setText(MessageManager.getString("label.background_colour")
- + "...");
+ backGround.setText(MessageManager.getString("action.background_colour"));
backGround.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
placeholdersMenu_actionPerformed(e);
}
});
- textbox.setText(MessageManager.getString("label.out_to_textbox")
- + "...");
+ textbox.setText(MessageManager.getString("label.out_to_textbox"));
textbox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@Attributes(
required = false,
minItems = 0,
- maxItems = 2147483647,
exclusiveMaximum = true,
- description = "Alignment annotations stores symbols and graphs usually rendered </br>below the alignment.")
+ description = "Alignment annotations stores symbols and graphs usually rendered </br>"
+ + "below the alignment and often reflect properties of the alignment </br>as a whole.")
private List<AlignmentAnnotationPojo> alignAnnotation = new ArrayList<AlignmentAnnotationPojo>();
@Attributes(
required = false,
minItems = 0,
- maxItems = 2147483647,
- description = "A sequence group is a region of an alignment which could <br>span across multiple columns and rows. These can be treated as<br> a sub-alignments.")
+ description = "A sequence group is a rectangular region of an alignment <br>bounded by startRes and endRes positions in the alignment <br>coordinate system for a set of sequences")
private List<SequenceGrpPojo> seqGroups = new ArrayList<SequenceGrpPojo>();
@Attributes(
required = false,
minItems = 0,
- maxItems = 2147483647,
- description = "Sequence features are associated with sequences rather than <br>alignments. A sequence feature can span across multiple <br>sequences in an alignment. They indicate features generated <br>by the same analysis process or retrieved from the same database <br>(such as Uniprot features).")
+ description = "Sequence features are properties of the individual sequences, <br>they do not change with the alignment, but are shown mapped<br> on to specific residues within the alignment")
private List<SequenceFeaturesPojo> seqFeatures = new ArrayList<SequenceFeaturesPojo>();
@Attributes(
"Nucleotide", "Pyrimidine", "Purine", "Turn", "Helix", "Strand",
"Buried", "Hydro", "T-Coffee Scores", "RNA Interaction type",
"Blosum62", "RNA Helices", "% Identity" },
- description = "The <a href=\"colour_schemes.html\">Colour Scheme</a> applied to the alignment")
+ description = "The <a href=\"#colourScheme\">Colour Scheme</a> applied to the alignment")
private String colourScheme;
- @Attributes(required = true, maxItems = 1, description = "This is an array of key=value pairs for storing custom application <br>specific settings")
+ @Attributes(
+ required = true,
+ maxItems = 0, description = "AppSettings stores key=value pairs of custom application specific <br>"
+ + "settings (i.e visualisation settings, etc) for different applications<br>"
+ + "that consume or generate BioJSON")
Map<String, Object> appSettings = new HashMap<String, Object>();
public AlignmentPojo()
{
@Attributes(
required = false,
- description = "The <a href=\"colour_schemes.html\">Colour Scheme</a> applied to the Sequence Group")
+ description = "The <a href=\"#colourScheme\">Colour Scheme</a> applied to the Sequence Group")
private String colourScheme;
@Attributes(required = true, description = "The name assigned to the seqGroup")
@Attributes(
required = true,
minItems = 1,
- maxItems = 2147483647,
uniqueItems = true,
description = "An array of the unique id's for the sequences belonging to the group")
private ArrayList<String> sequenceRefs = new ArrayList<String>();
bb = 0;
noGradient = true;
+ checkLimits();
}
/**
bb = maxColour.getBlue() - b1;
noGradient = false;
+ checkLimits();
+ }
+
+ private void checkLimits()
+ {
aamax = annotation.graphMax;
aamin = annotation.graphMin;
if (annotation.isRNA())
{
+ // reset colour palette
+ ColourSchemeProperty.resetRnaHelicesShading();
ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax);
}
}
}
}
+ /**
+ * delete the existing cached RNA helces colours
+ */
+ public static void resetRnaHelicesShading()
+ {
+ rnaHelices = null;
+ }
+
}
*/
package jalview.schemes;
-import java.awt.*;
-import java.util.Hashtable;
-import java.util.Map;
-
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
+import java.awt.Color;
+import java.util.Hashtable;
+import java.util.Map;
+
/**
* Looks at the information computed from an RNA Stockholm format file on the
* secondary structure of the alignment. Extracts the information on the
public class RNAHelicesColour extends ResidueColourScheme
{
- /**
- * Stores random colors generated for the number of helices
- */
- public Hashtable helixcolorhash = new Hashtable();
/**
* Maps sequence positions to the RNA helix they belong to. Key: position,
- * Value: helix
+ * Value: helix TODO: Revise or drop in favour of annotation position numbers
*/
- public Hashtable positionsToHelix = new Hashtable();
+ public Hashtable<Integer, String> positionsToHelix = new Hashtable<Integer, String>();
/**
* Number of helices in the RNA secondary structure
{
super(ResidueProperties.nucleotideIndex);
this.annotation = annotation;
+ ColourSchemeProperty.resetRnaHelicesShading();
refresh();
}
public RNAHelicesColour(AnnotatedCollectionI alignment)
{
super(ResidueProperties.nucleotideIndex);
+ ColourSchemeProperty.resetRnaHelicesShading();
alignmentChanged(alignment, null);
}
+ /**
+ * clones colour settings and annotation row data
+ *
+ * @param rnaHelicesColour
+ */
+ public RNAHelicesColour(RNAHelicesColour rnaHelicesColour)
+ {
+ super(ResidueProperties.nucleotideIndex);
+ annotation = rnaHelicesColour.annotation;
+ refresh();
+ }
+
@Override
public void alignmentChanged(AnnotatedCollectionI alignment,
Map<SequenceI, SequenceCollectionI> hiddenReps)
{
// is this a sensible way of determining type of annotation?
- if (annotations[i].getRNAStruc() != null)
+ if (annotations[i].visible && annotations[i].isRNA()
+ && annotations[i].isValidStruc())
{
annotation = annotations[i];
break;
annotation.getRNAStruc();
lastrefresh = annotation._rnasecstr.hashCode();
numHelix = 0;
- positionsToHelix = new Hashtable();
+ positionsToHelix = new Hashtable<Integer, String>();
// Figure out number of helices
// Length of rnasecstr is the number of pairs of positions that base pair
}
}
-
- // Generate random colors and store
- for (int j = 0; j <= numHelix; j++)
- {
- if (!helixcolorhash.containsKey(Integer.toString(j)))
- {
- helixcolorhash.put(Integer.toString(j),
- jalview.util.ColorUtils.generateRandomColor(Color.white));
- }
- }
+ ColourSchemeProperty.initRnaHelicesShading(numHelix);
}
}
* @param c
* Character in sequence
* @param j
- * Threshold
+ * position in sequence - used to locate helix
*
* @return Color in RGB
*/
refresh();
Color currentColour = Color.white;
String currentHelix = null;
- currentHelix = (String) positionsToHelix.get(j);
-
+ currentHelix = positionsToHelix.get(j);
if (currentHelix != null)
{
- currentColour = (Color) helixcolorhash.get(currentHelix);
+ currentColour = ColourSchemeProperty.rnaHelices[Integer
+ .parseInt(currentHelix)];
}
-
- // System.out.println(c + " " + j + " helix " + currentHelix + " " +
- // currentColour);
return currentColour;
}
-}
+
+ @Override
+ public ColourSchemeI applyTo(AnnotatedCollectionI sg,
+ Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
+ {
+ return new RNAHelicesColour(this);
+ }
+}
\ No newline at end of file
*/
package jalview.schemes;
-import java.util.*;
-import java.awt.event.*;
-
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
-import jalview.datamodel.*;
-import jalview.schemes.*;
+import jalview.datamodel.SequenceGroup;
+
+import java.awt.event.ActionEvent;
+import java.util.Hashtable;
+import java.util.Vector;
/**
* Helps generate the colors for RNA secondary structure. Future: add option to
{
String label = av.getAlignment().getAlignmentAnnotation()[i].label;
if (!list.contains(label))
+ {
list.addElement(label);
+ }
else
+ {
list.addElement(label + "_" + (index++));
+ }
}
adjusting = false;
av.setGlobalColourScheme(rhc);
- if (av.getAlignment().getGroups() != null)
- {
- for (SequenceGroup sg : ap.getAlignment().getGroups())
- {
- if (sg.cs == null)
- {
- continue;
- }
-
- sg.cs = new RNAHelicesColour(sg);
-
- }
- }
-
- ap.paintAlignment(false);
+ ap.paintAlignment(true);
}
void reset()
return _codonTranslate(lccodon);
}
String cdn = codonHash2.get(lccodon.toUpperCase());
- if (cdn != null && cdn.equals("*"))
+ if ("*".equals(cdn))
{
return "STOP";
}
public void setGlobalColourScheme(ColourSchemeI cs)
{
// TODO: logic refactored from AlignFrame changeColour -
- // autorecalc stuff should be changed to rely on the worker system
+ // TODO: autorecalc stuff should be changed to rely on the worker system
// check to see if we should implement a changeColour(cs) method rather than
// put th logic in here
// - means that caller decides if they want to just modify state and defer
}
}
}
-
}
@Override
// select rna struct to use for calculation
for (int i = 0; i < aa.length; i++)
{
- if (aa[i].getRNAStruc() != null && aa[i].isValidStruc())
+ if (aa[i].visible && aa[i].isRNA() && aa[i].isValidStruc())
{
rnaStruc = aa[i];
break;
alignViewport.setRnaStructureConsensusHash(hStrucConsensus);
// TODO AlignmentAnnotation rnaStruc!!!
updateResultAnnotation(true);
- if (alignViewport.getGlobalColourScheme() != null)
- {
- alignViewport.getGlobalColourScheme().setConsensus(hStrucConsensus);
- }
-
} catch (OutOfMemoryError error)
{
calcMan.workerCannotRun(this);
import jalview.datamodel.AlignmentAnnotation;
import jalview.gui.AlignFrame;
-import jalview.gui.AlignmentPanel;
-import jalview.ws.jws2.dm.AAConSettings;
+import jalview.util.MessageManager;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.WsParamSetI;
import jalview.ws.uimodel.AlignAnalysisUIText;
return new AlignAnalysisUIText(
compbio.ws.client.Services.AAConWS.toString(),
jalview.ws.jws2.AAConClient.class, CALC_ID, false, true, true,
- "AACon Calculations",
- "When checked, AACon calculations are updated automatically.",
- "Change AACon Settings...",
- "Modify settings for AACon calculations.");
+ MessageManager.getString("label.aacon_calculations"),
+ MessageManager.getString("tooltip.aacon_calculations"),
+ MessageManager.getString("label.aacon_settings"),
+ MessageManager.getString("tooltip.aacon_settings"));
}
}
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
import jalview.gui.AlignFrame;
-import jalview.ws.jws2.dm.AAConSettings;
+import jalview.util.MessageManager;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.WsParamSetI;
import jalview.ws.uimodel.AlignAnalysisUIText;
import java.util.TreeSet;
import java.util.regex.Pattern;
-import compbio.data.sequence.RNAStructReader.AlifoldResult;
import compbio.data.sequence.FastaSequence;
+import compbio.data.sequence.RNAStructReader.AlifoldResult;
import compbio.data.sequence.RNAStructScoreManager;
import compbio.data.sequence.Range;
import compbio.data.sequence.Score;
{
return new AlignAnalysisUIText(
compbio.ws.client.Services.RNAalifoldWS.toString(),
- jalview.ws.jws2.RNAalifoldClient.class,
- CALC_ID,
- true,
- false,
- true,
- "RNAAliFold Prediction",
- "When checked, RNA secondary structure predictions will be calculated for the alignment, and updated when edits are made.",
- "Change RNAAliFold settings...",
- "Modify settings for the RNAAliFold prediction. Use this to hide or show different results of the RNA calculation, and change RNA folding parameters");
-
+ jalview.ws.jws2.RNAalifoldClient.class, CALC_ID, true, false,
+ true, MessageManager.getString("label.rnalifold_calculations"),
+ MessageManager.getString("tooltip.rnalifold_calculations"),
+ MessageManager.getString("label.rnalifold_settings"),
+ MessageManager.getString("tooltip.rnalifold_settings"));
}
@Override
* same data object as was overwritten with the contact probabilites data.
*/
if (data == null)
+ {
data = compbio.data.sequence.RNAStructReader
.newEmptyScore(AlifoldResult.consensusAlignment);
+ }
if (descriptionData == null)
+ {
descriptionData = data;
+ }
String[] typenameAndDescription = constructTypenameAndDescription(descriptionData
.first());
{
float t = contacts.get(contact);
if (t > prob)
+ {
prob = t;
+ }
description += Integer.toString(contact.from) + "->"
+ Integer.toString(contact.to) + ": "
+ Float.toString(t) + "% | ";
score.getScores().get(0), score.getScores().get(1));
}
else
+ {
description = "Stochastic Backtrack Structure";
+ }
}
else if (datatype.equals(AlifoldResult.MEAStucture.toString()))
{
// ordering of the Scores TreeSet in ScoreManager which is, descending
// probability
if (contact.from == i || contact.to == i)
+ {
contacts.put(contact, basePairs.get(contact));
+ }
}
return contacts;
{
assertTrue(AlignmentUtils.translatesAs("tttcccaaaggg".toCharArray(), 0,
"FPKG".toCharArray()));
- // with start codon
+ // with start codon (not in protein)
assertTrue(AlignmentUtils.translatesAs("atgtttcccaaaggg".toCharArray(),
3, "FPKG".toCharArray()));
- // with stop codon1
+ // with stop codon1 (not in protein)
assertTrue(AlignmentUtils.translatesAs("tttcccaaagggtaa".toCharArray(),
0, "FPKG".toCharArray()));
- // with stop codon2
+ // with stop codon1 (in protein as *)
+ assertTrue(AlignmentUtils.translatesAs("tttcccaaagggtaa".toCharArray(),
+ 0, "FPKG*".toCharArray()));
+ // with stop codon2 (not in protein)
assertTrue(AlignmentUtils.translatesAs("tttcccaaagggtag".toCharArray(),
0, "FPKG".toCharArray()));
- // with stop codon3
+ // with stop codon3 (not in protein)
assertTrue(AlignmentUtils.translatesAs("tttcccaaagggtga".toCharArray(),
0, "FPKG".toCharArray()));
// with start and stop codon1
assertTrue(AlignmentUtils.translatesAs(
- "atgtttcccaaaggtaa".toCharArray(), 3, "FPKG".toCharArray()));
+ "atgtttcccaaagggtaa".toCharArray(), 3, "FPKG".toCharArray()));
+ // with start and stop codon1 (in protein as *)
+ assertTrue(AlignmentUtils.translatesAs(
+ "atgtttcccaaagggtaa".toCharArray(), 3, "FPKG*".toCharArray()));
// with start and stop codon2
assertTrue(AlignmentUtils.translatesAs(
- "atgtttcccaaaggtag".toCharArray(), 3, "FPKG".toCharArray()));
+ "atgtttcccaaagggtag".toCharArray(), 3, "FPKG".toCharArray()));
// with start and stop codon3
assertTrue(AlignmentUtils.translatesAs(
- "atgtttcccaaaggtga".toCharArray(), 3, "FPKG".toCharArray()));
+ "atgtttcccaaagggtga".toCharArray(), 3, "FPKG".toCharArray()));
+
+ // with embedded stop codon
+ assertTrue(AlignmentUtils.translatesAs(
+ "atgtttTAGcccaaaTAAgggtga".toCharArray(), 3,
+ "F*PK*G".toCharArray()));
// wrong protein
assertFalse(AlignmentUtils.translatesAs("tttcccaaaggg".toCharArray(),
anns[0].sequenceRef = al.getSequenceAt(1); anns[0].label = "label0";
anns[1].sequenceRef = al.getSequenceAt(3); anns[1].label = "structure";
anns[2].sequenceRef = al.getSequenceAt(3); anns[2].label = "iron";
- anns[3].sequenceRef = null; anns[3].label = "Quality";
- anns[4].sequenceRef = null; anns[4].label = "Consensus";
+ anns[3].autoCalculated = true; anns[3].label = "Quality";
+ anns[4].autoCalculated = true; anns[4].label = "Consensus";
anns[5].sequenceRef = al.getSequenceAt(0); anns[5].label = "label5";
anns[6].sequenceRef = al.getSequenceAt(3); anns[6].label = "IRP";
// @formatter:on
assertEquals("iron", anns[2].label); // sequence 3 /iron
assertEquals("IRP", anns[3].label); // sequence 3/IRP
assertEquals("structure", anns[4].label); // sequence 3/structure
- assertEquals("Quality", anns[5].label); // non-sequence annotations
+ assertEquals("Quality", anns[5].label); // autocalc annotations
assertEquals("Consensus", anns[6].label); // retain ordering
}
anns[0].sequenceRef = al.getSequenceAt(1); anns[0].label = "label0";
anns[1].sequenceRef = al.getSequenceAt(3); anns[1].label = "structure";
anns[2].sequenceRef = al.getSequenceAt(3); anns[2].label = "iron";
- anns[3].sequenceRef = null; anns[3].label = "Quality";
- anns[4].sequenceRef = null; anns[4].label = "Consensus";
+ anns[3].autoCalculated = true; anns[3].label = "Quality";
+ anns[4].autoCalculated = true; anns[4].label = "Consensus";
anns[5].sequenceRef = al.getSequenceAt(0); anns[5].label = "label5";
anns[6].sequenceRef = al.getSequenceAt(3); anns[6].label = "IRP";
// @formatter:on
AnnotationSorter testee = new AnnotationSorter(al, true);
testee.sort(anns, SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
- assertEquals("Quality", anns[0].label); // non-sequence annotations
+ assertEquals("Quality", anns[0].label); // autocalc annotations
assertEquals("Consensus", anns[1].label); // retain ordering
assertEquals("label5", anns[2].label); // for sequence 0
assertEquals("label0", anns[3].label); // for sequence 1
anns[0].sequenceRef = al.getSequenceAt(1); anns[0].label = "label0";
anns[1].sequenceRef = al.getSequenceAt(3); anns[1].label = "structure";
anns[2].sequenceRef = al.getSequenceAt(3); anns[2].label = "iron";
- anns[3].sequenceRef = null; anns[3].label = "Quality";
- anns[4].sequenceRef = null; anns[4].label = "Consensus";
+ anns[3].autoCalculated = true; anns[3].label = "Quality";
+ anns[4].autoCalculated = true; anns[4].label = "Consensus";
anns[5].sequenceRef = al.getSequenceAt(0); anns[5].label = "IRON";
anns[6].sequenceRef = al.getSequenceAt(2); anns[6].label = "Structure";
// @formatter:on
assertEquals("label0", anns[2].label); // label0 / sequence 1
assertEquals("Structure", anns[3].label); // Structure / sequence 2
assertEquals("structure", anns[4].label); // structure / sequence 3
- assertEquals("Quality", anns[5].label); // non-sequence annotations
+ assertEquals("Quality", anns[5].label); // autocalc annotations
assertEquals("Consensus", anns[6].label); // retain ordering
}
anns[0].sequenceRef = al.getSequenceAt(1); anns[0].label = "label0";
anns[1].sequenceRef = al.getSequenceAt(3); anns[1].label = "structure";
anns[2].sequenceRef = al.getSequenceAt(3); anns[2].label = "iron";
- anns[3].sequenceRef = null; anns[3].label = "Quality";
- anns[4].sequenceRef = null; anns[4].label = "Consensus";
+ anns[3].autoCalculated = true; anns[3].label = "Quality";
+ anns[4].autoCalculated = true; anns[4].label = "Consensus";
anns[5].sequenceRef = al.getSequenceAt(0); anns[5].label = "IRON";
anns[6].sequenceRef = al.getSequenceAt(2); anns[6].label = "Structure";
// @formatter:on
AnnotationSorter testee = new AnnotationSorter(al, true);
testee.sort(anns, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
- assertEquals("Quality", anns[0].label); // non-sequence annotations
+ assertEquals("Quality", anns[0].label); // autocalc annotations
assertEquals("Consensus", anns[1].label); // retain ordering
assertEquals("IRON", anns[2].label); // IRON / sequence 0
assertEquals("iron", anns[3].label); // iron / sequence 3
anns[0].sequenceRef = al.getSequenceAt(1); anns[0].label = "label0";
anns[1].sequenceRef = al.getSequenceAt(3); anns[1].label = "structure";
anns[2].sequenceRef = al.getSequenceAt(3); anns[2].label = "iron";
- anns[3].sequenceRef = null; anns[3].label = "Quality";
- anns[4].sequenceRef = null; anns[4].label = "Consensus";
+ anns[3].autoCalculated = true; anns[3].label = "Quality";
+ anns[4].autoCalculated = true; anns[4].label = "Consensus";
anns[5].sequenceRef = al.getSequenceAt(0); anns[5].label = "IRON";
anns[6].sequenceRef = al.getSequenceAt(2); anns[6].label = "Structure";
// @formatter:on
AnnotationSorter testee = new AnnotationSorter(al, true);
testee.sort(anns, SequenceAnnotationOrder.NONE);
- assertEquals("Quality", anns[0].label); // non-sequence annotations
+ assertEquals("Quality", anns[0].label); // autocalc annotations
assertEquals("Consensus", anns[1].label); // retain ordering
assertEquals("label0", anns[2].label);
assertEquals("structure", anns[3].label);
}
/**
- * Test simple translation to Amino Acids (with STOP codons translated to X).
+ * Test simple translation to Amino Acids (with STOP codons translated to *).
*
* @throws IOException
*/
AlignmentI translated = dna.translateCdna();
String aa = translated.getSequenceAt(0).getSequenceAsString();
assertEquals(
- "AAAACCDDEEFFGGGGHHIIIKKLLLLLLMNNPPPPQQRRRRRRSSSSSSTTTTVVVVWYYXXX",
+ "AAAACCDDEEFFGGGGHHIIIKKLLLLLLMNNPPPPQQRRRRRRSSSSSSTTTTVVVVWYY***",
aa);
}
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+@Test(groups = { "Network" })
public class DisorderAnnotExportImport
{
public static String testseqs = "examples/uniref50.fa";
public static jalview.gui.AlignFrame af = null;
- @BeforeClass(alwaysRun = true)
+ @BeforeClass(inheritGroups = true)
public static void setUpBeforeClass() throws Exception
{
assertNotNull("Couldn't load test data ('" + testseqs + "')", af);
}
- @AfterClass
+ @AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
if (af != null)
{
af.setVisible(false);
af.dispose();
+ af=null;
}
}
/**
* test for patches to JAL-1294
*/
- @Test(groups ={ "Functional" })
+ @Test
public void testDisorderAnnotExport()
{
disorderClient = new AADisorderClient(iupreds.get(0), af, null, null);