<td>defaultColour</td>
<td> <em>One of: </em><br>
Clustal, Blosum62, % Identity, Hydrophobic, Zappo, Taylor, Helix
- Propensity, Strand Propensity, Turn Propensity, Buried Index, Nucleotide</td>
+ Propensity, Strand Propensity, Turn Propensity, Buried Index, Nucleotide, T-Coffee Scores, RNA Helices</td>
<td>Default is no colour.</td>
</tr>
<tr>
<td>defaultColour</td>
<td> <em>One of: </em><br>
Clustal, Blosum62, % Identity, Hydrophobic, Zappo, Taylor, Helix
- Propensity, Strand Propensity, Turn Propensity, Buried Index, Nucleotide</td>
+ Propensity, Strand Propensity, Turn Propensity, Buried Index, Nucleotide, T-Coffee Scores, RNA Helices</td>
<td>Default is no colour.</td>
</tr>
<tr>
public static final int COVARIATION = 14;
public static final int TCOFFEE = 15;
+
+ public static final int RNAHELIX = 16;
public static final int RNAINTERACTION = 16;
*/
public static final int FIRST_COLOUR = NONE;
- public static final int LAST_COLOUR = NUCLEOTIDE;
+ public static final int LAST_COLOUR = RNAHELIX;
/**
* DOCUMENT ME!
{
ret = PURINEPYRIMIDINE;
}
-
else if (name.equalsIgnoreCase("RNA Interaction type"))
{
ret = RNAINTERACTION;
}
+ else if (name.equalsIgnoreCase("RNA Helices"))
+ {
+ ret = RNAHELIX;
+ }
// else if (name.equalsIgnoreCase("Covariation"))
// {
// ret = COVARIATION;
{
index = TCOFFEE;
}
+<<<<<<< HEAD
+=======
+ else if (cs instanceof RNAHelicesColour)
+ {
+ index = RNAHELIX;
+ }
+>>>>>>> JAL-952_rnahelix
/*
* else if (cs instanceof CovariationColourScheme) { index = COVARIATION; }
*/
ret = "T-Coffee Scores";
break;
+<<<<<<< HEAD
case RNAINTERACTION:
ret = "RNA Interaction type";
break;
+=======
+ case RNAHELIX:
+ ret = "RNA Helices";
+
+ break;
+>>>>>>> JAL-952_rnahelix
/*
* case COVARIATION: ret = "Covariation";
*
case TCOFFEE:
cs = new TCoffeeColourScheme(coll);
break;
+
+ case RNAHELIX:
+ cs = new RNAHelicesColour(coll);
+ break;
// case COVARIATION:
// cs = new CovariationColourScheme(annotation);
import java.awt.*;
import java.util.Hashtable;
+import java.util.Map;
import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AnnotatedCollectionI;
+import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
/**
this.annotation = annotation;
refresh();
}
+ public RNAHelicesColour(AnnotatedCollectionI alignment)
+ {
+ super(ResidueProperties.nucleotideIndex);
+ alignmentChanged(alignment, null);
+ }
+
+ @Override
+ public void alignmentChanged(AnnotatedCollectionI alignment,
+ Map<SequenceI, SequenceCollectionI> hiddenReps)
+ {
+ // This loop will find the first rna structure annotation by which to colour
+ // the sequences.
+ AlignmentAnnotation[] annotations = alignment.getAlignmentAnnotation();
+ for (int i = 0; i < annotations.length; i++) {
+
+ // is this a sensible way of determining type of annotation?
+ if (annotations[i].getRNAStruc() != null) {
+ annotation = annotations[i];
+ break;
+ }
+ }
+
+ refresh();
+
+ }
private long lastrefresh = -1;
public void refresh()
{
- if ((annotation._rnasecstr == null
+
+ if (annotation!=null && ((annotation._rnasecstr == null
|| lastrefresh != annotation._rnasecstr.hashCode())
- && annotation.isValidStruc())
+ && annotation.isValidStruc()))
{
annotation.getRNAStruc();
lastrefresh = annotation._rnasecstr.hashCode();
{
return;
}
-
- // This loop will find the first rna structure annotation by which to colour
- // the sequences.
- AlignmentAnnotation[] annotations = av.getAlignment().getAlignmentAnnotation();
- for (int i = 0; i < annotations.length; i++) {
-
- // is this a sensible way of determining type of annotation?
- if (annotations[i].getRNAStruc() != null) {
- currentAnnotation = annotations[i];
- break;
- }
- }
- if (currentAnnotation == null)
- {
- System.err.println("Jalview is about to try and colour by RNAHelices even"
- + " though there are no RNA secondary structure annotations present!");
- currentAnnotation = av.getAlignment().getAlignmentAnnotation()[0];// annotations.getSelectedIndex()];
- }
-
RNAHelicesColour rhc = null;
- rhc = new RNAHelicesColour(currentAnnotation);
+ rhc = new RNAHelicesColour(av.getAlignment());
av.setGlobalColourScheme(rhc);
continue;
}
- sg.cs = new RNAHelicesColour(currentAnnotation);
+ sg.cs = new RNAHelicesColour(sg);
}
}
assertTrue("Didn't read input file "+inFile, af!=null);
int olddsann=countDsAnn(af.getViewport());
assertTrue("Didn't find any dataset annotations",olddsann>0);
+ af.rnahelicesColour_actionPerformed(null);
+ assertTrue("Couldn't apply RNA helices colourscheme",af.getViewport().getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
assertTrue("Failed to store as a project.",af.saveAlignment(tfile, "Jalview"));
af.closeMenuItem_actionPerformed(true);
af=null;
int newdsann=countDsAnn(af.getViewport());
assertTrue("Differing numbers of dataset sequence annotation\nOriginally "+olddsann+" and now "+newdsann,olddsann==newdsann);
System.out.println("Read in same number of annotations as originally present ("+olddsann+")");
+ assertTrue("RNA helices colourscheme was not applied on import.",af.getViewport().getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
}
@Test
public void testTCoffeeScores() throws Exception
assertTrue("Didn't set T-coffee colourscheme for imported project.",af.getViewport().getGlobalColourScheme().getClass().equals(jalview.schemes.TCoffeeColourScheme.class));
System.out.println("T-Coffee score shading successfully recovered from project.");
}
-
}