From fe28b89504fd1b76cc9d9631184aa6e065d7e243 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 16 Jan 2017 08:52:20 +0000 Subject: [PATCH] JAL-1270 tweaks to AlignmentGenerator / client class --- test/jalview/analysis/AlignmentGenerator.java | 12 ++++++------ test/jalview/analysis/DnaTest.java | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/test/jalview/analysis/AlignmentGenerator.java b/test/jalview/analysis/AlignmentGenerator.java index 0e3bbbb..3187fd9 100644 --- a/test/jalview/analysis/AlignmentGenerator.java +++ b/test/jalview/analysis/AlignmentGenerator.java @@ -53,7 +53,6 @@ import org.testng.annotations.BeforeClass; */ public class AlignmentGenerator { - @BeforeClass(alwaysRun = true) public void setUpJvOptionPane() { @@ -87,13 +86,14 @@ public class AlignmentGenerator 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 @@ -124,11 +124,11 @@ public class AlignmentGenerator } /** - * Default constructor + * Constructor that sets nucleotide or peptide symbol set */ - public AlignmentGenerator() + public AlignmentGenerator(boolean nuc) { - + BASES = nuc ? NUCS : PEPS; } /** diff --git a/test/jalview/analysis/DnaTest.java b/test/jalview/analysis/DnaTest.java index cd5d3ca..2e21d9c 100644 --- a/test/jalview/analysis/DnaTest.java +++ b/test/jalview/analysis/DnaTest.java @@ -294,7 +294,8 @@ public class DnaTest /* * 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 }); -- 1.7.10.2