// Path: src/generator/SeqGenSingleSequenceMultipleRepeats.java
// public class SeqGenSingleSequenceMultipleRepeats extends SequenceGenerator
// {
// 	Random random = new Random();
// 
// 	@Override
// 	public CharSequence generateSequence(Options o)
// 	{
// 		FragmentErrorGenerator eg = new UniformErrorGenerator(o.characters,
// 			o.repeatErrorProbability);
// 		final CharSequence repeatedSequence = generateSequence(o.characters, o.repeatLength);
// 		StringBuilder sb = new StringBuilder(o.length);
// 		int[] repeatedSequenceIndices = new int[o.repeatCount];
// 		int nonRepeatedLength = o.length - o.repeatCount * o.repeatLength;
// 		if (nonRepeatedLength > 0)
// 		{
// 			for (int i = 0; i < o.repeatCount; i++)
// 			{
// 				repeatedSequenceIndices[i] = random.nextInt(nonRepeatedLength);
// 			}
// 			Arrays.sort(repeatedSequenceIndices);
// 			sb.append(generateSequence(o.characters, nonRepeatedLength));
// 		}
// 		int repeatStart = 0;
// 		for (int i = 0; i < o.repeatCount; i++)
// 		{
// 			if (verbose)
// 			{
// 				for (int j = 0; j < repeatedSequenceIndices[i] - repeatStart; j++)
// 				{
// 					System.out.print(" ");
// 				}
// 				System.out.print(repeatedSequence);
// 				repeatStart = repeatedSequenceIndices[i];
// 			}
// 			CharSequence currentRepeatedSequence;
// 			if (o.repeatErrorProbability > 0.0)
// 			{
// 				currentRepeatedSequence = eg.generateErrors(repeatedSequence);
// 			}
// 			else
// 			{
// 				currentRepeatedSequence = repeatedSequence;
// 			}
// 			sb.insert(i * o.repeatLength + repeatedSequenceIndices[i], currentRepeatedSequence);
// 		}
// 		String string = sb.toString();
// 		if (verbose)
// 		{
// 			System.out.println();
// 			System.out.println(string);
// 		}
// 		return string;
// 	}
// 
// 	/**
// 	 * Standalone debug method
// 	 * 
// 	 * @param args
// 	 */
// 	@SuppressWarnings("unused")
// 	public static void main(String[] args)
// 	{
// 		if (args.length < 3)
// 		{
// 			System.err.printf("*** Usage: %s m r l e",
// 				SeqGenSingleSequenceMultipleRepeats.class.getCanonicalName());
// 			System.exit(1);
// 		}
// 		Options o = new Options();
// 		o.length = Integer.parseInt(args[0]);
// 		o.repeatCount = Integer.parseInt(args[1]);
// 		o.repeatLength = Integer.parseInt(args[2]);
// 		o.repeatErrorProbability = Double.parseDouble(args[3]);
// 		SequenceGenerator generator = new SeqGenSingleSequenceMultipleRepeats();
// 		generator.setVerboseOutput(true);
// 		CharSequence generated = generator.generateSequence(o);
// 	}
// }
// 
// Path: src/generator/SequenceGenerator.java
// public abstract class SequenceGenerator
// {
// 	public static final String NUCLEOTIDES = "ACGT";
// 	public static final String NUCLEIC_ACID_ALLOWED_CHARACTERS = "ACGTURYKMSWBDHVNX-";
// 	public static final String AMINO_ACID_ALLOWED_CHARACTERS = "ABCDEFGHIKLMNOPQRSTUVWYZX*-";
// 
// 	protected boolean verbose;
// 
// 	public static class Options
// 	{
// 		/**
// 		 * Characters in the generated sequence come from here
// 		 */
// 		public String characters = NUCLEOTIDES;
// 		public int length;
// 		public int repeatCount;
// 		public int repeatLength;
// 		/**
// 		 * Each character in each repeat will be substituted with a random
// 		 * choice from {@link #characters} at this probability
// 		 */
// 		public double repeatErrorProbability;
// 	}
// 
// 	/**
// 	 * Generates a single sequence with the provided length from the given
// 	 * characters. XXX Make this protected again after fixing all of the
// 	 * horrible design decisions I've recently made
// 	 * 
// 	 * @param sample
// 	 * @param length
// 	 * @return
// 	 */
// 	public static CharSequence generateSequence(String sample, int length)
// 	{
// 		Random random = new Random();
// 		StringBuilder sb = new StringBuilder(length);
// 		for (int i = 0; i < length; i++)
// 		{
// 			int index = random.nextInt(sample.length());
// 			sb.append(sample.substring(index, index + 1));
// 		}
// 		return sb;
// 	}
// 
// 	/**
// 	 * Controls whether debugging information will be printed to
// 	 * <code>System.err</code>. TODO: Maybe allow a separate
// 	 * {@link java.io.OutputStream} to be specified.
// 	 * 
// 	 * @param verbose_
// 	 */
// 	public void setVerboseOutput(boolean verbose_)
// 	{
// 		verbose = verbose_;
// 	}
// 
// 	/**
// 	 * Generates a sequence according to the provided options
// 	 * 
// 	 * @param o
// 	 *            Options specifying length, repeat count, repeat length,
// 	 *            characters to sample, error rate, etc.
// 	 * @return
// 	 */
// 	public abstract CharSequence generateSequence(Options o);
// }


