import jalview.datamodel.SequenceI;
import jalview.datamodel.SequencePoint;
+import java.util.List;
import java.util.Vector;
public class PCAModel
int top;
- private Vector<SequencePoint> points;
+ private List<SequencePoint> points;
/**
* Constructor given sequence data, score model and score calculation
for (int i = 0; i < height; i++)
{
SequencePoint sp = new SequencePoint(seqs[i], scores[i]);
- points.addElement(sp);
+ points.add(sp);
}
}
}
/**
+ * Answers the index of the principal dimension of the PCA
*
- *
- * @return index of principle dimension of PCA
+ * @return
*/
public int getTop()
{
return top;
}
+ public void setTop(int t)
+ {
+ top = t;
+ }
+
/**
- * update the 2d coordinates for the list of points to the given dimensions
+ * Updates the 3D coordinates for the list of points to the given dimensions.
* Principal dimension is getTop(). Next greatest eigenvector is getTop()-1.
* Note - pca.getComponents starts counting the spectrum from rank-2 to zero,
* rather than rank-1, so getComponents(dimN ...) == updateRcView(dimN+1 ..)
for (int i = 0; i < pca.getHeight(); i++)
{
- points.elementAt(i).coord = scores[i];
+ points.get(i).coord = scores[i];
}
}
}
else
{
- Point p = points.elementAt(s).coord;
+ Point p = points.get(s).coord;
csv.append(",").append(p.x);
csv.append(",").append(p.y);
csv.append(",").append(p.z);
return csv.toString();
}
+ public String getScoreModelName()
+ {
+ return scoreModel == null ? "" : scoreModel.getName();
+ }
+
+ public void setScoreModel(ScoreModelI sm)
+ {
+ this.scoreModel = sm;
+ }
+
/**
+ * Answers the parameters configured for pairwise similarity calculations
*
- * @return x,y,z positions of point s (index into points) under current
- * transform.
+ * @return
*/
- public double[] getPointPosition(int s)
+ public SimilarityParamsI getSimilarityParameters()
{
- double pts[] = new double[3];
- Point p = points.elementAt(s).coord;
- pts[0] = p.x;
- pts[1] = p.y;
- pts[2] = p.z;
- return pts;
+ return similarityParams;
}
- public String getScoreModelName()
+ public List<SequencePoint> getSequencePoints()
{
- return scoreModel == null ? "" : scoreModel.getName();
+ return points;
}
- public void setScoreModel(ScoreModelI sm)
+ public void setSequencePoints(List<SequencePoint> sp)
{
- this.scoreModel = sm;
+ points = sp;
}
+ /**
+ * Answers the object holding the values of the computed PCA
+ *
+ * @return
+ */
+ public PCA getPcaData()
+ {
+ return pca;
+ }
+
+ public void setPCA(PCA data)
+ {
+ pca = data;
+ }
}