this.description = description;
this.annotations = annotations;
- for (int i = 0; i < annotations.length; i++)
+ areLabelsSecondaryStructure();
+ }
+
+ void areLabelsSecondaryStructure()
+ {
+ boolean nonSSLabel = false;
+ for (int i = 0; i < annotations.length; i++)
+ {
+ if(annotations[i]==null)
+ continue;
+
+ if (annotations[i].secondaryStructure == 'H' ||
+ annotations[i].secondaryStructure == 'E')
{
- if ((annotations[i] != null) &&
- ((annotations[i].secondaryStructure == 'H') ||
- (annotations[i].secondaryStructure == 'E')))
- {
- hasIcons = true;
- }
+ hasIcons = true;
+ }
- if ((annotations[i] != null) &&
- (annotations[i].displayCharacter.length() > 0))
- {
- hasText = true;
- }
+ if (annotations[i].secondaryStructure != 'H'
+ && annotations[i].secondaryStructure != 'E'
+ && annotations[i].secondaryStructure != '-')
+ {
+ nonSSLabel = true;
}
+
+ if (annotations[i].displayCharacter.length() > 0)
+ {
+ hasText = true;
+ }
+ }
+
+ if(nonSSLabel)
+ {
+ hasIcons = false;
+ for (int j = 0; j < annotations.length; j++)
+ {
+ if(annotations[j] !=null && annotations[j].secondaryStructure!=' ')
+ {
+ annotations[j].displayCharacter
+ =String.valueOf(annotations[j].secondaryStructure);
+ annotations[j].secondaryStructure = ' ';
+ if(annotations[j].description.length()<1)
+ annotations[j].description = annotations[j].displayCharacter;
+ }
+
+ }
+
+ }
+
}
/**
graphMin = min;
graphMax = max;
- for (int i = 0; i < annotations.length; i++)
- {
- if (!hasIcons
- && annotations[i] != null
- && ((annotations[i].secondaryStructure == 'H') ||
- (annotations[i].secondaryStructure == 'E')))
- {
- hasIcons = true;
- }
-
- if (!hasText
- && annotations[i]!=null
- && annotations[i].displayCharacter.length() > 0)
- {
- hasText = true;
- }
- }
+ areLabelsSecondaryStructure();
if(!drawValues && graphType!=NO_GRAPH)
{
}
/**
- * Attach the annotation to seqRef, starting from startRes position.
+ * Attach the annotation to seqRef, starting from startRes position. If alreadyMapped is true then the indices of the annotation[] array are sequence positions rather than alignment column positions.
* @param seqRef
* @param startRes
+ * @param alreadyMapped
*/
- public void createSequenceMapping(SequenceI seqRef, int startRes)
+ public void createSequenceMapping(SequenceI seqRef,
+ int startRes,
+ boolean alreadyMapped)
{
if(seqRef == null)
return;
sequenceMapping = new java.util.Hashtable();
sequenceRef = seqRef;
-
- if(startRes < sequenceRef.getStart())
- startRes = sequenceRef.getStart();
-
int seqPos;
- int fileOffset = 0;
- if(startRes > sequenceRef.getStart())
- {
- fileOffset = startRes - sequenceRef.getStart();
- }
-
for(int i = 0; i < annotations.length; i++)
{
- seqPos = sequenceRef.findPosition(i + fileOffset);
if (annotations[i] != null)
{
- sequenceMapping.put(new Integer(seqPos),
- annotations[i]);
+ if(alreadyMapped)
+ seqPos = seqRef.findPosition(i);
+ else
+ seqPos = i+startRes;
+
+ sequenceMapping.put(new Integer(seqPos), annotations[i]);
}
}
adjustForAlignment();
-
}
public void adjustForAlignment()