*/
public class AlignmentGenerator
{
-
@BeforeClass(alwaysRun = true)
public void setUpJvOptionPane()
{
usage();
return;
}
- BASES = args[0].toLowerCase().startsWith("n") ? NUCS : PEPS;
+ boolean nucleotide = args[0].toLowerCase().startsWith("n");
int width = Integer.parseInt(args[1]);
int height = Integer.parseInt(args[2]);
long randomSeed = Long.valueOf(args[3]);
int gapPercentage = Integer.valueOf(args[4]);
int changePercentage = Integer.valueOf(args[5]);
- AlignmentI al = new AlignmentGenerator().generate(width, height,
+ AlignmentI al = new AlignmentGenerator(nucleotide).generate(width,
+ height,
randomSeed, gapPercentage, changePercentage);
System.out.println("; " + height + " sequences of " + width
}
/**
- * Default constructor
+ * Constructor that sets nucleotide or peptide symbol set
*/
- public AlignmentGenerator()
+ public AlignmentGenerator(boolean nuc)
{
-
+ BASES = nuc ? NUCS : PEPS;
}
/**
/*
* 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 });