import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignViewport;
+import jalview.gui.JvOptionPane;
+import jalview.io.DataSourceType;
+import jalview.io.FileFormat;
import jalview.io.FormatAdapter;
import java.io.IOException;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class DnaTest
{
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
// @formatter:off
// AA encoding codons as ordered on the Jalview help page Amino Acid Table
private static String fasta = ">B\n" + "GCT" + "GCC" + "GCA" + "GCG"
throws IOException
{
AlignmentI alf = new FormatAdapter().readFile(
- JAL_1312_example_align_fasta, jalview.io.FormatAdapter.PASTE,
- "FASTA");
+ JAL_1312_example_align_fasta, DataSourceType.PASTE,
+ FileFormat.Fasta);
ColumnSelection cs = new ColumnSelection();
AlignViewportI av = new AlignViewport(alf, cs);
Dna dna = new Dna(av, new int[] { 0, alf.getWidth() - 1 });
throws IOException
{
AlignmentI alf = new FormatAdapter().readFile(
- JAL_1312_example_align_fasta, jalview.io.FormatAdapter.PASTE,
- "FASTA");
+ JAL_1312_example_align_fasta, DataSourceType.PASTE,
+ FileFormat.Fasta);
int vwidth = 15;
for (int ipos = 0; ipos + vwidth < alf.getWidth(); ipos += vwidth)
{
public void testTranslateCdna_simple() throws IOException
{
AlignmentI alf = new FormatAdapter().readFile(fasta,
- FormatAdapter.PASTE, "FASTA");
+ DataSourceType.PASTE, FileFormat.Fasta);
ColumnSelection cs = new ColumnSelection();
AlignViewportI av = new AlignViewport(alf, cs);
Dna dna = new Dna(av, new int[] { 0, alf.getWidth() - 1 });
public void testTranslateCdna_hiddenColumns() throws IOException
{
AlignmentI alf = new FormatAdapter().readFile(fasta,
- FormatAdapter.PASTE, "FASTA");
- ColumnSelection cs = new jalview.datamodel.ColumnSelection();
+ DataSourceType.PASTE, FileFormat.Fasta);
+ ColumnSelection cs = new ColumnSelection();
cs.hideColumns(6, 14); // hide codons 3/4/5
cs.hideColumns(24, 35); // hide codons 9-12
cs.hideColumns(177, 191); // hide codons 60-64
/*
* Generate cDNA - 8 sequences of 12 bases each.
*/
- AlignmentI cdna = new DnaAlignmentGenerator().generate(12, 8, 97, 5, 5);
+ AlignmentI cdna = new AlignmentGenerator(true)
+ .generate(12, 8, 97, 5, 5);
ColumnSelection cs = new ColumnSelection();
AlignViewportI av = new AlignViewport(cdna, cs);
Dna dna = new Dna(av, new int[] { 0, cdna.getWidth() - 1 });