X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentI.java;h=5bfd8788af78350542e42d38ef79b209eaa0fa07;hb=ab43013b7e357b84b4abade0dba949668dfb2a0e;hp=be1bff76535140afcf72914349cee473cc10d80b;hpb=a45774ee31d9f35d4eff46d54d7deab719afb092;p=jalview.git
diff --git a/src/jalview/datamodel/AlignmentI.java b/src/jalview/datamodel/AlignmentI.java
index be1bff7..5bfd878 100755
--- a/src/jalview/datamodel/AlignmentI.java
+++ b/src/jalview/datamodel/AlignmentI.java
@@ -1,28 +1,33 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
+ * Copyright (C) 2014 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.
- *
+ * 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 .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.datamodel;
-import java.util.*;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
/**
* Data structure to hold and manipulate a multiple sequence alignment
*/
-public interface AlignmentI
+public interface AlignmentI extends AnnotatedCollectionI
{
/**
* Calculates the number of sequences in an alignment
@@ -36,6 +41,7 @@ public interface AlignmentI
*
* @return Greatest sequence length within alignment.
*/
+ @Override
public int getWidth();
/**
@@ -56,11 +62,12 @@ public interface AlignmentI
public boolean isAligned(boolean includeHidden);
/**
- * Gets sequences as a Vector
+ * Gets sequences as a Synchronized collection
*
* @return All sequences in alignment.
*/
- public Vector getSequences();
+ @Override
+ public List getSequences();
/**
* Gets sequences as a SequenceI[]
@@ -175,9 +182,9 @@ public interface AlignmentI
/**
* Get all the groups associated with this alignment.
*
- * @return All groups as a Vector.
+ * @return All groups as a list.
*/
- public Vector getGroups();
+ public List getGroups();
/**
* Deletes all groups from this alignment.
@@ -204,9 +211,9 @@ public interface AlignmentI
/**
* Deletes a specific AlignmentAnnotation from the alignment, and removes its
- * reference from any SequenceI or SequenceGroup object's annotation if and only if aa is
- * contained within the alignment's annotation vector. Otherwise, it will do
- * nothing.
+ * reference from any SequenceI or SequenceGroup object's annotation if and
+ * only if aa is contained within the alignment's annotation vector.
+ * Otherwise, it will do nothing.
*
* @param aa
* the annotation to delete
@@ -215,15 +222,17 @@ public interface AlignmentI
public boolean deleteAnnotation(AlignmentAnnotation aa);
/**
- * Deletes a specific AlignmentAnnotation from the alignment, and optionally removes any
- * reference from any SequenceI or SequenceGroup object's annotation if and only if aa is
- * contained within the alignment's annotation vector. Otherwise, it will do
- * nothing.
+ * Deletes a specific AlignmentAnnotation from the alignment, and optionally
+ * removes any reference from any SequenceI or SequenceGroup object's
+ * annotation if and only if aa is contained within the alignment's annotation
+ * vector. Otherwise, it will do nothing.
*
* @param aa
* the annotation to delete
* @param unhook
- * flag indicating if any references should be removed from annotation - use this if you intend to add the annotation back into the alignment
+ * flag indicating if any references should be removed from
+ * annotation - use this if you intend to add the annotation back
+ * into the alignment
* @return true if annotation was deleted from this alignment.
*/
public boolean deleteAnnotation(AlignmentAnnotation aa, boolean unhook);
@@ -234,6 +243,7 @@ public interface AlignmentI
*
* @return array of AlignmentAnnotation objects
*/
+ @Override
public AlignmentAnnotation[] getAlignmentAnnotation();
/**
@@ -259,6 +269,13 @@ public interface AlignmentI
public boolean isNucleotide();
/**
+ * Test if alignment contains RNA structure
+ *
+ * @return true if RNA structure AligmnentAnnotation was added to alignment
+ */
+ public boolean hasRNAStructure();
+
+ /**
* Set alignment to be a nucleotide sequence
*
*/
@@ -422,4 +439,47 @@ public interface AlignmentI
* @param i
*/
public void addAnnotation(AlignmentAnnotation consensus, int i);
+
+ /**
+ * search for or create a specific annotation row on the alignment
+ *
+ * @param name
+ * name for annotation (must match)
+ * @param calcId
+ * calcId for the annotation (null or must match)
+ * @param autoCalc
+ * - value of autocalc flag for the annotation
+ * @param seqRef
+ * - null or specific sequence reference
+ * @param groupRef
+ * - null or specific group reference
+ * @param method
+ * - CalcId for the annotation (must match)
+ *
+ * @return existing annotation matching the given attributes
+ */
+ public AlignmentAnnotation findOrCreateAnnotation(String name,
+ String calcId, boolean autoCalc, SequenceI seqRef,
+ SequenceGroup groupRef);
+
+ /**
+ * move the given group up or down in the alignment by the given number of
+ * rows. Implementor assumes given group is already present on alignment - no
+ * recalculations are triggered.
+ *
+ * @param sg
+ * @param map
+ * @param up
+ * @param i
+ */
+ public void moveSelectedSequencesByOne(SequenceGroup sg,
+ Map map, boolean up);
+
+ /**
+ * validate annotation after an edit and update any alignment state flags
+ * accordingly
+ *
+ * @param alignmentAnnotation
+ */
+ public void validateAnnotation(AlignmentAnnotation alignmentAnnotation);
}