// Path: src/main/java/org/seqdoop/hadoop_bam/FormatConstants.java
// public class FormatConstants
// {
// 	/**
// 	 * Offset by which Sanger-style ASCII-encoded quality scores are shifted.
// 	 */
// 	public static final int SANGER_OFFSET = 33;
// 
// 	/**
// 	 * Maximum encodable quality score for Sanger Phred+33 encoded base qualities.
// 	 *
// 	 * Range of legal values is [0,93], according to wikipedia on 10/9/2013:
// 	 *   http://en.wikipedia.org/wiki/FASTQ_format#Quality
// 	 */
// 	public static final int SANGER_MAX = 93;
// 
// 	/**
// 	 * Offset by which Illumina-style ASCII-encoded quality scores are shifted.
// 	 */
// 	public static final int ILLUMINA_OFFSET = 64;
// 
// 	/**
// 	 * Maximum encodable quality score for Illumina Phred+64 encoded base qualities.
// 	 */
// 	public static final int ILLUMINA_MAX = 62;
// 
// 	/**
// 	 * Encodings for base quality formats.
// 	 */
// 	public enum BaseQualityEncoding { Illumina, Sanger };
// 
// 	private FormatConstants() {} // no instantiation
// 
// 	public static final String CONF_INPUT_BASE_QUALITY_ENCODING = "hbam.input.base-quality-encoding";
// 	public static final String CONF_INPUT_FILTER_FAILED_QC      = "hbam.input.filter-failed-qc";
// }
// 
// Path: src/main/java/org/seqdoop/hadoop_bam/FormatException.java
// public class FormatException extends RuntimeException
// {
// 	private static final long serialVersionUID = 1L;
// 	public FormatException(String msg)
// 	{
// 		super(msg);
// 	}
// }


import java.io.DataInput;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import org.apache.hadoop.io.Text;
import org.junit.*;
import static org.junit.Assert.*;
import org.seqdoop.hadoop_bam.SequencedFragment;
import org.seqdoop.hadoop_bam.FormatConstants;
import org.seqdoop.hadoop_bam.FormatException;
import java.io.IOException;
		frag.setQuality(new Text("zzz=zzzzzzzzzzzzzzzzzzzzzzzzzz"));
		assertEquals(3, SequencedFragment.verifyQuality(frag.getQuality(), FormatConstants.BaseQualityEncoding.Illumina));
	}

	@Test
	public void testConvertQualityIlluminaToSanger()
	{
		frag.setSequence(new Text("AGTAGTAGTAGTAGTAGTAGTAGTAGTAGT"));
		frag.setQuality(new Text("zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"));
		SequencedFragment.convertQuality(frag.getQuality(), FormatConstants.BaseQualityEncoding.Illumina, FormatConstants.BaseQualityEncoding.Sanger);
		assertEquals("[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[", frag.getQuality().toString());
	}

	@Test
	public void testConvertQualitySangerToIllumina()
	{
		frag.setSequence(new Text("AGTAGTAGTAGTAGTAGTAGTAGTAGTAGT"));
		frag.setQuality(new Text("[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["));
		SequencedFragment.convertQuality(frag.getQuality(), FormatConstants.BaseQualityEncoding.Sanger, FormatConstants.BaseQualityEncoding.Illumina);
		assertEquals("zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", frag.getQuality().toString());
	}

	@Test(expected=IllegalArgumentException.class)
	public void testConvertQualityNoop()
	{
		frag.setSequence(new Text("AGTAGTAGTAGTAGTAGTAGTAGTAGTAGT"));
		frag.setQuality(new Text("[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["));
		SequencedFragment.convertQuality(frag.getQuality(), FormatConstants.BaseQualityEncoding.Sanger, FormatConstants.BaseQualityEncoding.Sanger);
	}

// Path: src/main/java/org/seqdoop/hadoop_bam/FormatConstants.java
// public class FormatConstants
// {
// 	/**
// 	 * Offset by which Sanger-style ASCII-encoded quality scores are shifted.
// 	 */
// 	public static final int SANGER_OFFSET = 33;
// 
// 	/**
// 	 * Maximum encodable quality score for Sanger Phred+33 encoded base qualities.
// 	 *
// 	 * Range of legal values is [0,93], according to wikipedia on 10/9/2013:
// 	 *   http://en.wikipedia.org/wiki/FASTQ_format#Quality
// 	 */
// 	public static final int SANGER_MAX = 93;
// 
// 	/**
// 	 * Offset by which Illumina-style ASCII-encoded quality scores are shifted.
// 	 */
// 	public static final int ILLUMINA_OFFSET = 64;
// 
// 	/**
// 	 * Maximum encodable quality score for Illumina Phred+64 encoded base qualities.
// 	 */
// 	public static final int ILLUMINA_MAX = 62;
// 
// 	/**
// 	 * Encodings for base quality formats.
// 	 */
// 	public enum BaseQualityEncoding { Illumina, Sanger };
// 
// 	private FormatConstants() {} // no instantiation
// 
// 	public static final String CONF_INPUT_BASE_QUALITY_ENCODING = "hbam.input.base-quality-encoding";
// 	public static final String CONF_INPUT_FILTER_FAILED_QC      = "hbam.input.filter-failed-qc";
// }
// 
// Path: src/main/java/org/seqdoop/hadoop_bam/FormatException.java
// public class FormatException extends RuntimeException
// {
// 	private static final long serialVersionUID = 1L;
// 	public FormatException(String msg)
// 	{
// 		super(msg);
// 	}
// }


// Path: src/test/java/org/seqdoop/hadoop_bam/TestSequencedFragment.java
import java.io.DataInput;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import org.apache.hadoop.io.Text;
import org.junit.*;
import static org.junit.Assert.*;
import org.seqdoop.hadoop_bam.SequencedFragment;
import org.seqdoop.hadoop_bam.FormatConstants;
import org.seqdoop.hadoop_bam.FormatException;
import java.io.IOException;

		frag.setQuality(new Text("zzz=zzzzzzzzzzzzzzzzzzzzzzzzzz"));
		assertEquals(3, SequencedFragment.verifyQuality(frag.getQuality(), FormatConstants.BaseQualityEncoding.Illumina));
	}

	@Test
	public void testConvertQualityIlluminaToSanger()
	{
		frag.setSequence(new Text("AGTAGTAGTAGTAGTAGTAGTAGTAGTAGT"));
		frag.setQuality(new Text("zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"));
		SequencedFragment.convertQuality(frag.getQuality(), FormatConstants.BaseQualityEncoding.Illumina, FormatConstants.BaseQualityEncoding.Sanger);
		assertEquals("[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[", frag.getQuality().toString());
	}

	@Test
	public void testConvertQualitySangerToIllumina()
	{
		frag.setSequence(new Text("AGTAGTAGTAGTAGTAGTAGTAGTAGTAGT"));
		frag.setQuality(new Text("[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["));
		SequencedFragment.convertQuality(frag.getQuality(), FormatConstants.BaseQualityEncoding.Sanger, FormatConstants.BaseQualityEncoding.Illumina);
		assertEquals("zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", frag.getQuality().toString());
	}

	@Test(expected=IllegalArgumentException.class)
	public void testConvertQualityNoop()
	{
		frag.setSequence(new Text("AGTAGTAGTAGTAGTAGTAGTAGTAGTAGT"));
		frag.setQuality(new Text("[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["));
		SequencedFragment.convertQuality(frag.getQuality(), FormatConstants.BaseQualityEncoding.Sanger, FormatConstants.BaseQualityEncoding.Sanger);
	}

	@Test(expected=FormatException.class)