2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.datamodel;
24 * A bean that models a set of (x, y, z) values and a reference to a sequence.
25 * As used in Principal Component Analysis, the (x, y, z) values are the
26 * sequence's score for the currently selected first, second and third
27 * dimensions of the PCA.
29 public class SequencePoint
32 * Associated alignment sequence, or dummy sequence object
34 private final SequenceI sequence;
47 public SequencePoint(SequenceI sequence, Point pt)
49 this.sequence = sequence;
54 * Constructor given a sequence and an array of x, y, z coordinate positions
58 * @throws ArrayIndexOutOfBoundsException
59 * if array length is less than 3
61 public SequencePoint(SequenceI sequence, float[] coords)
63 this(sequence, new Point(coords[0], coords[1], coords[2]));
66 public SequenceI getSequence()
72 * Applies a translation to the (x, y, z) coordinates
76 public void translate(float x, float y, float z)
78 coord = new Point(coord.x + x, coord.y + y, coord.z + z);
82 * string representation for ease of inspection in debugging or logging only
85 public String toString()
87 return sequence.getName() + " " + coord.toString();