Fixed bad merge

This commit is contained in:
Guillermo del Angel 2013-01-28 20:04:25 -05:00
parent 5995f01a01
commit ff799cc79a
1 changed files with 18 additions and 21 deletions

View File

@ -49,16 +49,13 @@ import com.google.java.contract.Requires;
import net.sf.samtools.SAMFileHeader;
import org.broadinstitute.sting.BaseTest;
import org.broadinstitute.sting.gatk.walkers.bqsr.RecalibrationArgumentCollection;
import org.broadinstitute.sting.utils.collections.Pair;
import org.broadinstitute.sting.utils.recalibration.EventType;
import org.broadinstitute.sting.utils.recalibration.ReadCovariates;
import org.broadinstitute.sting.utils.recalibration.covariates.ReadGroupCovariate;
import org.broadinstitute.sting.utils.recalibration.covariates.RepeatLengthCovariate;
import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils;
import org.broadinstitute.sting.utils.sam.GATKSAMReadGroupRecord;
import org.broadinstitute.sting.utils.sam.GATKSAMRecord;
import org.broadinstitute.sting.utils.variant.GATKVariantContextUtils;
import org.broadinstitute.variant.utils.BaseUtils;
import org.broadinstitute.variant.utils.Pair;
import org.broadinstitute.variant.variantcontext.VariantContextUtils;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@ -86,38 +83,38 @@ public class RepeatLengthCovariateUnitTest {
@Test(enabled = true)
public void testFindNumberOfRepetitions() {
// First, test logic to compute number of repetitions of a substring on a given string.
int result = GATKVariantContextUtils.findNumberofRepetitions("AC".getBytes(),"ACAC".getBytes(), true);
int result = VariantContextUtils.findNumberofRepetitions("AC".getBytes(), "ACAC".getBytes(), true);
Assert.assertEquals(2,result);
result = GATKVariantContextUtils.findNumberofRepetitions("AC".getBytes(),"ACACACAC".getBytes(), true);
result = VariantContextUtils.findNumberofRepetitions("AC".getBytes(),"ACACACAC".getBytes(), true);
Assert.assertEquals(4,result);
result = GATKVariantContextUtils.findNumberofRepetitions("AC".getBytes(),"ACACACACGT".getBytes(), true);
result = VariantContextUtils.findNumberofRepetitions("AC".getBytes(),"ACACACACGT".getBytes(), true);
Assert.assertEquals(4,result);
result = GATKVariantContextUtils.findNumberofRepetitions("AC".getBytes(),"GTACACACAC".getBytes(), true);
result = VariantContextUtils.findNumberofRepetitions("AC".getBytes(),"GTACACACAC".getBytes(), true);
Assert.assertEquals(0,result);
result = GATKVariantContextUtils.findNumberofRepetitions("GCA".getBytes(),"GTAGGGT".getBytes(), true);
result = VariantContextUtils.findNumberofRepetitions("GCA".getBytes(),"GTAGGGT".getBytes(), true);
Assert.assertEquals(0,result);
result = GATKVariantContextUtils.findNumberofRepetitions("GCAGCA".getBytes(),"GCAGCAGTAGGGTGTACACACAC".getBytes(), true);
result = VariantContextUtils.findNumberofRepetitions("GCAGCA".getBytes(),"GCAGCAGTAGGGTGTACACACAC".getBytes(), true);
Assert.assertEquals(1,result);
result = GATKVariantContextUtils.findNumberofRepetitions("GCAGCA".getBytes(),"GTAGGGTGTACACACACGCAGCAT".getBytes(), true);
result = VariantContextUtils.findNumberofRepetitions("GCAGCA".getBytes(),"GTAGGGTGTACACACACGCAGCAT".getBytes(), true);
Assert.assertEquals(0,result);
result = GATKVariantContextUtils.findNumberofRepetitions("GCA".getBytes(),"GTAGGGTGTACACACACGCAGCAGCA".getBytes(), true);
result = VariantContextUtils.findNumberofRepetitions("GCA".getBytes(),"GTAGGGTGTACACACACGCAGCAGCA".getBytes(), true);
Assert.assertEquals(0,result);
// Same tests but looking backward on string
result = GATKVariantContextUtils.findNumberofRepetitions("AC".getBytes(),"ACAC".getBytes(), false);
result = VariantContextUtils.findNumberofRepetitions("AC".getBytes(),"ACAC".getBytes(), false);
Assert.assertEquals(2,result);
result = GATKVariantContextUtils.findNumberofRepetitions("AC".getBytes(),"ACACACAC".getBytes(), false);
result = VariantContextUtils.findNumberofRepetitions("AC".getBytes(),"ACACACAC".getBytes(), false);
Assert.assertEquals(4,result);
result = GATKVariantContextUtils.findNumberofRepetitions("AC".getBytes(),"ACACACACGT".getBytes(), false);
result = VariantContextUtils.findNumberofRepetitions("AC".getBytes(),"ACACACACGT".getBytes(), false);
Assert.assertEquals(0,result);
result = GATKVariantContextUtils.findNumberofRepetitions("AC".getBytes(),"GTACACACAC".getBytes(), false);
result = VariantContextUtils.findNumberofRepetitions("AC".getBytes(),"GTACACACAC".getBytes(), false);
Assert.assertEquals(4,result);
result = GATKVariantContextUtils.findNumberofRepetitions("GCA".getBytes(),"GTAGGGT".getBytes(), false);
result = VariantContextUtils.findNumberofRepetitions("GCA".getBytes(),"GTAGGGT".getBytes(), false);
Assert.assertEquals(0,result);
result = GATKVariantContextUtils.findNumberofRepetitions("GCAGCA".getBytes(),"GCAGCAGTAGGGTGTACACACAC".getBytes(), false);
result = VariantContextUtils.findNumberofRepetitions("GCAGCA".getBytes(),"GCAGCAGTAGGGTGTACACACAC".getBytes(), false);
Assert.assertEquals(0,result);
result = GATKVariantContextUtils.findNumberofRepetitions("GCAGCA".getBytes(),"GTAGGGTGTACACACACGCAGCAT".getBytes(), false);
result = VariantContextUtils.findNumberofRepetitions("GCAGCA".getBytes(),"GTAGGGTGTACACACACGCAGCAT".getBytes(), false);
Assert.assertEquals(0,result);
result = GATKVariantContextUtils.findNumberofRepetitions("GCA".getBytes(),"GTAGGGTGTACACACACGCAGCAGCA".getBytes(), false);
result = VariantContextUtils.findNumberofRepetitions("GCA".getBytes(),"GTAGGGTGTACACACACGCAGCAGCA".getBytes(), false);
Assert.assertEquals(3,result);
// test logic to get repeat unit and number of repeats from covariate value