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.ws.datamodel;
23 import jalview.datamodel.ContactListI;
24 import jalview.datamodel.ContactMatrixI;
25 import jalview.datamodel.Mapping;
26 import jalview.datamodel.SequenceI;
27 import jalview.util.MapList;
29 public interface MappableContactMatrixI extends ContactMatrixI
32 boolean hasReferenceSeq();
34 SequenceI getReferenceSeq();
37 * remaps the matrix to a new reference sequence
41 * - mapping from current reference to new reference - 1:1 only
42 * @return new ContactMatrixI instance with updated mapping
44 MappableContactMatrixI liftOver(SequenceI dsq, Mapping sqmpping);
47 * like ContactMatrixI.getContactList(int column) but
50 * - sequence or other object that this contact matrix is associated
53 * - position in localFrame
54 * @return ContactListI that returns contacts w.r.t. localFrame
57 ContactListI getMappableContactList(SequenceI localFrame, int column);
61 * Similar to AlignedCodonFrame.getMappingBetween
64 * - a reference sequence mappable to this contactMatrix - may be
66 * @return null or the MapList mapping to the coordinates of the reference
67 * sequence (or if hasReferenceSeq() is false, and sequenceRef is
68 * null, any mapping present)
71 MapList getMapFor(SequenceI sequenceRef);
74 * Locate a position in the mapped sequence for a single column in the matrix.
75 * this to resolve positions corresponding to column clusters
78 * - sequence derivced from reference sequence
81 * @return sequence position(s) corresponding to column in contact matrix
83 int[] getMappedPositionsFor(SequenceI localFrame, int column);
86 * Locate a position in the mapped sequence for a contiguous range of columns
87 * in the matrix use this to resolve positions corresponding to column
91 * - sequence derivced from reference sequence
94 * @return sequence position(s) corresponding to column in contact matrix
96 int[] getMappedPositionsFor(SequenceI localFrame, int from, int to);
98 ContactMatrixI getMappedMatrix();