public static final int PROTEIN = 0;
public static final int NUCLEOTIDE = 1;
+
+ public boolean hasRNAStructure = false;
/** DOCUMENT ME!! */
public AlignmentAnnotation[] annotations;
*/
public void addAnnotation(AlignmentAnnotation aa, int pos)
{
+ if(aa.getRNAStruc()!= null){
+ hasRNAStructure=true;
+ }
+
int aSize = 1;
if (annotations != null)
{
return false;
}
}
+
+ public boolean hasRNAStructure(){
+ return hasRNAStructure;
+ }
public void setDataset(Alignment data)
{
/**
* 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
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);
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
*
*/
consensus.hasText = true;
consensus.autoCalculated = true;
- if (alignment.isNucleotide())
+ if (alignment.isNucleotide() && alignment.hasRNAStructure())
{
strucConsensus = new AlignmentAnnotation("StrucConsensus", "PID",
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
{
alignment.addAnnotation(consensus);
// TODO: Make own if for structure
- if (alignment.isNucleotide())
+ if (alignment.isNucleotide() && alignment.hasRNAStructure())
{
alignment.addAnnotation(strucConsensus);
}