{
ap.scrollUp(true);
}
- while (seqCanvas.cursorY + 1 > ranges.getEndSeq())
+ while (seqCanvas.cursorY > ranges.getEndSeq())
{
ap.scrollUp(false);
}
/**
* Returns a hashCode built from hidden column ranges
*/
- public int hashCode(int hc)
+ @Override
+ public int hashCode()
{
- int hashCode = hc;
+ int hashCode = 1;
if (hiddenColumns != null)
{
for (int[] hidden : hiddenColumns)
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.schemes.ResidueProperties;
+import jalview.util.Comparison;
import jalview.util.Format;
import jalview.util.MessageManager;
type = (label.indexOf("_cons") == label.length() - 5) ? label
.substring(0, label.length() - 5) : label;
}
- boolean ss = false;
+ boolean ss = false, posterior = false;
type = id2type(type);
- if (type.equals("secondary structure"))
+ if (type.equalsIgnoreCase("secondary structure"))
{
ss = true;
}
+ if (type.equalsIgnoreCase("posterior probability"))
+ {
+ posterior = true;
+ }
// decide on secondary structure or not.
Annotation[] els = new Annotation[annots.length()];
for (int i = 0; i < annots.length(); i++)
}
}
+ if (posterior && !ann.isWhitespace()
+ && !Comparison.isGap(pos.charAt(0)))
+ {
+ float val = 0;
+ // symbol encodes values - 0..*==0..10
+ if (pos.charAt(0) == '*')
+ {
+ val = 10;
+ }
+ else
+ {
+ val = pos.charAt(0) - '0';
+ if (val > 9)
+ {
+ val = 10;
+ }
+ }
+ ann.value = val;
+ }
els[i] = ann;
}
if (typeIds == null)
{
typeIds = new Hashtable();
- typeIds.put("SS", "secondary structure");
- typeIds.put("SA", "surface accessibility");
+ typeIds.put("SS", "Secondary Structure");
+ typeIds.put("SA", "Surface Accessibility");
typeIds.put("TM", "transmembrane");
- typeIds.put("PP", "posterior probability");
+ typeIds.put("PP", "Posterior Probability");
typeIds.put("LI", "ligand binding");
typeIds.put("AS", "active site");
typeIds.put("IN", "intron");
typeIds.put("DE", "description");
typeIds.put("DR", "reference");
typeIds.put("LO", "look");
- typeIds.put("RF", "reference positions");
+ typeIds.put("RF", "Reference Positions");
}
}
while (e.hasMoreElements())
{
Object ll = e.nextElement();
- if (typeIds.get(ll).toString().equals(type))
+ if (typeIds.get(ll).toString().equalsIgnoreCase(type))
{
key = (String) ll;
break;
assertFalse(iter.hasNext());
// search for annotation with a particular label - expect three
- anns = al.findAnnotations(null, null, "secondary structure");
+ anns = al.findAnnotations(null, null, "Secondary Structure");
iter = anns.iterator();
assertTrue(iter.hasNext());
iter.next();
DataSourceType.PASTE));
// test for consistency in io
- StockholmFileTest.testAlignmentEquivalence(al, al_new, false);
+ StockholmFileTest.testAlignmentEquivalence(al, al_new, false, false,
+ false);
return;
} catch (Exception e)
{
DataSourceType.PASTE, FileFormat.Phylip);
assertNotNull("Couldn't parse reimported alignment data.", al_input);
- StockholmFileTest.testAlignmentEquivalence(al, al_input, false);
+ StockholmFileTest.testAlignmentEquivalence(al, al_input, false, false,
+ false);
}
}
{
StockholmFileTest.testFileIOwithFormat(new File(
"examples/testdata/rna-alignment.xml"), FileFormat.Stockholm,
- -1, -1, true);
+ -1, -1, true, true, true);
}
public void pfamFileIO() throws Exception
{
testFileIOwithFormat(new File(PfamFile), FileFormat.Stockholm, -1, 0,
- false);
+ false, false, false);
}
@Test(groups = { "Functional" })
public void rfamFileIO() throws Exception
{
testFileIOwithFormat(new File(RfamFile), FileFormat.Stockholm, 2, 1,
- false);
+ false, false, false);
}
/**
* @param ioformat
* - label for IO class used to write and read back in the data from
* f
+ * @param ignoreFeatures
* @param ignoreRowVisibility
+ * @param allowNullAnnotations
*/
public static void testFileIOwithFormat(File f, FileFormatI ioformat,
- int naliannot, int nminseqann, boolean ignoreRowVisibility)
+ int naliannot, int nminseqann, boolean ignoreFeatures,
+ boolean ignoreRowVisibility, boolean allowNullAnnotations)
{
System.out.println("Reading file: " + f);
String ff = f.getPath();
"Identify routine could not recognise output generated by '"
+ ioformat + "' writer",
ioformat.equals(identifyoutput));
- testAlignmentEquivalence(al, al_input, false);
+ testAlignmentEquivalence(al, al_input, ignoreFeatures,
+ ignoreRowVisibility, allowNullAnnotations);
int numaliannot = 0, numsqswithali = 0;
for (AlignmentAnnotation ala : al_input.getAlignmentAnnotation())
{
DataSourceType.PASTE));
// test for consistency in io
- StockholmFileTest.testAlignmentEquivalence(al, al_new, true);
+ StockholmFileTest.testAlignmentEquivalence(al, al_new, true, false,
+ false);
return;
} catch (Exception e)
{
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
import compbio.metadata.Argument;
public static jalview.gui.AlignFrame af = null;
- @BeforeClass(alwaysRun = true)
+ @BeforeGroups(groups = { "Network" })
public static void setUpBeforeClass() throws Exception
{
Cache.loadProperties("test/jalview/io/testProps.jvprops");
}
}
- @Test(groups = { "Functional" })
+ @Test(groups = { "Network" }, enabled = false)
public void testJPredStructOneSeqOnly()
{
af.selectAllSequenceMenuItem_actionPerformed(null);
}
- @Test(groups = { "Functional" })
+ @Test(groups = { "Network" }, enabled = false)
public void testJPredStructExport()
{
DataSourceType.PASTE));
// test for consistency in io
- StockholmFileTest.testAlignmentEquivalence(al, al_new, false);
+ StockholmFileTest.testAlignmentEquivalence(al, al_new, false, false,
+ false);
return;
} catch (Exception e)
{
+ "\nCouldn't complete Annotation file roundtrip input/output/input test.");
}
- @Test(groups = { "Functional" })
+ @Test(groups = { "Network" }, enabled = false)
public void testJpredwsSettingsRecovery()
{
Assert.fail("not implemnented");
DataSourceType.PASTE));
// test for consistency in io
- StockholmFileTest.testAlignmentEquivalence(al, al_new, false);
+ StockholmFileTest.testAlignmentEquivalence(al, al_new, false, false,
+ false);
return;
} catch (Exception e)
{