Clover icon

Coverage Report

  1. Project Clover database Wed Feb 4 2026 17:46:51 GMT
  2. Package jalview.datamodel

File SequencePoint.java

 

Coverage histogram

../../img/srcFileCovDistChart3.png
52% of files have more coverage

Code metrics

4
12
6
1
108
41
8
0.67
2
6
1.33

Classes

Class Line # Actions
SequencePoint 29 12 8
0.2272727322.7%
 

Contributing tests

This file is covered by 1 test. .

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
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.
11    *
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.
16    *
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.
20    */
21    package jalview.datamodel;
22   
23    /**
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.
28    */
 
29    public class SequencePoint extends AnnotationMapping
30    {
31    /*
32    * Associated alignment sequence, or dummy sequence object
33    */
34    private final SequenceI sequence;
35   
36    /*
37    * x, y, z values
38    */
39    public Point coord;
40   
41    /**
42    * Constructor
43    *
44    * @param sequence
45    * @param coord
46    */
 
47  30 toggle public SequencePoint(SequenceI sequence, Point pt)
48    {
49  30 this.sequence = sequence;
50  30 this.coord = pt;
51    }
52   
53   
54    /**
55    * Constructor given a sequence and an array of x, y, z coordinate positions
56    *
57    * @param sequence
58    * @param coords
59    * @throws ArrayIndexOutOfBoundsException
60    * if array length is less than 3
61    */
 
62  0 toggle public SequencePoint(SequenceI sequence, float[] coords)
63    {
64  0 this(sequence, new Point(coords[0], coords[1], coords[2]));
65    }
66   
 
67  60 toggle public SequenceI getSequence()
68    {
69  60 return sequence;
70    }
71   
72    /**
73    * Applies a translation to the (x, y, z) coordinates
74    *
75    * @param centre
76    */
 
77  0 toggle public void translate(float x, float y, float z)
78    {
79  0 coord = new Point(coord.x + x, coord.y + y, coord.z + z);
80    }
81   
82    /**
83    * string representation for ease of inspection in debugging or logging only
84    */
 
85  0 toggle @Override
86    public String toString()
87    {
88  0 return sequence.getName() + " " + coord.toString();
89    }
90   
 
91  0 toggle public String getDisplayName()
92    {
93  0 String displayName = sequence.getName();
94   
95  0 if (hasLabel())
96    {
97  0 displayName = displayName + "|" + label;
98    }
99   
100  0 if (hasAnnotationDetails())
101    {
102  0 displayName = displayName + "|" + annotationDetails;
103    }
104   
105  0 return displayName;
106    }
107   
108    }