*/
package jalview.datamodel;
+import jalview.analysis.Rna;
+
import java.util.Enumeration;
import java.util.Hashtable;
/** DOCUMENT ME!! */
public Annotation[] annotations;
+ /**
+ * RNA secondary structure contact positions
+ */
+ public SequenceFeature[] _rnasecstr = null;
+
+ /**
+ * Updates the _rnasecstr field Determines the positions that base pair and
+ * the positions of helices based on secondary structure from a Stockholm file
+ *
+ * @param RNAannot
+ */
+ private void _updateRnaSecStr(String RNAannot)
+ {
+ _rnasecstr = Rna.GetBasePairs(RNAannot);
+ Rna.HelixMap(_rnasecstr);
+
+ if (_rnasecstr != null && _rnasecstr.length > 0)
+ {
+ // show all the RNA secondary structure annotation symbols.
+ showAllColLabels = true;
+ scaleColLabel = true;
+ }
+ // System.out.println("featuregroup " + _rnasecstr[0].getFeatureGroup());
+ }
+
public java.util.Hashtable sequenceMapping;
/** DOCUMENT ME!! */
validateRangeAndDisplay();
}
+ /**
+ * Checks if annotation labels represent secondary structures
+ *
+ */
void areLabelsSecondaryStructure()
{
boolean nonSSLabel = false;
+ boolean isrna = false;
+ StringBuffer rnastring = new StringBuffer();
+
char firstChar = 0;
for (int i = 0; i < annotations.length; i++)
{
{
hasIcons |= true;
}
+ else
+ // Check for RNA secondary structure
+ {
+ if (annotations[i].secondaryStructure == 'S')
+ {
+ hasIcons |= true;
+ isrna |= true;
+ }
+ }
- if (annotations[i].displayCharacter == null)
+ // System.out.println("displaychar " + annotations[i].displayCharacter);
+
+ if (annotations[i].displayCharacter == null
+ || annotations[i].displayCharacter.length() == 0)
{
+ rnastring.append('.');
continue;
}
if (annotations[i].displayCharacter.length() == 1)
firstChar != ' '
&& firstChar != 'H'
&& firstChar != 'E'
+ && firstChar != 'S'
&& firstChar != '-'
&& firstChar < jalview.schemes.ResidueProperties.aaIndex.length)
{
}
}
}
+ else
+ {
+ rnastring.append(annotations[i].displayCharacter.charAt(1));
+ }
if (annotations[i].displayCharacter.length() > 0)
{
}
}
+ else
+ {
+ if (isrna)
+ {
+ _updateRnaSecStr(rnastring.toString());
+ }
+ }
annotationId = this.hashCode() + "";
}