--- /dev/null
+ScoreMatrix BLOSUM62Legacy
+#
+# The BLOSUM62 substitution matrix, as used in earlier versions of jalview
+#
+# Scores are not symbol case sensitive, unless column(s) are provided for lower case characters
+# The 'guide symbol' at the start of each row of score values is optional
+# Values may be integer or floating point, delimited by tab, space, comma or combinations
+#
+ A R N D C Q E G H I L K M F P S T W Y V B Z X *
+A 4 -1 -2 -2 0 -1 -1 0 -2 -1 -1 -1 -1 -2 -1 1 0 -3 -2 0 -2 -1 0 -4
+R -1 5 0 -2 -3 1 0 -2 0 -3 -2 2 -1 -3 -2 -1 -1 -3 -2 -3 -1 0 -1 -4
+N -2 0 6 1 -3 0 0 0 1 -3 -3 0 -2 -3 -2 1 0 -4 -2 -3 3 0 -1 -4
+D -2 -2 1 6 -3 0 2 -1 -1 -3 -4 -1 -3 -3 -1 0 -1 -4 -3 -3 4 1 -1 -4
+C 0 3 -3 -3 9 -3 -4 -3 -3 -1 -1 -3 -1 -2 -3 -1 -1 -2 -2 -1 -3 -3 -2 -4
+Q -1 1 0 0 -3 5 2 -2 0 -3 -2 1 0 -3 -1 0 -1 -2 -1 -2 0 3 -1 -4
+E -1 0 0 2 -4 2 5 -2 0 -3 -3 1 -2 -3 -1 0 -1 -3 -2 -2 1 4 -1 -4
+G 0 -2 0 -1 -3 -2 -2 6 -2 -4 -4 -2 -3 -3 -2 0 -2 -2 -3 -3 -1 -2 -1 -4
+H -2 0 1 -1 -3 0 0 -2 8 -3 -3 -1 -2 -1 -2 -1 -2 -2 2 -3 0 0 -1 -4
+I -1 -3 -3 -3 -1 -3 -3 -4 -3 4 2 -3 1 0 -3 -2 -1 -3 -1 3 -3 -3 -1 -4
+L -1 -2 -3 -4 -1 -2 -3 -4 -3 2 4 -2 2 0 -3 -2 -1 -2 -1 1 -4 -3 -1 -4
+K -1 2 0 -1 -3 1 1 -2 -1 -3 -2 5 -1 -3 -1 0 -1 -3 -2 -2 0 1 -1 -4
+M -1 -1 -2 -3 -1 0 -2 -3 -2 1 2 -1 5 0 -2 -1 -1 -1 -1 1 -3 -1 -1 -4
+F -2 -3 -3 -3 -2 -3 -3 -3 -1 0 0 -3 0 6 -4 -2 -2 1 3 -1 -3 -3 -1 -4
+P -1 -2 -2 -1 -3 -1 -1 -2 -2 -3 -3 -1 -2 -4 7 -1 -1 -4 -3 -2 -2 -1 -2 -4
+S 1 -1 1 0 -1 0 0 0 -1 -2 -2 0 -1 -2 -1 4 1 -3 -2 -2 0 0 0 -4
+T 0 -1 0 -1 -1 -1 -1 -2 -2 -1 -1 -1 -1 -2 -1 1 5 -2 -2 0 -1 -1 0 -4
+W -3 -3 -4 -4 -2 -2 -3 -2 -2 -3 -2 -3 -1 1 -4 -3 -2 11 2 -3 -4 -3 -2 -4
+Y -2 -2 -2 -3 -2 -1 -2 -3 2 -1 -1 -2 -1 3 -3 -2 -2 2 7 -1 -3 -2 -1 -4
+V 0 -3 -3 -3 -1 -2 -2 -3 -3 3 1 -2 1 -1 -2 -2 0 -3 -1 4 -3 -2 -1 -4
+B -2 -1 3 4 -3 0 1 -1 0 -3 -4 0 -3 -3 -2 0 -1 -4 -3 -3 4 1 -1 -4
+Z -1 0 0 1 -3 3 4 -2 0 -3 -3 1 -1 -3 -1 0 -1 -3 -2 -2 1 4 -1 -4
+X 0 -1 -1 -1 -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 0 0 -2 -1 -1 -1 -1 -1 -4
+* -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 1
<p>
<strong>Principal Component Analysis</strong>
</p>
- <p>A principal component analysis can be performed via the
- <a href="calculations.html">calculations dialog</a> which is accessed by selecting <strong>Calculate→Calculate
- Tree or PCA...</strong>.</p>
+ <p>
+ A principal component analysis can be performed via the <a
+ href="calculations.html">calculations dialog</a> which is accessed
+ by selecting <strong>Calculate→Calculate Tree or
+ PCA...</strong>.
+ </p>
<p>This calculation creates a spatial representation of the
similarities within a selected group, or all of the sequences in an
alignment. After the calculation finishes, a 3D viewer displays the
calculation are given in the <strong><em>Change
Parameters</em></strong> menu.
</p>
- <p>
- <em>PCA Calculation modes</em><br /> The default Jalview
- calculation mode (indicated when <em><strong>Jalview
- PCA Calculation</strong></em> is ticked in the <strong><em>Change
- Parameters</em></strong> menu) is to perform a PCA on a matrix where elements
- in the upper diagonal give the sum of scores for mutating in one
- direction, and the lower diagonal is the sum of scores for mutating
- in the other. For protein substitution models like BLOSUM62, this
- gives an asymmetric matrix, and a different PCA to a matrix produced
- with the method described in the paper by G. Casari, C. Sander and
- A. Valencia. Structural Biology volume 2, no. 2, February 1995 (<a
- href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=7749921">pubmed</a>)
- and implemented at the SeqSpace server at the EBI. This method
- preconditions the matrix by multiplying it with its transpose, and
- can be employed in the PCA viewer by unchecking the <strong><em>Jalview
- PCA Calculation</em></strong> option in the <strong><em>Change
- Parameters</em></strong> menu.
- </p>
<img src="pcaviewer.gif">
<p>
<strong>The PCA Viewer</strong>
added to the Jalview desktop in v2.7.</em> <em>The Reset button
and Change Parameters menu were added in Jalview 2.8.</em> <em>Support
for PAM250 based PCA was added in Jalview 2.8.1.</em>
+ </p>
+ <p>
+ <strong>Reproducing PCA calculations performed with older
+ Jalview releases</strong> Jalview 2.10.2 included a revised PCA
+ implementation which treated Gaps and non-standard residues in the
+ same way as a matrix produced with the method described in the paper
+ by G. Casari, C. Sander and A. Valencia. Structural Biology volume
+ 2, no. 2, February 1995 (<a
+ href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=7749921">pubmed</a>)
+ and implemented at the SeqSpace server at the EBI. To reproduce
+ calculations performed with earlier Jalview releases it is necessary
+ to execute the following Groovy script:
+
+ <pre>
+ jalview.analysis.scoremodels.ScoreMatrix.scoreGapAsAny=true
+ </pre>
+ Additionally, for PCAs performed with older versions of Jalview and
+ the Blosum62 matrix, it is also necessary to import the legacy
+ BLOSUM62 score matrix (which is asymmetric for mutations between C to
+ R) which can be downloaded at
+ http://www.jalview.org/examples/legacyBlosum62.scm
+ </p>
+
</body>
</html>
<p>The red box indicates the currently viewed region of the
alignment, this may be moved by clicking and dragging with the
mouse.</p>
- <p><strong>Right-click</strong> (or CMD-Click) to open the
- overview's popup menu. This provides an option to include hidden
- regions in the overview (shown as dark-grey rows and columns). <br/><br/>
- <em>The option to include/exclude hidden regions in the
- overview was introduced in Jalview 2.10.2</em>.
+ <p>Click anywhere else in the overview to centre the view on that
+ position</p>
+ <p></p>
+ <p>
+ <strong>Hiding hidden regions in the overview</strong>
+ </p>
+ <p>
+ Hidden sequences and columns are by default shown as dark-grey rows
+ and columns in the overview. Hidden regions can also be omitted
+ entirely (to make the Overview 'WYSIWIG') by <strong>Right-clicking</strong>
+ (or CMD-Clicking) to open the overview's popup menu.<br />
+ <br /> <em>The option to include/exclude hidden regions in the
+ overview was introduced in Jalview 2.10.2</em>.
+
<p>
<img src="overview.gif" width="407" height="137">
</p>
<!-- JAL-384 -->Custom shading schemes created via groovy
scripts
</li>
- <li>
- <!-- JAL-2491 -->linked scrolling of CDS/Protein views
- via Overview or sequence motif search operations
- </li>
- <li>
- <!-- JAL-2526 -->Efficiency improvements for interacting
- with alignment and overview windows
- </li>
- <li>
- <!-- JAL-2388 -->Hidden columns and sequences can be
- omitted in Overview
+ <li>Improved overview window
+ <ul>
+ <li>
+ <!-- JAL-2526 -->Efficiency improvements for
+ interacting with alignment and overview windows
+ </li>
+ <li>
+ <!-- JAL-2491 -->Linked scrolling of CDS/Protein
+ views via Overview or sequence motif search operations
+ </li>
+ <li>
+ <!-- JAL-2514 -->Scrolling of wrapped alignment views
+ via overview
+ </li>
+ <li>
+ <!-- JAL-2388 -->Hidden columns and sequences can be
+ omitted in Overview
+ </li>
+ <li>
+ <!-- JAL-2611 -->Click-drag in visible area allows
+ fine adjustment of visible position
+ </li>
+ </ul>
</li>
<li>
<!-- JAL-2535 -->Posterior probability annotation from
redundant alignments
</li>
<li>
- <!-- JAL-2365 -->Cannot configure feature colours with
- lightGray or darkGray via features file
+ <!-- JAL-2365,JAL-2642 -->Cannot configure feature colours with
+ lightGray or darkGray via features file (but can specify lightgray)
</li>
<li>
<!-- JAL-2421 -->Overview window visible region moves
due to 'null' string rather than empty string used for
residues with no corresponding PDB mapping).
</li>
+ <li><!-- JAL-2592 -->User defined colourschemes called 'User Defined' don't appear in Colours menu</li>
+ <li>
</ul>
public void setWrapAlignment(boolean wrap)
{
- vpRanges.setStartSeq(0);
+ vpRanges.setStartEndSeq(0, vpRanges.getVisibleAlignmentHeight());
vpRanges.setStartRes(0);
scalePanelHolder.setVisible(!wrap);
public void fastPaint(int horizontal)
{
- if (horizontal == 0
+ if (horizontal == 0 || gg == null
|| av.getAlignment().getAlignmentAnnotation() == null
|| av.getAlignment().getAlignmentAnnotation().length < 1)
{
* 'User Defined' opens a panel to configure or load a
* user-defined colour scheme
*/
- if (ResidueColourScheme.USER_DEFINED.equals(name))
+ if (ResidueColourScheme.USER_DEFINED_MENU.equals(name))
{
new UserDefinedColours(alignPanel);
return;
final String label = MessageManager.getString("action.user_defined");
JRadioButtonMenuItem userDefinedColour = new JRadioButtonMenuItem(
label);
- userDefinedColour.setName(ResidueColourScheme.USER_DEFINED);
+ userDefinedColour.setName(ResidueColourScheme.USER_DEFINED_MENU);
userDefinedColour.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
- client.changeColour_actionPerformed(ResidueColourScheme.USER_DEFINED);
+ client.changeColour_actionPerformed(ResidueColourScheme.USER_DEFINED_MENU);
}
});
colourMenu.add(userDefinedColour);
{
none = radioButton;
}
- if (ResidueColourScheme.USER_DEFINED.equals(buttonName))
+ if (ResidueColourScheme.USER_DEFINED_MENU.equals(buttonName))
{
userDefined = radioButton;
}
}
// recover view properties and display parameters
- if (view.getViewName() != null)
- {
- af.viewport.viewName = view.getViewName();
- af.setInitialTabVisible();
- }
- af.setBounds(view.getXpos(), view.getYpos(), view.getWidth(),
- view.getHeight());
af.viewport.setShowAnnotation(view.getShowAnnotation());
af.viewport.setAbovePIDThreshold(view.getPidSelected());
af.viewport.setShowUnconserved(view.hasShowUnconserved() ? view
.isShowUnconserved() : false);
af.viewport.getRanges().setStartRes(view.getStartRes());
+
+ if (view.getViewName() != null)
+ {
+ af.viewport.viewName = view.getViewName();
+ af.setInitialTabVisible();
+ }
+ af.setBounds(view.getXpos(), view.getYpos(), view.getWidth(),
+ view.getHeight());
// startSeq set in af.alignPanel.updateLayout below
af.alignPanel.updateLayout();
ColourSchemeI cs = null;
}
if (forConservation)
{
- if (!scheme.conservationApplied())
+ if (!scheme.conservationApplied() && sg != null)
{
/*
* first time the colour scheme has had Conservation shading applied
{
public static final String NONE = "None";
+ /*
+ * default display name for a user defined colour scheme
+ */
public static final String USER_DEFINED = "User Defined";
/*
+ * name for (new) "User Defined.." colour scheme menu item
+ */
+ public static final String USER_DEFINED_MENU = "*User Defined*";
+
+ /*
* lookup up by character value e.g. 'G' to the colors array index
* e.g. if symbolIndex['K'] = 11 then colors[11] is the colour for K
*/
{
return schemeName;
}
- return "User Defined";
+ return ResidueColourScheme.USER_DEFINED;
}
/**
{
residueShading.setConservation(hconservation);
}
+ /*
+ * reset conservation flag in case just set to false if
+ * Conservation was null (calculation still in progress)
+ */
+ residueShading.setConservationApplied(getConservationSelected());
residueShading.alignmentChanged(alignment, hiddenRepSequences);
}
*/
package jalview.ws.dbsources;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
-import jalview.io.DataSourceType;
-import jalview.io.FileFormat;
-import jalview.io.FormatAdapter;
import com.stevesoft.pat.Regex;
/*
* (non-Javadoc)
*
- * @see jalview.ws.DbSourceProxy#getSequenceRecords(java.lang.String[])
- */
- @Override
- public AlignmentI getSequenceRecords(String queries) throws Exception
- {
- // TODO: this is not a perfect implementation. We need to be able to add
- // individual references to each sequence in each family alignment that's
- // retrieved.
- startQuery();
- AlignmentI rcds = new FormatAdapter().readFile(getXFAMURL()
- + queries.trim().toUpperCase(), DataSourceType.URL,
- FileFormat.Stockholm);
- for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++)
- {
- rcds.getSequenceAt(s).addDBRef(new DBRefEntry(DBRefSource.PFAM,
- // getDbSource(),
- getDbVersion(), queries.trim().toUpperCase()));
- if (!getDbSource().equals(DBRefSource.PFAM))
- { // add the specific ref too
- rcds.getSequenceAt(s).addDBRef(
- new DBRefEntry(getDbSource(), getDbVersion(), queries
- .trim().toUpperCase()));
- }
- }
- stopQuery();
- return rcds;
- }
-
- /*
- * (non-Javadoc)
- *
* @see jalview.ws.DbSourceProxy#isValidReference(java.lang.String)
*/
@Override
@Override
protected String getXFAMURL()
{
- return "http://pfam.xfam.org/family/alignment/download/format?alnType=full&format=stockholm&order=t&case=l&gaps=default&entry=";
+ return "http://pfam.xfam.org/family/";
+
}
+ @Override
+ public String getXFAMURLSUFFIX()
+ {
+ return "/alignment/full";
+ }
/*
* (non-Javadoc)
*
@Override
protected String getXFAMURL()
{
- return "http://pfam.xfam.org/family/alignment/download/format?alnType=seed&format=stockholm&order=t&case=l&gaps=default&entry=";
+ return "http://pfam.xfam.org/family/";
}
+ @Override
+ public String getXFAMURLSUFFIX()
+ {
+ return "/alignment/seed";
+ }
/*
* (non-Javadoc)
*
@Override
protected String getXFAMURL()
{
- return "http://rfam.xfam.org/family/alignment/download/format?alnType=full&nseLabels=0&format=stockholm&acc=";
+ return "http://rfam.xfam.org/family/";
}
+ @Override
+ public String getXFAMURLSUFFIX()
+ {
+ return "/alignment/full";
+ }
/*
* (non-Javadoc)
*
protected String getXFAMURL()
{
return "http://rfam.xfam.org/family/";
- // Janelia Farms url
- // "http://rfam.janelia.org/cgi-bin/getalignment?type=seed&fmt=stockholm&acc=";
}
@Override
public String getXFAMURLSUFFIX()
{
- return "/alignment";
+ // to download gzipped file add '?gzip=1'
+ return "/alignment/stockholm";
}
/*
*/
package jalview.ws.dbsources;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.io.DataSourceType;
// retrieved.
startQuery();
// TODO: trap HTTP 404 exceptions and return null
- AlignmentI rcds = new FormatAdapter().readFile(getXFAMURL()
- + queries.trim().toUpperCase() + getXFAMURLSUFFIX(),
+ String xfamUrl = getXFAMURL()
+ + queries.trim().toUpperCase() + getXFAMURLSUFFIX();
+
+ if (Cache.log != null)
+ {
+ Cache.log.debug("XFAM URL for retrieval is: " + xfamUrl);
+ }
+
+ AlignmentI rcds = new FormatAdapter().readFile(xfamUrl ,
DataSourceType.URL, FileFormat.Stockholm);
+
for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++)
{
rcds.getSequenceAt(s).addDBRef(new DBRefEntry(getXfamSource(),
assertEquals(af.alignPanel.getViewName(), "View 1");
AlignViewport av2 = af.getViewport();
assertNotSame(av, av2);
+ assertSame(av2, af.alignPanel.av);
rs = av2.getResidueShading();
assertNotSame(av.getResidueShading(), rs);
assertEquals(rs.getThreshold(), 10);
- assertTrue(rs.conservationApplied());
+ assertTrue(rs.conservationApplied(), rs.toString());
assertEquals(rs.getConservationInc(), 20);
assertEquals(av2.getAlignment().getGroups().size(), 1);
sg = av2.getAlignment().getGroups().get(0);
WRAP_ALIGNMENT=false
#DAS_REGISTRY_URL=http\://www.dasregistry.org/das/ # retired 01/05/2015
DAS_REGISTRY_URL=http\://www.ebi.ac.uk/das-srv/registry/das/
+logs.Jalview.level=DEBUG
Assert.assertTrue(seedrf.getHeight() > 1,
"Seed Alignment for " + rfs.getTestQuery()
+ " didn't contain more than one sequence.");
+ Assert.assertTrue(seedrf.getProperties().size() > 0,
+ "Seed Alignment for " + rfs.getTestQuery()
+ + " didn't have any properties.");
+
}
@Test(groups = { "External" })
AlignmentI seedpf = pfseed.getSequenceRecords(pff.getTestQuery());
Assert.assertNotNull(seedpf, "Seed Alignment for " + pff.getTestQuery()
+ " didn't retrieve.");
+ Assert.assertTrue(seedpf.getProperties().size() > 0,
+ "Seed Alignment for " + pfseed.getTestQuery()
+ + " didn't have any properties.");
Assert.assertTrue(seedpf.getHeight() < fullpf.getHeight(),
"Expected Full alignment to have more sequences than seed for "
+ pff.getTestQuery());
+ Assert.assertTrue(fullpf.getProperties().size() > 0,
+ "Full Alignment for " + pff.getTestQuery()
+ + " didn't have any properties.");
+
}
}