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;
23 import java.awt.Color;
24 import java.util.BitSet;
25 import java.util.HashMap;
26 import java.util.List;
28 import jalview.util.MapList;
29 import jalview.ws.datamodel.alphafold.MappableContactMatrix;
32 * Dummy contact matrix based on sequence distance
37 public class SeqDistanceContactMatrix
38 extends MappableContactMatrix<SeqDistanceContactMatrix>
39 implements ContactMatrixI
41 private static final String SEQUENCE_DISTANCE = "SEQUENCE_DISTANCE";
43 private int width = 0;
45 public SeqDistanceContactMatrix(int width)
63 public ContactListI getContactList(final int column)
65 if (column < 0 || column >= width)
69 return new ContactListImpl(new ContactListProviderI()
75 // public Color getColorForScore(int column)
77 // return jalview.util.ColorUtils.getGraduatedColour(Math.abs(column-p),
78 // 0, Color.white, width, Color.magenta);
81 // public Color getColorForRange(int from_column, int to_column)
83 // return jalview.util.ColorUtils.getGraduatedColour(
84 // Math.abs(to_column + from_column - 2 * p) / 2, 0, Color.white, width,
89 public int getContactHeight()
96 public int getPosition()
102 public double getContactAt(int column)
104 return Math.abs(column - p);
110 public String getAnnotDescr()
112 return "Sequence distance matrix";
116 public String getAnnotLabel()
118 return "Sequence Distance";
122 public String getType()
124 return SEQUENCE_DISTANCE;
128 public int getWidth()
134 public int getHeight()
140 public double getElementAt(int _column, int i)
142 return Math.abs(_column - i);
146 protected SeqDistanceContactMatrix newMappableContactMatrix(
147 SequenceI newRefSeq, MapList newFromMapList)
150 return new SeqDistanceContactMatrix(width);