*/
package jalview.ext.paradise;
+import java.util.Locale;
+
import static org.testng.AssertJUnit.assertTrue;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
import jalview.gui.JvOptionPane;
+import jalview.io.DataSourceType;
import jalview.io.FastaFile;
+import jalview.io.FileFormat;
import jalview.io.FormatAdapter;
import java.io.BufferedReader;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import MCview.PDBfile;
-
import compbio.util.FileUtil;
+import mc_view.PDBfile;
public class TestAnnotate3D
{
{
Iterator<Reader> ids = Annotate3D.getRNAMLForPDBId("2GIS");
assertTrue("Didn't retrieve 2GIS by id.", ids != null);
- Iterator<Reader> files = Annotate3D.getRNAMLForPDBFileAsString(FileUtil
- .readFileToString(new File("examples/2GIS.pdb")));
+ Iterator<Reader> files = Annotate3D.getRNAMLForPDBFileAsString(
+ FileUtil.readFileToString(new File("examples/2GIS.pdb")));
assertTrue("Didn't retrieve using examples/2GIS.pdb.", files != null);
int i = 0;
while (ids.hasNext() && files.hasNext())
{
- BufferedReader file = new BufferedReader(files.next()), id = new BufferedReader(
- ids.next());
+ BufferedReader file = new BufferedReader(files.next()),
+ id = new BufferedReader(ids.next());
String iline, fline;
do
{
public void testPDBfileVsRNAML() throws Exception
{
PDBfile pdbf = new PDBfile(true, false, true, "examples/2GIS.pdb",
- FormatAdapter.FILE);
+ DataSourceType.FILE);
Assert.assertTrue(pdbf.isValid());
// Comment - should add new FileParse constructor like new FileParse(Reader
// ..). for direct reading
- Iterator<Reader> readers = Annotate3D
- .getRNAMLForPDBFileAsString(FileUtil.readFileToString(new File(
- "examples/2GIS.pdb")));
+ Iterator<Reader> readers = Annotate3D.getRNAMLForPDBFileAsString(
+ FileUtil.readFileToString(new File("examples/2GIS.pdb")));
testRNAMLcontent(readers, pdbf);
}
assertTrue("No data returned by Annotate3D", sb.length() > 0);
final String lines = sb.toString();
AlignmentI al = new FormatAdapter().readFile(lines,
- FormatAdapter.PASTE, "RNAML");
+ DataSourceType.PASTE, FileFormat.Rnaml);
if (al == null || al.getHeight() == 0)
{
System.out.println(lines);
{
{
SequenceI struseq = null;
- String sq_ = new String(sq.getSequence()).toLowerCase();
+ String sq_ = sq.getSequenceAsString().toLowerCase(Locale.ROOT);
for (SequenceI _struseq : pdbf.getSeqsAsArray())
{
- final String lowerCase = new String(_struseq.getSequence())
- .toLowerCase();
+ final String lowerCase = _struseq.getSequenceAsString()
+ .toLowerCase(Locale.ROOT);
if (lowerCase.equals(sq_))
{
struseq = _struseq;
}
if (struseq == null)
{
- AssertJUnit
- .fail("Couldn't find this sequence in original input:\n"
- + new FastaFile()
- .print(new SequenceI[] { sq })
- + "\n\nOriginal input:\n"
- + new FastaFile().print(pdbf.getSeqsAsArray())
+ 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");
}
}