/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
+import jalview.gui.JvOptionPane;
import jalview.io.FastaFile;
import java.util.Arrays;
import java.util.Random;
+import org.testng.annotations.BeforeClass;
+
/**
* Generates, and outputs in Fasta format, a random DNA alignment for given
* sequence length and count. Will regenerate the same alignment each time if
*/
public class DnaAlignmentGenerator
{
+
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
private static final char GAP = '-';
private static final char ZERO = '0';
private Random random;
+
/**
* Outputs a DNA 'alignment' where each position is a random choice from
* 'GTCA-'.
+ " bases with " + gapPercentage + "% gaps and "
+ changePercentage + "% mutations (random seed = " + randomSeed
+ ")");
- System.out.println(new FastaFile().print(al.getSequencesArray()));
+ System.out.println(new FastaFile().print(al.getSequencesArray(), true));
}
/**