@Test(groups = "Functional")
public final void testGetSequenceProxy() throws Exception
{
- String pathname = "test/jalview/ext/htsjdk/pgmb.fasta";
+ String pathname = "test/jalview/ext/htsjdk/pgmB.fasta";
HtsContigDb db = new HtsContigDb("ADB", new File(pathname));
-
+
assertTrue(db.isValid());
assertTrue(db.isIndexed()); // htsjdk opens the .fai file
-
+
SequenceI sq = db.getSequenceProxy("Deminut");
assertNotNull(sq);
assertEquals(sq.getLength(), 606);
sq = db.getSequenceProxy("PPL_06716");
assertNotNull(sq);
assertEquals(sq.getLength(), 602);
-
+
// dict = db.getDictionary(f, truncate))
}
expectedExceptions = java.lang.IllegalArgumentException.class)
public final void testGetSequenceProxy_indexed()
{
- String pathname = "test/jalview/ext/htsjdk/pgmb.fasta.fai";
+ String pathname = "test/jalview/ext/htsjdk/pgmB.fasta.fai";
new HtsContigDb("ADB", new File(pathname));
fail("Expected exception opening .fai file");
}
@Test(groups = "Functional")
public void testCreateFastaSequenceIndex() throws IOException
{
- File fasta = new File("test/jalview/ext/htsjdk/pgmb.fasta");
-
+ File fasta = new File("test/jalview/ext/htsjdk/pgmB.fasta");
+
/*
* create .fai with no overwrite fails if it exists
*/
- try {
+ try
+ {
HtsContigDb.createFastaSequenceIndex(fasta.toPath(), false);
fail("Expected exception");
} catch (IOException e)
{
+ System.out.println(
+ "Caught IOException in testCreateFastaSequenceIndex");
+ e.printStackTrace();
// expected
}
* 1GAQ has been reduced to alpha carbons only
* 1QCF is the full PDB file including headers, HETATM etc
*/
- String[] testFile = new String[] { "./examples/1GAQ.txt",
+ String[] testFile = new String[] { "./examples/1gaq.txt",
"./test/jalview/ext/jmol/1xyz.pdb",
- "./test/jalview/ext/jmol/1qcf.pdb" };
+ "./test/jalview/ext/jmol/1QCF.pdb" };
//@formatter:off
// a modified and very cut-down extract of 4UJ4
JmolParser jtest = new JmolParser(pdbStr, DataSourceType.FILE);
Vector<SequenceI> seqs = jtest.getSeqs(), mcseqs = mctest.getSeqs();
- assertTrue(
- "No sequences extracted from testfile\n"
- + (jtest.hasWarningMessage() ? jtest.getWarningMessage()
- : "(No warnings raised)"), seqs != null
- && seqs.size() > 0);
+ assertTrue("No sequences extracted from testfile\n"
+ + (jtest.hasWarningMessage() ? jtest.getWarningMessage()
+ : "(No warnings raised)"),
+ seqs != null && seqs.size() > 0);
for (SequenceI sq : seqs)
{
- assertEquals("JMol didn't process " + pdbStr
- + " to the same sequence as MCView",
- sq.getSequenceAsString(), mcseqs.remove(0)
- .getSequenceAsString());
+ assertEquals(
+ "JMol didn't process " + pdbStr
+ + " to the same sequence as MCView",
+ sq.getSequenceAsString(),
+ mcseqs.remove(0).getSequenceAsString());
AlignmentI al = new Alignment(new SequenceI[] { sq });
validateSecStrRows(al);
}
private void checkFirstAAIsAssoc(SequenceI sq)
{
- assertTrue("No secondary structure assigned for protein sequence for "
- + sq.getName(),
+ assertTrue(
+ "No secondary structure assigned for protein sequence for "
+ + sq.getName(),
sq.getAnnotation() != null && sq.getAnnotation().length >= 1
&& sq.getAnnotation()[0].hasIcons);
assertTrue(
"Secondary structure not associated for sequence "
- + sq.getName(), sq.getAnnotation()[0].sequenceRef == sq);
+ + sq.getName(),
+ sq.getAnnotation()[0].sequenceRef == sq);
}
/**
{
PDBfile mctest = new PDBfile(false, false, false,
pastePDBDataWithChainBreak, DataSourceType.PASTE);
- JmolParser jtest = new JmolParser(pastePDBDataWithChainBreak, DataSourceType.PASTE);
+ JmolParser jtest = new JmolParser(pastePDBDataWithChainBreak,
+ DataSourceType.PASTE);
Vector<SequenceI> seqs = jtest.getSeqs();
Vector<SequenceI> mcseqs = mctest.getSeqs();
{
PDBfile mctest = new PDBfile(false, false, false, pdbWithAltLoc,
DataSourceType.PASTE);
- JmolParser jtest = new JmolParser(pdbWithAltLoc,
- DataSourceType.PASTE);
+ JmolParser jtest = new JmolParser(pdbWithAltLoc, DataSourceType.PASTE);
Vector<SequenceI> seqs = jtest.getSeqs();
Vector<SequenceI> mcseqs = mctest.getSeqs();