import static org.junit.Assert.*;
import java.util.List;
import generator.SeqGenSingleSequenceMultipleRepeats;
import generator.SequenceGenerator;
import org.junit.Test;
package assembly;


public class FragmentTest
{
	private static final int PAIRED_END_LENGTH = 100;

	@Test
	public void testPairedEndClone()
	{
		SequenceGenerator g = new SeqGenSingleSequenceMultipleRepeats();
		SequenceGenerator.Options o = new SequenceGenerator.Options();
		final int fragmentLength = 500;
		o.length = fragmentLength;
// Path: src/generator/SeqGenSingleSequenceMultipleRepeats.java
// public class SeqGenSingleSequenceMultipleRepeats extends SequenceGenerator
// {
// 	Random random = new Random();
// 
// 	@Override
// 	public CharSequence generateSequence(Options o)
// 	{
// 		FragmentErrorGenerator eg = new UniformErrorGenerator(o.characters,
// 			o.repeatErrorProbability);
// 		final CharSequence repeatedSequence = generateSequence(o.characters, o.repeatLength);
// 		StringBuilder sb = new StringBuilder(o.length);
// 		int[] repeatedSequenceIndices = new int[o.repeatCount];
// 		int nonRepeatedLength = o.length - o.repeatCount * o.repeatLength;
// 		if (nonRepeatedLength > 0)
// 		{
// 			for (int i = 0; i < o.repeatCount; i++)
// 			{
// 				repeatedSequenceIndices[i] = random.nextInt(nonRepeatedLength);
// 			}
// 			Arrays.sort(repeatedSequenceIndices);
// 			sb.append(generateSequence(o.characters, nonRepeatedLength));
// 		}
// 		int repeatStart = 0;
// 		for (int i = 0; i < o.repeatCount; i++)
// 		{
// 			if (verbose)
// 			{
// 				for (int j = 0; j < repeatedSequenceIndices[i] - repeatStart; j++)
// 				{
// 					System.out.print(" ");
// 				}
// 				System.out.print(repeatedSequence);
// 				repeatStart = repeatedSequenceIndices[i];
// 			}
// 			CharSequence currentRepeatedSequence;
// 			if (o.repeatErrorProbability > 0.0)
// 			{
// 				currentRepeatedSequence = eg.generateErrors(repeatedSequence);
// 			}
// 			else
// 			{
// 				currentRepeatedSequence = repeatedSequence;
// 			}
// 			sb.insert(i * o.repeatLength + repeatedSequenceIndices[i], currentRepeatedSequence);
// 		}
// 		String string = sb.toString();
// 		if (verbose)
// 		{
// 			System.out.println();
// 			System.out.println(string);
// 		}
// 		return string;
// 	}
// 
// 	/**
// 	 * Standalone debug method
// 	 * 
// 	 * @param args
// 	 */
// 	@SuppressWarnings("unused")
// 	public static void main(String[] args)
// 	{
// 		if (args.length < 3)
// 		{
// 			System.err.printf("*** Usage: %s m r l e",
// 				SeqGenSingleSequenceMultipleRepeats.class.getCanonicalName());
// 			System.exit(1);
// 		}
// 		Options o = new Options();
// 		o.length = Integer.parseInt(args[0]);
// 		o.repeatCount = Integer.parseInt(args[1]);
// 		o.repeatLength = Integer.parseInt(args[2]);
// 		o.repeatErrorProbability = Double.parseDouble(args[3]);
// 		SequenceGenerator generator = new SeqGenSingleSequenceMultipleRepeats();
// 		generator.setVerboseOutput(true);
// 		CharSequence generated = generator.generateSequence(o);
// 	}
// }
// 
// Path: src/generator/SequenceGenerator.java
// public abstract class SequenceGenerator
// {
// 	public static final String NUCLEOTIDES = "ACGT";
// 	public static final String NUCLEIC_ACID_ALLOWED_CHARACTERS = "ACGTURYKMSWBDHVNX-";
// 	public static final String AMINO_ACID_ALLOWED_CHARACTERS = "ABCDEFGHIKLMNOPQRSTUVWYZX*-";
// 
// 	protected boolean verbose;
// 
// 	public static class Options
// 	{
// 		/**
// 		 * Characters in the generated sequence come from here
// 		 */
// 		public String characters = NUCLEOTIDES;
// 		public int length;
// 		public int repeatCount;
// 		public int repeatLength;
// 		/**
// 		 * Each character in each repeat will be substituted with a random
// 		 * choice from {@link #characters} at this probability
// 		 */
// 		public double repeatErrorProbability;
// 	}
// 
// 	/**
// 	 * Generates a single sequence with the provided length from the given
// 	 * characters. XXX Make this protected again after fixing all of the
// 	 * horrible design decisions I've recently made
// 	 * 
// 	 * @param sample
// 	 * @param length
// 	 * @return
// 	 */
// 	public static CharSequence generateSequence(String sample, int length)
// 	{
// 		Random random = new Random();
// 		StringBuilder sb = new StringBuilder(length);
// 		for (int i = 0; i < length; i++)
// 		{
// 			int index = random.nextInt(sample.length());
// 			sb.append(sample.substring(index, index + 1));
// 		}
// 		return sb;
// 	}
// 
// 	/**
// 	 * Controls whether debugging information will be printed to
// 	 * <code>System.err</code>. TODO: Maybe allow a separate
// 	 * {@link java.io.OutputStream} to be specified.
// 	 * 
// 	 * @param verbose_
// 	 */
// 	public void setVerboseOutput(boolean verbose_)
// 	{
// 		verbose = verbose_;
// 	}
// 
// 	/**
// 	 * Generates a sequence according to the provided options
// 	 * 
// 	 * @param o
// 	 *            Options specifying length, repeat count, repeat length,
// 	 *            characters to sample, error rate, etc.
// 	 * @return
// 	 */
// 	public abstract CharSequence generateSequence(Options o);
// }


// Path: test/assembly/FragmentTest.java
import static org.junit.Assert.*;
import java.util.List;
import generator.SeqGenSingleSequenceMultipleRepeats;
import generator.SequenceGenerator;
import org.junit.Test;

package assembly;


public class FragmentTest
{
	private static final int PAIRED_END_LENGTH = 100;

	@Test
	public void testPairedEndClone()
	{
		SequenceGenerator g = new SeqGenSingleSequenceMultipleRepeats();
		SequenceGenerator.Options o = new SequenceGenerator.Options();
		final int fragmentLength = 500;
		o.length = fragmentLength;
		CharSequence s = g.generateSequence(o);