JAL-4366 JAL-728 simple hack to use 3di matrix when gecos-3di is enabled
[jalview.git] / src / jalview / ws / datamodel / MappableContactMatrixI.java
index d1a5ff7..9ca88cc 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.ws.datamodel;
 
 import jalview.datamodel.ContactListI;
@@ -12,35 +32,46 @@ public interface MappableContactMatrixI extends ContactMatrixI
   boolean hasReferenceSeq();
 
   SequenceI getReferenceSeq();
+
   /**
    * remaps the matrix to a new reference sequence
-   * @param dsq 
-   * @param sqmpping - mapping from current reference to new reference - 1:1 only
+   * 
+   * @param dsq
+   * @param sqmpping
+   *          - mapping from current reference to new reference - 1:1 only
    * @return new ContactMatrixI instance with updated mapping
    */
   MappableContactMatrixI liftOver(SequenceI dsq, Mapping sqmpping);
-  
+
   /**
    * like ContactMatrixI.getContactList(int column) but
-   * @param localFrame - sequence or other object that this contact matrix is associated with
-   * @param column - position in localFrame
+   * 
+   * @param localFrame
+   *          - sequence or other object that this contact matrix is associated
+   *          with
+   * @param column
+   *          - position in localFrame
    * @return ContactListI that returns contacts w.r.t. localFrame
    */
-  
+
   ContactListI getMappableContactList(SequenceI localFrame, int column);
 
   /**
    * 
-   * Similar to AlignedCodonFrame.getMappingBetween 
+   * Similar to AlignedCodonFrame.getMappingBetween
    * 
-   * @param sequenceRef - a reference sequence mappable to this contactMatrix - may be null
-   * @return null or the MapList mapping to the coordinates of the reference sequence (or if hasReferenceSeq() is false, and sequenceRef is null, any mapping present)
+   * @param sequenceRef
+   *          - a reference sequence mappable to this contactMatrix - may be
+   *          null
+   * @return null or the MapList mapping to the coordinates of the reference
+   *         sequence (or if hasReferenceSeq() is false, and sequenceRef is
+   *         null, any mapping present)
    * 
    */
   MapList getMapFor(SequenceI sequenceRef);
-  
+
   /**
-   * Locate a position in the mapped sequence for a column in the matrix - use
+   * Locate a position in the mapped sequence for a single column in the matrix.
    * this to resolve positions corresponding to column clusters
    * 
    * @param localFrame
@@ -50,4 +81,19 @@ public interface MappableContactMatrixI extends ContactMatrixI
    * @return sequence position(s) corresponding to column in contact matrix
    */
   int[] getMappedPositionsFor(SequenceI localFrame, int column);
+
+  /**
+   * Locate a position in the mapped sequence for a contiguous range of columns
+   * in the matrix use this to resolve positions corresponding to column
+   * clusters
+   * 
+   * @param localFrame
+   *          - sequence derivced from reference sequence
+   * @param column
+   *          - matrix row/column
+   * @return sequence position(s) corresponding to column in contact matrix
+   */
+  int[] getMappedPositionsFor(SequenceI localFrame, int from, int to);
+
+  ContactMatrixI getMappedMatrix();
 }