</xs:documentation>
</xs:annotation>
<xs:sequence>
- <xs:element name="details" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- The text report of the calculation
- </xs:documentation>
- </xs:annotation>
- </xs:element>
<xs:element name="pairwiseMatrix" type="jv:DoubleMatrix" />
+ <xs:element name="tridiagonalMatrix" type="jv:DoubleMatrix" />
+ <xs:element name="tridiagonalD" type="jv:DoubleVector" />
+ <xs:element name="tridiagonalE" type="jv:DoubleVector" />
<xs:element name="eigenMatrix" type="jv:DoubleMatrix" />
<xs:element name="eigenMatrixD" type="jv:DoubleVector" />
- <xs:element name="eigenMatrixE" type="jv:DoubleVector" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="DoubleVector">
import jalview.api.analysis.ScoreModelI;
import jalview.api.analysis.SimilarityParamsI;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.Point;
import jalview.math.MatrixI;
*/
private MatrixI pairwiseScores;
- private MatrixI afterTred;
+ private MatrixI tridiagonal;
- private MatrixI eigenvector;
-
- private String details;
+ private MatrixI eigenMatrix;
/**
* Constructor given the sequences to compute for, the similarity model to
*/
public double getEigenvalue(int i)
{
- return eigenvector.getD()[i];
+ return eigenMatrix.getD()[i];
}
/**
for (int i = 0; i < pairwiseScores.width(); i++)
{
- out += (pairwiseScores.getValue(row, i) * eigenvector.getValue(i, n));
+ out += (pairwiseScores.getValue(row, i) * eigenMatrix.getValue(i, n));
}
- return out / eigenvector.getD()[n];
+ return out / eigenMatrix.getD()[n];
}
/**
*/
public String getDetails()
{
- return details;
- /*
StringBuilder sb = new StringBuilder(1024);
sb.append("PCA calculation using ").append(scoreModel.getName())
.append(" sequence similarity matrix\n========\n\n");
PrintStream ps = wrapOutputBuffer(sb);
+ /*
+ * pairwise similarity scores
+ */
sb.append(" --- OrigT * Orig ---- \n");
pairwiseScores.print(ps, "%8.2f");
+ /*
+ * tridiagonal matrix, with D and E vectors
+ */
sb.append(" ---Tridiag transform matrix ---\n");
sb.append(" --- D vector ---\n");
- afterTred.printD(ps, "%15.4e");
+ tridiagonal.printD(ps, "%15.4e");
ps.println();
sb.append("--- E vector ---\n");
- afterTred.printE(ps, "%15.4e");
+ tridiagonal.printE(ps, "%15.4e");
ps.println();
+ /*
+ * eigenvalues matrix, with D vector
+ */
sb.append(" --- New diagonalization matrix ---\n");
- eigenvector.print(ps, "%8.2f");
+ eigenMatrix.print(ps, "%8.2f");
sb.append(" --- Eigenvalues ---\n");
- eigenvector.printD(ps, "%15.4e");
+ eigenMatrix.printD(ps, "%15.4e");
ps.println();
return sb.toString();
- */
}
/**
@Override
public void run()
{
- /*
- * print details to a string buffer as they are computed
- */
- StringBuilder sb = new StringBuilder(1024);
- sb.append("PCA calculation using ").append(scoreModel.getName())
- .append(" sequence similarity matrix\n========\n\n");
- PrintStream ps = wrapOutputBuffer(sb);
-
try
{
- eigenvector = scoreModel.findSimilarities(seqs, similarityParams);
-
- sb.append(" --- OrigT * Orig ---- \n");
- eigenvector.print(ps, "%8.2f");
-
- pairwiseScores = eigenvector.copy();
-
- eigenvector.tred();
-
- afterTred = eigenvector.copy();
-
- sb.append(" ---Tridiag transform matrix ---\n");
- sb.append(" --- D vector ---\n");
- afterTred.printD(ps, "%15.4e");
- ps.println();
- sb.append("--- E vector ---\n");
- afterTred.printE(ps, "%15.4e");
- ps.println();
-
- // Now produce the diagonalization matrix
- eigenvector.tqli();
+ /*
+ * sequence pairwise similarity scores
+ */
+ pairwiseScores = scoreModel.findSimilarities(seqs, similarityParams);
+
+ /*
+ * tridiagonal matrix
+ */
+ tridiagonal = pairwiseScores.copy();
+ tridiagonal.tred();
+
+ /*
+ * the diagonalization matrix
+ */
+ eigenMatrix = tridiagonal.copy();
+ eigenMatrix.tqli();
} catch (Exception q)
{
+ Cache.log.error("Error computing PCA: " + q.getMessage());
q.printStackTrace();
- sb.append("\n*** Unexpected exception when performing PCA ***\n"
- + q.getLocalizedMessage());
- sb.append(
- "*** Matrices below may not be fully diagonalised. ***\n");
}
-
- sb.append(" --- New diagonalization matrix ---\n");
- eigenvector.print(ps, "%8.2f");
- sb.append(" --- Eigenvalues ---\n");
- eigenvector.printD(ps, "%15.4e");
- ps.println();
-
- details = sb.toString();
}
/**
public MatrixI getEigenmatrix()
{
- return eigenvector;
+ return eigenMatrix;
}
public void setEigenmatrix(MatrixI m)
{
- eigenvector = m;
+ eigenMatrix = m;
+ }
+
+ public MatrixI getTridiagonal()
+ {
+ return tridiagonal;
}
- public void setDetails(String d)
+ public void setTridiagonal(MatrixI tridiagonal)
{
- details = d;
+ this.tridiagonal = tridiagonal;
}
}
import jalview.schemabinding.version2.DoubleMatrix;
import jalview.schemabinding.version2.EigenMatrix;
import jalview.schemabinding.version2.EigenMatrixD;
-import jalview.schemabinding.version2.EigenMatrixE;
import jalview.schemabinding.version2.Features;
import jalview.schemabinding.version2.Group;
import jalview.schemabinding.version2.HiddenColumns;
import jalview.schemabinding.version2.StructureState;
import jalview.schemabinding.version2.ThresholdLine;
import jalview.schemabinding.version2.Tree;
+import jalview.schemabinding.version2.TridiagonalD;
+import jalview.schemabinding.version2.TridiagonalE;
+import jalview.schemabinding.version2.TridiagonalMatrix;
import jalview.schemabinding.version2.UserColours;
import jalview.schemabinding.version2.Viewport;
import jalview.schemabinding.version2.types.ColourThreshTypeType;
PcaData data = new PcaData();
viewer.setPcaData(data);
PCA pca = pcaModel.getPcaData();
- data.setDetails(pca.getDetails());
- MatrixI m = pca.getEigenmatrix();
- EigenMatrix eigenMatrix = new EigenMatrix();
- eigenMatrix.setRows(m.height());
- eigenMatrix.setColumns(m.width());
- data.setEigenMatrix(eigenMatrix);
- for (int i = 0; i < m.height(); i++)
- {
- Row row = new Row();
- for (int j = 0; j < m.width(); j++)
- {
- row.addD(m.getValue(i, j));
- }
- eigenMatrix.addRow(row);
- }
- EigenMatrixD eigenMatrixD = new EigenMatrixD();
- eigenMatrixD.setD(m.getD());
- data.setEigenMatrixD(eigenMatrixD);
- EigenMatrixE eigenMatrixE = new EigenMatrixE();
- eigenMatrixE.setD(m.getE());
- data.setEigenMatrixE(eigenMatrixE);
PairwiseMatrix pm = new PairwiseMatrix();
- m = pca.getPairwiseScores();
- pm.setRows(m.height());
- pm.setColumns(m.width());
+ MatrixI m = pca.getPairwiseScores();
+ saveDoubleMatrix(m, pm);
data.setPairwiseMatrix(pm);
- for (int i = 0; i < m.height(); i++)
- {
- Row row = new Row();
- for (int j = 0; j < m.width(); j++)
- {
- row.addD(m.getValue(i, j));
- }
- pm.addRow(row);
- }
+
+ TridiagonalMatrix tm = new TridiagonalMatrix();
+ m = pca.getTridiagonal();
+ saveDoubleMatrix(m, tm);
+ data.setTridiagonalMatrix(tm);
+ TridiagonalD tridiagonalD = new TridiagonalD();
+ tridiagonalD.setD(m.getD());
+ data.setTridiagonalD(tridiagonalD);
+ TridiagonalE tridiagonalE = new TridiagonalE();
+ tridiagonalE.setD(m.getE());
+ data.setTridiagonalE(tridiagonalE);
+
+ m = pca.getEigenmatrix();
+ EigenMatrix eigenMatrix = new EigenMatrix();
+ data.setEigenMatrix(eigenMatrix);
+ saveDoubleMatrix(m, eigenMatrix);
+ EigenMatrixD eigenmatrixD = new EigenMatrixD();
+ eigenmatrixD.setD(m.getD());
+ data.setEigenMatrixD(eigenmatrixD);
jms.addPcaViewer(viewer);
} catch (Throwable t)
}
/**
+ * Stores values from a matrix into an XML element
+ *
+ * @param m
+ * @param xmlMatrix
+ * @see #loadDoubleMatrix(DoubleMatrix)
+ */
+ protected void saveDoubleMatrix(MatrixI m, DoubleMatrix xmlMatrix)
+ {
+ xmlMatrix.setRows(m.height());
+ xmlMatrix.setColumns(m.width());
+ for (int i = 0; i < m.height(); i++)
+ {
+ Row row = new Row();
+ for (int j = 0; j < m.width(); j++)
+ {
+ row.addD(m.getValue(i, j));
+ }
+ xmlMatrix.addRow(row);
+ }
+ }
+
+ /**
+ * Loads XML matrix data into a new Matrix object
+ *
+ * @param mData
+ * @return
+ * @see Jalview2XML#saveDoubleMatrix(MatrixI, DoubleMatrix)
+ */
+ protected MatrixI loadDoubleMatrix(DoubleMatrix mData)
+ {
+ int rows = mData.getRows();
+ double[][] vals = new double[rows][];
+
+ for (int i = 0; i < rows; i++)
+ {
+ vals[i] = mData.getRow(i).getD();
+ }
+
+ MatrixI m = new Matrix(vals);
+ return m;
+ }
+
+ /**
* Save any Varna viewers linked to this sequence. Writes an rnaViewer element
* for each viewer, with
* <ul>
.getScoreModel(modelName, ap);
PCA pca = new PCA(null, scoreModel, params);
PcaData pcaData = viewer.getPcaData();
- pca.setDetails(pcaData.getDetails());
- MatrixI pairwise = loadMatrix(pcaData.getPairwiseMatrix());
+
+ MatrixI pairwise = loadDoubleMatrix(pcaData.getPairwiseMatrix());
pca.setPairwiseScores(pairwise);
- MatrixI result = loadMatrix(pcaData.getEigenMatrix());
+
+ MatrixI triDiag = loadDoubleMatrix(pcaData.getTridiagonalMatrix());
+ triDiag.setD(pcaData.getTridiagonalD().getD());
+ triDiag.setE(pcaData.getTridiagonalE().getD());
+ pca.setTridiagonal(triDiag);
+
+ MatrixI result = loadDoubleMatrix(pcaData.getEigenMatrix());
result.setD(pcaData.getEigenMatrixD().getD());
- result.setE(pcaData.getEigenMatrixE().getD());
pca.setEigenmatrix(result);
+
panel.pcaModel.setPCA(pca);
/*
}
/**
- * Loads XML matrix data into a new Matrix object
- *
- * @param mData
- * @return
- */
- protected MatrixI loadMatrix(DoubleMatrix mData)
- {
- int rows = mData.getRows();
- double[][] vals = new double[rows][];
-
- for (int i = 0; i < rows; i++)
- {
- vals[i] = mData.getRow(i).getD();
- }
-
- MatrixI m = new Matrix(vals);
- return m;
- }
-
- /**
* Populates an XML model of the feature colour scheme for one feature type
*
* @param featureType
-#Fri May 04 15:18:48 BST 2018
+#Mon May 07 09:17:08 BST 2018
jalview.schemabinding.version2.SeqPointMax=jalview.schemabinding.version2.descriptors.SeqPointMaxDescriptor
jalview.schemabinding.version2.ThresholdLine=jalview.schemabinding.version2.descriptors.ThresholdLineDescriptor
jalview.schemabinding.version2.SequenceSetProperties=jalview.schemabinding.version2.descriptors.SequenceSetPropertiesDescriptor
jalview.schemabinding.version2.Tree=jalview.schemabinding.version2.descriptors.TreeDescriptor
jalview.schemabinding.version2.JalviewModel=jalview.schemabinding.version2.descriptors.JalviewModelDescriptor
jalview.schemabinding.version2.SequenceType=jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor
+jalview.schemabinding.version2.TridiagonalE=jalview.schemabinding.version2.descriptors.TridiagonalEDescriptor
jalview.schemabinding.version2.SequencePoint=jalview.schemabinding.version2.descriptors.SequencePointDescriptor
jalview.schemabinding.version2.OtherData=jalview.schemabinding.version2.descriptors.OtherDataDescriptor
jalview.schemabinding.version2.Setting=jalview.schemabinding.version2.descriptors.SettingDescriptor
+jalview.schemabinding.version2.TridiagonalD=jalview.schemabinding.version2.descriptors.TridiagonalDDescriptor
jalview.schemabinding.version2.Axis=jalview.schemabinding.version2.descriptors.AxisDescriptor
jalview.schemabinding.version2.AlcodonFrame=jalview.schemabinding.version2.descriptors.AlcodonFrameDescriptor
jalview.schemabinding.version2.AnnotationElement=jalview.schemabinding.version2.descriptors.AnnotationElementDescriptor
jalview.schemabinding.version2.WebServiceParameterSet=jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor
jalview.schemabinding.version2.Alcodon=jalview.schemabinding.version2.descriptors.AlcodonDescriptor
jalview.schemabinding.version2.AnnotationColours=jalview.schemabinding.version2.descriptors.AnnotationColoursDescriptor
+jalview.schemabinding.version2.TridiagonalMatrix=jalview.schemabinding.version2.descriptors.TridiagonalMatrixDescriptor
jalview.schemabinding.version2.Pdbids=jalview.schemabinding.version2.descriptors.PdbidsDescriptor
jalview.schemabinding.version2.AnnotationColourScheme=jalview.schemabinding.version2.descriptors.AnnotationColourSchemeDescriptor
jalview.schemabinding.version2.Mapping=jalview.schemabinding.version2.descriptors.MappingDescriptor
// --------------------------/
/**
- * The text report of the calculation
- *
+ * Field _pairwiseMatrix.
*/
- private java.lang.String _details;
+ private jalview.schemabinding.version2.PairwiseMatrix _pairwiseMatrix;
/**
- * Field _pairwiseMatrix.
+ * Field _tridiagonalMatrix.
*/
- private jalview.schemabinding.version2.PairwiseMatrix _pairwiseMatrix;
+ private jalview.schemabinding.version2.TridiagonalMatrix _tridiagonalMatrix;
+
+ /**
+ * Field _tridiagonalD.
+ */
+ private jalview.schemabinding.version2.TridiagonalD _tridiagonalD;
+
+ /**
+ * Field _tridiagonalE.
+ */
+ private jalview.schemabinding.version2.TridiagonalE _tridiagonalE;
/**
* Field _eigenMatrix.
*/
private jalview.schemabinding.version2.EigenMatrixD _eigenMatrixD;
- /**
- * Field _eigenMatrixE.
- */
- private jalview.schemabinding.version2.EigenMatrixE _eigenMatrixE;
-
// ----------------/
// - Constructors -/
// ----------------/
// -----------/
/**
- * Returns the value of field 'details'. The field 'details' has the following
- * description: The text report of the calculation
- *
- *
- * @return the value of field 'Details'.
- */
- public java.lang.String getDetails()
- {
- return this._details;
- }
-
- /**
* Returns the value of field 'eigenMatrix'.
*
* @return the value of field 'EigenMatrix'.
}
/**
- * Returns the value of field 'eigenMatrixE'.
+ * Returns the value of field 'pairwiseMatrix'.
*
- * @return the value of field 'EigenMatrixE'.
+ * @return the value of field 'PairwiseMatrix'.
*/
- public jalview.schemabinding.version2.EigenMatrixE getEigenMatrixE()
+ public jalview.schemabinding.version2.PairwiseMatrix getPairwiseMatrix()
{
- return this._eigenMatrixE;
+ return this._pairwiseMatrix;
}
/**
- * Returns the value of field 'pairwiseMatrix'.
+ * Returns the value of field 'tridiagonalD'.
*
- * @return the value of field 'PairwiseMatrix'.
+ * @return the value of field 'TridiagonalD'.
*/
- public jalview.schemabinding.version2.PairwiseMatrix getPairwiseMatrix()
+ public jalview.schemabinding.version2.TridiagonalD getTridiagonalD()
{
- return this._pairwiseMatrix;
+ return this._tridiagonalD;
+ }
+
+ /**
+ * Returns the value of field 'tridiagonalE'.
+ *
+ * @return the value of field 'TridiagonalE'.
+ */
+ public jalview.schemabinding.version2.TridiagonalE getTridiagonalE()
+ {
+ return this._tridiagonalE;
+ }
+
+ /**
+ * Returns the value of field 'tridiagonalMatrix'.
+ *
+ * @return the value of field 'TridiagonalMatrix'.
+ */
+ public jalview.schemabinding.version2.TridiagonalMatrix getTridiagonalMatrix()
+ {
+ return this._tridiagonalMatrix;
}
/**
}
/**
- * Sets the value of field 'details'. The field 'details' has the following
- * description: The text report of the calculation
- *
- *
- * @param details
- * the value of field 'details'.
- */
- public void setDetails(final java.lang.String details)
- {
- this._details = details;
- }
-
- /**
* Sets the value of field 'eigenMatrix'.
*
* @param eigenMatrix
}
/**
- * Sets the value of field 'eigenMatrixE'.
- *
- * @param eigenMatrixE
- * the value of field 'eigenMatrixE'.
- */
- public void setEigenMatrixE(
- final jalview.schemabinding.version2.EigenMatrixE eigenMatrixE)
- {
- this._eigenMatrixE = eigenMatrixE;
- }
-
- /**
* Sets the value of field 'pairwiseMatrix'.
*
* @param pairwiseMatrix
}
/**
+ * Sets the value of field 'tridiagonalD'.
+ *
+ * @param tridiagonalD
+ * the value of field 'tridiagonalD'.
+ */
+ public void setTridiagonalD(
+ final jalview.schemabinding.version2.TridiagonalD tridiagonalD)
+ {
+ this._tridiagonalD = tridiagonalD;
+ }
+
+ /**
+ * Sets the value of field 'tridiagonalE'.
+ *
+ * @param tridiagonalE
+ * the value of field 'tridiagonalE'.
+ */
+ public void setTridiagonalE(
+ final jalview.schemabinding.version2.TridiagonalE tridiagonalE)
+ {
+ this._tridiagonalE = tridiagonalE;
+ }
+
+ /**
+ * Sets the value of field 'tridiagonalMatrix'.
+ *
+ * @param tridiagonalMatrix
+ * the value of field 'tridiagonalMatrix'.
+ */
+ public void setTridiagonalMatrix(
+ final jalview.schemabinding.version2.TridiagonalMatrix tridiagonalMatrix)
+ {
+ this._tridiagonalMatrix = tridiagonalMatrix;
+ }
+
+ /**
* Method unmarshal.
*
* @param reader
import org.exolab.castor.xml.Unmarshaller;
/**
- * Class EigenMatrixE.
+ * Class TridiagonalD.
*
* @version $Revision$ $Date$
*/
-public class EigenMatrixE extends DoubleVector
+public class TridiagonalD extends DoubleVector
implements java.io.Serializable
{
// - Constructors -/
// ----------------/
- public EigenMatrixE()
+ public TridiagonalD()
{
super();
}
org.exolab.castor.xml.ValidationException
{
return (jalview.schemabinding.version2.DoubleVector) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.EigenMatrixE.class,
+ .unmarshal(jalview.schemabinding.version2.TridiagonalD.class,
reader);
}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class TridiagonalE.
+ *
+ * @version $Revision$ $Date$
+ */
+public class TridiagonalE extends DoubleVector
+ implements java.io.Serializable
+{
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public TridiagonalE()
+ {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.schemabinding.version2.DoubleVector
+ */
+ public static jalview.schemabinding.version2.DoubleVector unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.schemabinding.version2.DoubleVector) Unmarshaller
+ .unmarshal(jalview.schemabinding.version2.TridiagonalE.class,
+ reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class TridiagonalMatrix.
+ *
+ * @version $Revision$ $Date$
+ */
+public class TridiagonalMatrix extends DoubleMatrix
+ implements java.io.Serializable
+{
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public TridiagonalMatrix()
+ {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.schemabinding.version2.DoubleMatrix
+ */
+ public static jalview.schemabinding.version2.DoubleMatrix unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.schemabinding.version2.DoubleMatrix) Unmarshaller
+ .unmarshal(
+ jalview.schemabinding.version2.TridiagonalMatrix.class,
+ reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
+
+}
// -- initialize element descriptors
- // -- _details
+ // -- _pairwiseMatrix
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.String.class, "_details", "details",
+ jalview.schemabinding.version2.PairwiseMatrix.class,
+ "_pairwiseMatrix", "pairwiseMatrix",
org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
handler = new org.exolab.castor.xml.XMLFieldHandler()
{
public java.lang.Object getValue(java.lang.Object object)
throws IllegalStateException
{
PcaDataType target = (PcaDataType) object;
- return target.getDetails();
+ return target.getPairwiseMatrix();
}
public void setValue(java.lang.Object object, java.lang.Object value)
try
{
PcaDataType target = (PcaDataType) object;
- target.setDetails((java.lang.String) value);
+ target.setPairwiseMatrix(
+ (jalview.schemabinding.version2.PairwiseMatrix) value);
} catch (java.lang.Exception ex)
{
throw new IllegalStateException(ex.toString());
public java.lang.Object newInstance(java.lang.Object parent)
{
- return null;
+ return new jalview.schemabinding.version2.PairwiseMatrix();
}
};
desc.setHandler(handler);
desc.setMultivalued(false);
addFieldDescriptor(desc);
- // -- validation code for: _details
+ // -- validation code for: _pairwiseMatrix
fieldValidator = new org.exolab.castor.xml.FieldValidator();
fieldValidator.setMinOccurs(1);
{ // -- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
}
desc.setValidator(fieldValidator);
- // -- _pairwiseMatrix
+ // -- _tridiagonalMatrix
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.PairwiseMatrix.class,
- "_pairwiseMatrix", "pairwiseMatrix",
+ jalview.schemabinding.version2.TridiagonalMatrix.class,
+ "_tridiagonalMatrix", "tridiagonalMatrix",
org.exolab.castor.xml.NodeType.Element);
handler = new org.exolab.castor.xml.XMLFieldHandler()
{
throws IllegalStateException
{
PcaDataType target = (PcaDataType) object;
- return target.getPairwiseMatrix();
+ return target.getTridiagonalMatrix();
}
public void setValue(java.lang.Object object, java.lang.Object value)
try
{
PcaDataType target = (PcaDataType) object;
- target.setPairwiseMatrix(
- (jalview.schemabinding.version2.PairwiseMatrix) value);
+ target.setTridiagonalMatrix(
+ (jalview.schemabinding.version2.TridiagonalMatrix) value);
} catch (java.lang.Exception ex)
{
throw new IllegalStateException(ex.toString());
public java.lang.Object newInstance(java.lang.Object parent)
{
- return new jalview.schemabinding.version2.PairwiseMatrix();
+ return new jalview.schemabinding.version2.TridiagonalMatrix();
}
};
desc.setHandler(handler);
desc.setMultivalued(false);
addFieldDescriptor(desc);
- // -- validation code for: _pairwiseMatrix
+ // -- validation code for: _tridiagonalMatrix
fieldValidator = new org.exolab.castor.xml.FieldValidator();
fieldValidator.setMinOccurs(1);
{ // -- local scope
}
desc.setValidator(fieldValidator);
- // -- _eigenMatrix
+ // -- _tridiagonalD
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.EigenMatrix.class,
- "_eigenMatrix", "eigenMatrix",
+ jalview.schemabinding.version2.TridiagonalD.class,
+ "_tridiagonalD", "tridiagonalD",
org.exolab.castor.xml.NodeType.Element);
handler = new org.exolab.castor.xml.XMLFieldHandler()
{
throws IllegalStateException
{
PcaDataType target = (PcaDataType) object;
- return target.getEigenMatrix();
+ return target.getTridiagonalD();
}
public void setValue(java.lang.Object object, java.lang.Object value)
try
{
PcaDataType target = (PcaDataType) object;
- target.setEigenMatrix(
- (jalview.schemabinding.version2.EigenMatrix) value);
+ target.setTridiagonalD(
+ (jalview.schemabinding.version2.TridiagonalD) value);
} catch (java.lang.Exception ex)
{
throw new IllegalStateException(ex.toString());
public java.lang.Object newInstance(java.lang.Object parent)
{
- return new jalview.schemabinding.version2.EigenMatrix();
+ return new jalview.schemabinding.version2.TridiagonalD();
}
};
desc.setHandler(handler);
desc.setMultivalued(false);
addFieldDescriptor(desc);
- // -- validation code for: _eigenMatrix
+ // -- validation code for: _tridiagonalD
fieldValidator = new org.exolab.castor.xml.FieldValidator();
fieldValidator.setMinOccurs(1);
{ // -- local scope
}
desc.setValidator(fieldValidator);
- // -- _eigenMatrixD
+ // -- _tridiagonalE
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.EigenMatrixD.class,
- "_eigenMatrixD", "eigenMatrixD",
+ jalview.schemabinding.version2.TridiagonalE.class,
+ "_tridiagonalE", "tridiagonalE",
org.exolab.castor.xml.NodeType.Element);
handler = new org.exolab.castor.xml.XMLFieldHandler()
{
throws IllegalStateException
{
PcaDataType target = (PcaDataType) object;
- return target.getEigenMatrixD();
+ return target.getTridiagonalE();
}
public void setValue(java.lang.Object object, java.lang.Object value)
try
{
PcaDataType target = (PcaDataType) object;
- target.setEigenMatrixD(
- (jalview.schemabinding.version2.EigenMatrixD) value);
+ target.setTridiagonalE(
+ (jalview.schemabinding.version2.TridiagonalE) value);
} catch (java.lang.Exception ex)
{
throw new IllegalStateException(ex.toString());
public java.lang.Object newInstance(java.lang.Object parent)
{
- return new jalview.schemabinding.version2.EigenMatrixD();
+ return new jalview.schemabinding.version2.TridiagonalE();
}
};
desc.setHandler(handler);
desc.setMultivalued(false);
addFieldDescriptor(desc);
- // -- validation code for: _eigenMatrixD
+ // -- validation code for: _tridiagonalE
fieldValidator = new org.exolab.castor.xml.FieldValidator();
fieldValidator.setMinOccurs(1);
{ // -- local scope
}
desc.setValidator(fieldValidator);
- // -- _eigenMatrixE
+ // -- _eigenMatrix
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.EigenMatrixE.class,
- "_eigenMatrixE", "eigenMatrixE",
+ jalview.schemabinding.version2.EigenMatrix.class,
+ "_eigenMatrix", "eigenMatrix",
org.exolab.castor.xml.NodeType.Element);
handler = new org.exolab.castor.xml.XMLFieldHandler()
{
throws IllegalStateException
{
PcaDataType target = (PcaDataType) object;
- return target.getEigenMatrixE();
+ return target.getEigenMatrix();
}
public void setValue(java.lang.Object object, java.lang.Object value)
try
{
PcaDataType target = (PcaDataType) object;
- target.setEigenMatrixE(
- (jalview.schemabinding.version2.EigenMatrixE) value);
+ target.setEigenMatrix(
+ (jalview.schemabinding.version2.EigenMatrix) value);
} catch (java.lang.Exception ex)
{
throw new IllegalStateException(ex.toString());
public java.lang.Object newInstance(java.lang.Object parent)
{
- return new jalview.schemabinding.version2.EigenMatrixE();
+ return new jalview.schemabinding.version2.EigenMatrix();
}
};
desc.setHandler(handler);
desc.setMultivalued(false);
addFieldDescriptor(desc);
- // -- validation code for: _eigenMatrixE
+ // -- validation code for: _eigenMatrix
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ // -- _eigenMatrixD
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ jalview.schemabinding.version2.EigenMatrixD.class,
+ "_eigenMatrixD", "eigenMatrixD",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ PcaDataType target = (PcaDataType) object;
+ return target.getEigenMatrixD();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ PcaDataType target = (PcaDataType) object;
+ target.setEigenMatrixD(
+ (jalview.schemabinding.version2.EigenMatrixD) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return new jalview.schemabinding.version2.EigenMatrixD();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("www.jalview.org");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _eigenMatrixD
fieldValidator = new org.exolab.castor.xml.FieldValidator();
fieldValidator.setMinOccurs(1);
{ // -- local scope
//- Imported classes and packages -/
//---------------------------------/
-import jalview.schemabinding.version2.EigenMatrixE;
+import jalview.schemabinding.version2.TridiagonalD;
/**
- * Class EigenMatrixEDescriptor.
+ * Class TridiagonalDDescriptor.
*
* @version $Revision$ $Date$
*/
-public class EigenMatrixEDescriptor extends
+public class TridiagonalDDescriptor extends
jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor
{
// - Constructors -/
// ----------------/
- public EigenMatrixEDescriptor()
+ public TridiagonalDDescriptor()
{
super();
setExtendsWithoutFlatten(
new jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor());
_nsURI = "www.jalview.org";
- _xmlName = "eigenMatrixE";
+ _xmlName = "tridiagonalD";
_elementDefinition = true;
}
*/
public java.lang.Class getJavaClass()
{
- return jalview.schemabinding.version2.EigenMatrixE.class;
+ return jalview.schemabinding.version2.TridiagonalD.class;
}
/**
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.TridiagonalE;
+
+/**
+ * Class TridiagonalEDescriptor.
+ *
+ * @version $Revision$ $Date$
+ */
+public class TridiagonalEDescriptor extends
+ jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public TridiagonalEDescriptor()
+ {
+ super();
+ setExtendsWithoutFlatten(
+ new jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor());
+ _nsURI = "www.jalview.org";
+ _xmlName = "tridiagonalE";
+ _elementDefinition = true;
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode()
+ {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+ {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass()
+ {
+ return jalview.schemabinding.version2.TridiagonalE.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix()
+ {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI()
+ {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator()
+ {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName()
+ {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition()
+ {
+ return _elementDefinition;
+ }
+
+}
--- /dev/null
+/*
+ * This class was automatically generated with
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.TridiagonalMatrix;
+
+/**
+ * Class TridiagonalMatrixDescriptor.
+ *
+ * @version $Revision$ $Date$
+ */
+public class TridiagonalMatrixDescriptor extends
+ jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public TridiagonalMatrixDescriptor()
+ {
+ super();
+ setExtendsWithoutFlatten(
+ new jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor());
+ _nsURI = "www.jalview.org";
+ _xmlName = "tridiagonalMatrix";
+ _elementDefinition = true;
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode()
+ {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+ {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass()
+ {
+ return jalview.schemabinding.version2.TridiagonalMatrix.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix()
+ {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI()
+ {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator()
+ {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName()
+ {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition()
+ {
+ return _elementDefinition;
+ }
+
+}