+ private void testRNAMLcontent(Iterator<Reader> readers, PDBfile pdbf)
+ throws Exception
+ {
+ StringBuffer sb = new StringBuffer();
+ int r = 0;
+ while (readers.hasNext())
+ {
+ System.out.println("Testing RNAML input number " + (++r));
+ BufferedReader br = new BufferedReader(readers.next());
+ String line;
+ while ((line = br.readLine()) != null)
+ {
+ sb.append(line + "\n");
+ }
+ assertTrue("No data returned by Annotate3D", sb.length() > 0);
+ final String lines = sb.toString();
+ AlignmentI al = new FormatAdapter().readFile(lines,
+ DataSourceType.PASTE, FileFormat.Rnaml);
+ if (al == null || al.getHeight() == 0)
+ {
+ System.out.println(lines);
+ }
+ assertTrue("No alignment returned.", al != null);
+ assertTrue("No sequences in returned alignment.", al.getHeight() > 0);
+ if (pdbf != null)
+ {
+ for (SequenceI sq : al.getSequences())
+ {
+ {
+ SequenceI struseq = null;
+ String sq_ = sq.getSequenceAsString().toLowerCase();
+ for (SequenceI _struseq : pdbf.getSeqsAsArray())
+ {
+ final String lowerCase = _struseq.getSequenceAsString()
+ .toLowerCase();
+ if (lowerCase.equals(sq_))
+ {
+ struseq = _struseq;
+ break;
+ }
+ }
+ if (struseq == null)
+ {
+ AssertJUnit
+ .fail("Couldn't find this sequence in original input:\n"
+ + new FastaFile().print(
+ new SequenceI[] { sq }, true)
+ + "\n\nOriginal input:\n"
+ + new FastaFile().print(
+ pdbf.getSeqsAsArray(), true) + "\n");
+ }
+ }
+ }
+ }
+ }
+ }