From 4f95f850b3d84a5c8e26533a02916bffd6710bdc Mon Sep 17 00:00:00 2001 From: Ryan Poplin Date: Mon, 7 Jan 2013 11:05:44 -0500 Subject: [PATCH 01/25] Bug fix in the HC's allele mapping for multi-allelic events. Using the allele alone as a key isn't sufficient because alleles change when the reference allele changes during VariantContextUtils.simpleMerge for multi-allelic events. --- .../haplotypecaller/GenotypingEngine.java | 185 +++++++++++------- .../haplotypecaller/HaplotypeCaller.java | 20 +- .../HaplotypeCallerIntegrationTest.java | 6 +- .../variantcontext/VariantContextUtils.java | 1 - 4 files changed, 124 insertions(+), 88 deletions(-) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java index 5aef002fe..8b7b0b918 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java @@ -59,16 +59,16 @@ public class GenotypingEngine { } @Requires({"refLoc.containsP(activeRegionWindow)", "haplotypes.size() > 0"}) - public List assignGenotypeLikelihoodsAndCallIndependentEvents( final UnifiedGenotyperEngine UG_engine, - final List haplotypes, - final List samples, - final Map haplotypeReadMap, - final Map> perSampleFilteredReadList, - final byte[] ref, - final GenomeLoc refLoc, - final GenomeLoc activeRegionWindow, - final GenomeLocParser genomeLocParser, - final List activeAllelesToGenotype ) { + public List assignGenotypeLikelihoods( final UnifiedGenotyperEngine UG_engine, + final List haplotypes, + final List samples, + final Map haplotypeReadMap, + final Map> perSampleFilteredReadList, + final byte[] ref, + final GenomeLoc refLoc, + final GenomeLoc activeRegionWindow, + final GenomeLocParser genomeLocParser, + final List activeAllelesToGenotype ) { final List returnCalls = new ArrayList(); final boolean in_GGA_mode = !activeAllelesToGenotype.isEmpty(); @@ -120,7 +120,7 @@ public class GenotypingEngine { priorityList.clear(); int alleleCount = 0; for( final Allele compAltAllele : compVC.getAlternateAlleles() ) { - HashSet alleleSet = new HashSet(2); + ArrayList alleleSet = new ArrayList(2); alleleSet.add(compVC.getReference()); alleleSet.add(compAltAllele); priorityList.add("Allele" + alleleCount); @@ -133,45 +133,26 @@ public class GenotypingEngine { if( eventsAtThisLoc.isEmpty() ) { continue; } - // Create the allele mapping object which maps the original haplotype alleles to the alleles present in just this event - Map> alleleMapper = createAlleleMapper( loc, eventsAtThisLoc, haplotypes ); + // Create the event mapping object which maps the original haplotype events to the events present at just this locus + final Map> eventMapper = createEventMapper(loc, eventsAtThisLoc, haplotypes); - final Allele refAllele = eventsAtThisLoc.get(0).getReference(); - final ArrayList alleleOrdering = new ArrayList(alleleMapper.size()); - alleleOrdering.add(refAllele); - for( final VariantContext vc : eventsAtThisLoc ) { - alleleOrdering.add(vc.getAlternateAllele(0)); - } - - // Sanity check the priority list - for( final VariantContext vc : eventsAtThisLoc ) { - if( !priorityList.contains(vc.getSource()) ) { - throw new ReviewedStingException("Event found on haplotype that wasn't added to priority list. Something went wrong in the merging of alleles."); - } - } - for( final String name : priorityList ) { - boolean found = false; - for( final VariantContext vc : eventsAtThisLoc ) { - if(vc.getSource().equals(name)) { found = true; break; } - } - if( !found ) { - throw new ReviewedStingException("Event added to priority list but wasn't found on any haplotype. Something went wrong in the merging of alleles."); - } - } + // Sanity check the priority list for mistakes + sanityCheckPriorityList( priorityList, eventsAtThisLoc ); // Merge the event to find a common reference representation final VariantContext mergedVC = VariantContextUtils.simpleMerge(eventsAtThisLoc, priorityList, VariantContextUtils.FilteredRecordMergeType.KEEP_IF_ANY_UNFILTERED, VariantContextUtils.GenotypeMergeType.PRIORITIZE, false, false, null, false, false); if( mergedVC == null ) { continue; } - // let's update the Allele keys in the mapper because they can change after merging when there are complex events - final Map> updatedAlleleMapper = new HashMap>(alleleMapper.size()); - for ( int i = 0; i < mergedVC.getNAlleles(); i++ ) { - final Allele oldAllele = alleleOrdering.get(i); - final Allele newAllele = mergedVC.getAlleles().get(i); - updatedAlleleMapper.put(newAllele, alleleMapper.get(oldAllele)); - alleleOrdering.set(i, newAllele); + if( eventsAtThisLoc.size() != mergedVC.getAlternateAlleles().size() ) { + throw new ReviewedStingException("Something went wrong in the merging of alleles."); } - alleleMapper = updatedAlleleMapper; + final HashMap mergeMap = new HashMap(); + mergeMap.put(null, mergedVC.getReference()); // the reference event (null) --> the reference allele + for(int iii = 0; iii < mergedVC.getAlternateAlleles().size(); iii++) { + mergeMap.put(eventsAtThisLoc.get(iii), mergedVC.getAlternateAllele(iii)); // BUGBUG: This is assuming that the order of alleles is the same as the priority list given to simpleMerge function + } + + final Map> alleleMapper = createAlleleMapper(mergeMap, eventMapper); if( DEBUG ) { System.out.println("Genotyping event at " + loc + " with alleles = " + mergedVC.getAlleles()); @@ -180,20 +161,7 @@ public class GenotypingEngine { final Map alleleReadMap = convertHaplotypeReadMapToAlleleReadMap( haplotypeReadMap, alleleMapper, UG_engine.getUAC().CONTAMINATION_FRACTION, UG_engine.getUAC().contaminationLog ); - // Grab the genotype likelihoods from the appropriate places in the haplotype likelihood matrix -- calculation performed independently per sample - final GenotypesContext genotypes = GenotypesContext.create(samples.size()); - for( final String sample : samples ) { - final int numHaplotypes = alleleMapper.size(); - final double[] genotypeLikelihoods = new double[numHaplotypes * (numHaplotypes+1) / 2]; - final double[][] haplotypeLikelihoodMatrix = LikelihoodCalculationEngine.computeDiploidHaplotypeLikelihoods(sample, alleleReadMap, alleleOrdering); - int glIndex = 0; - for( int iii = 0; iii < numHaplotypes; iii++ ) { - for( int jjj = 0; jjj <= iii; jjj++ ) { - genotypeLikelihoods[glIndex++] = haplotypeLikelihoodMatrix[iii][jjj]; // for example: AA,AB,BB,AC,BC,CC - } - } - genotypes.add( new GenotypeBuilder(sample).alleles(noCall).PL(genotypeLikelihoods).make() ); - } + final GenotypesContext genotypes = calculateGLsForThisEvent( samples, alleleReadMap, mergedVC ); final VariantContext call = UG_engine.calculateGenotypes(new VariantContextBuilder(mergedVC).genotypes(genotypes).make(), UG_engine.getUAC().GLmodel); if( call != null ) { final Map alleleReadMap_annotations = ( USE_FILTERED_READ_MAP_FOR_ANNOTATIONS ? alleleReadMap : @@ -212,6 +180,41 @@ public class GenotypingEngine { return returnCalls; } + private GenotypesContext calculateGLsForThisEvent( final List samples, final Map alleleReadMap, final VariantContext mergedVC ) { + final GenotypesContext genotypes = GenotypesContext.create(samples.size()); + // Grab the genotype likelihoods from the appropriate places in the haplotype likelihood matrix -- calculation performed independently per sample + for( final String sample : samples ) { + final int numHaplotypes = mergedVC.getAlleles().size(); + final double[] genotypeLikelihoods = new double[numHaplotypes * (numHaplotypes+1) / 2]; + final double[][] haplotypeLikelihoodMatrix = LikelihoodCalculationEngine.computeDiploidHaplotypeLikelihoods(sample, alleleReadMap, mergedVC.getAlleles()); + int glIndex = 0; + for( int iii = 0; iii < numHaplotypes; iii++ ) { + for( int jjj = 0; jjj <= iii; jjj++ ) { + genotypeLikelihoods[glIndex++] = haplotypeLikelihoodMatrix[iii][jjj]; // for example: AA,AB,BB,AC,BC,CC + } + } + genotypes.add( new GenotypeBuilder(sample).alleles(noCall).PL(genotypeLikelihoods).make() ); + } + return genotypes; + } + + private void sanityCheckPriorityList( final ArrayList priorityList, final ArrayList eventsAtThisLoc ) { + for( final VariantContext vc : eventsAtThisLoc ) { + if( !priorityList.contains(vc.getSource()) ) { + throw new ReviewedStingException("Event found on haplotype that wasn't added to priority list. Something went wrong in the merging of alleles."); + } + } + for( final String name : priorityList ) { + boolean found = false; + for( final VariantContext vc : eventsAtThisLoc ) { + if(vc.getSource().equals(name)) { found = true; break; } + } + if( !found ) { + throw new ReviewedStingException("Event added to priority list but wasn't found on any haplotype. Something went wrong in the merging of alleles."); + } + } + } + private static Map filterToOnlyOverlappingReads( final GenomeLocParser parser, final Map perSampleReadMap, final Map> perSampleFilteredReadList, @@ -437,27 +440,45 @@ public class GenotypingEngine { return ((pa1b1 - pa1*pb1) * (pa1b1 - pa1*pb1)) / ( pa1 * (1.0 - pa1) * pb1 * (1.0 - pb1) ); } + protected static Map> createAlleleMapper( final Map mergeMap, final Map> eventMap ) { + final Map> alleleMapper = new HashMap>(); + for( final Map.Entry entry : mergeMap.entrySet() ) { + alleleMapper.put(entry.getValue(), eventMap.get(new Event(entry.getKey()))); + } + return alleleMapper; + } + @Requires({"haplotypes.size() >= eventsAtThisLoc.size() + 1"}) @Ensures({"result.size() == eventsAtThisLoc.size() + 1"}) - protected static Map> createAlleleMapper( final int loc, final List eventsAtThisLoc, final List haplotypes ) { + protected static Map> createEventMapper( final int loc, final List eventsAtThisLoc, final List haplotypes ) { - final Map> alleleMapper = new HashMap>(eventsAtThisLoc.size()+1); + final Map> eventMapper = new HashMap>(eventsAtThisLoc.size()+1); final Allele refAllele = eventsAtThisLoc.get(0).getReference(); - alleleMapper.put(refAllele, new ArrayList()); - for( final VariantContext vc : eventsAtThisLoc ) - alleleMapper.put(vc.getAlternateAllele(0), new ArrayList()); + VariantContext refVC = eventsAtThisLoc.get(0); + eventMapper.put(new Event(null), new ArrayList()); + for( final VariantContext vc : eventsAtThisLoc ) { + eventMapper.put(new Event(vc), new ArrayList()); + } final ArrayList undeterminedHaplotypes = new ArrayList(haplotypes.size()); for( final Haplotype h : haplotypes ) { - if( h.isArtificialHaplotype() && loc == h.getArtificialAllelePosition() && alleleMapper.containsKey(h.getArtificialAllele()) ) { - alleleMapper.get(h.getArtificialAllele()).add(h); + if( h.isArtificialHaplotype() && loc == h.getArtificialAllelePosition() ) { + final ArrayList alleles = new ArrayList(2); + alleles.add(refAllele); + alleles.add(h.getArtificialAllele()); + final Event artificialVC = new Event( (new VariantContextBuilder()).source("artificialHaplotype") + .alleles(alleles) + .loc(refVC.getChr(), refVC.getStart(), refVC.getStart() + refAllele.length() - 1).make() ); + if( eventMapper.containsKey(artificialVC) ) { + eventMapper.get(artificialVC).add(h); + } } else if( h.getEventMap().get(loc) == null ) { // no event at this location so let's investigate later undeterminedHaplotypes.add(h); } else { boolean haplotypeIsDetermined = false; for( final VariantContext vcAtThisLoc : eventsAtThisLoc ) { if( h.getEventMap().get(loc).hasSameAllelesAs(vcAtThisLoc) ) { - alleleMapper.get(vcAtThisLoc.getAlternateAllele(0)).add(h); + eventMapper.get(new Event(vcAtThisLoc)).add(h); haplotypeIsDetermined = true; break; } @@ -469,25 +490,23 @@ public class GenotypingEngine { } for( final Haplotype h : undeterminedHaplotypes ) { - Allele matchingAllele = null; - for( final Map.Entry> alleleToTest : alleleMapper.entrySet() ) { + Event matchingEvent = new Event(null); + for( final Map.Entry> eventToTest : eventMapper.entrySet() ) { // don't test against the reference allele - if( alleleToTest.getKey().equals(refAllele) ) + if( eventToTest.getKey().equals(new Event(null)) ) continue; - final Haplotype artificialHaplotype = alleleToTest.getValue().get(0); + final Haplotype artificialHaplotype = eventToTest.getValue().get(0); if( isSubSetOf(artificialHaplotype.getEventMap(), h.getEventMap(), true) ) { - matchingAllele = alleleToTest.getKey(); + matchingEvent = eventToTest.getKey(); break; } } - if( matchingAllele == null ) - matchingAllele = refAllele; - alleleMapper.get(matchingAllele).add(h); + eventMapper.get(matchingEvent).add(h); } - return alleleMapper; + return eventMapper; } protected static boolean isSubSetOf(final Map subset, final Map superset, final boolean resolveSupersetToSubset) { @@ -636,4 +655,22 @@ public class GenotypingEngine { } return vcs; } + + private static class Event { + public VariantContext vc; + + public Event( final VariantContext vc ) { + this.vc = vc; + } + + @Override + public boolean equals( final Object obj ) { + return obj instanceof Event && ((((Event) obj).vc == null && vc == null) || (((Event) obj).vc != null && vc != null && ((Event) obj).vc.hasSameAllelesAs(vc))) ; + } + + @Override + public int hashCode() { + return (vc == null ? -1 : vc.getAlleles().hashCode()); + } + } } \ No newline at end of file diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/HaplotypeCaller.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/HaplotypeCaller.java index 8c8113f46..cde089b34 100755 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/HaplotypeCaller.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/HaplotypeCaller.java @@ -416,16 +416,16 @@ public class HaplotypeCaller extends ActiveRegionWalker implem // subset down to only the best haplotypes to be genotyped in all samples ( in GGA mode use all discovered haplotypes ) final ArrayList bestHaplotypes = ( UG_engine.getUAC().GenotypingMode != GenotypeLikelihoodsCalculationModel.GENOTYPING_MODE.GENOTYPE_GIVEN_ALLELES ? likelihoodCalculationEngine.selectBestHaplotypes( haplotypes, stratifiedReadMap ) : haplotypes ); - for( final VariantContext call : genotypingEngine.assignGenotypeLikelihoodsAndCallIndependentEvents( UG_engine, - bestHaplotypes, - samplesList, - stratifiedReadMap, - perSampleFilteredReadList, - fullReferenceWithPadding, - getPaddedLoc(activeRegion), - activeRegion.getLocation(), - getToolkit().getGenomeLocParser(), - activeAllelesToGenotype ) ) { + for( final VariantContext call : genotypingEngine.assignGenotypeLikelihoods( UG_engine, + bestHaplotypes, + samplesList, + stratifiedReadMap, + perSampleFilteredReadList, + fullReferenceWithPadding, + getPaddedLoc(activeRegion), + activeRegion.getLocation(), + getToolkit().getGenomeLocParser(), + activeAllelesToGenotype ) ) { vcfWriter.add( call ); } diff --git a/protected/java/test/org/broadinstitute/sting/gatk/walkers/haplotypecaller/HaplotypeCallerIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/haplotypecaller/HaplotypeCallerIntegrationTest.java index 1683044f0..4c2714dde 100644 --- a/protected/java/test/org/broadinstitute/sting/gatk/walkers/haplotypecaller/HaplotypeCallerIntegrationTest.java +++ b/protected/java/test/org/broadinstitute/sting/gatk/walkers/haplotypecaller/HaplotypeCallerIntegrationTest.java @@ -21,7 +21,7 @@ public class HaplotypeCallerIntegrationTest extends WalkerTest { @Test public void testHaplotypeCallerMultiSample() { - HCTest(CEUTRIO_BAM, "", "47fdbe5f01d3ce5e53056eea8c488e45"); + HCTest(CEUTRIO_BAM, "", "35c8425b44429ac7468c2cd26f8f5a42"); } @Test @@ -33,7 +33,7 @@ public class HaplotypeCallerIntegrationTest extends WalkerTest { @Test public void testHaplotypeCallerMultiSampleGGA() { HCTest(CEUTRIO_BAM, "--max_alternate_alleles 3 -gt_mode GENOTYPE_GIVEN_ALLELES -out_mode EMIT_ALL_SITES -alleles " + validationDataLocation + "combined.phase1.chr20.raw.indels.sites.vcf", - "54b7cc3da3d8349ff4302f99883ab188"); + "d918d25b22a551cae5d70ea30d7feed1"); } private void HCTestComplexVariants(String bam, String args, String md5) { @@ -72,7 +72,7 @@ public class HaplotypeCallerIntegrationTest extends WalkerTest { @Test public void HCTestProblematicReadsModifiedInActiveRegions() { final String base = String.format("-T HaplotypeCaller -R %s -I %s", REF, privateTestDir + "haplotype-problem-4.bam") + " --no_cmdline_in_header -o %s -minPruning 3 -L 4:49139026-49139965"; - final WalkerTestSpec spec = new WalkerTestSpec(base, Arrays.asList("ece627de486aee69d02872891c6cb0ff")); + final WalkerTestSpec spec = new WalkerTestSpec(base, Arrays.asList("2e8e6313228b0387008437feae7f5469")); executeTest("HCTestProblematicReadsModifiedInActiveRegions: ", spec); } diff --git a/public/java/src/org/broadinstitute/variant/variantcontext/VariantContextUtils.java b/public/java/src/org/broadinstitute/variant/variantcontext/VariantContextUtils.java index 5d9a6d476..4d1e70340 100755 --- a/public/java/src/org/broadinstitute/variant/variantcontext/VariantContextUtils.java +++ b/public/java/src/org/broadinstitute/variant/variantcontext/VariantContextUtils.java @@ -499,7 +499,6 @@ public class VariantContextUtils { final VariantContext first = VCs.get(0); final String name = first.getSource(); final Allele refAllele = determineReferenceAllele(VCs); - Byte referenceBaseForIndel = null; final Set alleles = new LinkedHashSet(); final Set filters = new HashSet(); From 04e3978b04f6ca0d63ee5c16664b4d604c763a52 Mon Sep 17 00:00:00 2001 From: Tad Jordan Date: Mon, 7 Jan 2013 12:08:39 -0500 Subject: [PATCH 02/25] Fixed VariantEval tests -Added sorting by rows to VariantEval --- .../sting/gatk/walkers/varianteval/VariantEvalReportWriter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalReportWriter.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalReportWriter.java index 91efd1ffd..6dad128fe 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalReportWriter.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalReportWriter.java @@ -162,7 +162,7 @@ public class VariantEvalReportWriter { // create the table final String tableName = ve.getSimpleName(); final String tableDesc = ve.getClass().getAnnotation(Analysis.class).description(); - report.addTable(tableName, tableDesc, 1 + stratifiers.size() + (scanner.hasMoltenField() ? 2 : datamap.size())); + report.addTable(tableName, tableDesc, 1 + stratifiers.size() + (scanner.hasMoltenField() ? 2 : datamap.size()), GATKReportTable.TableSortingWay.SORT_BY_ROW); // grab the table, and add the columns we need to it final GATKReportTable table = report.getTable(tableName); From b4e7b3d691684faf193499a78634456930a92f03 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Mon, 7 Jan 2013 13:07:36 -0500 Subject: [PATCH 03/25] Fixed precision problem in the Bayesian calculation of Qemp: we need to cap below max integer because the MathUtils code add +1. Added unit tests for handling large number of observations. --- .../sting/utils/QualityUtils.java | 4 ++++ .../sting/utils/recalibration/RecalDatum.java | 10 ++++---- .../walkers/bqsr/BQSRGathererUnitTest.java | 24 +++++++++++++++++++ 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/utils/QualityUtils.java b/public/java/src/org/broadinstitute/sting/utils/QualityUtils.java index 844fa6b90..96fd0250c 100755 --- a/public/java/src/org/broadinstitute/sting/utils/QualityUtils.java +++ b/public/java/src/org/broadinstitute/sting/utils/QualityUtils.java @@ -90,6 +90,10 @@ public class QualityUtils { return qualToErrorProbLog10Cache[(int)qual & 0xff]; // Map: 127 -> 127; -128 -> 128; -1 -> 255; etc. } + static public double qualToErrorProbLog10(final double qual) { + return qual/-10.0; + } + /** * Convert a probability to a quality score. Note, this is capped at Q40. * diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java b/public/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java index eebc86b6b..7bd21ddaa 100755 --- a/public/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java +++ b/public/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java @@ -341,6 +341,8 @@ public class RecalDatum { return log10QempPriorCache[difference]; } + static private final long MAX_NUMBER_OF_OBSERVATIONS = Integer.MAX_VALUE - 1; + static protected double log10QempLikelihood(final double Qempirical, long nObservations, long nErrors) { if ( nObservations == 0 ) return 0.0; @@ -348,15 +350,15 @@ public class RecalDatum { // the binomial code requires ints as input (because it does caching). This should theoretically be fine because // there is plenty of precision in 2^31 observations, but we need to make sure that we don't have overflow // before casting down to an int. - if ( nObservations > Integer.MAX_VALUE ) { + if ( nObservations > MAX_NUMBER_OF_OBSERVATIONS ) { // we need to decrease nErrors by the same fraction that we are decreasing nObservations - final double fraction = (double)Integer.MAX_VALUE / (double)nObservations; + final double fraction = (double)MAX_NUMBER_OF_OBSERVATIONS / (double)nObservations; nErrors = Math.round((double)nErrors * fraction); - nObservations = Integer.MAX_VALUE; + nObservations = MAX_NUMBER_OF_OBSERVATIONS; } // this is just a straight binomial PDF - double log10Prob = MathUtils.log10BinomialProbability((int)nObservations, (int)nErrors, QualityUtils.qualToErrorProbLog10((byte)(int)Qempirical)); + double log10Prob = MathUtils.log10BinomialProbability((int)nObservations, (int)nErrors, QualityUtils.qualToErrorProbLog10(Qempirical)); if ( Double.isInfinite(log10Prob) || Double.isNaN(log10Prob) ) log10Prob = -Double.MAX_VALUE; diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java index 44bc7de5f..538c027d9 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java @@ -26,6 +26,25 @@ public class BQSRGathererUnitTest extends BaseTest { private static File recal_original = new File(privateTestDir + "HiSeq.1mb.1RG.noSG.table"); + @Test(enabled = true) + public void testManyObservations() { + File recal = new File(privateTestDir + "bqsr.manyObservations.piece.table"); + + final File output = BaseTest.createTempFile("BQSRgathererTest", ".table"); + + List recalFiles = new LinkedList (); + for ( int i=0; i < 5; i++ ) + recalFiles.add(recal); + + BQSRGatherer gatherer = new BQSRGatherer(); + gatherer.gather(recalFiles, output); + + GATKReport originalReport = new GATKReport(new File(privateTestDir + "bqsr.manyObservations.full.table")); + GATKReport calculatedReport = new GATKReport(output); + + testReports(originalReport, calculatedReport); + } + @Test(enabled = true) public void testGatherBQSR() { BQSRGatherer gatherer = new BQSRGatherer(); @@ -42,6 +61,11 @@ public class BQSRGathererUnitTest extends BaseTest { GATKReport originalReport = new GATKReport(recal_original); GATKReport calculatedReport = new GATKReport(output); + testReports(originalReport, calculatedReport); + } + + private void testReports(final GATKReport originalReport, final GATKReport calculatedReport) { + // test the Arguments table List columnsToTest = Arrays.asList(RecalUtils.ARGUMENT_COLUMN_NAME, RecalUtils.ARGUMENT_VALUE_COLUMN_NAME); GATKReportTable originalTable = originalReport.getTable(RecalUtils.ARGUMENT_REPORT_TABLE_TITLE); From 78f7a4e300e9b6c9f742580aa3d0d34cd099d0ea Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Mon, 7 Jan 2013 14:03:08 -0500 Subject: [PATCH 04/25] Received permission from Mauricio to archive the DPP and PBPP PipelineTests --- .../pipeline/DataProcessingPipelineTest.scala | 67 ------------------- .../PacbioProcessingPipelineTest.scala | 46 ------------- 2 files changed, 113 deletions(-) delete mode 100644 public/scala/test/org/broadinstitute/sting/queue/pipeline/DataProcessingPipelineTest.scala delete mode 100644 public/scala/test/org/broadinstitute/sting/queue/pipeline/PacbioProcessingPipelineTest.scala diff --git a/public/scala/test/org/broadinstitute/sting/queue/pipeline/DataProcessingPipelineTest.scala b/public/scala/test/org/broadinstitute/sting/queue/pipeline/DataProcessingPipelineTest.scala deleted file mode 100644 index 60c9d9a59..000000000 --- a/public/scala/test/org/broadinstitute/sting/queue/pipeline/DataProcessingPipelineTest.scala +++ /dev/null @@ -1,67 +0,0 @@ -package org.broadinstitute.sting.queue.pipeline - -/* - * Copyright (c) 2011, The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -import org.testng.annotations.Test -import org.broadinstitute.sting.BaseTest - -class DataProcessingPipelineTest { - @Test(timeOut=36000000) - def testSimpleBAM { - val projectName = "test1" - val testOut = projectName + ".exampleBAM.bam.clean.dedup.recal.bam" - val spec = new PipelineTestSpec - spec.name = "DataProcessingPipeline" - spec.args = Array( - " -S public/scala/qscript/org/broadinstitute/sting/queue/qscripts/DataProcessingPipeline.scala", - " -R " + BaseTest.publicTestDir + "exampleFASTA.fasta", - " -i " + BaseTest.publicTestDir + "exampleBAM.bam", - " -D " + BaseTest.publicTestDir + "exampleDBSNP.vcf", - " -test ", - " -p " + projectName).mkString - spec.fileMD5s += testOut -> "45d97df6d291695b92668e8a55c54cd0" - PipelineTest.executeTest(spec) - } - - @Test(timeOut=36000000) - def testBWAPEBAM { - val projectName = "test2" - val testOut = projectName + ".exampleBAM.bam.clean.dedup.recal.bam" - val spec = new PipelineTestSpec - spec.name = "DataProcessingPipeline" - spec.args = Array( - " -S public/scala/qscript/org/broadinstitute/sting/queue/qscripts/DataProcessingPipeline.scala", - " -R " + BaseTest.publicTestDir + "exampleFASTA.fasta", - " -i " + BaseTest.publicTestDir + "exampleBAM.bam", - " -D " + BaseTest.publicTestDir + "exampleDBSNP.vcf", - " -test ", - " -bwa /home/unix/carneiro/bin/bwa", - " -bwape ", - " -p " + projectName).mkString - spec.fileMD5s += testOut -> "9fca827ecc8436465b831bb6f879357a" - PipelineTest.executeTest(spec) - } - -} diff --git a/public/scala/test/org/broadinstitute/sting/queue/pipeline/PacbioProcessingPipelineTest.scala b/public/scala/test/org/broadinstitute/sting/queue/pipeline/PacbioProcessingPipelineTest.scala deleted file mode 100644 index dd07cbfdc..000000000 --- a/public/scala/test/org/broadinstitute/sting/queue/pipeline/PacbioProcessingPipelineTest.scala +++ /dev/null @@ -1,46 +0,0 @@ -package org.broadinstitute.sting.queue.pipeline - -/* - * Copyright (c) 2011, The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -import org.testng.annotations.Test -import org.broadinstitute.sting.BaseTest - -class PacbioProcessingPipelineTest { - @Test(timeOut=36000000) - def testPacbioProcessingPipeline { - val testOut = "exampleBAM.recal.bam" - val spec = new PipelineTestSpec - spec.name = "pacbioProcessingPipeline" - spec.args = Array( - " -S public/scala/qscript/org/broadinstitute/sting/queue/qscripts/PacbioProcessingPipeline.scala", - " -R " + BaseTest.publicTestDir + "exampleFASTA.fasta", - " -i " + BaseTest.publicTestDir + "exampleBAM.bam", - " -blasr ", - " -test ", - " -D " + BaseTest.publicTestDir + "exampleDBSNP.vcf").mkString - spec.fileMD5s += testOut -> "b84f9c45e045685067ded681d5e6224c" - PipelineTest.executeTest(spec) - } -} From 35d9bd377ca97a929e5c67f9bbb96fd35c30f820 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Mon, 7 Jan 2013 14:42:40 -0500 Subject: [PATCH 05/25] Moved (nearly) all Walkers from public to protected and removed GATKLite utils --- .../sting/gatk/DummyProtectedClass.java | 34 -- .../gatk/walkers/annotator/AlleleBalance.java | 0 .../annotator/AlleleBalanceBySample.java | 0 .../annotator/AverageAltAlleleLength.java | 0 .../gatk/walkers/annotator/BaseCounts.java | 0 .../annotator/BaseQualityRankSumTest.java | 0 .../walkers/annotator/ChromosomeCounts.java | 0 .../annotator/ClippingRankSumTest.java | 0 .../walkers/annotator/DepthOfCoverage.java | 0 .../annotator/DepthPerAlleleBySample.java | 0 .../gatk/walkers/annotator/FisherStrand.java | 0 .../gatk/walkers/annotator/GCContent.java | 0 .../walkers/annotator/HaplotypeScore.java | 0 .../gatk/walkers/annotator/HardyWeinberg.java | 0 .../walkers/annotator/HomopolymerRun.java | 0 .../walkers/annotator/InbreedingCoeff.java | 0 .../sting/gatk/walkers/annotator/LowMQ.java | 0 .../walkers/annotator/MVLikelihoodRatio.java | 0 .../annotator/MappingQualityRankSumTest.java | 0 .../walkers/annotator/MappingQualityZero.java | 0 .../annotator/MappingQualityZeroBySample.java | 0 .../annotator/MappingQualityZeroFraction.java | 0 .../gatk/walkers/annotator/NBaseCount.java | 0 .../gatk/walkers/annotator/QualByDepth.java | 0 .../walkers/annotator/RMSMappingQuality.java | 0 .../gatk/walkers/annotator/RankSumTest.java | 0 .../walkers/annotator/ReadPosRankSumTest.java | 0 .../gatk/walkers/annotator/SampleList.java | 0 .../sting/gatk/walkers/annotator/SnpEff.java | 0 .../walkers/annotator/SpanningDeletions.java | 0 .../annotator/TandemRepeatAnnotator.java | 0 .../annotator/TechnologyComposition.java | 0 .../TransmissionDisequilibriumTest.java | 0 .../walkers/annotator/VariantAnnotator.java | 0 .../annotator/VariantAnnotatorEngine.java | 0 .../gatk/walkers/annotator/VariantType.java | 0 .../ActiveRegionBasedAnnotation.java | 0 .../AnnotationInterfaceManager.java | 0 .../annotator/interfaces/AnnotationType.java | 0 .../interfaces/AnnotatorCompatible.java | 0 .../interfaces/ExperimentalAnnotation.java | 0 .../interfaces/GenotypeAnnotation.java | 0 .../interfaces/InfoFieldAnnotation.java | 0 .../interfaces/RodRequiringAnnotation.java | 0 .../interfaces/StandardAnnotation.java | 0 .../VariantAnnotatorAnnotation.java | 0 .../interfaces/WorkInProgressAnnotation.java | 0 .../walkers/beagle/BeagleOutputToVCF.java | 0 .../walkers/beagle/ProduceBeagleInput.java | 0 .../beagle/VariantsToBeagleUnphased.java | 0 .../reducereads/SimpleGenomeLoc.java | 0 .../gatk/walkers/coverage/CallableLoci.java | 0 .../walkers/coverage/CompareCallableLoci.java | 0 .../gatk/walkers/coverage/CoverageUtils.java | 0 .../walkers/coverage/DepthOfCoverage.java | 0 .../coverage/DepthOfCoverageStats.java | 0 .../gatk/walkers/coverage/DoCOutputType.java | 0 .../walkers/coverage/GCContentByInterval.java | 0 .../diagnostics/ErrorRatePerCycle.java | 0 .../diagnostics/ReadGroupProperties.java | 0 .../diagnostics/ReadLengthDistribution.java | 0 .../diagnostics/targets/CallableStatus.java | 0 .../diagnostics/targets/DiagnoseTargets.java | 0 .../targets/FindCoveredIntervals.java | 0 .../targets/IntervalStatistics.java | 0 .../diagnostics/targets/LocusStatistics.java | 0 .../diagnostics/targets/SampleStatistics.java | 0 .../diagnostics/targets/ThresHolder.java | 0 .../walkers/diffengine/BAMDiffableReader.java | 0 .../gatk/walkers/diffengine/DiffElement.java | 0 .../gatk/walkers/diffengine/DiffEngine.java | 0 .../gatk/walkers/diffengine/DiffNode.java | 0 .../gatk/walkers/diffengine/DiffObjects.java | 0 .../gatk/walkers/diffengine/DiffValue.java | 0 .../walkers/diffengine/DiffableReader.java | 0 .../gatk/walkers/diffengine/Difference.java | 0 .../diffengine/GATKReportDiffableReader.java | 0 .../walkers/diffengine/VCFDiffableReader.java | 0 .../fasta/FastaAlternateReferenceMaker.java | 0 .../walkers/fasta/FastaReferenceMaker.java | 0 .../gatk/walkers/fasta/FastaSequence.java | 0 .../sting/gatk/walkers/fasta/FastaStats.java | 0 .../gatk/walkers/filters/ClusteredSnps.java | 0 .../walkers/filters/FiltrationContext.java | 0 .../filters/FiltrationContextWindow.java | 0 .../walkers/filters/VariantFiltration.java | 0 .../walkers/genotyper/BaseMismatchModel.java | 0 .../genotyper/ConsensusAlleleCounter.java | 0 .../walkers/genotyper/DiploidGenotype.java | 0 .../DiploidSNPGenotypeLikelihoods.java | 0 .../GenotypeLikelihoodsCalculationModel.java | 0 .../walkers/genotyper/GenotypePriors.java | 0 ...elGenotypeLikelihoodsCalculationModel.java | 0 ...NPGenotypeLikelihoodsCalculationModel.java | 0 .../genotyper/UnifiedArgumentCollection.java | 0 .../walkers/genotyper/UnifiedGenotyper.java | 21 - .../genotyper/UnifiedGenotyperEngine.java | 0 .../walkers/genotyper/VariantCallContext.java | 0 .../gatk/walkers/genotyper/afcalc/AFCalc.java | 0 .../genotyper/afcalc/AFCalcFactory.java | 0 .../genotyper/afcalc/AFCalcResult.java | 0 .../genotyper/afcalc/DiploidExactAFCalc.java | 0 .../genotyper/afcalc/ExactACcounts.java | 0 .../walkers/genotyper/afcalc/ExactACset.java | 0 .../walkers/genotyper/afcalc/ExactAFCalc.java | 0 .../genotyper/afcalc/ExactCallLogger.java | 0 .../IndependentAllelesDiploidExactAFCalc.java | 0 .../afcalc/OriginalDiploidExactAFCalc.java | 0 .../afcalc/ReferenceDiploidExactAFCalc.java | 0 .../genotyper/afcalc/StateTracker.java | 0 .../indels/ConstrainedMateFixingManager.java | 0 .../indels/HaplotypeIndelErrorModel.java | 0 .../gatk/walkers/indels/IndelRealigner.java | 0 .../gatk/walkers/indels/LeftAlignIndels.java | 0 .../indels/PairHMMIndelErrorModel.java | 0 .../indels/RealignerTargetCreator.java | 0 .../gatk/walkers/phasing/AllelePair.java | 0 .../sting/gatk/walkers/phasing/BaseArray.java | 0 .../walkers/phasing/CardinalityCounter.java | 0 .../phasing/CloneableIteratorLinkedList.java | 0 .../gatk/walkers/phasing/DisjointSet.java | 0 .../sting/gatk/walkers/phasing/Haplotype.java | 0 ...eSegregatingAlternateAllelesVCFWriter.java | 0 .../walkers/phasing/PhaseByTransmission.java | 0 .../gatk/walkers/phasing/PhasingGraph.java | 0 .../walkers/phasing/PhasingGraphEdge.java | 0 .../gatk/walkers/phasing/PhasingRead.java | 0 .../gatk/walkers/phasing/PhasingUtils.java | 0 .../phasing/PreciseNonNegativeDouble.java | 0 .../walkers/phasing/ReadBackedPhasing.java | 0 .../sting/gatk/walkers/phasing/ReadBase.java | 0 .../walkers/phasing/ReadBasesAtPosition.java | 0 .../gatk/walkers/phasing/SNPallelePair.java | 0 .../validation/GenotypeAndValidate.java | 0 .../validation/ValidationAmplicons.java | 0 .../FrequencyModeSelector.java | 0 .../GLBasedSampleSelector.java | 0 .../GTBasedSampleSelector.java | 0 .../validationsiteselector/GenomeEvent.java | 0 .../KeepAFSpectrumFrequencySelector.java | 0 .../NullSampleSelector.java | 0 .../SampleSelector.java | 0 .../UniformSamplingFrequencySelector.java | 0 .../ValidationSiteSelector.java | 0 .../gatk/walkers/varianteval/VariantEval.java | 0 .../varianteval/VariantEvalReportWriter.java | 0 .../varianteval/evaluators/CompOverlap.java | 0 .../varianteval/evaluators/CountVariants.java | 0 .../evaluators/GenotypeConcordance.java | 0 .../evaluators/IndelLengthHistogram.java | 0 .../varianteval/evaluators/IndelSummary.java | 0 .../MendelianViolationEvaluator.java | 0 .../evaluators/MultiallelicSummary.java | 0 .../evaluators/PrintMissingComp.java | 0 .../varianteval/evaluators/StandardEval.java | 0 .../evaluators/ThetaVariantEvaluator.java | 0 .../evaluators/TiTvVariantEvaluator.java | 0 .../evaluators/ValidationReport.java | 0 .../evaluators/VariantEvaluator.java | 0 .../evaluators/VariantSummary.java | 0 .../GenotypePhasingEvaluator.java | 0 .../SamplePhasingStatistics.java | 0 .../stratifications/AlleleCount.java | 0 .../stratifications/AlleleFrequency.java | 0 .../varianteval/stratifications/CompRod.java | 0 .../varianteval/stratifications/Contig.java | 0 .../varianteval/stratifications/CpG.java | 0 .../stratifications/Degeneracy.java | 0 .../DynamicStratification.java | 0 .../varianteval/stratifications/EvalRod.java | 0 .../varianteval/stratifications/Filter.java | 0 .../stratifications/FunctionalClass.java | 0 .../stratifications/IndelSize.java | 0 .../IntervalStratification.java | 0 .../stratifications/JexlExpression.java | 0 .../varianteval/stratifications/Novelty.java | 0 .../stratifications/OneBPIndel.java | 0 .../RequiredStratification.java | 0 .../varianteval/stratifications/Sample.java | 0 .../StandardStratification.java | 0 .../stratifications/TandemRepeat.java | 0 .../stratifications/VariantStratifier.java | 0 .../stratifications/VariantType.java | 0 .../stratifications/manager/StratNode.java | 0 .../manager/StratNodeIterator.java | 0 .../manager/StratificationManager.java | 0 .../stratifications/manager/Stratifier.java | 0 .../walkers/varianteval/util/Analysis.java | 0 .../util/AnalysisModuleScanner.java | 0 .../walkers/varianteval/util/DataPoint.java | 0 .../varianteval/util/EvaluationContext.java | 0 .../gatk/walkers/varianteval/util/Molten.java | 0 .../util/SortableJexlVCMatchExp.java | 0 .../varianteval/util/VariantEvalUtils.java | 0 .../ApplyRecalibration.java | 0 .../GaussianMixtureModel.java | 0 .../MultivariateGaussian.java | 0 .../variantrecalibration/TrainingSet.java | 0 .../walkers/variantrecalibration/Tranche.java | 0 .../variantrecalibration/TrancheManager.java | 0 .../VQSRCalibrationCurve.java | 0 .../VariantDataManager.java | 0 .../variantrecalibration/VariantDatum.java | 0 .../VariantRecalibrator.java | 0 ...VariantRecalibratorArgumentCollection.java | 0 .../VariantRecalibratorEngine.java | 0 .../walkers/variantutils/CombineVariants.java | 0 .../variantutils/FilterLiftedVariants.java | 0 .../variantutils/LeftAlignVariants.java | 0 .../variantutils/LiftoverVariants.java | 0 .../variantutils/RandomlySplitVariants.java | 0 .../walkers/variantutils/SelectHeaders.java | 0 .../walkers/variantutils/SelectVariants.java | 0 .../variantutils/ValidateVariants.java | 0 .../VariantValidationAssessor.java | 0 .../variantutils/VariantsToBinaryPed.java | 0 .../walkers/variantutils/VariantsToTable.java | 0 .../walkers/variantutils/VariantsToVCF.java | 0 .../sting/gatk/GenomeAnalysisEngine.java | 13 +- .../sting/gatk/walkers/bqsr/BQSRGatherer.java | 86 --- .../gatk/walkers/bqsr/BaseRecalibrator.java | 534 ------------------ .../walkers/bqsr/ReadRecalibrationInfo.java | 163 ------ .../bqsr/RecalibrationArgumentCollection.java | 251 -------- .../walkers/bqsr/RecalibrationEngine.java | 216 ------- .../sting/gatk/walkers/{ => qc}/FlagStat.java | 6 +- .../sting/gatk/walkers/{ => qc}/Pileup.java | 5 +- .../gatk/walkers/{ => qc}/PrintRODs.java | 3 +- .../walkers/{ => readutils}/ClipReads.java | 5 +- .../walkers/{ => readutils}/PrintReads.java | 3 +- .../walkers/{ => readutils}/SplitSamFile.java | 6 +- .../utils/classloader/GATKLiteUtils.java | 100 ---- .../sting/utils/exceptions/UserException.java | 6 - .../gatk/GenomeAnalysisEngineUnitTest.java | 2 +- .../UnifiedGenotyperLiteIntegrationTest.java | 35 -- .../{ => qc}/FlagStatIntegrationTest.java | 2 +- .../{ => qc}/PileupWalkerIntegrationTest.java | 2 +- .../ClipReadsWalkersIntegrationTest.java | 2 +- .../PrintReadsIntegrationTest.java | 2 +- .../PrintReadsLargeScaleTest.java | 2 +- .../{ => readutils}/PrintReadsUnitTest.java | 6 +- 240 files changed, 32 insertions(+), 1473 deletions(-) delete mode 100644 protected/java/src/org/broadinstitute/sting/gatk/DummyProtectedClass.java rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalance.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalanceBySample.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AverageAltAlleleLength.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseCounts.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseQualityRankSumTest.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ClippingRankSumTest.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HomopolymerRun.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/InbreedingCoeff.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/LowMQ.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MVLikelihoodRatio.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityRankSumTest.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroBySample.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroFraction.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/NBaseCount.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RankSumTest.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ReadPosRankSumTest.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SampleList.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SnpEff.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SpanningDeletions.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TandemRepeatAnnotator.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TransmissionDisequilibriumTest.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantType.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/ActiveRegionBasedAnnotation.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotationInterfaceManager.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotationType.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotatorCompatible.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/ExperimentalAnnotation.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/GenotypeAnnotation.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/InfoFieldAnnotation.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/RodRequiringAnnotation.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/StandardAnnotation.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/VariantAnnotatorAnnotation.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/WorkInProgressAnnotation.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/beagle/BeagleOutputToVCF.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/beagle/ProduceBeagleInput.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/beagle/VariantsToBeagleUnphased.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/compression/reducereads/SimpleGenomeLoc.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CallableLoci.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CompareCallableLoci.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverage.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageStats.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DoCOutputType.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/coverage/GCContentByInterval.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycle.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadGroupProperties.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadLengthDistribution.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/CallableStatus.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/DiagnoseTargets.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/FindCoveredIntervals.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/IntervalStatistics.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/LocusStatistics.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/SampleStatistics.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/ThresHolder.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/BAMDiffableReader.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffElement.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngine.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNode.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjects.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffValue.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReader.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/Difference.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/GATKReportDiffableReader.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/VCFDiffableReader.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaAlternateReferenceMaker.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaReferenceMaker.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaSequence.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaStats.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/filters/ClusteredSnps.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/filters/FiltrationContext.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/filters/FiltrationContextWindow.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltration.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/BaseMismatchModel.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ConsensusAlleleCounter.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotype.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypePriors.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java (94%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/VariantCallContext.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalc.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalcFactory.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalcResult.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/DiploidExactAFCalc.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactACcounts.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactACset.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactAFCalc.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactCallLogger.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/IndependentAllelesDiploidExactAFCalc.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/OriginalDiploidExactAFCalc.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ReferenceDiploidExactAFCalc.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/StateTracker.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/indels/ConstrainedMateFixingManager.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/indels/HaplotypeIndelErrorModel.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/indels/LeftAlignIndels.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreator.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/AllelePair.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/BaseArray.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/CardinalityCounter.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/CloneableIteratorLinkedList.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/DisjointSet.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/Haplotype.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/MergeSegregatingAlternateAllelesVCFWriter.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmission.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingGraph.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingGraphEdge.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingRead.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingUtils.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PreciseNonNegativeDouble.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasing.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBase.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBasesAtPosition.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/phasing/SNPallelePair.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/validation/GenotypeAndValidate.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmplicons.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/FrequencyModeSelector.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GLBasedSampleSelector.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GTBasedSampleSelector.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GenomeEvent.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/KeepAFSpectrumFrequencySelector.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/NullSampleSelector.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/SampleSelector.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/UniformSamplingFrequencySelector.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/ValidationSiteSelector.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEval.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalReportWriter.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CompOverlap.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CountVariants.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/GenotypeConcordance.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/IndelLengthHistogram.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/IndelSummary.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/MendelianViolationEvaluator.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/MultiallelicSummary.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/PrintMissingComp.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/StandardEval.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/ThetaVariantEvaluator.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/TiTvVariantEvaluator.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/ValidationReport.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/VariantEvaluator.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/VariantSummary.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/genotypePhasingEvaluator/GenotypePhasingEvaluator.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/genotypePhasingEvaluator/SamplePhasingStatistics.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/AlleleCount.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/AlleleFrequency.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/CompRod.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Contig.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/CpG.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Degeneracy.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/DynamicStratification.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/EvalRod.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Filter.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/FunctionalClass.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/IndelSize.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/IntervalStratification.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/JexlExpression.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Novelty.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/OneBPIndel.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/RequiredStratification.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Sample.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/StandardStratification.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/TandemRepeat.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/VariantStratifier.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/VariantType.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratNode.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratNodeIterator.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratificationManager.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/Stratifier.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/Analysis.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/AnalysisModuleScanner.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/DataPoint.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/EvaluationContext.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/Molten.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/SortableJexlVCMatchExp.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/VariantEvalUtils.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/ApplyRecalibration.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/GaussianMixtureModel.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/MultivariateGaussian.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/TrainingSet.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/Tranche.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/TrancheManager.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VQSRCalibrationCurve.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDataManager.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDatum.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrator.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibratorArgumentCollection.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibratorEngine.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariants.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/FilterLiftedVariants.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariants.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariants.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/RandomlySplitVariants.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectHeaders.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantValidationAssessor.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToBinaryPed.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java (100%) delete mode 100755 public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGatherer.java delete mode 100755 public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BaseRecalibrator.java delete mode 100644 public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfo.java delete mode 100755 public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationArgumentCollection.java delete mode 100644 public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationEngine.java rename public/java/src/org/broadinstitute/sting/gatk/walkers/{ => qc}/FlagStat.java (96%) rename public/java/src/org/broadinstitute/sting/gatk/walkers/{ => qc}/Pileup.java (96%) rename public/java/src/org/broadinstitute/sting/gatk/walkers/{ => qc}/PrintRODs.java (96%) rename public/java/src/org/broadinstitute/sting/gatk/walkers/{ => readutils}/ClipReads.java (99%) rename public/java/src/org/broadinstitute/sting/gatk/walkers/{ => readutils}/PrintReads.java (98%) rename public/java/src/org/broadinstitute/sting/gatk/walkers/{ => readutils}/SplitSamFile.java (95%) delete mode 100755 public/java/src/org/broadinstitute/sting/utils/classloader/GATKLiteUtils.java delete mode 100755 public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperLiteIntegrationTest.java rename public/java/test/org/broadinstitute/sting/gatk/walkers/{ => qc}/FlagStatIntegrationTest.java (92%) rename public/java/test/org/broadinstitute/sting/gatk/walkers/{ => qc}/PileupWalkerIntegrationTest.java (98%) rename public/java/test/org/broadinstitute/sting/gatk/walkers/{ => readutils}/ClipReadsWalkersIntegrationTest.java (98%) rename public/java/test/org/broadinstitute/sting/gatk/walkers/{ => readutils}/PrintReadsIntegrationTest.java (97%) rename public/java/test/org/broadinstitute/sting/gatk/walkers/{ => readutils}/PrintReadsLargeScaleTest.java (92%) rename public/java/test/org/broadinstitute/sting/gatk/walkers/{ => readutils}/PrintReadsUnitTest.java (94%) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/DummyProtectedClass.java b/protected/java/src/org/broadinstitute/sting/gatk/DummyProtectedClass.java deleted file mode 100644 index c1324aea4..000000000 --- a/protected/java/src/org/broadinstitute/sting/gatk/DummyProtectedClass.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.broadinstitute.sting.gatk; - -/* - * Copyright (c) 2009 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -import org.broadinstitute.sting.utils.classloader.ProtectedPackageSource; - -public class DummyProtectedClass implements ProtectedPackageSource { - - // THIS CLASS IS USED JUST SO THAT WE CAN TEST WHETHER WE ARE USING THE LITE OR FULL VERSION OF THE GATK - // **** DO NOT REMOVE! **** -} diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalance.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalance.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalance.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalance.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalanceBySample.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalanceBySample.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalanceBySample.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalanceBySample.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AverageAltAlleleLength.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AverageAltAlleleLength.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AverageAltAlleleLength.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AverageAltAlleleLength.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseCounts.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseCounts.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseCounts.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseCounts.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseQualityRankSumTest.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseQualityRankSumTest.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseQualityRankSumTest.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseQualityRankSumTest.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ClippingRankSumTest.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ClippingRankSumTest.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ClippingRankSumTest.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ClippingRankSumTest.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HomopolymerRun.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HomopolymerRun.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HomopolymerRun.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HomopolymerRun.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/InbreedingCoeff.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/InbreedingCoeff.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/InbreedingCoeff.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/InbreedingCoeff.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/LowMQ.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/LowMQ.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/LowMQ.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/LowMQ.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MVLikelihoodRatio.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MVLikelihoodRatio.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MVLikelihoodRatio.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MVLikelihoodRatio.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityRankSumTest.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityRankSumTest.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityRankSumTest.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityRankSumTest.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroBySample.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroBySample.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroBySample.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroBySample.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroFraction.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroFraction.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroFraction.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroFraction.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/NBaseCount.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/NBaseCount.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/NBaseCount.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/NBaseCount.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RankSumTest.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RankSumTest.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RankSumTest.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RankSumTest.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ReadPosRankSumTest.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ReadPosRankSumTest.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ReadPosRankSumTest.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ReadPosRankSumTest.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SampleList.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SampleList.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SampleList.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SampleList.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SnpEff.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SnpEff.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SnpEff.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SnpEff.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SpanningDeletions.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SpanningDeletions.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SpanningDeletions.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SpanningDeletions.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TandemRepeatAnnotator.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TandemRepeatAnnotator.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TandemRepeatAnnotator.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TandemRepeatAnnotator.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TransmissionDisequilibriumTest.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TransmissionDisequilibriumTest.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TransmissionDisequilibriumTest.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TransmissionDisequilibriumTest.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantType.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantType.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantType.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantType.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/ActiveRegionBasedAnnotation.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/ActiveRegionBasedAnnotation.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/ActiveRegionBasedAnnotation.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/ActiveRegionBasedAnnotation.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotationInterfaceManager.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotationInterfaceManager.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotationInterfaceManager.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotationInterfaceManager.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotationType.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotationType.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotationType.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotationType.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotatorCompatible.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotatorCompatible.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotatorCompatible.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotatorCompatible.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/ExperimentalAnnotation.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/ExperimentalAnnotation.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/ExperimentalAnnotation.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/ExperimentalAnnotation.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/GenotypeAnnotation.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/GenotypeAnnotation.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/GenotypeAnnotation.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/GenotypeAnnotation.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/InfoFieldAnnotation.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/InfoFieldAnnotation.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/InfoFieldAnnotation.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/InfoFieldAnnotation.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/RodRequiringAnnotation.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/RodRequiringAnnotation.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/RodRequiringAnnotation.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/RodRequiringAnnotation.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/StandardAnnotation.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/StandardAnnotation.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/StandardAnnotation.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/StandardAnnotation.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/VariantAnnotatorAnnotation.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/VariantAnnotatorAnnotation.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/VariantAnnotatorAnnotation.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/VariantAnnotatorAnnotation.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/WorkInProgressAnnotation.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/WorkInProgressAnnotation.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/WorkInProgressAnnotation.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/WorkInProgressAnnotation.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/beagle/BeagleOutputToVCF.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/beagle/BeagleOutputToVCF.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/beagle/BeagleOutputToVCF.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/beagle/BeagleOutputToVCF.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/beagle/ProduceBeagleInput.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/beagle/ProduceBeagleInput.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/beagle/ProduceBeagleInput.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/beagle/ProduceBeagleInput.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/beagle/VariantsToBeagleUnphased.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/beagle/VariantsToBeagleUnphased.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/beagle/VariantsToBeagleUnphased.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/beagle/VariantsToBeagleUnphased.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/compression/reducereads/SimpleGenomeLoc.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/compression/reducereads/SimpleGenomeLoc.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/compression/reducereads/SimpleGenomeLoc.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/compression/reducereads/SimpleGenomeLoc.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CallableLoci.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CallableLoci.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CallableLoci.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CallableLoci.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CompareCallableLoci.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CompareCallableLoci.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CompareCallableLoci.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CompareCallableLoci.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverage.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverage.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverage.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverage.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageStats.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageStats.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageStats.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageStats.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DoCOutputType.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DoCOutputType.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DoCOutputType.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DoCOutputType.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/GCContentByInterval.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/GCContentByInterval.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/GCContentByInterval.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/GCContentByInterval.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycle.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycle.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycle.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycle.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadGroupProperties.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadGroupProperties.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadGroupProperties.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadGroupProperties.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadLengthDistribution.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadLengthDistribution.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadLengthDistribution.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadLengthDistribution.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/CallableStatus.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/CallableStatus.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/CallableStatus.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/CallableStatus.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/DiagnoseTargets.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/DiagnoseTargets.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/DiagnoseTargets.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/DiagnoseTargets.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/FindCoveredIntervals.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/FindCoveredIntervals.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/FindCoveredIntervals.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/FindCoveredIntervals.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/IntervalStatistics.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/IntervalStatistics.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/IntervalStatistics.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/IntervalStatistics.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/LocusStatistics.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/LocusStatistics.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/LocusStatistics.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/LocusStatistics.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/SampleStatistics.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/SampleStatistics.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/SampleStatistics.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/SampleStatistics.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/ThresHolder.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/ThresHolder.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/ThresHolder.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/ThresHolder.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/BAMDiffableReader.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/BAMDiffableReader.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/BAMDiffableReader.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/BAMDiffableReader.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffElement.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffElement.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffElement.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffElement.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngine.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngine.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngine.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNode.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNode.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNode.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNode.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjects.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjects.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjects.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjects.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffValue.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffValue.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffValue.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffValue.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReader.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReader.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReader.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReader.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/Difference.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/Difference.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/Difference.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/Difference.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/GATKReportDiffableReader.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/GATKReportDiffableReader.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/GATKReportDiffableReader.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/GATKReportDiffableReader.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/VCFDiffableReader.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/VCFDiffableReader.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/VCFDiffableReader.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/VCFDiffableReader.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaAlternateReferenceMaker.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaAlternateReferenceMaker.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaAlternateReferenceMaker.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaAlternateReferenceMaker.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaReferenceMaker.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaReferenceMaker.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaReferenceMaker.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaReferenceMaker.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaSequence.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaSequence.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaSequence.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaSequence.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaStats.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaStats.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaStats.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/fasta/FastaStats.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/filters/ClusteredSnps.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/filters/ClusteredSnps.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/filters/ClusteredSnps.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/filters/ClusteredSnps.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/filters/FiltrationContext.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/filters/FiltrationContext.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/filters/FiltrationContext.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/filters/FiltrationContext.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/filters/FiltrationContextWindow.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/filters/FiltrationContextWindow.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/filters/FiltrationContextWindow.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/filters/FiltrationContextWindow.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltration.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltration.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltration.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltration.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/BaseMismatchModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/BaseMismatchModel.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/BaseMismatchModel.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/BaseMismatchModel.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ConsensusAlleleCounter.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ConsensusAlleleCounter.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ConsensusAlleleCounter.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ConsensusAlleleCounter.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotype.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotype.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotype.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotype.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypePriors.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypePriors.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypePriors.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypePriors.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java similarity index 94% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java index b5386ff6b..3dc0c3b71 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java @@ -28,7 +28,6 @@ package org.broadinstitute.sting.gatk.walkers.genotyper; import org.broadinstitute.sting.commandline.*; import org.broadinstitute.sting.gatk.CommandLineGATK; import org.broadinstitute.sting.gatk.arguments.DbsnpArgumentCollection; -import org.broadinstitute.sting.gatk.arguments.StandardCallerArgumentCollection; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.downsampling.DownsampleType; @@ -41,7 +40,6 @@ import org.broadinstitute.sting.gatk.walkers.annotator.VariantAnnotatorEngine; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatible; import org.broadinstitute.sting.utils.SampleUtils; import org.broadinstitute.sting.utils.baq.BAQ; -import org.broadinstitute.sting.utils.classloader.GATKLiteUtils; import org.broadinstitute.sting.utils.variant.GATKVariantContextUtils; import org.broadinstitute.variant.vcf.*; import org.broadinstitute.sting.utils.exceptions.UserException; @@ -230,25 +228,6 @@ public class UnifiedGenotyper extends LocusWalker, Unif **/ public void initialize() { - // Check for protected modes - if (GATKLiteUtils.isGATKLite()) { - // no polyploid/pooled mode in GATK Like - if (UAC.samplePloidy != GATKVariantContextUtils.DEFAULT_PLOIDY || - UAC.referenceSampleName != null || - UAC.referenceSampleRod.isBound()) { - throw new UserException.NotSupportedInGATKLite("you cannot enable usage of ploidy values other than 2"); - } - - if ( UAC.CONTAMINATION_FRACTION > 0.0 ) { - if ( UAC.CONTAMINATION_FRACTION == StandardCallerArgumentCollection.DEFAULT_CONTAMINATION_FRACTION ) { - UAC.CONTAMINATION_FRACTION = 0.0; - logger.warn("setting contamination down-sampling fraction to 0.0 because it is not enabled in GATK-lite"); - } else { - throw new UserException.NotSupportedInGATKLite("you cannot enable usage of contamination down-sampling"); - } - } - } - if ( UAC.TREAT_ALL_READS_AS_SINGLE_POOL ) { samples.add(GenotypeLikelihoodsCalculationModel.DUMMY_SAMPLE_NAME); } else { diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/VariantCallContext.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/VariantCallContext.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/VariantCallContext.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/VariantCallContext.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalc.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalc.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalc.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalc.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalcFactory.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalcFactory.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalcFactory.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalcFactory.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalcResult.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalcResult.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalcResult.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/AFCalcResult.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/DiploidExactAFCalc.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/DiploidExactAFCalc.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/DiploidExactAFCalc.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/DiploidExactAFCalc.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactACcounts.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactACcounts.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactACcounts.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactACcounts.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactACset.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactACset.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactACset.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactACset.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactAFCalc.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactAFCalc.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactAFCalc.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactAFCalc.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactCallLogger.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactCallLogger.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactCallLogger.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ExactCallLogger.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/IndependentAllelesDiploidExactAFCalc.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/IndependentAllelesDiploidExactAFCalc.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/IndependentAllelesDiploidExactAFCalc.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/IndependentAllelesDiploidExactAFCalc.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/OriginalDiploidExactAFCalc.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/OriginalDiploidExactAFCalc.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/OriginalDiploidExactAFCalc.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/OriginalDiploidExactAFCalc.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ReferenceDiploidExactAFCalc.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ReferenceDiploidExactAFCalc.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ReferenceDiploidExactAFCalc.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/ReferenceDiploidExactAFCalc.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/StateTracker.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/StateTracker.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/StateTracker.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/afcalc/StateTracker.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/ConstrainedMateFixingManager.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/ConstrainedMateFixingManager.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/indels/ConstrainedMateFixingManager.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/ConstrainedMateFixingManager.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/HaplotypeIndelErrorModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/HaplotypeIndelErrorModel.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/indels/HaplotypeIndelErrorModel.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/HaplotypeIndelErrorModel.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/LeftAlignIndels.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/LeftAlignIndels.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/indels/LeftAlignIndels.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/LeftAlignIndels.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreator.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreator.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreator.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreator.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/AllelePair.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/AllelePair.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/AllelePair.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/AllelePair.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/BaseArray.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/BaseArray.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/BaseArray.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/BaseArray.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/CardinalityCounter.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/CardinalityCounter.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/CardinalityCounter.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/CardinalityCounter.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/CloneableIteratorLinkedList.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/CloneableIteratorLinkedList.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/CloneableIteratorLinkedList.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/CloneableIteratorLinkedList.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/DisjointSet.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/DisjointSet.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/DisjointSet.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/DisjointSet.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/Haplotype.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/Haplotype.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/Haplotype.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/Haplotype.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/MergeSegregatingAlternateAllelesVCFWriter.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/MergeSegregatingAlternateAllelesVCFWriter.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/MergeSegregatingAlternateAllelesVCFWriter.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/MergeSegregatingAlternateAllelesVCFWriter.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmission.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmission.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmission.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmission.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingGraph.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingGraph.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingGraph.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingGraph.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingGraphEdge.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingGraphEdge.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingGraphEdge.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingGraphEdge.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingRead.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingRead.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingRead.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingRead.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingUtils.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingUtils.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingUtils.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhasingUtils.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PreciseNonNegativeDouble.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PreciseNonNegativeDouble.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PreciseNonNegativeDouble.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PreciseNonNegativeDouble.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasing.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasing.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasing.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasing.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBase.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBase.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBase.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBase.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBasesAtPosition.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBasesAtPosition.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBasesAtPosition.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/ReadBasesAtPosition.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/SNPallelePair.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/SNPallelePair.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/phasing/SNPallelePair.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/SNPallelePair.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/validation/GenotypeAndValidate.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/GenotypeAndValidate.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/validation/GenotypeAndValidate.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/GenotypeAndValidate.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmplicons.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmplicons.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmplicons.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmplicons.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/FrequencyModeSelector.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/FrequencyModeSelector.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/FrequencyModeSelector.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/FrequencyModeSelector.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GLBasedSampleSelector.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GLBasedSampleSelector.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GLBasedSampleSelector.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GLBasedSampleSelector.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GTBasedSampleSelector.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GTBasedSampleSelector.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GTBasedSampleSelector.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GTBasedSampleSelector.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GenomeEvent.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GenomeEvent.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GenomeEvent.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/GenomeEvent.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/KeepAFSpectrumFrequencySelector.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/KeepAFSpectrumFrequencySelector.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/KeepAFSpectrumFrequencySelector.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/KeepAFSpectrumFrequencySelector.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/NullSampleSelector.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/NullSampleSelector.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/NullSampleSelector.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/NullSampleSelector.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/SampleSelector.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/SampleSelector.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/SampleSelector.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/SampleSelector.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/UniformSamplingFrequencySelector.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/UniformSamplingFrequencySelector.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/UniformSamplingFrequencySelector.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/UniformSamplingFrequencySelector.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/ValidationSiteSelector.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/ValidationSiteSelector.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/ValidationSiteSelector.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/validation/validationsiteselector/ValidationSiteSelector.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEval.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEval.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEval.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEval.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalReportWriter.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalReportWriter.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalReportWriter.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalReportWriter.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CompOverlap.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CompOverlap.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CompOverlap.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CompOverlap.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CountVariants.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CountVariants.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CountVariants.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CountVariants.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/GenotypeConcordance.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/GenotypeConcordance.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/GenotypeConcordance.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/GenotypeConcordance.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/IndelLengthHistogram.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/IndelLengthHistogram.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/IndelLengthHistogram.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/IndelLengthHistogram.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/IndelSummary.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/IndelSummary.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/IndelSummary.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/IndelSummary.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/MendelianViolationEvaluator.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/MendelianViolationEvaluator.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/MendelianViolationEvaluator.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/MendelianViolationEvaluator.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/MultiallelicSummary.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/MultiallelicSummary.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/MultiallelicSummary.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/MultiallelicSummary.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/PrintMissingComp.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/PrintMissingComp.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/PrintMissingComp.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/PrintMissingComp.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/StandardEval.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/StandardEval.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/StandardEval.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/StandardEval.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/ThetaVariantEvaluator.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/ThetaVariantEvaluator.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/ThetaVariantEvaluator.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/ThetaVariantEvaluator.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/TiTvVariantEvaluator.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/TiTvVariantEvaluator.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/TiTvVariantEvaluator.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/TiTvVariantEvaluator.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/ValidationReport.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/ValidationReport.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/ValidationReport.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/ValidationReport.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/VariantEvaluator.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/VariantEvaluator.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/VariantEvaluator.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/VariantEvaluator.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/VariantSummary.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/VariantSummary.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/VariantSummary.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/VariantSummary.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/genotypePhasingEvaluator/GenotypePhasingEvaluator.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/genotypePhasingEvaluator/GenotypePhasingEvaluator.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/genotypePhasingEvaluator/GenotypePhasingEvaluator.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/genotypePhasingEvaluator/GenotypePhasingEvaluator.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/genotypePhasingEvaluator/SamplePhasingStatistics.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/genotypePhasingEvaluator/SamplePhasingStatistics.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/genotypePhasingEvaluator/SamplePhasingStatistics.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/genotypePhasingEvaluator/SamplePhasingStatistics.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/AlleleCount.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/AlleleCount.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/AlleleCount.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/AlleleCount.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/AlleleFrequency.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/AlleleFrequency.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/AlleleFrequency.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/AlleleFrequency.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/CompRod.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/CompRod.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/CompRod.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/CompRod.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Contig.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Contig.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Contig.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Contig.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/CpG.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/CpG.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/CpG.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/CpG.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Degeneracy.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Degeneracy.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Degeneracy.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Degeneracy.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/DynamicStratification.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/DynamicStratification.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/DynamicStratification.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/DynamicStratification.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/EvalRod.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/EvalRod.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/EvalRod.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/EvalRod.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Filter.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Filter.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Filter.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Filter.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/FunctionalClass.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/FunctionalClass.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/FunctionalClass.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/FunctionalClass.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/IndelSize.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/IndelSize.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/IndelSize.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/IndelSize.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/IntervalStratification.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/IntervalStratification.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/IntervalStratification.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/IntervalStratification.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/JexlExpression.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/JexlExpression.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/JexlExpression.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/JexlExpression.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Novelty.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Novelty.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Novelty.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Novelty.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/OneBPIndel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/OneBPIndel.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/OneBPIndel.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/OneBPIndel.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/RequiredStratification.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/RequiredStratification.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/RequiredStratification.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/RequiredStratification.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Sample.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Sample.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Sample.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/Sample.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/StandardStratification.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/StandardStratification.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/StandardStratification.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/StandardStratification.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/TandemRepeat.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/TandemRepeat.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/TandemRepeat.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/TandemRepeat.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/VariantStratifier.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/VariantStratifier.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/VariantStratifier.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/VariantStratifier.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/VariantType.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/VariantType.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/VariantType.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/VariantType.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratNode.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratNode.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratNode.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratNode.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratNodeIterator.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratNodeIterator.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratNodeIterator.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratNodeIterator.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratificationManager.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratificationManager.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratificationManager.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratificationManager.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/Stratifier.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/Stratifier.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/Stratifier.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/Stratifier.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/Analysis.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/Analysis.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/Analysis.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/Analysis.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/AnalysisModuleScanner.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/AnalysisModuleScanner.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/AnalysisModuleScanner.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/AnalysisModuleScanner.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/DataPoint.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/DataPoint.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/DataPoint.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/DataPoint.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/EvaluationContext.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/EvaluationContext.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/EvaluationContext.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/EvaluationContext.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/Molten.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/Molten.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/Molten.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/Molten.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/SortableJexlVCMatchExp.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/SortableJexlVCMatchExp.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/SortableJexlVCMatchExp.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/SortableJexlVCMatchExp.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/VariantEvalUtils.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/VariantEvalUtils.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/VariantEvalUtils.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/util/VariantEvalUtils.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/ApplyRecalibration.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/ApplyRecalibration.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/ApplyRecalibration.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/ApplyRecalibration.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/GaussianMixtureModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/GaussianMixtureModel.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/GaussianMixtureModel.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/GaussianMixtureModel.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/MultivariateGaussian.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/MultivariateGaussian.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/MultivariateGaussian.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/MultivariateGaussian.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/TrainingSet.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/TrainingSet.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/TrainingSet.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/TrainingSet.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/Tranche.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/Tranche.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/Tranche.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/Tranche.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/TrancheManager.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/TrancheManager.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/TrancheManager.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/TrancheManager.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VQSRCalibrationCurve.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VQSRCalibrationCurve.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VQSRCalibrationCurve.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VQSRCalibrationCurve.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDataManager.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDataManager.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDataManager.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDataManager.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDatum.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDatum.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDatum.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDatum.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrator.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrator.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrator.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrator.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibratorArgumentCollection.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibratorArgumentCollection.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibratorArgumentCollection.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibratorArgumentCollection.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibratorEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibratorEngine.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibratorEngine.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibratorEngine.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariants.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariants.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariants.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariants.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/FilterLiftedVariants.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/FilterLiftedVariants.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/FilterLiftedVariants.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/FilterLiftedVariants.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariants.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariants.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariants.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariants.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariants.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariants.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariants.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariants.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/RandomlySplitVariants.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/RandomlySplitVariants.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/RandomlySplitVariants.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/RandomlySplitVariants.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectHeaders.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectHeaders.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectHeaders.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectHeaders.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantValidationAssessor.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantValidationAssessor.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantValidationAssessor.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantValidationAssessor.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToBinaryPed.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToBinaryPed.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToBinaryPed.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToBinaryPed.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java rename to protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java diff --git a/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java b/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java index 1187039bb..54907f9f2 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java +++ b/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java @@ -53,7 +53,6 @@ import org.broadinstitute.sting.gatk.samples.SampleDB; import org.broadinstitute.sting.gatk.samples.SampleDBBuilder; import org.broadinstitute.sting.gatk.walkers.*; import org.broadinstitute.sting.utils.*; -import org.broadinstitute.sting.utils.classloader.GATKLiteUtils; import org.broadinstitute.sting.utils.classloader.PluginManager; import org.broadinstitute.sting.utils.collections.Pair; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; @@ -217,13 +216,6 @@ public class GenomeAnalysisEngine { baseRecalibration = new BaseRecalibration(recalFile, quantizationLevels, disableIndelQuals, preserveQLessThan, emitOriginalQuals); } - /** - * Utility method to determine whether this is the lite version of the GATK - */ - public boolean isGATKLite() { - return GATKLiteUtils.isGATKLite(); - } - /** * Actually run the GATK with the specified walker. * @@ -330,10 +322,7 @@ public class GenomeAnalysisEngine { try { return walkerManager.createByName(walkerName); } catch ( UserException e ) { - if ( isGATKLite() && GATKLiteUtils.isAvailableOnlyInFullGATK(walkerName) ) { - e = new UserException.NotSupportedInGATKLite("the " + walkerName + " walker is available only in the full version of the GATK"); - } - else if ( isDeprecatedWalker(walkerName) ) { + if ( isDeprecatedWalker(walkerName) ) { e = new UserException.DeprecatedWalker(walkerName, getDeprecatedMajorVersionNumber(walkerName)); } throw e; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGatherer.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGatherer.java deleted file mode 100755 index dbb628135..000000000 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGatherer.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2011 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.broadinstitute.sting.gatk.walkers.bqsr; - -import org.broadinstitute.sting.commandline.Gatherer; -import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; -import org.broadinstitute.sting.utils.exceptions.UserException; -import org.broadinstitute.sting.utils.recalibration.RecalUtils; -import org.broadinstitute.sting.utils.recalibration.RecalibrationReport; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.PrintStream; -import java.util.List; - -/** - * User: carneiro - * Date: 3/29/11 - */ - - -public class BQSRGatherer extends Gatherer { - - private static final String EMPTY_INPUT_LIST = "list of inputs files is empty"; - private static final String MISSING_OUTPUT_FILE = "missing output file name"; - - @Override - public void gather(List inputs, File output) { - final PrintStream outputFile; - try { - outputFile = new PrintStream(output); - } catch(FileNotFoundException e) { - throw new UserException.MissingArgument("output", MISSING_OUTPUT_FILE); - } - - RecalibrationReport generalReport = null; - for (File input : inputs) { - final RecalibrationReport inputReport = new RecalibrationReport(input); - if (generalReport == null) - generalReport = inputReport; - else - generalReport.combine(inputReport); - } - if (generalReport == null) - throw new ReviewedStingException(EMPTY_INPUT_LIST); - - generalReport.calculateQuantizedQualities(); - - RecalibrationArgumentCollection RAC = generalReport.getRAC(); - if ( RAC.RECAL_PDF_FILE != null ) { - RAC.RECAL_TABLE_FILE = output; - if ( RAC.existingRecalibrationReport != null ) { - final RecalibrationReport originalReport = new RecalibrationReport(RAC.existingRecalibrationReport); - RecalUtils.generateRecalibrationPlot(RAC, originalReport.getRecalibrationTables(), generalReport.getRecalibrationTables(), generalReport.getCovariates()); - } - else { - RecalUtils.generateRecalibrationPlot(RAC, generalReport.getRecalibrationTables(), generalReport.getCovariates()); - } - } - - generalReport.output(outputFile); - } -} diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BaseRecalibrator.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BaseRecalibrator.java deleted file mode 100755 index 2c774d94d..000000000 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BaseRecalibrator.java +++ /dev/null @@ -1,534 +0,0 @@ -/* - * Copyright (c) 2010 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.broadinstitute.sting.gatk.walkers.bqsr; - -import net.sf.picard.reference.IndexedFastaSequenceFile; -import net.sf.samtools.CigarElement; -import net.sf.samtools.SAMFileHeader; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.Advanced; -import org.broadinstitute.sting.commandline.Argument; -import org.broadinstitute.sting.commandline.ArgumentCollection; -import org.broadinstitute.sting.gatk.CommandLineGATK; -import org.broadinstitute.sting.gatk.contexts.ReferenceContext; -import org.broadinstitute.sting.gatk.filters.*; -import org.broadinstitute.sting.gatk.iterators.ReadTransformer; -import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; -import org.broadinstitute.sting.gatk.walkers.*; -import org.broadinstitute.sting.utils.MathUtils; -import org.broadinstitute.variant.utils.BaseUtils; -import org.broadinstitute.sting.utils.baq.BAQ; -import org.broadinstitute.sting.utils.classloader.GATKLiteUtils; -import org.broadinstitute.sting.utils.clipping.ReadClipper; -import org.broadinstitute.sting.utils.collections.Pair; -import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; -import org.broadinstitute.sting.utils.exceptions.UserException; -import org.broadinstitute.sting.utils.help.DocumentedGATKFeature; -import org.broadinstitute.sting.utils.recalibration.*; -import org.broadinstitute.sting.utils.recalibration.covariates.Covariate; -import org.broadinstitute.sting.utils.sam.GATKSAMRecord; -import org.broadinstitute.sting.utils.sam.ReadUtils; - -import java.io.File; -import java.io.IOException; -import java.io.PrintStream; -import java.lang.reflect.Constructor; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * First pass of the base quality score recalibration -- Generates recalibration table based on various user-specified covariates (such as read group, reported quality score, machine cycle, and nucleotide context). - * - *

- * This walker is designed to work as the first pass in a two-pass processing step. It does a by-locus traversal operating - * only at sites that are not in dbSNP. We assume that all reference mismatches we see are therefore errors and indicative - * of poor base quality. This walker generates tables based on various user-specified covariates (such as read group, - * reported quality score, cycle, and context). Since there is a large amount of data one can then calculate an empirical - * probability of error given the particular covariates seen at this site, where p(error) = num mismatches / num observations. - * The output file is a table (of the several covariate values, num observations, num mismatches, empirical quality score). - *

- * Note: ReadGroupCovariate and QualityScoreCovariate are required covariates and will be added for the user regardless of whether or not they were specified. - * - *

- * - *

Input

- *

- * The input read data whose base quality scores need to be assessed. - *

- * A database of known polymorphic sites to skip over. - *

- * - *

Output

- *

- * A GATK Report file with many tables: - *

    - *
  1. The list of arguments
  2. - *
  3. The quantized qualities table
  4. - *
  5. The recalibration table by read group
  6. - *
  7. The recalibration table by quality score
  8. - *
  9. The recalibration table for all the optional covariates
  10. - *
- * - * The GATK Report is intended to be easy to read by humans or computers. Check out the documentation of the GATKReport to learn how to manipulate this table. - *

- * - *

Examples

- *
- * java -Xmx4g -jar GenomeAnalysisTK.jar \
- *   -T BaseRecalibrator \
- *   -I my_reads.bam \
- *   -R resources/Homo_sapiens_assembly18.fasta \
- *   -knownSites bundle/hg18/dbsnp_132.hg18.vcf \
- *   -knownSites another/optional/setOfSitesToMask.vcf \
- *   -o recal_data.grp
- * 
- */ - -@DocumentedGATKFeature(groupName = "BAM Processing and Analysis Tools", extraDocs = {CommandLineGATK.class}) -@BAQMode(ApplicationTime = ReadTransformer.ApplicationTime.FORBIDDEN) -@ReadFilters({MappingQualityZeroFilter.class, MappingQualityUnavailableFilter.class, UnmappedReadFilter.class, NotPrimaryAlignmentFilter.class, DuplicateReadFilter.class, FailsVendorQualityCheckFilter.class}) -@PartitionBy(PartitionType.READ) -public class BaseRecalibrator extends ReadWalker implements NanoSchedulable { - /** - * all the command line arguments for BQSR and it's covariates - */ - @ArgumentCollection - private final RecalibrationArgumentCollection RAC = new RecalibrationArgumentCollection(); - - /** - * When you have nct > 1, BQSR uses nct times more memory to compute its recalibration tables, for efficiency - * purposes. If you have many covariates, and therefore are using a lot of memory, you can use this flag - * to safely access only one table. There may be some CPU cost, but as long as the table is really big - * there should be relatively little CPU costs. - */ - @Argument(fullName = "lowMemoryMode", shortName="lowMemoryMode", doc="Reduce memory usage in multi-threaded code at the expense of threading efficiency", required = false) - public boolean lowMemoryMode = false; - - @Advanced - @Argument(fullName = "bqsrBAQGapOpenPenalty", shortName="bqsrBAQGOP", doc="BQSR BAQ gap open penalty (Phred Scaled). Default value is 40. 30 is perhaps better for whole genome call sets", required = false) - public double BAQGOP = BAQ.DEFAULT_GOP; - - /** - * an object that keeps track of the information necessary for quality score quantization - */ - private QuantizationInfo quantizationInfo; - - /** - * list to hold the all the covariate objects that were requested (required + standard + experimental) - */ - private Covariate[] requestedCovariates; - - private RecalibrationEngine recalibrationEngine; - - private int minimumQToUse; - - private static final String NO_DBSNP_EXCEPTION = "This calculation is critically dependent on being able to skip over known variant sites. Please provide a VCF file containing known sites of genetic variation."; - - private BAQ baq; // BAQ the reads on the fly to generate the alignment uncertainty vector - private IndexedFastaSequenceFile referenceReader; // fasta reference reader for use with BAQ calculation - private final static byte NO_BAQ_UNCERTAINTY = (byte)'@'; - - /** - * Parse the -cov arguments and create a list of covariates to be used here - * Based on the covariates' estimates for initial capacity allocate the data hashmap - */ - public void initialize() { - baq = new BAQ(BAQGOP); // setup the BAQ object with the provided gap open penalty - - // check for unsupported access - if (getToolkit().isGATKLite() && !getToolkit().getArguments().disableIndelQuals) - throw new UserException.NotSupportedInGATKLite("base insertion/deletion recalibration is not supported, please use the --disable_indel_quals argument"); - - if (RAC.FORCE_PLATFORM != null) - RAC.DEFAULT_PLATFORM = RAC.FORCE_PLATFORM; - - if (RAC.knownSites.isEmpty() && !RAC.RUN_WITHOUT_DBSNP) // Warn the user if no dbSNP file or other variant mask was specified - throw new UserException.CommandLineException(NO_DBSNP_EXCEPTION); - - if (RAC.LIST_ONLY) { - RecalUtils.listAvailableCovariates(logger); - System.exit(0); - } - RAC.existingRecalibrationReport = getToolkit().getArguments().BQSR_RECAL_FILE; // if we have a recalibration file, record it so it goes on the report table - - Pair, ArrayList> covariates = RecalUtils.initializeCovariates(RAC); // initialize the required and optional covariates - ArrayList requiredCovariates = covariates.getFirst(); - ArrayList optionalCovariates = covariates.getSecond(); - - requestedCovariates = new Covariate[requiredCovariates.size() + optionalCovariates.size()]; - int covariateIndex = 0; - for (final Covariate covariate : requiredCovariates) - requestedCovariates[covariateIndex++] = covariate; - for (final Covariate covariate : optionalCovariates) - requestedCovariates[covariateIndex++] = covariate; - - logger.info("The covariates being used here: "); - for (Covariate cov : requestedCovariates) { // list all the covariates being used - logger.info("\t" + cov.getClass().getSimpleName()); - cov.initialize(RAC); // initialize any covariate member variables using the shared argument collection - } - - try { - RAC.RECAL_TABLE = new PrintStream(RAC.RECAL_TABLE_FILE); - } catch (IOException e) { - throw new UserException.CouldNotCreateOutputFile(RAC.RECAL_TABLE_FILE, e); - } - - initializeRecalibrationEngine(); - minimumQToUse = getToolkit().getArguments().PRESERVE_QSCORES_LESS_THAN; - referenceReader = getToolkit().getReferenceDataSource().getReference(); - } - - /** - * Initialize the recalibration engine - */ - private void initializeRecalibrationEngine() { - int numReadGroups = 0; - for ( final SAMFileHeader header : getToolkit().getSAMFileHeaders() ) - numReadGroups += header.getReadGroups().size(); - - recalibrationEngine = new RecalibrationEngine(requestedCovariates, numReadGroups, RAC.RECAL_TABLE_UPDATE_LOG, lowMemoryMode); - } - - private boolean isLowQualityBase( final GATKSAMRecord read, final int offset ) { - return read.getBaseQualities()[offset] < minimumQToUse; - } - - /** - * For each read at this locus get the various covariate values and increment that location in the map based on - * whether or not the base matches the reference at this particular location - */ - public Long map( final ReferenceContext ref, final GATKSAMRecord originalRead, final RefMetaDataTracker metaDataTracker ) { - - final GATKSAMRecord read = ReadClipper.hardClipSoftClippedBases( ReadClipper.hardClipAdaptorSequence(originalRead) ); - if( read.isEmpty() ) { return 0L; } // the whole read was inside the adaptor so skip it - - RecalUtils.parsePlatformForRead(read, RAC); - if (!RecalUtils.isColorSpaceConsistent(RAC.SOLID_NOCALL_STRATEGY, read)) { // parse the solid color space and check for color no-calls - return 0L; // skip this read completely - } - - final int[] isSNP = calculateIsSNP(read, ref, originalRead); - final int[] isInsertion = calculateIsIndel(read, EventType.BASE_INSERTION); - final int[] isDeletion = calculateIsIndel(read, EventType.BASE_DELETION); - final int nErrors = nEvents(isSNP, isInsertion, isDeletion); - - // note for efficiency regions we don't compute the BAQ array unless we actually have - // some error to marginalize over. For ILMN data ~85% of reads have no error - final byte[] baqArray = nErrors == 0 ? flatBAQArray(read) : calculateBAQArray(read); - - if( baqArray != null ) { // some reads just can't be BAQ'ed - final ReadCovariates covariates = RecalUtils.computeCovariates(read, requestedCovariates); - final boolean[] skip = calculateSkipArray(read, metaDataTracker); // skip known sites of variation as well as low quality and non-regular bases - final double[] snpErrors = calculateFractionalErrorArray(isSNP, baqArray); - final double[] insertionErrors = calculateFractionalErrorArray(isInsertion, baqArray); - final double[] deletionErrors = calculateFractionalErrorArray(isDeletion, baqArray); - - // aggregate all of the info into our info object, and update the data - final ReadRecalibrationInfo info = new ReadRecalibrationInfo(read, covariates, skip, snpErrors, insertionErrors, deletionErrors); - recalibrationEngine.updateDataForRead(info); - return 1L; - } else { - return 0L; - } - } - - /** - * Compute the number of mutational events across all hasEvent vectors - * - * Simply the sum of entries in hasEvents - * - * @param hasEvents a vector a vectors of 0 (no event) and 1 (has event) - * @return the total number of events across all hasEvent arrays - */ - private int nEvents(final int[]... hasEvents) { - int n = 0; - for ( final int[] hasEvent : hasEvents ) { - n += MathUtils.sum(hasEvent); - } - return n; - } - - protected boolean[] calculateSkipArray( final GATKSAMRecord read, final RefMetaDataTracker metaDataTracker ) { - final byte[] bases = read.getReadBases(); - final boolean[] skip = new boolean[bases.length]; - final boolean[] knownSites = calculateKnownSites(read, metaDataTracker.getValues(RAC.knownSites)); - for( int iii = 0; iii < bases.length; iii++ ) { - skip[iii] = !BaseUtils.isRegularBase(bases[iii]) || isLowQualityBase(read, iii) || knownSites[iii] || badSolidOffset(read, iii); - } - return skip; - } - - protected boolean badSolidOffset( final GATKSAMRecord read, final int offset ) { - return ReadUtils.isSOLiDRead(read) && RAC.SOLID_RECAL_MODE != RecalUtils.SOLID_RECAL_MODE.DO_NOTHING && !RecalUtils.isColorSpaceConsistent(read, offset); - } - - protected boolean[] calculateKnownSites( final GATKSAMRecord read, final List features ) { - final int readLength = read.getReadBases().length; - final boolean[] knownSites = new boolean[readLength]; - Arrays.fill(knownSites, false); - for( final Feature f : features ) { - int featureStartOnRead = ReadUtils.getReadCoordinateForReferenceCoordinate(read.getSoftStart(), read.getCigar(), f.getStart(), ReadUtils.ClippingTail.LEFT_TAIL, true); // BUGBUG: should I use LEFT_TAIL here? - if( featureStartOnRead == ReadUtils.CLIPPING_GOAL_NOT_REACHED ) { - featureStartOnRead = 0; - } - - int featureEndOnRead = ReadUtils.getReadCoordinateForReferenceCoordinate(read.getSoftStart(), read.getCigar(), f.getEnd(), ReadUtils.ClippingTail.LEFT_TAIL, true); - if( featureEndOnRead == ReadUtils.CLIPPING_GOAL_NOT_REACHED ) { - featureEndOnRead = readLength; - } - - if( featureStartOnRead > readLength ) { - featureStartOnRead = featureEndOnRead = readLength; - } - - Arrays.fill(knownSites, Math.max(0, featureStartOnRead), Math.min(readLength, featureEndOnRead + 1), true); - } - return knownSites; - } - - // BUGBUG: can be merged with calculateIsIndel - protected static int[] calculateIsSNP( final GATKSAMRecord read, final ReferenceContext ref, final GATKSAMRecord originalRead ) { - final byte[] readBases = read.getReadBases(); - final byte[] refBases = Arrays.copyOfRange(ref.getBases(), read.getAlignmentStart() - originalRead.getAlignmentStart(), ref.getBases().length + read.getAlignmentEnd() - originalRead.getAlignmentEnd()); - final int[] snp = new int[readBases.length]; - int readPos = 0; - int refPos = 0; - for ( final CigarElement ce : read.getCigar().getCigarElements() ) { - final int elementLength = ce.getLength(); - switch (ce.getOperator()) { - case M: - case EQ: - case X: - for( int iii = 0; iii < elementLength; iii++ ) { - snp[readPos] = ( BaseUtils.basesAreEqual(readBases[readPos], refBases[refPos]) ? 0 : 1 ); - readPos++; - refPos++; - } - break; - case D: - case N: - refPos += elementLength; - break; - case I: - case S: // ReferenceContext doesn't have the soft clipped bases! - readPos += elementLength; - break; - case H: - case P: - break; - default: - throw new ReviewedStingException("Unsupported cigar operator: " + ce.getOperator()); - } - } - return snp; - } - - protected static int[] calculateIsIndel( final GATKSAMRecord read, final EventType mode ) { - final byte[] readBases = read.getReadBases(); - final int[] indel = new int[readBases.length]; - Arrays.fill(indel, 0); - int readPos = 0; - for ( final CigarElement ce : read.getCigar().getCigarElements() ) { - final int elementLength = ce.getLength(); - switch (ce.getOperator()) { - case M: - case EQ: - case X: - case S: - { - readPos += elementLength; - break; - } - case D: - { - final int index = ( read.getReadNegativeStrandFlag() ? readPos : ( readPos > 0 ? readPos - 1 : readPos ) ); - indel[index] = ( mode.equals(EventType.BASE_DELETION) ? 1 : 0 ); - break; - } - case I: - { - final boolean forwardStrandRead = !read.getReadNegativeStrandFlag(); - if( forwardStrandRead ) { - indel[(readPos > 0 ? readPos - 1 : readPos)] = ( mode.equals(EventType.BASE_INSERTION) ? 1 : 0 ); - } - for (int iii = 0; iii < elementLength; iii++) { - readPos++; - } - if( !forwardStrandRead ) { - indel[(readPos < indel.length ? readPos : readPos - 1)] = ( mode.equals(EventType.BASE_INSERTION) ? 1 : 0 ); - } - break; - } - case N: - case H: - case P: - break; - default: - throw new ReviewedStingException("Unsupported cigar operator: " + ce.getOperator()); - } - } - return indel; - } - - protected static double[] calculateFractionalErrorArray( final int[] errorArray, final byte[] baqArray ) { - if(errorArray.length != baqArray.length ) { - throw new ReviewedStingException("Array length mismatch detected. Malformed read?"); - } - - final int BLOCK_START_UNSET = -1; - - final double[] fractionalErrors = new double[baqArray.length]; - Arrays.fill(fractionalErrors, 0.0); - boolean inBlock = false; - int blockStartIndex = BLOCK_START_UNSET; - int iii; - for( iii = 0; iii < fractionalErrors.length; iii++ ) { - if( baqArray[iii] == NO_BAQ_UNCERTAINTY ) { - if( !inBlock ) { - fractionalErrors[iii] = (double) errorArray[iii]; - } else { - calculateAndStoreErrorsInBlock(iii, blockStartIndex, errorArray, fractionalErrors); - inBlock = false; // reset state variables - blockStartIndex = BLOCK_START_UNSET; // reset state variables - } - } else { - inBlock = true; - if( blockStartIndex == BLOCK_START_UNSET ) { blockStartIndex = iii; } - } - } - if( inBlock ) { - calculateAndStoreErrorsInBlock(iii-1, blockStartIndex, errorArray, fractionalErrors); - } - if( fractionalErrors.length != errorArray.length ) { - throw new ReviewedStingException("Output array length mismatch detected. Malformed read?"); - } - return fractionalErrors; - } - - private static void calculateAndStoreErrorsInBlock( final int iii, - final int blockStartIndex, - final int[] errorArray, - final double[] fractionalErrors ) { - int totalErrors = 0; - for( int jjj = Math.max(0,blockStartIndex-1); jjj <= iii; jjj++ ) { - totalErrors += errorArray[jjj]; - } - for( int jjj = Math.max(0, blockStartIndex-1); jjj <= iii; jjj++ ) { - fractionalErrors[jjj] = ((double) totalErrors) / ((double)(iii - Math.max(0,blockStartIndex-1) + 1)); - } - } - - /** - * Create a BAQ style array that indicates no alignment uncertainty - * @param read the read for which we want a BAQ array - * @return a BAQ-style non-null byte[] counting NO_BAQ_UNCERTAINTY values - * // TODO -- could be optimized avoiding this function entirely by using this inline if the calculation code above - */ - private byte[] flatBAQArray(final GATKSAMRecord read) { - final byte[] baq = new byte[read.getReadLength()]; - Arrays.fill(baq, NO_BAQ_UNCERTAINTY); - return baq; - } - - /** - * Compute an actual BAQ array for read, based on its quals and the reference sequence - * @param read the read to BAQ - * @return a non-null BAQ tag array for read - */ - private byte[] calculateBAQArray( final GATKSAMRecord read ) { - baq.baqRead(read, referenceReader, BAQ.CalculationMode.RECALCULATE, BAQ.QualityMode.ADD_TAG); - return BAQ.getBAQTag(read); - } - - /** - * Initialize the reduce step by returning 0L - * - * @return returns 0L - */ - public Long reduceInit() { - return 0L; - } - - /** - * The Reduce method doesn't do anything for this walker. - * - * @param mapped Result of the map. This value is immediately ignored. - * @param sum The summing CountedData used to output the CSV data - * @return returns The sum used to output the CSV data - */ - public Long reduce(Long mapped, Long sum) { - sum += mapped; - return sum; - } - - @Override - public void onTraversalDone(Long result) { - recalibrationEngine.finalizeData(); - - logger.info("Calculating quantized quality scores..."); - quantizeQualityScores(); - - logger.info("Writing recalibration report..."); - generateReport(); - logger.info("...done!"); - - if ( RAC.RECAL_PDF_FILE != null ) { - logger.info("Generating recalibration plots..."); - generatePlots(); - } - - logger.info("Processed: " + result + " reads"); - } - - private RecalibrationTables getRecalibrationTable() { - return recalibrationEngine.getFinalRecalibrationTables(); - } - - private void generatePlots() { - File recalFile = getToolkit().getArguments().BQSR_RECAL_FILE; - if (recalFile != null) { - RecalibrationReport report = new RecalibrationReport(recalFile); - RecalUtils.generateRecalibrationPlot(RAC, report.getRecalibrationTables(), getRecalibrationTable(), requestedCovariates); - } - else - RecalUtils.generateRecalibrationPlot(RAC, getRecalibrationTable(), requestedCovariates); - } - - /** - * go through the quality score table and use the # observations and the empirical quality score - * to build a quality score histogram for quantization. Then use the QuantizeQual algorithm to - * generate a quantization map (recalibrated_qual -> quantized_qual) - */ - private void quantizeQualityScores() { - quantizationInfo = new QuantizationInfo(getRecalibrationTable(), RAC.QUANTIZING_LEVELS); - } - - private void generateReport() { - RecalUtils.outputRecalibrationReport(RAC, quantizationInfo, getRecalibrationTable(), requestedCovariates, RAC.SORT_BY_ALL_COLUMNS); - } -} \ No newline at end of file diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfo.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfo.java deleted file mode 100644 index b884b89db..000000000 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfo.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2012 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.broadinstitute.sting.gatk.walkers.bqsr; - -import com.google.java.contract.Ensures; -import com.google.java.contract.Requires; -import org.broadinstitute.sting.utils.QualityUtils; -import org.broadinstitute.sting.utils.recalibration.EventType; -import org.broadinstitute.sting.utils.recalibration.ReadCovariates; -import org.broadinstitute.sting.utils.sam.GATKSAMRecord; - -/** - * Created with IntelliJ IDEA. - * User: depristo - * Date: 12/18/12 - * Time: 3:50 PM - * - * TODO -- merge in ReadCovariates? - */ -public final class ReadRecalibrationInfo { - private final GATKSAMRecord read; - private final int length; - private final ReadCovariates covariates; - private final boolean[] skips; - private final byte[] baseQuals, insertionQuals, deletionQuals; - private final double[] snpErrors, insertionErrors, deletionErrors; - - public ReadRecalibrationInfo(final GATKSAMRecord read, - final ReadCovariates covariates, - final boolean[] skips, - final double[] snpErrors, - final double[] insertionErrors, - final double[] deletionErrors) { - if ( read == null ) throw new IllegalArgumentException("read cannot be null"); - if ( covariates == null ) throw new IllegalArgumentException("covariates cannot be null"); - if ( skips == null ) throw new IllegalArgumentException("skips cannot be null"); - if ( snpErrors == null ) throw new IllegalArgumentException("snpErrors cannot be null"); - if ( insertionErrors == null ) throw new IllegalArgumentException("insertionErrors cannot be null"); - if ( deletionErrors == null ) throw new IllegalArgumentException("deletionErrors cannot be null"); - - this.read = read; - this.baseQuals = read.getBaseQualities(); - this.length = baseQuals.length; - this.covariates = covariates; - this.skips = skips; - this.insertionQuals = read.getExistingBaseInsertionQualities(); - this.deletionQuals = read.getExistingBaseDeletionQualities(); - this.snpErrors = snpErrors; - this.insertionErrors = insertionErrors; - this.deletionErrors = deletionErrors; - - if ( skips.length != length ) throw new IllegalArgumentException("skips.length " + snpErrors.length + " != length " + length); - if ( snpErrors.length != length ) throw new IllegalArgumentException("snpErrors.length " + snpErrors.length + " != length " + length); - if ( insertionErrors.length != length ) throw new IllegalArgumentException("insertionErrors.length " + snpErrors.length + " != length " + length); - if ( deletionErrors.length != length ) throw new IllegalArgumentException("deletionErrors.length " + snpErrors.length + " != length " + length); - } - - /** - * Get the qual score for event type at offset - * - * @param eventType the type of event we want the qual for - * @param offset the offset into this read for the qual - * @return a valid quality score for event at offset - */ - @Requires("validOffset(offset)") - @Ensures("validQual(result)") - public byte getQual(final EventType eventType, final int offset) { - switch ( eventType ) { - case BASE_SUBSTITUTION: return baseQuals[offset]; - // note optimization here -- if we don't have ins/del quals we just return the default byte directly - case BASE_INSERTION: return insertionQuals == null ? GATKSAMRecord.DEFAULT_INSERTION_DELETION_QUAL : insertionQuals[offset]; - case BASE_DELETION: return deletionQuals == null ? GATKSAMRecord.DEFAULT_INSERTION_DELETION_QUAL : deletionQuals[offset]; - default: throw new IllegalStateException("Unknown event type " + eventType); - } - } - - /** - * Get the error fraction for event type at offset - * - * The error fraction is a value between 0 and 1 that indicates how much certainty we have - * in the error occurring at offset. A value of 1 means that the error definitely occurs at this - * site, a value of 0.0 means it definitely doesn't happen here. 0.5 means that half the weight - * of the error belongs here - * - * @param eventType the type of event we want the qual for - * @param offset the offset into this read for the qual - * @return a fractional weight for an error at this offset - */ - @Requires("validOffset(offset)") - @Ensures("result >= 0.0 && result <= 1.0") - public double getErrorFraction(final EventType eventType, final int offset) { - switch ( eventType ) { - case BASE_SUBSTITUTION: return snpErrors[offset]; - case BASE_INSERTION: return insertionErrors[offset]; - case BASE_DELETION: return deletionErrors[offset]; - default: throw new IllegalStateException("Unknown event type " + eventType); - } - } - - /** - * Get the read involved in this recalibration info - * @return a non-null GATKSAMRecord - */ - @Ensures("result != null") - public GATKSAMRecord getRead() { - return read; - } - - /** - * Should offset in this read be skipped (because it's covered by a known variation site?) - * @param offset a valid offset into this info - * @return true if offset should be skipped, false otherwise - */ - @Requires("validOffset(offset)") - public boolean skip(final int offset) { - return skips[offset]; - } - - /** - * Get the ReadCovariates object carrying the mapping from offsets -> covariate key sets - * @return a non-null ReadCovariates object - */ - @Ensures("result != null") - public ReadCovariates getCovariatesValues() { - return covariates; - } - - /** - * Ensures an offset is valid. Used in contracts - * @param offset a proposed offset - * @return true if offset is valid w.r.t. the data in this object, false otherwise - */ - private boolean validOffset(final int offset) { - return offset >= 0 && offset < baseQuals.length; - } - - private boolean validQual(final byte result) { - return result >= 0 && result <= QualityUtils.MAX_QUAL_SCORE; - } -} diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationArgumentCollection.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationArgumentCollection.java deleted file mode 100755 index 622413b18..000000000 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationArgumentCollection.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright (c) 2010 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.broadinstitute.sting.gatk.walkers.bqsr; - -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.*; -import org.broadinstitute.sting.gatk.report.GATKReportTable; -import org.broadinstitute.sting.utils.recalibration.RecalUtils; - -import java.io.File; -import java.io.PrintStream; -import java.util.Collections; -import java.util.List; - -/** - * Created by IntelliJ IDEA. - * User: rpoplin - * Date: Nov 27, 2009 - * - * A collection of the arguments that are common to both CovariateCounterWalker and TableRecalibrationWalker. - * This set of arguments will also be passed to the constructor of every Covariate when it is instantiated. - */ - -public class RecalibrationArgumentCollection { - - /** - * This algorithm treats every reference mismatch as an indication of error. However, real genetic variation is expected to mismatch the reference, - * so it is critical that a database of known polymorphic sites is given to the tool in order to skip over those sites. This tool accepts any number of RodBindings (VCF, Bed, etc.) - * for use as this database. For users wishing to exclude an interval list of known variation simply use -XL my.interval.list to skip over processing those sites. - * Please note however that the statistics reported by the tool will not accurately reflected those sites skipped by the -XL argument. - */ - @Input(fullName = "knownSites", shortName = "knownSites", doc = "A database of known polymorphic sites to skip over in the recalibration algorithm", required = false) - public List> knownSites = Collections.emptyList(); - - /** - * After the header, data records occur one per line until the end of the file. The first several items on a line are the - * values of the individual covariates and will change depending on which covariates were specified at runtime. The last - * three items are the data- that is, number of observations for this combination of covariates, number of reference mismatches, - * and the raw empirical quality score calculated by phred-scaling the mismatch rate. Use '/dev/stdout' to print to standard out. - */ - @Gather(BQSRGatherer.class) - @Output(doc = "The output recalibration table file to create", required = true) - public File RECAL_TABLE_FILE = null; - public PrintStream RECAL_TABLE; - - /** - * If not provided, then no plots will be generated (useful for queue scatter/gathering). - * However, we *highly* recommend that users generate these plots whenever possible for QC checking. - */ - @Output(fullName = "plot_pdf_file", shortName = "plots", doc = "The output recalibration pdf file to create", required = false) - public File RECAL_PDF_FILE = null; - - /** - * If not provided, then a temporary file is created and then deleted upon completion. - * For advanced users only. - */ - @Advanced - @Argument(fullName = "intermediate_csv_file", shortName = "intermediate", doc = "The intermediate csv file to create", required = false) - public File RECAL_CSV_FILE = null; - - /** - * Note that the --list argument requires a fully resolved and correct command-line to work. - */ - @Argument(fullName = "list", shortName = "ls", doc = "List the available covariates and exit", required = false) - public boolean LIST_ONLY = false; - - /** - * Note that the ReadGroup and QualityScore covariates are required and do not need to be specified. - * Also, unless --no_standard_covs is specified, the Cycle and Context covariates are standard and are included by default. - * Use the --list argument to see the available covariates. - */ - @Argument(fullName = "covariate", shortName = "cov", doc = "One or more covariates to be used in the recalibration. Can be specified multiple times", required = false) - public String[] COVARIATES = null; - - /* - * The Cycle and Context covariates are standard and are included by default unless this argument is provided. - * Note that the ReadGroup and QualityScore covariates are required and cannot be excluded. - */ - @Argument(fullName = "no_standard_covs", shortName = "noStandard", doc = "Do not use the standard set of covariates, but rather just the ones listed using the -cov argument", required = false) - public boolean DO_NOT_USE_STANDARD_COVARIATES = false; - - /** - * This calculation is critically dependent on being able to skip over known polymorphic sites. Please be sure that you know what you are doing if you use this option. - */ - @Advanced - @Argument(fullName = "run_without_dbsnp_potentially_ruining_quality", shortName = "run_without_dbsnp_potentially_ruining_quality", required = false, doc = "If specified, allows the recalibrator to be used without a dbsnp rod. Very unsafe and for expert users only.") - public boolean RUN_WITHOUT_DBSNP = false; - - /** - * CountCovariates and TableRecalibration accept a --solid_recal_mode flag which governs how the recalibrator handles the - * reads which have had the reference inserted because of color space inconsistencies. - */ - @Argument(fullName = "solid_recal_mode", shortName = "sMode", required = false, doc = "How should we recalibrate solid bases in which the reference was inserted? Options = DO_NOTHING, SET_Q_ZERO, SET_Q_ZERO_BASE_N, or REMOVE_REF_BIAS") - public RecalUtils.SOLID_RECAL_MODE SOLID_RECAL_MODE = RecalUtils.SOLID_RECAL_MODE.SET_Q_ZERO; - - /** - * CountCovariates and TableRecalibration accept a --solid_nocall_strategy flag which governs how the recalibrator handles - * no calls in the color space tag. Unfortunately because of the reference inserted bases mentioned above, reads with no calls in - * their color space tag can not be recalibrated. - */ - @Argument(fullName = "solid_nocall_strategy", shortName = "solid_nocall_strategy", doc = "Defines the behavior of the recalibrator when it encounters no calls in the color space. Options = THROW_EXCEPTION, LEAVE_READ_UNRECALIBRATED, or PURGE_READ", required = false) - public RecalUtils.SOLID_NOCALL_STRATEGY SOLID_NOCALL_STRATEGY = RecalUtils.SOLID_NOCALL_STRATEGY.THROW_EXCEPTION; - - /** - * The context covariate will use a context of this size to calculate it's covariate value for base mismatches - */ - @Argument(fullName = "mismatches_context_size", shortName = "mcs", doc = "size of the k-mer context to be used for base mismatches", required = false) - public int MISMATCHES_CONTEXT_SIZE = 2; - - /** - * The context covariate will use a context of this size to calculate it's covariate value for base insertions and deletions - */ - @Argument(fullName = "indels_context_size", shortName = "ics", doc = "size of the k-mer context to be used for base insertions and deletions", required = false) - public int INDELS_CONTEXT_SIZE = 3; - - /** - * The cycle covariate will generate an error if it encounters a cycle greater than this value. - * This argument is ignored if the Cycle covariate is not used. - */ - @Argument(fullName = "maximum_cycle_value", shortName = "maxCycle", doc = "the maximum cycle value permitted for the Cycle covariate", required = false) - public int MAXIMUM_CYCLE_VALUE = 500; - - /** - * A default base qualities to use as a prior (reported quality) in the mismatch covariate model. This value will replace all base qualities in the read for this default value. Negative value turns it off (default is off) - */ - @Argument(fullName = "mismatches_default_quality", shortName = "mdq", doc = "default quality for the base mismatches covariate", required = false) - public byte MISMATCHES_DEFAULT_QUALITY = -1; - - /** - * A default base qualities to use as a prior (reported quality) in the insertion covariate model. This parameter is used for all reads without insertion quality scores for each base. (default is on) - */ - @Argument(fullName = "insertions_default_quality", shortName = "idq", doc = "default quality for the base insertions covariate", required = false) - public byte INSERTIONS_DEFAULT_QUALITY = 45; - - /** - * A default base qualities to use as a prior (reported quality) in the mismatch covariate model. This value will replace all base qualities in the read for this default value. Negative value turns it off (default is off) - */ - @Argument(fullName = "deletions_default_quality", shortName = "ddq", doc = "default quality for the base deletions covariate", required = false) - public byte DELETIONS_DEFAULT_QUALITY = 45; - - /** - * Reads with low quality bases on either tail (beginning or end) will not be considered in the context. This parameter defines the quality below which (inclusive) a tail is considered low quality - */ - @Argument(fullName = "low_quality_tail", shortName = "lqt", doc = "minimum quality for the bases in the tail of the reads to be considered", required = false) - public byte LOW_QUAL_TAIL = 2; - - /** - * BQSR generates a quantization table for quick quantization later by subsequent tools. BQSR does not quantize the base qualities, this is done by the engine with the -qq or -BQSR options. - * This parameter tells BQSR the number of levels of quantization to use to build the quantization table. - */ - @Argument(fullName = "quantizing_levels", shortName = "ql", required = false, doc = "number of distinct quality scores in the quantized output") - public int QUANTIZING_LEVELS = 16; - - /** - * The tag name for the binary tag covariate (if using it) - */ - @Argument(fullName = "binary_tag_name", shortName = "bintag", required = false, doc = "the binary tag covariate name if using it") - public String BINARY_TAG_NAME = null; - - /* - * whether GATK report tables should have rows in sorted order, starting from leftmost column - */ - @Argument(fullName = "sort_by_all_columns", shortName = "sortAllCols", doc = "Sort the rows in the tables of reports", required = false) - public Boolean SORT_BY_ALL_COLUMNS = false; - - ///////////////////////////// - // Debugging-only Arguments - ///////////////////////////// - - @Hidden - @Argument(fullName = "default_platform", shortName = "dP", required = false, doc = "If a read has no platform then default to the provided String. Valid options are illumina, 454, and solid.") - public String DEFAULT_PLATFORM = null; - - @Hidden - @Argument(fullName = "force_platform", shortName = "fP", required = false, doc = "If provided, the platform of EVERY read will be forced to be the provided String. Valid options are illumina, 454, and solid.") - public String FORCE_PLATFORM = null; - - @Hidden - @Output(fullName = "recal_table_update_log", shortName = "recal_table_update_log", required = false, doc = "If provided, log all updates to the recalibration tables to the given file. For debugging/testing purposes only") - public PrintStream RECAL_TABLE_UPDATE_LOG = null; - - public File existingRecalibrationReport = null; - - public GATKReportTable generateReportTable(final String covariateNames) { - GATKReportTable argumentsTable; - if(SORT_BY_ALL_COLUMNS) { - argumentsTable = new GATKReportTable("Arguments", "Recalibration argument collection values used in this run", 2, GATKReportTable.TableSortingWay.SORT_BY_COLUMN); - } else { - argumentsTable = new GATKReportTable("Arguments", "Recalibration argument collection values used in this run", 2); - } - argumentsTable.addColumn("Argument"); - argumentsTable.addColumn(RecalUtils.ARGUMENT_VALUE_COLUMN_NAME); - argumentsTable.addRowID("covariate", true); - argumentsTable.set("covariate", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, covariateNames); - argumentsTable.addRowID("no_standard_covs", true); - argumentsTable.set("no_standard_covs", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, DO_NOT_USE_STANDARD_COVARIATES); - argumentsTable.addRowID("run_without_dbsnp", true); - argumentsTable.set("run_without_dbsnp", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, RUN_WITHOUT_DBSNP); - argumentsTable.addRowID("solid_recal_mode", true); - argumentsTable.set("solid_recal_mode", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, SOLID_RECAL_MODE); - argumentsTable.addRowID("solid_nocall_strategy", true); - argumentsTable.set("solid_nocall_strategy", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, SOLID_NOCALL_STRATEGY); - argumentsTable.addRowID("mismatches_context_size", true); - argumentsTable.set("mismatches_context_size", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, MISMATCHES_CONTEXT_SIZE); - argumentsTable.addRowID("indels_context_size", true); - argumentsTable.set("indels_context_size", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, INDELS_CONTEXT_SIZE); - argumentsTable.addRowID("mismatches_default_quality", true); - argumentsTable.set("mismatches_default_quality", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, MISMATCHES_DEFAULT_QUALITY); - argumentsTable.addRowID("insertions_default_quality", true); - argumentsTable.set("insertions_default_quality", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, INSERTIONS_DEFAULT_QUALITY); - argumentsTable.addRowID("low_quality_tail", true); - argumentsTable.set("low_quality_tail", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, LOW_QUAL_TAIL); - argumentsTable.addRowID("default_platform", true); - argumentsTable.set("default_platform", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, DEFAULT_PLATFORM); - argumentsTable.addRowID("force_platform", true); - argumentsTable.set("force_platform", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, FORCE_PLATFORM); - argumentsTable.addRowID("quantizing_levels", true); - argumentsTable.set("quantizing_levels", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, QUANTIZING_LEVELS); - argumentsTable.addRowID("recalibration_report", true); - argumentsTable.set("recalibration_report", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, existingRecalibrationReport == null ? "null" : existingRecalibrationReport.getAbsolutePath()); - argumentsTable.addRowID("plot_pdf_file", true); - argumentsTable.set("plot_pdf_file", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, RECAL_PDF_FILE == null ? "null" : RECAL_PDF_FILE.getAbsolutePath()); - argumentsTable.addRowID("binary_tag_name", true); - argumentsTable.set("binary_tag_name", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, BINARY_TAG_NAME == null ? "null" : BINARY_TAG_NAME); - return argumentsTable; - } - -} diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationEngine.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationEngine.java deleted file mode 100644 index ca9fb4bca..000000000 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationEngine.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (c) 2012 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.broadinstitute.sting.gatk.walkers.bqsr; - -import com.google.java.contract.Requires; -import org.broadinstitute.sting.utils.collections.NestedIntegerArray; -import org.broadinstitute.sting.utils.recalibration.*; -import org.broadinstitute.sting.utils.recalibration.covariates.Covariate; -import org.broadinstitute.sting.utils.sam.GATKSAMRecord; - -import java.io.PrintStream; -import java.util.LinkedList; -import java.util.List; - -public class RecalibrationEngine { - final protected Covariate[] covariates; - final private int numReadGroups; - final private PrintStream maybeLogStream; - final private boolean lowMemoryMode; - - /** - * Has finalizeData() been called? - */ - private boolean finalized = false; - - /** - * The final (merged, etc) recalibration tables, suitable for downstream analysis. - */ - private RecalibrationTables finalRecalibrationTables = null; - - private final List recalibrationTablesList = new LinkedList(); - - private final ThreadLocal threadLocalTables = new ThreadLocal() { - private synchronized RecalibrationTables makeAndCaptureTable() { - final RecalibrationTables newTable = new RecalibrationTables(covariates, numReadGroups, maybeLogStream); - recalibrationTablesList.add(newTable); - return newTable; - } - - @Override - protected synchronized RecalibrationTables initialValue() { - if ( lowMemoryMode ) { - return recalibrationTablesList.isEmpty() ? makeAndCaptureTable() : recalibrationTablesList.get(0); - } else { - return makeAndCaptureTable(); - } - } - }; - - /** - * Get a recalibration table suitable for updating the underlying RecalDatums - * - * May return a thread-local version, or a single version, depending on the initialization - * arguments of this instance. - * - * @return updated tables - */ - protected RecalibrationTables getUpdatableRecalibrationTables() { - return threadLocalTables.get(); - } - - /** - * Initialize the recalibration engine - * - * Called once before any calls to updateDataForRead are made. The engine should prepare itself - * to handle any number of updateDataForRead calls containing ReadRecalibrationInfo containing - * keys for each of the covariates provided. - * - * The engine should collect match and mismatch data into the recalibrationTables data. - * - * @param covariates an array of the covariates we'll be using in this engine, order matters - * @param numReadGroups the number of read groups we should use for the recalibration tables - * @param maybeLogStream an optional print stream for logging calls to the nestedhashmap in the recalibration tables - */ - public RecalibrationEngine(final Covariate[] covariates, final int numReadGroups, final PrintStream maybeLogStream, final boolean enableLowMemoryMode) { - if ( covariates == null ) throw new IllegalArgumentException("Covariates cannot be null"); - if ( numReadGroups < 1 ) throw new IllegalArgumentException("numReadGroups must be >= 1 but got " + numReadGroups); - - this.covariates = covariates.clone(); - this.numReadGroups = numReadGroups; - this.maybeLogStream = maybeLogStream; - this.lowMemoryMode = enableLowMemoryMode; - } - - /** - * Update the recalibration statistics using the information in recalInfo - * @param recalInfo data structure holding information about the recalibration values for a single read - */ - @Requires("recalInfo != null") - public void updateDataForRead( final ReadRecalibrationInfo recalInfo ) { - final GATKSAMRecord read = recalInfo.getRead(); - final ReadCovariates readCovariates = recalInfo.getCovariatesValues(); - final RecalibrationTables tables = getUpdatableRecalibrationTables(); - final NestedIntegerArray qualityScoreTable = tables.getQualityScoreTable(); - - for( int offset = 0; offset < read.getReadBases().length; offset++ ) { - if( ! recalInfo.skip(offset) ) { - - for (final EventType eventType : EventType.values()) { - final int[] keys = readCovariates.getKeySet(offset, eventType); - final int eventIndex = eventType.ordinal(); - final byte qual = recalInfo.getQual(eventType, offset); - final double isError = recalInfo.getErrorFraction(eventType, offset); - - RecalUtils.incrementDatumOrPutIfNecessary(qualityScoreTable, qual, isError, keys[0], keys[1], eventIndex); - - for (int i = 2; i < covariates.length; i++) { - if (keys[i] < 0) - continue; - - RecalUtils.incrementDatumOrPutIfNecessary(tables.getTable(i), qual, isError, keys[0], keys[1], keys[i], eventIndex); - } - } - } - } - } - - - /** - * Finalize, if appropriate, all derived data in recalibrationTables. - * - * Called once after all calls to updateDataForRead have been issued. - * - * Assumes that all of the principal tables (by quality score) have been completely updated, - * and walks over this data to create summary data tables like by read group table. - */ - public void finalizeData() { - if ( finalized ) throw new IllegalStateException("FinalizeData() has already been called"); - - // merge all of the thread-local tables - finalRecalibrationTables = mergeThreadLocalRecalibrationTables(); - - final NestedIntegerArray byReadGroupTable = finalRecalibrationTables.getReadGroupTable(); - final NestedIntegerArray byQualTable = finalRecalibrationTables.getQualityScoreTable(); - - // iterate over all values in the qual table - for ( NestedIntegerArray.Leaf leaf : byQualTable.getAllLeaves() ) { - final int rgKey = leaf.keys[0]; - final int eventIndex = leaf.keys[2]; - final RecalDatum rgDatum = byReadGroupTable.get(rgKey, eventIndex); - final RecalDatum qualDatum = leaf.value; - - if ( rgDatum == null ) { - // create a copy of qualDatum, and initialize byReadGroup table with it - byReadGroupTable.put(new RecalDatum(qualDatum), rgKey, eventIndex); - } else { - // combine the qual datum with the existing datum in the byReadGroup table - rgDatum.combine(qualDatum); - } - } - - finalized = true; - } - - /** - * Merge all of the thread local recalibration tables into a single one. - * - * Reuses one of the recalibration tables to hold the merged table, so this function can only be - * called once in the engine. - * - * @return the merged recalibration table - */ - @Requires("! finalized") - private RecalibrationTables mergeThreadLocalRecalibrationTables() { - if ( recalibrationTablesList.isEmpty() ) throw new IllegalStateException("recalibration tables list is empty"); - - RecalibrationTables merged = null; - for ( final RecalibrationTables table : recalibrationTablesList ) { - if ( merged == null ) - // fast path -- if there's only only one table, so just make it the merged one - merged = table; - else { - merged.combine(table); - } - } - - return merged; - } - - /** - * Get the final recalibration tables, after finalizeData() has been called - * - * This returns the finalized recalibration table collected by this engine. - * - * It is an error to call this function before finalizeData has been called - * - * @return the finalized recalibration table collected by this engine - */ - public RecalibrationTables getFinalRecalibrationTables() { - if ( ! finalized ) throw new IllegalStateException("Cannot get final recalibration tables until finalizeData() has been called"); - return finalRecalibrationTables; - } -} diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/FlagStat.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/qc/FlagStat.java similarity index 96% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/FlagStat.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/qc/FlagStat.java index b4ef66aaf..c8304db21 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/FlagStat.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/qc/FlagStat.java @@ -1,9 +1,13 @@ -package org.broadinstitute.sting.gatk.walkers; +package org.broadinstitute.sting.gatk.walkers.qc; import org.broadinstitute.sting.commandline.Output; import org.broadinstitute.sting.gatk.CommandLineGATK; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.DataSource; +import org.broadinstitute.sting.gatk.walkers.NanoSchedulable; +import org.broadinstitute.sting.gatk.walkers.ReadWalker; +import org.broadinstitute.sting.gatk.walkers.Requires; import org.broadinstitute.sting.utils.help.DocumentedGATKFeature; import org.broadinstitute.sting.utils.sam.GATKSAMRecord; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/Pileup.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/qc/Pileup.java similarity index 96% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/Pileup.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/qc/Pileup.java index a3efea9f1..fb08d1c03 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/Pileup.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/qc/Pileup.java @@ -23,7 +23,7 @@ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package org.broadinstitute.sting.gatk.walkers; +package org.broadinstitute.sting.gatk.walkers.qc; import org.broad.tribble.Feature; import org.broadinstitute.sting.commandline.Argument; @@ -34,6 +34,9 @@ import org.broadinstitute.sting.gatk.CommandLineGATK; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.LocusWalker; +import org.broadinstitute.sting.gatk.walkers.NanoSchedulable; +import org.broadinstitute.sting.gatk.walkers.TreeReducible; import org.broadinstitute.sting.utils.Utils; import org.broadinstitute.sting.utils.help.DocumentedGATKFeature; import org.broadinstitute.sting.utils.pileup.PileupElement; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/PrintRODs.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/qc/PrintRODs.java similarity index 96% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/PrintRODs.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/qc/PrintRODs.java index d7ae3050e..3ffdf3e9d 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/PrintRODs.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/qc/PrintRODs.java @@ -23,7 +23,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package org.broadinstitute.sting.gatk.walkers; +package org.broadinstitute.sting.gatk.walkers.qc; import org.broad.tribble.Feature; import org.broadinstitute.sting.commandline.Input; @@ -33,6 +33,7 @@ import org.broadinstitute.sting.gatk.CommandLineGATK; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.RodWalker; import org.broadinstitute.sting.utils.help.DocumentedGATKFeature; import java.io.PrintStream; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/ClipReads.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/readutils/ClipReads.java similarity index 99% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/ClipReads.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/readutils/ClipReads.java index 93eaee209..3dd49dea8 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/ClipReads.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/readutils/ClipReads.java @@ -23,7 +23,7 @@ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package org.broadinstitute.sting.gatk.walkers; +package org.broadinstitute.sting.gatk.walkers.readutils; import net.sf.picard.reference.ReferenceSequence; import net.sf.picard.reference.ReferenceSequenceFile; @@ -37,6 +37,9 @@ import org.broadinstitute.sting.gatk.CommandLineGATK; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.io.StingSAMFileWriter; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.DataSource; +import org.broadinstitute.sting.gatk.walkers.ReadWalker; +import org.broadinstitute.sting.gatk.walkers.Requires; import org.broadinstitute.variant.utils.BaseUtils; import org.broadinstitute.sting.utils.Utils; import org.broadinstitute.sting.utils.clipping.ClippingOp; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/PrintReads.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/readutils/PrintReads.java similarity index 98% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/PrintReads.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/readutils/PrintReads.java index 37176cbf9..956c0d7d4 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/PrintReads.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/readutils/PrintReads.java @@ -23,7 +23,7 @@ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package org.broadinstitute.sting.gatk.walkers; +package org.broadinstitute.sting.gatk.walkers.readutils; import net.sf.samtools.SAMFileWriter; import net.sf.samtools.SAMReadGroupRecord; @@ -35,6 +35,7 @@ import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.iterators.ReadTransformer; import org.broadinstitute.sting.gatk.iterators.ReadTransformersMode; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.*; import org.broadinstitute.sting.utils.SampleUtils; import org.broadinstitute.sting.utils.baq.BAQ; import org.broadinstitute.sting.utils.help.DocumentedGATKFeature; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/SplitSamFile.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/readutils/SplitSamFile.java similarity index 95% rename from public/java/src/org/broadinstitute/sting/gatk/walkers/SplitSamFile.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/readutils/SplitSamFile.java index 7d70c470d..07d1f7c23 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/SplitSamFile.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/readutils/SplitSamFile.java @@ -23,7 +23,7 @@ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package org.broadinstitute.sting.gatk.walkers; +package org.broadinstitute.sting.gatk.walkers.readutils; import net.sf.samtools.SAMFileHeader; import net.sf.samtools.SAMFileWriter; @@ -34,6 +34,10 @@ import org.broadinstitute.sting.commandline.Argument; import org.broadinstitute.sting.gatk.CommandLineGATK; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.DataSource; +import org.broadinstitute.sting.gatk.walkers.ReadWalker; +import org.broadinstitute.sting.gatk.walkers.Requires; +import org.broadinstitute.sting.gatk.walkers.WalkerName; import org.broadinstitute.sting.utils.help.DocumentedGATKFeature; import org.broadinstitute.sting.utils.sam.GATKSAMRecord; import org.broadinstitute.sting.utils.sam.ReadUtils; diff --git a/public/java/src/org/broadinstitute/sting/utils/classloader/GATKLiteUtils.java b/public/java/src/org/broadinstitute/sting/utils/classloader/GATKLiteUtils.java deleted file mode 100755 index 2ab7d0618..000000000 --- a/public/java/src/org/broadinstitute/sting/utils/classloader/GATKLiteUtils.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2010 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.broadinstitute.sting.utils.classloader; - -import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; - -import java.util.*; - -/** - * Created by IntelliJ IDEA. - * User: ebanks - * - * A set of static utility methods for working with the full vs. Lite GATK build - */ -public class GATKLiteUtils { - /** - * Constructor access disallowed...static utility methods only! - */ - private GATKLiteUtils() { } - - - private static Set fullVersionGATKWalkers = new HashSet(); - static { - fullVersionGATKWalkers.add("HaplotypeCaller"); - fullVersionGATKWalkers.add("ReduceReads"); - } - /** - * Utility method to check whether a given walker is only available in the full GATK release - * - * @param walkerName the walker class name (not the package) to check - */ - public static boolean isAvailableOnlyInFullGATK(final String walkerName) { - return fullVersionGATKWalkers.contains(walkerName); - } - - /** - * Utility method to determine whether this is the lite version of the GATK - */ - public static boolean isGATKLite() { - if ( isLiteVersion == null ) { - try { - Class.forName(DummyProtectedClassName); - isLiteVersion = false; - } catch ( ClassNotFoundException e) { - isLiteVersion = true; - } - } - return isLiteVersion; - } - private static final String DummyProtectedClassName = "org.broadinstitute.sting.gatk.DummyProtectedClass"; - private static Boolean isLiteVersion = null; - - - /** - * Utility method to pull out a protected subclass if possible, otherwise it falls back to a public subclass. - * Important note: the protected classes MUST implement ProtectedPackageSource! - * - * @param interfaceClass the interface class which the target classes implement - */ - public static Class getProtectedClassIfAvailable(final Class interfaceClass) { - List> classes = new PluginManager(interfaceClass).getPlugins(); - if ( classes.isEmpty() ) - throw new ReviewedStingException("No classes implementing the interface class " + interfaceClass.getSimpleName() + " were found"); - - Class result = null; - for ( Class c : classes ) { - if ( ProtectedPackageSource.class.isAssignableFrom(c) ) { - result = c; - break; - } - } - if ( result == null ) - result = classes.get(0); - - return result; - } -} diff --git a/public/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java b/public/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java index 01c4b7a16..c799479ed 100755 --- a/public/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java +++ b/public/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java @@ -92,12 +92,6 @@ public class UserException extends ReviewedStingException { } } - public static class NotSupportedInGATKLite extends UserException { - public NotSupportedInGATKLite(String message) { - super(String.format("GATK Lite does not support all of the features of the full version: %s", message)); - } - } - // todo -- fix up exception cause passing public static class MissingArgument extends CommandLineException { public MissingArgument(String arg, String message) { diff --git a/public/java/test/org/broadinstitute/sting/gatk/GenomeAnalysisEngineUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/GenomeAnalysisEngineUnitTest.java index d8905ad35..e96aae07a 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/GenomeAnalysisEngineUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/GenomeAnalysisEngineUnitTest.java @@ -28,7 +28,7 @@ import org.broadinstitute.sting.BaseTest; import org.broadinstitute.sting.commandline.ArgumentException; import org.broadinstitute.sting.commandline.Tags; import org.broadinstitute.sting.gatk.datasources.reads.SAMReaderID; -import org.broadinstitute.sting.gatk.walkers.PrintReads; +import org.broadinstitute.sting.gatk.walkers.readutils.PrintReads; import org.broadinstitute.sting.utils.GenomeLocSortedSet; import org.testng.annotations.Test; diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperLiteIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperLiteIntegrationTest.java deleted file mode 100755 index 783a8d7fc..000000000 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperLiteIntegrationTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.broadinstitute.sting.gatk.walkers.genotyper; - -import org.broadinstitute.sting.WalkerTest; -import org.broadinstitute.sting.utils.classloader.GATKLiteUtils; -import org.testng.SkipException; -import org.testng.annotations.Test; - -import java.util.Arrays; - -// ********************************************************************************** // -// Note that this class also serves as an integration test for the VariantAnnotator! // -// ********************************************************************************** // - -public class UnifiedGenotyperLiteIntegrationTest extends WalkerTest { - - private final static String baseCommand = "-T UnifiedGenotyper -R " + b36KGReference + " --no_cmdline_in_header -glm BOTH -minIndelFrac 0.0 --dbsnp " + b36dbSNP129; - - // -------------------------------------------------------------------------------------------------------------- - // - // testing contamination down-sampling gets ignored - // - // -------------------------------------------------------------------------------------------------------------- - - @Test - public void testContaminationDownsampling() { - if ( !GATKLiteUtils.isGATKLite() ) - throw new SkipException("Only want to test for GATK lite"); - - WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( - baseCommand + " -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -o %s -L 1:10,000,000-10,010,000", 1, - Arrays.asList("9addd225a985178339a0c49dc5fdc220")); - executeTest("test contamination_percentage_to_filter gets ignored", spec); - } - -} diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/FlagStatIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/qc/FlagStatIntegrationTest.java similarity index 92% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/FlagStatIntegrationTest.java rename to public/java/test/org/broadinstitute/sting/gatk/walkers/qc/FlagStatIntegrationTest.java index d2acaa588..aaebfc588 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/FlagStatIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/qc/FlagStatIntegrationTest.java @@ -1,4 +1,4 @@ -package org.broadinstitute.sting.gatk.walkers; +package org.broadinstitute.sting.gatk.walkers.qc; import org.broadinstitute.sting.WalkerTest; import org.testng.annotations.Test; diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/PileupWalkerIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/qc/PileupWalkerIntegrationTest.java similarity index 98% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/PileupWalkerIntegrationTest.java rename to public/java/test/org/broadinstitute/sting/gatk/walkers/qc/PileupWalkerIntegrationTest.java index b457698e9..05c82806d 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/PileupWalkerIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/qc/PileupWalkerIntegrationTest.java @@ -1,4 +1,4 @@ -package org.broadinstitute.sting.gatk.walkers; +package org.broadinstitute.sting.gatk.walkers.qc; import org.broadinstitute.sting.WalkerTest; import org.testng.annotations.Test; diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/ClipReadsWalkersIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/readutils/ClipReadsWalkersIntegrationTest.java similarity index 98% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/ClipReadsWalkersIntegrationTest.java rename to public/java/test/org/broadinstitute/sting/gatk/walkers/readutils/ClipReadsWalkersIntegrationTest.java index ade9bda16..a19b3724f 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/ClipReadsWalkersIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/readutils/ClipReadsWalkersIntegrationTest.java @@ -22,7 +22,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package org.broadinstitute.sting.gatk.walkers; +package org.broadinstitute.sting.gatk.walkers.readutils; import org.broadinstitute.sting.WalkerTest; import org.testng.annotations.Test; diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/readutils/PrintReadsIntegrationTest.java similarity index 97% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsIntegrationTest.java rename to public/java/test/org/broadinstitute/sting/gatk/walkers/readutils/PrintReadsIntegrationTest.java index 717d9d953..247000431 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/readutils/PrintReadsIntegrationTest.java @@ -1,4 +1,4 @@ -package org.broadinstitute.sting.gatk.walkers; +package org.broadinstitute.sting.gatk.walkers.readutils; import org.broadinstitute.sting.WalkerTest; import org.testng.annotations.DataProvider; diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsLargeScaleTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/readutils/PrintReadsLargeScaleTest.java similarity index 92% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsLargeScaleTest.java rename to public/java/test/org/broadinstitute/sting/gatk/walkers/readutils/PrintReadsLargeScaleTest.java index ad7ac56f9..81a3082a2 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsLargeScaleTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/readutils/PrintReadsLargeScaleTest.java @@ -1,4 +1,4 @@ -package org.broadinstitute.sting.gatk.walkers; +package org.broadinstitute.sting.gatk.walkers.readutils; import org.broadinstitute.sting.WalkerTest; import org.testng.annotations.Test; diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/readutils/PrintReadsUnitTest.java similarity index 94% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsUnitTest.java rename to public/java/test/org/broadinstitute/sting/gatk/walkers/readutils/PrintReadsUnitTest.java index 1aaa00aee..0da3b6b1f 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/PrintReadsUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/readutils/PrintReadsUnitTest.java @@ -1,4 +1,4 @@ -package org.broadinstitute.sting.gatk.walkers; +package org.broadinstitute.sting.gatk.walkers.readutils; import net.sf.samtools.SAMFileHeader; import net.sf.samtools.SAMRecord; @@ -59,7 +59,7 @@ public class PrintReadsUnitTest extends BaseTest { private ReferenceContext bases = null; //private ReferenceContext ref = new ReferenceContext() - PrintReads walker; + org.broadinstitute.sting.gatk.walkers.readutils.PrintReads walker; ArtificialSAMFileWriter writer; @BeforeMethod @@ -67,7 +67,7 @@ public class PrintReadsUnitTest extends BaseTest { trav = new ArtificialReadsTraversal(); readTotal = ( ( trav.endingChr - trav.startingChr ) + 1 ) * trav.readsPerChr + trav.unMappedReads; - walker = new PrintReads(); + walker = new org.broadinstitute.sting.gatk.walkers.readutils.PrintReads(); writer = new ArtificialSAMFileWriter(); walker.out = writer; walker.initialize(); From d3e2352072d0797bef54cf1c336ad8a1d554767b Mon Sep 17 00:00:00 2001 From: Mauricio Carneiro Date: Mon, 7 Jan 2013 14:49:57 -0500 Subject: [PATCH 06/25] Moved processing pipelines to private These pipelines were supposed to serve as an example for the community, they were written a long-long-long time ago and are being used today by users as the 'best practice pipeline'. Unless we decide we want to support and maintain an example best-practices pipeline, I'm moving these to private. --- .../qscripts/DataProcessingPipeline.scala | 496 ------------------ .../MethodsDevelopmentCallingPipeline.scala | 373 ------------- .../qscripts/PacbioProcessingPipeline.scala | 188 ------- 3 files changed, 1057 deletions(-) delete mode 100755 public/scala/qscript/org/broadinstitute/sting/queue/qscripts/DataProcessingPipeline.scala delete mode 100755 public/scala/qscript/org/broadinstitute/sting/queue/qscripts/MethodsDevelopmentCallingPipeline.scala delete mode 100755 public/scala/qscript/org/broadinstitute/sting/queue/qscripts/PacbioProcessingPipeline.scala diff --git a/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/DataProcessingPipeline.scala b/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/DataProcessingPipeline.scala deleted file mode 100755 index 165e6a4e9..000000000 --- a/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/DataProcessingPipeline.scala +++ /dev/null @@ -1,496 +0,0 @@ -package org.broadinstitute.sting.queue.qscripts - -import org.broadinstitute.sting.queue.extensions.gatk._ -import org.broadinstitute.sting.queue.QScript -import org.broadinstitute.sting.queue.extensions.picard._ -import org.broadinstitute.sting.gatk.walkers.indels.IndelRealigner.ConsensusDeterminationModel -import org.broadinstitute.sting.utils.baq.BAQ.CalculationMode - -import collection.JavaConversions._ -import net.sf.samtools.SAMFileReader -import net.sf.samtools.SAMFileHeader.SortOrder - -import org.broadinstitute.sting.queue.util.QScriptUtils -import org.broadinstitute.sting.queue.function.ListWriterFunction -import org.broadinstitute.sting.commandline.Hidden -import org.broadinstitute.sting.commandline - -class DataProcessingPipeline extends QScript { - qscript => - - /**************************************************************************** - * Required Parameters - ****************************************************************************/ - - - @Input(doc="input BAM file - or list of BAM files", fullName="input", shortName="i", required=true) - var input: File = _ - - @Input(doc="Reference fasta file", fullName="reference", shortName="R", required=true) - var reference: File = _ - - @Input(doc="dbsnp ROD to use (must be in VCF format)", fullName="dbsnp", shortName="D", required=true) - var dbSNP: Seq[File] = Seq() - - /**************************************************************************** - * Optional Parameters - ****************************************************************************/ - - @Input(doc="extra VCF files to use as reference indels for Indel Realignment", fullName="extra_indels", shortName="indels", required=false) - var indels: Seq[File] = Seq() - - @Input(doc="The path to the binary of bwa (usually BAM files have already been mapped - but if you want to remap this is the option)", fullName="path_to_bwa", shortName="bwa", required=false) - var bwaPath: File = _ - - @Argument(doc="the project name determines the final output (BAM file) base name. Example NA12878 yields NA12878.processed.bam", fullName="project", shortName="p", required=false) - var projectName: String = "project" - - @Argument(doc="Output path for the processed BAM files.", fullName="output_directory", shortName="outputDir", required=false) - var outputDir: String = "" - - @Argument(doc="the -L interval string to be used by GATK - output bams at interval only", fullName="gatk_interval_string", shortName="L", required=false) - var intervalString: String = "" - - @Input(doc="an intervals file to be used by GATK - output bams at intervals only", fullName="gatk_interval_file", shortName="intervals", required=false) - var intervals: File = _ - - @Argument(doc="Cleaning model: KNOWNS_ONLY, USE_READS or USE_SW", fullName="clean_model", shortName="cm", required=false) - var cleaningModel: String = "USE_READS" - - @Argument(doc="Decompose input BAM file and fully realign it using BWA and assume Single Ended reads", fullName="use_bwa_single_ended", shortName="bwase", required=false) - var useBWAse: Boolean = false - - @Argument(doc="Decompose input BAM file and fully realign it using BWA and assume Pair Ended reads", fullName="use_bwa_pair_ended", shortName="bwape", required=false) - var useBWApe: Boolean = false - - @Argument(doc="Decompose input BAM file and fully realign it using BWA SW", fullName="use_bwa_sw", shortName="bwasw", required=false) - var useBWAsw: Boolean = false - - @Argument(doc="Number of threads BWA should use", fullName="bwa_threads", shortName="bt", required=false) - var bwaThreads: Int = 1 - - @Argument(doc="Perform validation on the BAM files", fullName="validation", shortName="vs", required=false) - var validation: Boolean = false - - - /**************************************************************************** - * Hidden Parameters - ****************************************************************************/ - @Hidden - @Argument(doc="How many ways to scatter/gather", fullName="scatter_gather", shortName="sg", required=false) - var nContigs: Int = -1 - - @Hidden - @Argument(doc="Define the default platform for Count Covariates -- useful for techdev purposes only.", fullName="default_platform", shortName="dp", required=false) - var defaultPlatform: String = "" - - @Hidden - @Argument(doc="Run the pipeline in test mode only", fullName = "test_mode", shortName = "test", required=false) - var testMode: Boolean = false - - - /**************************************************************************** - * Global Variables - ****************************************************************************/ - - val queueLogDir: String = ".qlog/" // Gracefully hide Queue's output - - var cleanModelEnum: ConsensusDeterminationModel = ConsensusDeterminationModel.USE_READS - - - - - /**************************************************************************** - * Helper classes and methods - ****************************************************************************/ - - class ReadGroup (val id: String, - val lb: String, - val pl: String, - val pu: String, - val sm: String, - val cn: String, - val ds: String) - {} - - // Utility function to merge all bam files of similar samples. Generates one BAM file per sample. - // It uses the sample information on the header of the input BAM files. - // - // Because the realignment only happens after these scripts are executed, in case you are using - // bwa realignment, this function will operate over the original bam files and output over the - // (to be realigned) bam files. - def createSampleFiles(bamFiles: Seq[File], realignedBamFiles: Seq[File]): Map[String, Seq[File]] = { - - // Creating a table with SAMPLE information from each input BAM file - val sampleTable = scala.collection.mutable.Map.empty[String, Seq[File]] - val realignedIterator = realignedBamFiles.iterator - for (bam <- bamFiles) { - val rBam = realignedIterator.next() // advance to next element in the realignedBam list so they're in sync. - - val samReader = new SAMFileReader(bam) - val header = samReader.getFileHeader - val readGroups = header.getReadGroups - - // only allow one sample per file. Bam files with multiple samples would require pre-processing of the file - // with PrintReads to separate the samples. Tell user to do it himself! - assert(!QScriptUtils.hasMultipleSamples(readGroups), "The pipeline requires that only one sample is present in a BAM file. Please separate the samples in " + bam) - - // Fill out the sample table with the readgroups in this file - for (rg <- readGroups) { - val sample = rg.getSample - if (!sampleTable.contains(sample)) - sampleTable(sample) = Seq(rBam) - else if ( !sampleTable(sample).contains(rBam)) - sampleTable(sample) :+= rBam - } - } - sampleTable.toMap - } - - // Rebuilds the Read Group string to give BWA - def addReadGroups(inBam: File, outBam: File, samReader: SAMFileReader) { - val readGroups = samReader.getFileHeader.getReadGroups - var index: Int = readGroups.length - for (rg <- readGroups) { - val intermediateInBam: File = if (index == readGroups.length) { inBam } else { swapExt(outBam, ".bam", index+1 + "-rg.bam") } - val intermediateOutBam: File = if (index > 1) {swapExt(outBam, ".bam", index + "-rg.bam") } else { outBam} - val readGroup = new ReadGroup(rg.getReadGroupId, rg.getLibrary, rg.getPlatform, rg.getPlatformUnit, rg.getSample, rg.getSequencingCenter, rg.getDescription) - add(addReadGroup(intermediateInBam, intermediateOutBam, readGroup)) - index = index - 1 - } - } - - // Takes a list of processed BAM files and realign them using the BWA option requested (bwase or bwape). - // Returns a list of realigned BAM files. - def performAlignment(bams: Seq[File]): Seq[File] = { - var realignedBams: Seq[File] = Seq() - var index = 1 - for (bam <- bams) { - // first revert the BAM file to the original qualities - val saiFile1 = swapExt(bam, ".bam", "." + index + ".1.sai") - val saiFile2 = swapExt(bam, ".bam", "." + index + ".2.sai") - val realignedSamFile = swapExt(bam, ".bam", "." + index + ".realigned.sam") - val realignedBamFile = swapExt(bam, ".bam", "." + index + ".realigned.bam") - val rgRealignedBamFile = swapExt(bam, ".bam", "." + index + ".realigned.rg.bam") - - if (useBWAse) { - val revertedBAM = revertBAM(bam, true) - add(bwa_aln_se(revertedBAM, saiFile1), - bwa_sam_se(revertedBAM, saiFile1, realignedSamFile)) - } - else if (useBWApe) { - val revertedBAM = revertBAM(bam, true) - add(bwa_aln_pe(revertedBAM, saiFile1, 1), - bwa_aln_pe(revertedBAM, saiFile2, 2), - bwa_sam_pe(revertedBAM, saiFile1, saiFile2, realignedSamFile)) - } - else if (useBWAsw) { - val revertedBAM = revertBAM(bam, false) - val fastQ = swapExt(revertedBAM, ".bam", ".fq") - add(convertToFastQ(revertedBAM, fastQ), - bwa_sw(fastQ, realignedSamFile)) - } - add(sortSam(realignedSamFile, realignedBamFile, SortOrder.coordinate)) - addReadGroups(realignedBamFile, rgRealignedBamFile, new SAMFileReader(bam)) - realignedBams :+= rgRealignedBamFile - index = index + 1 - } - realignedBams - } - - def getIndelCleaningModel: ConsensusDeterminationModel = { - if (cleaningModel == "KNOWNS_ONLY") - ConsensusDeterminationModel.KNOWNS_ONLY - else if (cleaningModel == "USE_SW") - ConsensusDeterminationModel.USE_SW - else - ConsensusDeterminationModel.USE_READS - } - - def revertBams(bams: Seq[File], removeAlignmentInformation: Boolean): Seq[File] = { - var revertedBAMList: Seq[File] = Seq() - for (bam <- bams) - revertedBAMList :+= revertBAM(bam, removeAlignmentInformation) - revertedBAMList - } - - def revertBAM(bam: File, removeAlignmentInformation: Boolean): File = { - val revertedBAM = swapExt(bam, ".bam", ".reverted.bam") - add(revert(bam, revertedBAM, removeAlignmentInformation)) - revertedBAM - } - - /**************************************************************************** - * Main script - ****************************************************************************/ - - - def script() { - // final output list of processed bam files - var cohortList: Seq[File] = Seq() - - // sets the model for the Indel Realigner - cleanModelEnum = getIndelCleaningModel - - // keep a record of the number of contigs in the first bam file in the list - val bams = QScriptUtils.createSeqFromFile(input) - if (nContigs < 0) - nContigs = QScriptUtils.getNumberOfContigs(bams(0)) - - val realignedBAMs = if (useBWApe || useBWAse || useBWAsw) {performAlignment(bams)} else {revertBams(bams, false)} - - // generate a BAM file per sample joining all per lane files if necessary - val sampleBAMFiles: Map[String, Seq[File]] = createSampleFiles(bams, realignedBAMs) - - // if this is a 'knowns only' indel realignment run, do it only once for all samples. - val globalIntervals = new File(outputDir + projectName + ".intervals") - if (cleaningModel == ConsensusDeterminationModel.KNOWNS_ONLY) - add(target(null, globalIntervals)) - - // put each sample through the pipeline - for ((sample, bamList) <- sampleBAMFiles) { - - // BAM files generated by the pipeline - val bam = new File(qscript.projectName + "." + sample + ".bam") - val cleanedBam = swapExt(bam, ".bam", ".clean.bam") - val dedupedBam = swapExt(bam, ".bam", ".clean.dedup.bam") - val recalBam = swapExt(bam, ".bam", ".clean.dedup.recal.bam") - - // Accessory files - val targetIntervals = if (cleaningModel == ConsensusDeterminationModel.KNOWNS_ONLY) {globalIntervals} else {swapExt(bam, ".bam", ".intervals")} - val metricsFile = swapExt(bam, ".bam", ".metrics") - val preRecalFile = swapExt(bam, ".bam", ".pre_recal.table") - val postRecalFile = swapExt(bam, ".bam", ".post_recal.table") - val preOutPath = swapExt(bam, ".bam", ".pre") - val postOutPath = swapExt(bam, ".bam", ".post") - val preValidateLog = swapExt(bam, ".bam", ".pre.validation") - val postValidateLog = swapExt(bam, ".bam", ".post.validation") - - - // Validation is an optional step for the BAM file generated after - // alignment and the final bam file of the pipeline. - if (validation) { - for (sampleFile <- bamList) - add(validate(sampleFile, preValidateLog), - validate(recalBam, postValidateLog)) - } - - if (cleaningModel != ConsensusDeterminationModel.KNOWNS_ONLY) - add(target(bamList, targetIntervals)) - - add(clean(bamList, targetIntervals, cleanedBam), - dedup(cleanedBam, dedupedBam, metricsFile), - cov(dedupedBam, preRecalFile), - recal(dedupedBam, preRecalFile, recalBam), - cov(recalBam, postRecalFile)) - - - cohortList :+= recalBam - } - - // output a BAM list with all the processed per sample files - val cohortFile = new File(qscript.outputDir + qscript.projectName + ".cohort.list") - add(writeList(cohortList, cohortFile)) - } - - - - /**************************************************************************** - * Classes (GATK Walkers) - ****************************************************************************/ - - - - // General arguments to non-GATK tools - trait ExternalCommonArgs extends CommandLineFunction { - this.memoryLimit = 4 - this.isIntermediate = true - } - - // General arguments to GATK walkers - trait CommandLineGATKArgs extends CommandLineGATK with ExternalCommonArgs { - this.reference_sequence = qscript.reference - } - - trait SAMargs extends PicardBamFunction with ExternalCommonArgs { - this.maxRecordsInRam = 100000 - } - - case class target (inBams: Seq[File], outIntervals: File) extends RealignerTargetCreator with CommandLineGATKArgs { - if (cleanModelEnum != ConsensusDeterminationModel.KNOWNS_ONLY) - this.input_file = inBams - this.out = outIntervals - this.mismatchFraction = 0.0 - this.known ++= qscript.dbSNP - if (indels != null) - this.known ++= qscript.indels - this.scatterCount = nContigs - this.analysisName = queueLogDir + outIntervals + ".target" - this.jobName = queueLogDir + outIntervals + ".target" - } - - case class clean (inBams: Seq[File], tIntervals: File, outBam: File) extends IndelRealigner with CommandLineGATKArgs { - this.input_file = inBams - this.targetIntervals = tIntervals - this.out = outBam - this.known ++= qscript.dbSNP - if (qscript.indels != null) - this.known ++= qscript.indels - this.consensusDeterminationModel = cleanModelEnum - this.compress = 0 - this.noPGTag = qscript.testMode; - this.scatterCount = nContigs - this.analysisName = queueLogDir + outBam + ".clean" - this.jobName = queueLogDir + outBam + ".clean" - } - - case class cov (inBam: File, outRecalFile: File) extends BaseRecalibrator with CommandLineGATKArgs { - this.knownSites ++= qscript.dbSNP - this.covariate ++= Seq("ReadGroupCovariate", "QualityScoreCovariate", "CycleCovariate", "ContextCovariate") - this.input_file :+= inBam - this.disable_indel_quals = true - this.out = outRecalFile - if (!defaultPlatform.isEmpty) this.default_platform = defaultPlatform - if (!qscript.intervalString.isEmpty) this.intervalsString ++= Seq(qscript.intervalString) - else if (qscript.intervals != null) this.intervals :+= qscript.intervals - this.scatterCount = nContigs - this.analysisName = queueLogDir + outRecalFile + ".covariates" - this.jobName = queueLogDir + outRecalFile + ".covariates" - } - - case class recal (inBam: File, inRecalFile: File, outBam: File) extends PrintReads with CommandLineGATKArgs { - this.input_file :+= inBam - this.BQSR = inRecalFile - this.baq = CalculationMode.CALCULATE_AS_NECESSARY - this.out = outBam - if (!qscript.intervalString.isEmpty) this.intervalsString ++= Seq(qscript.intervalString) - else if (qscript.intervals != null) this.intervals :+= qscript.intervals - this.scatterCount = nContigs - this.isIntermediate = false - this.analysisName = queueLogDir + outBam + ".recalibration" - this.jobName = queueLogDir + outBam + ".recalibration" - } - - - - /**************************************************************************** - * Classes (non-GATK programs) - ****************************************************************************/ - - - case class dedup (inBam: File, outBam: File, metricsFile: File) extends MarkDuplicates with ExternalCommonArgs { - this.input :+= inBam - this.output = outBam - this.metrics = metricsFile - this.memoryLimit = 16 - this.analysisName = queueLogDir + outBam + ".dedup" - this.jobName = queueLogDir + outBam + ".dedup" - } - - case class joinBams (inBams: Seq[File], outBam: File) extends MergeSamFiles with ExternalCommonArgs { - this.input = inBams - this.output = outBam - this.analysisName = queueLogDir + outBam + ".joinBams" - this.jobName = queueLogDir + outBam + ".joinBams" - } - - case class sortSam (inSam: File, outBam: File, sortOrderP: SortOrder) extends SortSam with ExternalCommonArgs { - this.input :+= inSam - this.output = outBam - this.sortOrder = sortOrderP - this.analysisName = queueLogDir + outBam + ".sortSam" - this.jobName = queueLogDir + outBam + ".sortSam" - } - - case class validate (inBam: File, outLog: File) extends ValidateSamFile with ExternalCommonArgs { - this.input :+= inBam - this.output = outLog - this.REFERENCE_SEQUENCE = qscript.reference - this.isIntermediate = false - this.analysisName = queueLogDir + outLog + ".validate" - this.jobName = queueLogDir + outLog + ".validate" - } - - - case class addReadGroup (inBam: File, outBam: File, readGroup: ReadGroup) extends AddOrReplaceReadGroups with ExternalCommonArgs { - this.input :+= inBam - this.output = outBam - this.RGID = readGroup.id - this.RGCN = readGroup.cn - this.RGDS = readGroup.ds - this.RGLB = readGroup.lb - this.RGPL = readGroup.pl - this.RGPU = readGroup.pu - this.RGSM = readGroup.sm - this.analysisName = queueLogDir + outBam + ".rg" - this.jobName = queueLogDir + outBam + ".rg" - } - - case class revert (inBam: File, outBam: File, removeAlignmentInfo: Boolean) extends RevertSam with ExternalCommonArgs { - this.output = outBam - this.input :+= inBam - this.removeAlignmentInformation = removeAlignmentInfo; - this.sortOrder = if (removeAlignmentInfo) {SortOrder.queryname} else {SortOrder.coordinate} - this.analysisName = queueLogDir + outBam + "revert" - this.jobName = queueLogDir + outBam + ".revert" - } - - case class convertToFastQ (inBam: File, outFQ: File) extends SamToFastq with ExternalCommonArgs { - this.input :+= inBam - this.fastq = outFQ - this.analysisName = queueLogDir + outFQ + "convert_to_fastq" - this.jobName = queueLogDir + outFQ + ".convert_to_fastq" - } - - case class bwa_aln_se (inBam: File, outSai: File) extends CommandLineFunction with ExternalCommonArgs { - @Input(doc="bam file to be aligned") var bam = inBam - @Output(doc="output sai file") var sai = outSai - def commandLine = bwaPath + " aln -t " + bwaThreads + " -q 5 " + reference + " -b " + bam + " > " + sai - this.analysisName = queueLogDir + outSai + ".bwa_aln_se" - this.jobName = queueLogDir + outSai + ".bwa_aln_se" - } - - case class bwa_aln_pe (inBam: File, outSai1: File, index: Int) extends CommandLineFunction with ExternalCommonArgs { - @Input(doc="bam file to be aligned") var bam = inBam - @Output(doc="output sai file for 1st mating pair") var sai = outSai1 - def commandLine = bwaPath + " aln -t " + bwaThreads + " -q 5 " + reference + " -b" + index + " " + bam + " > " + sai - this.analysisName = queueLogDir + outSai1 + ".bwa_aln_pe1" - this.jobName = queueLogDir + outSai1 + ".bwa_aln_pe1" - } - - case class bwa_sam_se (inBam: File, inSai: File, outBam: File) extends CommandLineFunction with ExternalCommonArgs { - @Input(doc="bam file to be aligned") var bam = inBam - @Input(doc="bwa alignment index file") var sai = inSai - @Output(doc="output aligned bam file") var alignedBam = outBam - def commandLine = bwaPath + " samse " + reference + " " + sai + " " + bam + " > " + alignedBam - this.memoryLimit = 6 - this.analysisName = queueLogDir + outBam + ".bwa_sam_se" - this.jobName = queueLogDir + outBam + ".bwa_sam_se" - } - - case class bwa_sam_pe (inBam: File, inSai1: File, inSai2:File, outBam: File) extends CommandLineFunction with ExternalCommonArgs { - @Input(doc="bam file to be aligned") var bam = inBam - @Input(doc="bwa alignment index file for 1st mating pair") var sai1 = inSai1 - @Input(doc="bwa alignment index file for 2nd mating pair") var sai2 = inSai2 - @Output(doc="output aligned bam file") var alignedBam = outBam - def commandLine = bwaPath + " sampe " + reference + " " + sai1 + " " + sai2 + " " + bam + " " + bam + " > " + alignedBam - this.memoryLimit = 6 - this.analysisName = queueLogDir + outBam + ".bwa_sam_pe" - this.jobName = queueLogDir + outBam + ".bwa_sam_pe" - } - - case class bwa_sw (inFastQ: File, outBam: File) extends CommandLineFunction with ExternalCommonArgs { - @Input(doc="fastq file to be aligned") var fq = inFastQ - @Output(doc="output bam file") var bam = outBam - def commandLine = bwaPath + " bwasw -t " + bwaThreads + " " + reference + " " + fq + " > " + bam - this.analysisName = queueLogDir + outBam + ".bwasw" - this.jobName = queueLogDir + outBam + ".bwasw" - } - - case class writeList(inBams: Seq[File], outBamList: File) extends ListWriterFunction { - this.inputFiles = inBams - this.listFile = outBamList - this.analysisName = queueLogDir + outBamList + ".bamList" - this.jobName = queueLogDir + outBamList + ".bamList" - } -} diff --git a/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/MethodsDevelopmentCallingPipeline.scala b/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/MethodsDevelopmentCallingPipeline.scala deleted file mode 100755 index b860358ca..000000000 --- a/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/MethodsDevelopmentCallingPipeline.scala +++ /dev/null @@ -1,373 +0,0 @@ -package org.broadinstitute.sting.queue.qscripts - -import org.broadinstitute.sting.queue.extensions.gatk._ -import org.broadinstitute.sting.queue.QScript -import org.broadinstitute.sting.gatk.phonehome.GATKRunReport - -class MethodsDevelopmentCallingPipeline extends QScript { - qscript => - - @Argument(shortName="outputDir", doc="output directory", required=false) - var outputDir: String = "./" - - @Argument(shortName="skipCalling", doc="skip the calling part of the pipeline and only run VQSR on preset, gold standard VCF files", required=false) - var skipCalling: Boolean = false - - @Argument(shortName="dataset", doc="selects the datasets to run. If not provided, all datasets will be used", required=false) - var datasets: List[String] = Nil - - @Argument(shortName="runGoldStandard", doc="run the pipeline with the goldstandard VCF files for comparison", required=false) - var runGoldStandard: Boolean = false - - @Argument(shortName="noBAQ", doc="turns off BAQ calculation", required=false) - var noBAQ: Boolean = false - - @Argument(shortName="noIndels", doc="do not call indels with the Unified Genotyper", required=false) - var noIndels: Boolean = false - - @Argument(shortName="mbq", doc="The minimum Phred-Scaled quality score threshold to be considered a good base.", required=false) - var minimumBaseQuality: Int = -1 - - @Argument(shortName="deletions", doc="Maximum deletion fraction allowed at a site to call a genotype.", required=false) - var deletions: Double = -1 - - @Argument(shortName="sample", doc="Samples to include in Variant Eval", required=false) - var samples: List[String] = Nil - - class Target( - val baseName: String, - val reference: File, - val dbsnpFile: String, - val hapmapFile: String, - val maskFile: String, - val bamList: File, - val goldStandard_VCF: File, - val intervals: String, - val indelTranchTarget: Double, - val snpTrancheTarget: Double, - val isLowpass: Boolean, - val isExome: Boolean, - val nSamples: Int) { - val name = qscript.outputDir + baseName - val clusterFile = new File(name + ".clusters") - val rawSnpVCF = new File(name + ".raw.vcf") - val rawIndelVCF = new File(name + ".raw.indel.vcf") - val filteredIndelVCF = new File(name + ".filtered.indel.vcf") - val recalibratedSnpVCF = new File(name + ".snp.recalibrated.vcf") - val recalibratedIndelVCF = new File(name + ".indel.recalibrated.vcf") - val tranchesSnpFile = new File(name + ".snp.tranches") - val tranchesIndelFile = new File(name + ".indel.tranches") - val vqsrSnpRscript = name + ".snp.vqsr.r" - val vqsrIndelRscript = name + ".indel.vqsr.r" - val recalSnpFile = new File(name + ".snp.tranches.recal") - val recalIndelFile = new File(name + ".indel.tranches.recal") - val goldStandardRecalibratedVCF = new File(name + "goldStandard.recalibrated.vcf") - val goldStandardTranchesFile = new File(name + "goldStandard.tranches") - val goldStandardRecalFile = new File(name + "goldStandard.tranches.recal") - val evalFile = new File(name + ".snp.eval") - val evalIndelFile = new File(name + ".indel.eval") - val goldStandardName = qscript.outputDir + "goldStandard/" + baseName - val goldStandardClusterFile = new File(goldStandardName + ".clusters") - } - - val b37_decoy = new File("/humgen/1kg/reference/human_g1k_v37_decoy.fasta") - val hg19 = new File("/seq/references/Homo_sapiens_assembly19/v1/Homo_sapiens_assembly19.fasta") - val hg18 = new File("/seq/references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta") - val b36 = new File("/humgen/1kg/reference/human_b36_both.fasta") - val b37 = new File("/humgen/1kg/reference/human_g1k_v37.fasta") - val dbSNP_hg18_129 = "/humgen/gsa-hpprojects/GATK/data/Comparisons/Validated/dbSNP/dbsnp_129_hg18.rod" // Special case for NA12878 collections that can't use 132 because they are part of it. - val dbSNP_b36 = "/humgen/gsa-hpprojects/GATK/data/Comparisons/Validated/dbSNP/dbsnp_132.b36.excluding_sites_after_129.vcf" - val dbSNP_b37 = "/humgen/gsa-hpprojects/GATK/data/Comparisons/Validated/dbSNP/dbsnp_129_b37.leftAligned.vcf" // Special case for NA12878 collections that can't use 132 because they are part of it. - val hapmap_hg18 = "/humgen/gsa-hpprojects/GATK/data/Comparisons/Validated/HapMap/3.3/sites_r27_nr.hg18_fwd.vcf" - val hapmap_b36 = "/humgen/gsa-hpprojects/GATK/data/Comparisons/Validated/HapMap/3.3/sites_r27_nr.b36_fwd.vcf" - val hapmap_b37 = "/humgen/gsa-hpprojects/GATK/data/Comparisons/Validated/HapMap/3.3/sites_r27_nr.b37_fwd.vcf" - val training_hapmap_b37 = "/humgen/1kg/processing/pipeline_test_bams/hapmap3.3_training_chr20.vcf" - val omni_b36 = "/humgen/gsa-hpprojects/GATK/data/Comparisons/Validated/Omni2.5_chip/Omni25_sites_1525_samples.b36.vcf" - val omni_b37 = "/humgen/gsa-hpprojects/GATK/data/Comparisons/Validated/Omni2.5_chip/Omni25_sites_1525_samples.b37.vcf" - val indelMask_b36 = "/humgen/1kg/processing/pipeline_test_bams/pilot1.dindel.mask.b36.bed" - val indelMask_b37 = "/humgen/1kg/processing/pipeline_test_bams/pilot1.dindel.mask.b37.bed" - val training_1000G = "/humgen/1kg/processing/official_release/phase1/projectConsensus/phase1.wgs.projectConsensus.v2b.recal.highQuality.vcf" - val badSites_1000G = "/humgen/1kg/processing/official_release/phase1/projectConsensus/phase1.wgs.projectConsensus.v2b.recal.terrible.vcf" - val projectConsensus_1000G = "/humgen/1kg/processing/official_release/phase1/projectConsensus/ALL.wgs.projectConsensus_v2b.20101123.snps.sites.vcf" - val indelGoldStandardCallset = "/humgen/gsa-hpprojects/GATK/data/Comparisons/Unvalidated/GoldStandardIndel/gold.standard.indel.MillsAnd1000G.b37.vcf" - - val lowPass: Boolean = true - val exome: Boolean = true - val indels: Boolean = true - - val queueLogDir = ".qlog/" - - // BUGBUG: We no longer support b36/hg18 because several of the necessary files aren't available aligned to those references - - val targetDataSets: Map[String, Target] = Map( - "NA12878_gold" -> new Target("NA12878.goldStandard", hg19, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/humgen/gsa-hpprojects/dev/carneiro/NA12878/data/goldStandard.list"), - new File("/humgen/gsa-hpprojects/dev/carneiro/NA12878/analysis/snps/NA12878.HiSeq19.filtered.vcf"), // ** There is no gold standard for the gold standard ** - "/humgen/1kg/processing/pipeline_test_bams/whole_genome_chunked.noChrY.hg19.intervals", 90.0, 99.0, lowPass, !exome, 391), - "NA12878_wgs_b37" -> new Target("NA12878.HiSeq.WGS.b37", hg19, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/humgen/gsa-hpprojects/NA12878Collection/bams/NA12878.HiSeq.WGS.bwa.cleaned.recal.hg19.bam"), - new File("/humgen/gsa-hpprojects/dev/carneiro/NA12878/analysis/snps/NA12878.HiSeq19.filtered.vcf"), - "/humgen/1kg/processing/pipeline_test_bams/whole_genome_chunked.noChrY.hg19.intervals", 90.0, 99.0, !lowPass, !exome, 1), - "NA12878_wgs_decoy" -> new Target("NA12878.HiSeq.WGS.b37_decoy", b37_decoy, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/humgen/gsa-hpprojects/NA12878Collection/bams/CEUTrio.HiSeq.WGS.b37_decoy.NA12878.clean.dedup.recal.bam"), - new File("/humgen/gsa-hpprojects/dev/carneiro/NA12878/analysis/snps/NA12878.HiSeq19.filtered.vcf"), // ** THIS GOLD STANDARD NEEDS TO BE CORRECTED ** - "/humgen/1kg/processing/pipeline_test_bams/whole_genome_chunked.noChrY.hg19.intervals", 90.0, 99.0, !lowPass, !exome, 1), - "NA12878_wgs_hg18" -> new Target("NA12878.HiSeq.WGS.hg18", hg18, dbSNP_hg18_129, hapmap_hg18, - "/humgen/gsa-hpprojects/dev/depristo/oneOffProjects/1000GenomesProcessingPaper/wgs.v13/HiSeq.WGS.cleaned.indels.10.mask", - new File("/humgen/gsa-hpprojects/NA12878Collection/bams/NA12878.HiSeq.WGS.bwa.cleaned.recal.bam"), - new File("/home/radon01/depristo/work/oneOffProjects/1000GenomesProcessingPaper/wgs.v13/HiSeq.WGS.cleaned.ug.snpfiltered.indelfiltered.vcf"), - "/humgen/1kg/processing/pipeline_test_bams/whole_genome_chunked.hg18.intervals", 90.0, 99.0, !lowPass, !exome, 1), - "NA12878_wex_b37" -> new Target("NA12878.HiSeq.WEx.b37", hg19, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/seq/picard_aggregation/C339/NA12878/v3/NA12878.bam"), - new File("/humgen/gsa-hpprojects/dev/carneiro/trio/analysis/snps/CEUTrio.WEx.filtered.vcf"), // ** THIS GOLD STANDARD NEEDS TO BE CORRECTED ** - "/seq/references/HybSelOligos/whole_exome_agilent_1.1_refseq_plus_3_boosters/whole_exome_agilent_1.1_refseq_plus_3_boosters.Homo_sapiens_assembly19.targets.interval_list", 90.0, 98.0, !lowPass, exome, 1), - "NA12878_wex_hg18" -> new Target("NA12878.HiSeq.WEx.hg18", hg18, dbSNP_hg18_129, hapmap_hg18, - "/humgen/gsa-hpprojects/dev/depristo/oneOffProjects/1000GenomesProcessingPaper/wgs.v13/GA2.WEx.cleaned.indels.10.mask", - new File("/humgen/gsa-hpprojects/NA12878Collection/bams/NA12878.WEx.cleaned.recal.bam"), - new File("/home/radon01/depristo/work/oneOffProjects/1000GenomesProcessingPaper/wgs.v13/GA2.WEx.cleaned.ug.snpfiltered.indelfiltered.vcf"), - "/seq/references/HybSelOligos/whole_exome_agilent_1.1_refseq_plus_3_boosters/whole_exome_agilent_1.1_refseq_plus_3_boosters.targets.interval_list", 90.0, 98.0, !lowPass, exome, 1), - "NA12878_wex_decoy" -> new Target("NA12878.HiSeq.WEx.b37_decoy", b37_decoy, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/humgen/gsa-hpprojects/NA12878Collection/bams/CEUTrio.HiSeq.WEx.b37_decoy.NA12878.clean.dedup.recal.bam"), - new File("/humgen/gsa-hpprojects/dev/carneiro/trio/analysis/snps/CEUTrio.WEx.filtered.vcf"), // ** THIS GOLD STANDARD NEEDS TO BE CORRECTED ** - "/seq/references/HybSelOligos/whole_exome_agilent_1.1_refseq_plus_3_boosters/whole_exome_agilent_1.1_refseq_plus_3_boosters.Homo_sapiens_assembly19.targets.interval_list", 90.0, 98.0, !lowPass, exome, 1), - "CEUTrio_wex_b37" -> new Target("CEUTrio.HiSeq.WEx.b37", hg19, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/humgen/gsa-hpprojects/NA12878Collection/bams/CEUTrio.HiSeq.WEx.bwa.cleaned.recal.bam"), - new File("/humgen/gsa-hpprojects/dev/carneiro/trio/analysis/snps/CEUTrio.WEx.filtered.vcf"), - "/seq/references/HybSelOligos/whole_exome_agilent_1.1_refseq_plus_3_boosters/whole_exome_agilent_1.1_refseq_plus_3_boosters.Homo_sapiens_assembly19.targets.interval_list", 90.0, 98.0, !lowPass, exome, 3), - "CEUTrio_wgs_b37" -> new Target("CEUTrio.HiSeq.WGS.b37", hg19, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/humgen/gsa-hpprojects/NA12878Collection/bams/CEUTrio.HiSeq.WGS.bwa.cleaned.recal.bam"), - new File("/humgen/gsa-hpprojects/dev/carneiro/trio/analysis/snps/CEUTrio.WEx.filtered.vcf"), // ** THIS GOLD STANDARD NEEDS TO BE CORRECTED ** - "/humgen/1kg/processing/pipeline_test_bams/whole_genome_chunked.hg19.intervals", 90.0, 99.0, !lowPass, !exome, 3), - "CEUTrio_wex_decoy" -> new Target("CEUTrio.HiSeq.WEx.b37_decoy", b37_decoy, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/humgen/gsa-hpprojects/NA12878Collection/bams/CEUTrio.HiSeq.WEx.b37_decoy.list"), - new File("/humgen/gsa-hpprojects/dev/carneiro/trio/analysis/snps/CEUTrio.WEx.filtered.vcf"), // ** THIS GOLD STANDARD NEEDS TO BE CORRECTED ** - "/seq/references/HybSelOligos/whole_exome_agilent_1.1_refseq_plus_3_boosters/whole_exome_agilent_1.1_refseq_plus_3_boosters.Homo_sapiens_assembly19.targets.interval_list", 90.0, 98.0, !lowPass, exome, 3), - "CEUTrio_wgs_decoy" -> new Target("CEUTrio.HiSeq.WGS.b37_decoy", b37_decoy, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/humgen/gsa-hpprojects/NA12878Collection/bams/CEUTrio.HiSeq.WGS.b37_decoy.list"), - new File("/humgen/gsa-hpprojects/dev/carneiro/trio/analysis/snps/CEUTrio.WEx.filtered.vcf"), // ** THIS GOLD STANDARD NEEDS TO BE CORRECTED ** - "/humgen/1kg/processing/pipeline_test_bams/whole_genome_chunked.hg19.intervals", 90.0, 99.0, !lowPass, !exome, 3), - "GA2hg19" -> new Target("NA12878.GA2.hg19", hg19, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/humgen/gsa-hpprojects/NA12878Collection/bams/NA12878.GA2.WGS.bwa.cleaned.hg19.bam"), - new File("/humgen/gsa-hpprojects/dev/carneiro/NA12878/analysis/snps/NA12878.GA2.hg19.filtered.vcf"), - "/humgen/1kg/processing/pipeline_test_bams/whole_genome_chunked.hg19.intervals", 90.0, 99.0, !lowPass, !exome, 1), - "FIN" -> new Target("FIN", b37, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/humgen/1kg/processing/pipeline_test_bams/FIN.79sample.Nov2010.chr20.bam"), - new File("/humgen/gsa-hpprojects/dev/data/AugChr20Calls_v4_3state/ALL.august.v4.chr20.filtered.vcf"), // ** THIS GOLD STANDARD NEEDS TO BE CORRECTED ** - "/humgen/1kg/processing/pipeline_test_bams/whole_genome_chunked.chr20.hg19.intervals", 90.0, 99.0, lowPass, !exome, 79), - "TGPWExGdA" -> new Target("1000G.WEx.GdA", b37, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/humgen/1kg/processing/pipeline_test_bams/Barcoded_1000G_WEx_Reduced_Plate_1.cleaned.list"), // BUGBUG: reduce from 60 to 20 people - new File("/humgen/gsa-scr1/delangel/NewUG/calls/AugustRelease.filtered_Q50_QD5.0_SB0.0.allSamples.SNPs_hg19.WEx_UG_newUG_MQC.vcf"), // ** THIS GOLD STANDARD NEEDS TO BE CORRECTED ** - "/seq/references/HybSelOligos/whole_exome_agilent_1.1_refseq_plus_3_boosters/whole_exome_agilent_1.1_refseq_plus_3_boosters.Homo_sapiens_assembly19.targets.interval_list", 90.0, 99.0, !lowPass, exome, 96), - "LowPassN60" -> new Target("lowpass.N60", b36, dbSNP_b36, hapmap_b36, indelMask_b36, - new File("/humgen/1kg/analysis/bamsForDataProcessingPapers/lowpass_b36/lowpass.chr20.cleaned.matefixed.bam"), // the bam list to call from - new File("/home/radon01/depristo/work/oneOffProjects/VQSRCutByNRS/lowpass.N60.chr20.filtered.vcf"), // the gold standard VCF file to run through the VQSR - "/humgen/1kg/processing/pipeline_test_bams/whole_genome_chunked.chr20.b36.intervals", 90.0, 99.0, lowPass, !exome, 60), // chunked interval list to use with Queue's scatter/gather functionality - "LowPassEUR363Nov" -> new Target("EUR.nov2010", b37, dbSNP_b37, hapmap_b37, indelMask_b37, - new File("/humgen/1kg/processing/pipeline_test_bams/EUR.363sample.Nov2010.chr20.bam"), - new File("/humgen/gsa-hpprojects/dev/data/AugChr20Calls_v4_3state/ALL.august.v4.chr20.filtered.vcf"), // ** THIS GOLD STANDARD NEEDS TO BE CORRECTED ** - "/humgen/1kg/processing/pipeline_test_bams/whole_genome_chunked.chr20.hg19.intervals", 90.0, 99.0, lowPass, !exome, 363) - ) - - - def script = { - - // Selects the datasets in the -dataset argument and adds them to targets. - var targets: List[Target] = List() - if (!datasets.isEmpty) - for (ds <- datasets) - targets ::= targetDataSets(ds) - else // If -dataset is not specified, all datasets are used. - for (targetDS <- targetDataSets.valuesIterator) - targets ::= targetDS - - val goldStandard = true - for (target <- targets) { - if( !skipCalling ) { - if (!noIndels) add(new indelCall(target), new indelRecal(target), new indelCut(target), new indelEvaluation(target)) - add(new snpCall(target)) - add(new snpRecal(target, !goldStandard)) - add(new snpCut(target, !goldStandard)) - add(new snpEvaluation(target)) - } - if ( runGoldStandard ) { - add(new snpRecal(target, goldStandard)) - add(new snpCut(target, goldStandard)) - } - } - } - - - trait UNIVERSAL_GATK_ARGS extends CommandLineGATK { - logging_level = "INFO"; - memoryLimit = 4; - phone_home = GATKRunReport.PhoneHomeOption.NO_ET - } - - def bai(bam: File) = new File(bam + ".bai") - - // 1.) Unified Genotyper Base - class GenotyperBase (t: Target) extends UnifiedGenotyper with UNIVERSAL_GATK_ARGS { - this.reference_sequence = t.reference - this.intervalsString ++= List(t.intervals) - this.scatterCount = 140 - this.nt = 2 - this.dcov = if ( t.isLowpass ) { 50 } else { 250 } - this.stand_call_conf = if ( t.isLowpass ) { 4.0 } else { 30.0 } - this.stand_emit_conf = if ( t.isLowpass ) { 4.0 } else { 30.0 } - this.input_file :+= t.bamList - this.D = new File(t.dbsnpFile) - } - - // 1a.) Call SNPs with UG - class snpCall (t: Target) extends GenotyperBase(t) { - if (minimumBaseQuality >= 0) - this.min_base_quality_score = minimumBaseQuality - if (qscript.deletions >= 0) - this.max_deletion_fraction = qscript.deletions - this.out = t.rawSnpVCF - this.glm = org.broadinstitute.sting.gatk.walkers.genotyper.GenotypeLikelihoodsCalculationModel.Model.SNP - this.baq = if (noBAQ || t.isExome) {org.broadinstitute.sting.utils.baq.BAQ.CalculationMode.OFF} else {org.broadinstitute.sting.utils.baq.BAQ.CalculationMode.CALCULATE_AS_NECESSARY} - this.analysisName = t.name + "_UGs" - this.jobName = queueLogDir + t.name + ".snpcall" - } - - // 1b.) Call Indels with UG - class indelCall (t: Target) extends GenotyperBase(t) { - this.memoryLimit = 6 - this.out = t.rawIndelVCF - this.glm = org.broadinstitute.sting.gatk.walkers.genotyper.GenotypeLikelihoodsCalculationModel.Model.INDEL - this.baq = org.broadinstitute.sting.utils.baq.BAQ.CalculationMode.OFF - this.analysisName = t.name + "_UGi" - this.jobName = queueLogDir + t.name + ".indelcall" - } - - // 2.) Hard Filtering for indels - class indelFilter (t: Target) extends VariantFiltration with UNIVERSAL_GATK_ARGS { - this.memoryLimit = 2 - this.reference_sequence = t.reference - this.intervalsString ++= List(t.intervals) - this.scatterCount = 10 - this.V = t.rawIndelVCF - this.out = t.filteredIndelVCF - this.filterName ++= List("IndelQD", "IndelReadPosRankSum", "IndelFS") - this.filterExpression ++= List("QD < 2.0", "ReadPosRankSum < -20.0", "FS > 200.0") - if (t.nSamples >= 10) { - this.filterName ++= List("IndelInbreedingCoeff") - this.filterExpression ++= List("InbreedingCoeff < -0.8") - } - this.analysisName = t.name + "_VF" - this.jobName = queueLogDir + t.name + ".indelfilter" - } - - class VQSRBase(t: Target) extends VariantRecalibrator with UNIVERSAL_GATK_ARGS { - this.nt = 2 - this.reference_sequence = t.reference - this.intervalsString ++= List(t.intervals) - this.allPoly = true - this.tranche ++= List("100.0", "99.9", "99.5", "99.3", "99.0", "98.9", "98.8", "98.5", "98.4", "98.3", "98.2", "98.1", "98.0", "97.9", "97.8", "97.5", "97.0", "95.0", "90.0") - } - - class snpRecal(t: Target, goldStandard: Boolean) extends VQSRBase(t) with UNIVERSAL_GATK_ARGS { - this.input :+= ( if ( goldStandard ) { t.goldStandard_VCF } else { t.rawSnpVCF } ) - this.resource :+= new TaggedFile( t.hapmapFile, "known=false,training=true,truth=true,prior=15.0" ) - this.resource :+= new TaggedFile( omni_b37, "known=false,training=true,truth=true,prior=12.0" ) - this.resource :+= new TaggedFile( training_1000G, "known=false,training=true,prior=10.0" ) - this.resource :+= new TaggedFile( t.dbsnpFile, "known=true,prior=2.0" ) - this.resource :+= new TaggedFile( projectConsensus_1000G, "prior=8.0" ) - this.use_annotation ++= List("QD", "HaplotypeScore", "MQRankSum", "ReadPosRankSum", "MQ", "FS") - if(t.nSamples >= 10) - this.use_annotation ++= List("InbreedingCoeff") // InbreedingCoeff is a population-wide statistic that requires at least 10 samples to calculate - if(!t.isExome) - this.use_annotation ++= List("DP") - else { // exome specific parameters - this.resource :+= new TaggedFile( badSites_1000G, "bad=true,prior=2.0" ) - this.mG = 6 - if(t.nSamples <= 3) { // very few exome samples means very few variants - this.mG = 4 - this.percentBad = 0.04 - } - } - this.tranches_file = if ( goldStandard ) { t.goldStandardTranchesFile } else { t.tranchesSnpFile } - this.recal_file = if ( goldStandard ) { t.goldStandardRecalFile } else { t.recalSnpFile } - this.rscript_file = t.vqsrSnpRscript - this.mode = org.broadinstitute.sting.gatk.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode.SNP - this.analysisName = t.name + "_VQSRs" - this.jobName = queueLogDir + t.name + ".snprecal" - } - - class indelRecal(t: Target) extends VQSRBase(t) with UNIVERSAL_GATK_ARGS { - this.input :+= t.rawIndelVCF - this.resource :+= new TaggedFile(indelGoldStandardCallset, "known=false,training=true,truth=true,prior=12.0" ) - this.resource :+= new TaggedFile( t.dbsnpFile, "known=true,prior=2.0" ) - this.use_annotation ++= List("QD", "HaplotypeScore", "ReadPosRankSum", "FS") - if(t.nSamples >= 10) - this.use_annotation ++= List("InbreedingCoeff") // InbreedingCoeff is a population-wide statistic that requires at least 10 samples to calculate - this.tranches_file = t.tranchesIndelFile - this.recal_file = t.recalIndelFile - this.rscript_file = t.vqsrIndelRscript - this.mode = org.broadinstitute.sting.gatk.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode.INDEL - this.analysisName = t.name + "_VQSRi" - this.jobName = queueLogDir + t.name + ".indelrecal" - } - - - // 4.) Apply the recalibration table to the appropriate tranches - class applyVQSRBase (t: Target) extends ApplyRecalibration with UNIVERSAL_GATK_ARGS { - this.memoryLimit = 6 - this.reference_sequence = t.reference - this.intervalsString ++= List(t.intervals) - } - - class snpCut (t: Target, goldStandard: Boolean) extends applyVQSRBase(t) { - this.input :+= ( if ( goldStandard ) { t.goldStandard_VCF } else { t.rawSnpVCF } ) - this.tranches_file = if ( goldStandard ) { t.goldStandardTranchesFile } else { t.tranchesSnpFile} - this.recal_file = if ( goldStandard ) { t.goldStandardRecalFile } else { t.recalSnpFile } - this.ts_filter_level = t.snpTrancheTarget - this.mode = org.broadinstitute.sting.gatk.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode.SNP - this.out = t.recalibratedSnpVCF - this.analysisName = t.name + "_AVQSRs" - this.jobName = queueLogDir + t.name + ".snpcut" - } - - class indelCut (t: Target) extends applyVQSRBase(t) { - this.input :+= t.rawIndelVCF - this.tranches_file = t.tranchesIndelFile - this.recal_file = t.recalIndelFile - this.ts_filter_level = t.indelTranchTarget - this.mode = org.broadinstitute.sting.gatk.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode.INDEL - this.out = t.recalibratedIndelVCF - this.analysisName = t.name + "_AVQSRi" - this.jobName = queueLogDir + t.name + ".indelcut" - } - - - // 5.) Variant Evaluation Base(OPTIONAL) - class EvalBase(t: Target) extends VariantEval with UNIVERSAL_GATK_ARGS { - this.memoryLimit = 3 - this.comp :+= new TaggedFile(t.hapmapFile, "hapmap" ) - this.D = new File(t.dbsnpFile) - this.reference_sequence = t.reference - this.intervalsString ++= List(t.intervals) - this.sample = samples - } - - // 5a.) SNP Evaluation (OPTIONAL) based on the cut vcf - class snpEvaluation(t: Target) extends EvalBase(t) { - if (t.reference == b37 || t.reference == hg19) this.comp :+= new TaggedFile( omni_b37, "omni" ) - this.eval :+= t.recalibratedSnpVCF - this.out = t.evalFile - this.analysisName = t.name + "_VEs" - this.jobName = queueLogDir + t.name + ".snpeval" - } - - // 5b.) Indel Evaluation (OPTIONAL) - class indelEvaluation(t: Target) extends EvalBase(t) { - this.eval :+= t.recalibratedIndelVCF - this.comp :+= new TaggedFile(indelGoldStandardCallset, "indelGS" ) - this.noEV = true - this.evalModule = List("CompOverlap", "CountVariants", "TiTvVariantEvaluator", "ValidationReport", "IndelStatistics") - this.out = t.evalIndelFile - this.analysisName = t.name + "_VEi" - this.jobName = queueLogDir + queueLogDir + t.name + ".indeleval" - } -} diff --git a/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/PacbioProcessingPipeline.scala b/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/PacbioProcessingPipeline.scala deleted file mode 100755 index ef73840b3..000000000 --- a/public/scala/qscript/org/broadinstitute/sting/queue/qscripts/PacbioProcessingPipeline.scala +++ /dev/null @@ -1,188 +0,0 @@ -package org.broadinstitute.sting.queue.qscripts - -import org.broadinstitute.sting.queue.QScript -import org.broadinstitute.sting.queue.util.QScriptUtils -import net.sf.samtools.SAMFileHeader.SortOrder -import org.broadinstitute.sting.utils.exceptions.UserException -import org.broadinstitute.sting.commandline.Hidden -import org.broadinstitute.sting.queue.extensions.picard.{ReorderSam, SortSam, AddOrReplaceReadGroups} -import org.broadinstitute.sting.queue.extensions.gatk._ - -/** - * Created by IntelliJ IDEA. - * User: carneiro - * Date: 4/20/11 - * Time: 16:29 PM - */ - - -class PacbioProcessingPipeline extends QScript { - - @Input(doc="input FASTA/FASTQ/BAM file - or list of FASTA/FASTQ/BAM files. ", shortName="i", required=true) - var input: File = _ - - @Input(doc="Reference fasta file", shortName="R", required=true) - var reference: File = _ - - @Input(doc="dbsnp VCF file to use ", shortName="D", required=true) - var dbSNP: File = _ - - @Argument(doc="Number of jobs to scatter/gather. Default: 0." , shortName = "sg", required=false) - var threads: Int = 0 - - @Argument(doc="Sample Name to fill in the Read Group information (only necessary if using fasta/fastq)" , shortName = "sn", required=false) - var sample: String = "NA" - - @Input(doc="The path to the binary of bwa to align fasta/fastq files", fullName="path_to_bwa", shortName="bwa", required=false) - var bwaPath: File = _ - - @Argument(doc="Input is a BLASR generated BAM file", shortName = "blasr", fullName="blasr_bam", required=false) - var BLASR_BAM: Boolean = false - - @Hidden - @Argument(doc="The default base qualities to use before recalibration. Default is Q20 (should be good for every dataset)." , shortName = "dbq", required=false) - var dbq: Int = 20 - - @Hidden - @Argument(shortName="bwastring", required=false) - var bwastring: String = "" - - @Hidden - @Argument(shortName = "test", fullName = "test_mode", required = false) - var testMode: Boolean = false - - val queueLogDir: String = ".qlog/" - - def script() { - - val fileList: Seq[File] = QScriptUtils.createSeqFromFile(input) - - for (file: File <- fileList) { - - var USE_BWA: Boolean = false - var resetQuals: Boolean = true - - if (file.endsWith(".fasta") || file.endsWith(".fq") || file.endsWith(".fastq")) { - if (bwaPath == null) { - throw new UserException("You provided a fasta/fastq file but didn't provide the path for BWA"); - } - USE_BWA = true - if (file.endsWith(".fq") || file.endsWith(".fastq")) - resetQuals = false - } - - // FASTA -> BAM steps - val alignedSam: File = file.getName + ".aligned.sam" - val sortedBam: File = swapExt(alignedSam, ".sam", ".bam") - val rgBam: File = swapExt(file, ".bam", ".rg.bam") - - val bamBase = if (USE_BWA) {rgBam} else {file} - - // BAM Steps - val mqBAM: File = swapExt(bamBase, ".bam", ".mq.bam") - val recalFile1: File = swapExt(bamBase, ".bam", ".recal1.table") - val recalFile2: File = swapExt(bamBase, ".bam", ".recal2.table") - val recalBam: File = swapExt(bamBase, ".bam", ".recal.bam") - val path1: String = recalBam + ".before" - val path2: String = recalBam + ".after" - - if (USE_BWA) { - add(align(file, alignedSam), - sortSam(alignedSam, sortedBam), - addReadGroup(sortedBam, rgBam, sample)) - } - - else if (BLASR_BAM) { - val reorderedBAM = swapExt(bamBase, ".bam", ".reordered.bam") - add(reorder(bamBase, reorderedBAM), - changeMQ(reorderedBAM, mqBAM)) - } - - val bam = if (BLASR_BAM) {mqBAM} else {bamBase} - - add(cov(bam, recalFile1, resetQuals), - recal(bam, recalFile1, recalBam), - cov(recalBam, recalFile2, false)) - } - } - - - // General arguments to non-GATK tools - trait ExternalCommonArgs extends CommandLineFunction { - this.memoryLimit = 4 - this.isIntermediate = true - } - - trait CommandLineGATKArgs extends CommandLineGATK with ExternalCommonArgs { - this.reference_sequence = reference - } - - - case class align(@Input inFastq: File, @Output outSam: File) extends ExternalCommonArgs { - def commandLine = bwaPath + " bwasw -b5 -q2 -r1 -z20 -t16 " + reference + " " + inFastq + " > " + outSam - this.memoryLimit = 8 - this.analysisName = queueLogDir + outSam + ".bwa_sam_se" - this.jobName = queueLogDir + outSam + ".bwa_sam_se" - } - - case class sortSam (inSam: File, outBam: File) extends SortSam with ExternalCommonArgs { - this.input = List(inSam) - this.output = outBam - this.memoryLimit = 8 - this.sortOrder = SortOrder.coordinate - this.analysisName = queueLogDir + outBam + ".sortSam" - this.jobName = queueLogDir + outBam + ".sortSam" - } - - case class reorder (inSam: File, outSam: File) extends ReorderSam with ExternalCommonArgs { - this.input = List(inSam) - this.output = outSam - this.sortReference = reference - } - - case class changeMQ(inBam: File, outBam: File) extends PrintReads with CommandLineGATKArgs { - this.input_file :+= inBam - this.out = outBam - this.read_filter :+= "ReassignMappingQuality" - } - - case class addReadGroup (inBam: File, outBam: File, sample: String) extends AddOrReplaceReadGroups with ExternalCommonArgs { - @Output(doc="output bai file") var bai = swapExt(outBam, ".bam", ".bai") - this.input = List(inBam) - this.output = outBam - this.RGID = "1" - this.RGCN = "BI" - this.RGPL = "PacBio_RS" - this.RGSM = sample - this.RGLB = "default_library" - this.RGPU = "default_pu" - this.analysisName = queueLogDir + outBam + ".rg" - this.jobName = queueLogDir + outBam + ".rg" - } - - case class cov (inBam: File, outRecalFile: File, resetQuals: Boolean) extends BaseRecalibrator with CommandLineGATKArgs { - if (resetQuals) - this.DBQ = dbq - this.knownSites :+= dbSNP - this.covariate ++= List("ReadGroupCovariate", "QualityScoreCovariate", "CycleCovariate", "ContextCovariate") - this.input_file :+= inBam - this.disable_indel_quals = true - this.out = outRecalFile - this.analysisName = queueLogDir + outRecalFile + ".covariates" - this.jobName = queueLogDir + outRecalFile + ".covariates" - this.scatterCount = threads - this.read_filter :+= "BadCigar" - } - - case class recal (inBam: File, inRecalFile: File, outBam: File) extends PrintReads with CommandLineGATKArgs { - this.DBQ = dbq - this.input_file :+= inBam - this.BQSR = inRecalFile - this.out = outBam - this.isIntermediate = false - this.analysisName = queueLogDir + outBam + ".recalibration" - this.jobName = queueLogDir + outBam + ".recalibration" - this.read_filter :+= "BadCigar" - this.scatterCount = threads - } -} From a0219acfaab515db23864972fcdbcd81bd504487 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Mon, 7 Jan 2013 14:55:21 -0500 Subject: [PATCH 07/25] Collapse the PerReadAlleleLikelihoodMap classes into 1 now that Lite is gone --- .../gatk/walkers/genotyper/ErrorModel.java | 2 +- ...dyGenotypeLikelihoodsCalculationModel.java | 3 +- ...elGenotypeLikelihoodsCalculationModel.java | 2 +- ...NPGenotypeLikelihoodsCalculationModel.java | 2 +- .../haplotypecaller/GenotypingEngine.java | 4 +- .../LikelihoodCalculationEngine.java | 2 +- .../AdvancedPerReadAlleleLikelihoodMap.java | 71 ------------------- .../genotyper/PerReadAlleleLikelihoodMap.java | 54 +++++++++----- .../StandardPerReadAlleleLikelihoodMap.java | 46 ------------ 9 files changed, 44 insertions(+), 142 deletions(-) delete mode 100644 protected/java/src/org/broadinstitute/sting/utils/genotyper/AdvancedPerReadAlleleLikelihoodMap.java rename {public => protected}/java/src/org/broadinstitute/sting/utils/genotyper/PerReadAlleleLikelihoodMap.java (69%) delete mode 100644 public/java/src/org/broadinstitute/sting/utils/genotyper/StandardPerReadAlleleLikelihoodMap.java diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ErrorModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ErrorModel.java index 30650e9c0..e51e41e88 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ErrorModel.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/ErrorModel.java @@ -60,7 +60,7 @@ public class ErrorModel { boolean hasCalledAlleles = false; - final PerReadAlleleLikelihoodMap perReadAlleleLikelihoodMap = PerReadAlleleLikelihoodMap.getBestAvailablePerReadAlleleLikelihoodMap(); + final PerReadAlleleLikelihoodMap perReadAlleleLikelihoodMap = new PerReadAlleleLikelihoodMap(); if (refSampleVC != null) { for (Allele allele : refSampleVC.getAlleles()) { diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidyGenotypeLikelihoodsCalculationModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidyGenotypeLikelihoodsCalculationModel.java index ce66ce8d0..2788f201c 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidyGenotypeLikelihoodsCalculationModel.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidyGenotypeLikelihoodsCalculationModel.java @@ -31,6 +31,7 @@ import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.GenomeLocParser; import org.broadinstitute.sting.utils.MathUtils; +import org.broadinstitute.sting.utils.genotyper.PerReadAlleleLikelihoodMap; import org.broadinstitute.variant.vcf.VCFConstants; import org.broadinstitute.sting.utils.collections.Pair; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; @@ -231,7 +232,7 @@ public abstract class GeneralPloidyGenotypeLikelihoodsCalculationModel extends G ReadBackedPileup pileup = AlignmentContextUtils.stratify(sample.getValue(), contextType).getBasePileup(); if (!perReadAlleleLikelihoodMap.containsKey(sample.getKey())){ // no likelihoods have been computed for this sample at this site - perReadAlleleLikelihoodMap.put(sample.getKey(), org.broadinstitute.sting.utils.genotyper.PerReadAlleleLikelihoodMap.getBestAvailablePerReadAlleleLikelihoodMap()); + perReadAlleleLikelihoodMap.put(sample.getKey(), new PerReadAlleleLikelihoodMap()); } // create the GenotypeLikelihoods object diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java index 56965c022..ce59a90fc 100755 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsCalculationModel.java @@ -119,7 +119,7 @@ public class IndelGenotypeLikelihoodsCalculationModel extends GenotypeLikelihood if (!perReadAlleleLikelihoodMap.containsKey(sample.getKey())){ // no likelihoods have been computed for this sample at this site - perReadAlleleLikelihoodMap.put(sample.getKey(), PerReadAlleleLikelihoodMap.getBestAvailablePerReadAlleleLikelihoodMap()); + perReadAlleleLikelihoodMap.put(sample.getKey(), new PerReadAlleleLikelihoodMap()); } final ReadBackedPileup pileup = context.getBasePileup(); if (pileup != null) { diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java index c10f7264e..80a787fe0 100755 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java @@ -55,7 +55,7 @@ public class SNPGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoodsC protected SNPGenotypeLikelihoodsCalculationModel(UnifiedArgumentCollection UAC, Logger logger) { super(UAC, logger); useAlleleFromVCF = UAC.GenotypingMode == GENOTYPING_MODE.GENOTYPE_GIVEN_ALLELES; - perReadAlleleLikelihoodMap = PerReadAlleleLikelihoodMap.getBestAvailablePerReadAlleleLikelihoodMap(); + perReadAlleleLikelihoodMap = new PerReadAlleleLikelihoodMap(); } public VariantContext getLikelihoods(final RefMetaDataTracker tracker, diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java index 8b7b0b918..0c7e43525 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java @@ -223,7 +223,7 @@ public class GenotypingEngine { final Map returnMap = new HashMap(); final GenomeLoc callLoc = parser.createGenomeLoc(call); for( final Map.Entry sample : perSampleReadMap.entrySet() ) { - final PerReadAlleleLikelihoodMap likelihoodMap = PerReadAlleleLikelihoodMap.getBestAvailablePerReadAlleleLikelihoodMap(); + final PerReadAlleleLikelihoodMap likelihoodMap = new PerReadAlleleLikelihoodMap(); for( final Map.Entry> mapEntry : sample.getValue().getLikelihoodReadMap().entrySet() ) { // only count the read if it overlaps the event, otherwise it is not added to the output read list at all @@ -277,7 +277,7 @@ public class GenotypingEngine { final Map alleleReadMap = new HashMap(); for( final Map.Entry haplotypeReadMapEntry : haplotypeReadMap.entrySet() ) { // for each sample - final PerReadAlleleLikelihoodMap perReadAlleleLikelihoodMap = PerReadAlleleLikelihoodMap.getBestAvailablePerReadAlleleLikelihoodMap(); + final PerReadAlleleLikelihoodMap perReadAlleleLikelihoodMap = new PerReadAlleleLikelihoodMap(); for( final Map.Entry> alleleMapperEntry : alleleMapper.entrySet() ) { // for each output allele final List mappedHaplotypes = alleleMapperEntry.getValue(); for( final Map.Entry> readEntry : haplotypeReadMapEntry.getValue().getLikelihoodReadMap().entrySet() ) { // for each read diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LikelihoodCalculationEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LikelihoodCalculationEngine.java index 1be484075..8e90285d9 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LikelihoodCalculationEngine.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LikelihoodCalculationEngine.java @@ -104,7 +104,7 @@ public class LikelihoodCalculationEngine { private PerReadAlleleLikelihoodMap computeReadLikelihoods( final ArrayList haplotypes, final ArrayList reads) { - final PerReadAlleleLikelihoodMap perReadAlleleLikelihoodMap = PerReadAlleleLikelihoodMap.getBestAvailablePerReadAlleleLikelihoodMap(); + final PerReadAlleleLikelihoodMap perReadAlleleLikelihoodMap = new PerReadAlleleLikelihoodMap(); final int numHaplotypes = haplotypes.size(); for( final GATKSAMRecord read : reads ) { final byte[] overallGCP = new byte[read.getReadLength()]; diff --git a/protected/java/src/org/broadinstitute/sting/utils/genotyper/AdvancedPerReadAlleleLikelihoodMap.java b/protected/java/src/org/broadinstitute/sting/utils/genotyper/AdvancedPerReadAlleleLikelihoodMap.java deleted file mode 100644 index 4a13fb615..000000000 --- a/protected/java/src/org/broadinstitute/sting/utils/genotyper/AdvancedPerReadAlleleLikelihoodMap.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2011 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -package org.broadinstitute.sting.utils.genotyper; - - -import org.broadinstitute.sting.gatk.downsampling.AlleleBiasedDownsamplingUtils; -import org.broadinstitute.sting.utils.classloader.ProtectedPackageSource; -import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; -import org.broadinstitute.sting.utils.sam.GATKSAMRecord; -import org.broadinstitute.variant.variantcontext.Allele; - -import java.io.PrintStream; -import java.util.*; - -public class AdvancedPerReadAlleleLikelihoodMap extends StandardPerReadAlleleLikelihoodMap implements ProtectedPackageSource { - - public ReadBackedPileup createPerAlleleDownsampledBasePileup(final ReadBackedPileup pileup, final double downsamplingFraction, final PrintStream log) { - return AlleleBiasedDownsamplingUtils.createAlleleBiasedBasePileup(pileup, downsamplingFraction, log); - } - - public void performPerAlleleDownsampling(final double downsamplingFraction, final PrintStream log) { - // special case removal of all or no reads - if ( downsamplingFraction <= 0.0 ) - return; - if ( downsamplingFraction >= 1.0 ) { - likelihoodReadMap.clear(); - return; - } - - // start by stratifying the reads by the alleles they represent at this position - final Map> alleleReadMap = new HashMap>(alleles.size()); - for ( Allele allele : alleles ) - alleleReadMap.put(allele, new ArrayList()); - - for ( Map.Entry> entry : likelihoodReadMap.entrySet() ) { - // do not remove reduced reads! - if ( !entry.getKey().isReducedRead() ) { - final Allele bestAllele = getMostLikelyAllele(entry.getValue()); - if ( bestAllele != Allele.NO_CALL ) - alleleReadMap.get(bestAllele).add(entry.getKey()); - } - } - - // compute the reads to remove and actually remove them - final List readsToRemove = AlleleBiasedDownsamplingUtils.selectAlleleBiasedReads(alleleReadMap, downsamplingFraction, log); - for ( final GATKSAMRecord read : readsToRemove ) - likelihoodReadMap.remove(read); - } -} diff --git a/public/java/src/org/broadinstitute/sting/utils/genotyper/PerReadAlleleLikelihoodMap.java b/protected/java/src/org/broadinstitute/sting/utils/genotyper/PerReadAlleleLikelihoodMap.java similarity index 69% rename from public/java/src/org/broadinstitute/sting/utils/genotyper/PerReadAlleleLikelihoodMap.java rename to protected/java/src/org/broadinstitute/sting/utils/genotyper/PerReadAlleleLikelihoodMap.java index ff85c33a0..5dcd5eb6c 100644 --- a/public/java/src/org/broadinstitute/sting/utils/genotyper/PerReadAlleleLikelihoodMap.java +++ b/protected/java/src/org/broadinstitute/sting/utils/genotyper/PerReadAlleleLikelihoodMap.java @@ -25,26 +25,23 @@ package org.broadinstitute.sting.utils.genotyper; -import org.broadinstitute.sting.utils.classloader.GATKLiteUtils; -import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; +import org.broadinstitute.sting.gatk.downsampling.AlleleBiasedDownsamplingUtils; import org.broadinstitute.sting.utils.pileup.PileupElement; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; import org.broadinstitute.sting.utils.sam.GATKSAMRecord; import org.broadinstitute.variant.variantcontext.Allele; import java.io.PrintStream; -import java.lang.reflect.Constructor; import java.util.*; -public abstract class PerReadAlleleLikelihoodMap { +public class PerReadAlleleLikelihoodMap { public static final double INFORMATIVE_LIKELIHOOD_THRESHOLD = 0.2; protected List alleles; protected Map> likelihoodReadMap; - public abstract void performPerAlleleDownsampling(final double downsamplingFraction, final PrintStream log); - public abstract ReadBackedPileup createPerAlleleDownsampledBasePileup(final ReadBackedPileup pileup, final double downsamplingFraction, final PrintStream log); + public PerReadAlleleLikelihoodMap() {} public void add(GATKSAMRecord read, Allele a, Double likelihood) { Map likelihoodMap; @@ -63,6 +60,39 @@ public abstract class PerReadAlleleLikelihoodMap { } + public ReadBackedPileup createPerAlleleDownsampledBasePileup(final ReadBackedPileup pileup, final double downsamplingFraction, final PrintStream log) { + return AlleleBiasedDownsamplingUtils.createAlleleBiasedBasePileup(pileup, downsamplingFraction, log); + } + + public void performPerAlleleDownsampling(final double downsamplingFraction, final PrintStream log) { + // special case removal of all or no reads + if ( downsamplingFraction <= 0.0 ) + return; + if ( downsamplingFraction >= 1.0 ) { + likelihoodReadMap.clear(); + return; + } + + // start by stratifying the reads by the alleles they represent at this position + final Map> alleleReadMap = new HashMap>(alleles.size()); + for ( Allele allele : alleles ) + alleleReadMap.put(allele, new ArrayList()); + + for ( Map.Entry> entry : likelihoodReadMap.entrySet() ) { + // do not remove reduced reads! + if ( !entry.getKey().isReducedRead() ) { + final Allele bestAllele = getMostLikelyAllele(entry.getValue()); + if ( bestAllele != Allele.NO_CALL ) + alleleReadMap.get(bestAllele).add(entry.getKey()); + } + } + + // compute the reads to remove and actually remove them + final List readsToRemove = AlleleBiasedDownsamplingUtils.selectAlleleBiasedReads(alleleReadMap, downsamplingFraction, log); + for ( final GATKSAMRecord read : readsToRemove ) + likelihoodReadMap.remove(read); + } + public int size() { return likelihoodReadMap.size(); } @@ -122,16 +152,4 @@ public abstract class PerReadAlleleLikelihoodMap { } return (maxLike - prevMaxLike > INFORMATIVE_LIKELIHOOD_THRESHOLD ? mostLikelyAllele : Allele.NO_CALL ); } - - public static PerReadAlleleLikelihoodMap getBestAvailablePerReadAlleleLikelihoodMap() { - final Class PerReadAlleleLikelihoodMapClass = GATKLiteUtils.getProtectedClassIfAvailable(PerReadAlleleLikelihoodMap.class); - try { - final Constructor constructor = PerReadAlleleLikelihoodMapClass.getDeclaredConstructor((Class[])null); - constructor.setAccessible(true); - return (PerReadAlleleLikelihoodMap)constructor.newInstance(); - } - catch (Exception e) { - throw new ReviewedStingException("Unable to create RecalibrationEngine class instance " + PerReadAlleleLikelihoodMapClass.getSimpleName()); - } - } } diff --git a/public/java/src/org/broadinstitute/sting/utils/genotyper/StandardPerReadAlleleLikelihoodMap.java b/public/java/src/org/broadinstitute/sting/utils/genotyper/StandardPerReadAlleleLikelihoodMap.java deleted file mode 100644 index 1a27c6ecb..000000000 --- a/public/java/src/org/broadinstitute/sting/utils/genotyper/StandardPerReadAlleleLikelihoodMap.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2011 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -package org.broadinstitute.sting.utils.genotyper; - - -import org.broadinstitute.sting.utils.classloader.PublicPackageSource; -import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; -import org.broadinstitute.sting.utils.sam.GATKSAMRecord; -import org.broadinstitute.variant.variantcontext.Allele; - -import java.io.PrintStream; -import java.util.*; - -public class StandardPerReadAlleleLikelihoodMap extends PerReadAlleleLikelihoodMap implements PublicPackageSource { - - public StandardPerReadAlleleLikelihoodMap() { - likelihoodReadMap = new LinkedHashMap>(); - alleles = new ArrayList(); - } - - // not implemented in the standard version - public void performPerAlleleDownsampling(final double downsamplingFraction, final PrintStream log) {} - public ReadBackedPileup createPerAlleleDownsampledBasePileup(final ReadBackedPileup pileup, final double downsamplingFraction, final PrintStream log) { return pileup; } -} From d4b4f95e122ced649ff49a989c63e36a3ef3fc46 Mon Sep 17 00:00:00 2001 From: Ami Levy-Moonshine Date: Mon, 7 Jan 2013 15:07:16 -0500 Subject: [PATCH 08/25] move CatVariants to public --- .../sting/tools/CatVariants.java | 209 ++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 public/java/src/org/broadinstitute/sting/tools/CatVariants.java diff --git a/public/java/src/org/broadinstitute/sting/tools/CatVariants.java b/public/java/src/org/broadinstitute/sting/tools/CatVariants.java new file mode 100644 index 000000000..e5811c423 --- /dev/null +++ b/public/java/src/org/broadinstitute/sting/tools/CatVariants.java @@ -0,0 +1,209 @@ +package org.broadinstitute.sting.tools; + +import net.sf.picard.reference.ReferenceSequenceFile; +import net.sf.picard.reference.ReferenceSequenceFileFactory; +import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.Level; +import org.broad.tribble.AbstractFeatureReader; +import org.broad.tribble.FeatureReader; +import org.broadinstitute.sting.commandline.Argument; +import org.broadinstitute.sting.commandline.Input; +import org.broadinstitute.sting.commandline.Output; +import org.broadinstitute.sting.commandline.CommandLineProgram; +import org.broadinstitute.variant.bcf2.BCF2Codec; +import org.broadinstitute.variant.vcf.VCFCodec; +import org.broadinstitute.variant.vcf.VCFHeader; +import org.broadinstitute.sting.utils.collections.Pair; +import org.broadinstitute.sting.utils.exceptions.UserException; +import org.broadinstitute.variant.variantcontext.VariantContext; +import org.broadinstitute.variant.variantcontext.writer.Options; +import org.broadinstitute.variant.variantcontext.writer.VariantContextWriter; +import org.broadinstitute.variant.variantcontext.writer.VariantContextWriterFactory; + +import java.io.*; +import java.util.*; + + +/** + * + * Usage: java -cp dist/GenomeAnalysisTK.jar org.broadinstitute.sting.tools.AppendVariants [sorted (optional)]"); + * The input files can be of type: VCF (ends in .vcf or .VCF)"); + * BCF2 (ends in .bcf or .BCF)"); + * Output file must be vcf or bcf file (.vcf or .bcf)"); + * If the input files are already sorted, the last argument can indicate that"); + */ +public class CatVariants extends CommandLineProgram { + // setup the logging system, used by some codecs + private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getRootLogger(); + + @Input(fullName = "reference", shortName = "R", doc = "genome reference file .fasta", required = true) + private File refFile = null; + + @Input(fullName="variant", shortName="V", doc="Input VCF file/s named .vcf or .bcf", required = true) + private List variant = null; + + @Output(fullName = "outputFile", shortName = "out", doc = "output file name .vcf or .bcf", required = true) + private File outputFile = null; + + @Argument(fullName = "assumeSorted", shortName = "assumeSorted", doc = "assumeSorted should be true if he input files are already sorted (based on the position of the variants", required = false) + private Boolean assumeSorted = false; + + /* + * print usage information + */ + private static void printUsage() { + System.err.println("Usage: java -cp dist/GenomeAnalysisTK.jar org.broadinstitute.sting.tools.AppendVariants [sorted (optional)]"); + System.err.println(" The input files can be of type: VCF (ends in .vcf or .VCF)"); + System.err.println(" BCF2 (ends in .bcf or .BCF)"); + System.err.println(" Output file must be vcf or bcf file (.vcf or .bcf)"); + System.err.println(" if the input files are already sorted, the last argument can indicate that"); + } + + @Override + protected int execute() throws Exception { + //if(help){ + // printUsage(); + // return 1; + //} + + BasicConfigurator.configure(); + logger.setLevel(Level.INFO); + + if ( ! refFile.getName().endsWith(".fasta")) { + throw new UserException("Reference file "+refFile+"name must end with .fasta"); + } + + if ( ! refFile.exists() ) { + throw new UserException(String.format("Reference file %s does not exist", refFile.getAbsolutePath())); + } + + // Comparator>> comparator = new PositionComparator(); + Comparator> positionComparator = new PositionComparator(); + + + //PriorityQueue>> queue = + // new PriorityQueue>>(2000, comparator); + Queue> priorityQueue; + if(assumeSorted) + priorityQueue = new LinkedList>(); + else + priorityQueue = new PriorityQueue>(10000, positionComparator); + + Iterator files = variant.iterator(); + File file; + while (files.hasNext()) { + file = files.next(); + if (!(file.getName().endsWith(".vcf") || file.getName().endsWith(".VCF") || file.getName().endsWith(".bcf") || file.getName().endsWith(".BCF"))){ + System.err.println("File " + file.getAbsolutePath() + " should be .vcf or .bcf"); + printUsage(); + return 1; + } + if (assumeSorted){ + priorityQueue.add(new Pair(0,file)); + } + else{ + if (!file.exists()) { + throw new UserException(String.format("File %s doesn't exist",file.getAbsolutePath())); + } + FeatureReader reader; + boolean useVCF = (file.getName().endsWith(".vcf") || file.getName().endsWith(".VCF")); + if(useVCF) + reader = AbstractFeatureReader.getFeatureReader(file.getAbsolutePath(), new VCFCodec(), false); + else + reader = AbstractFeatureReader.getFeatureReader(file.getAbsolutePath(), new BCF2Codec(), false); + Iterator it = reader.iterator(); + if(!it.hasNext()){ + System.err.println(String.format("File %s is empty. This file will be ignored",file.getAbsolutePath())); + continue; + } + VariantContext vc = it.next(); + int firstPosition = vc.getStart(); + reader.close(); + //queue.add(new Pair>(firstPosition,reader)); + priorityQueue.add(new Pair(firstPosition,file)); + } + + } + + if (!(outputFile.getName().endsWith(".vcf") || outputFile.getName().endsWith(".VCF"))){ + throw new UserException(String.format("Output file %s should be .vcf", outputFile)); + } + ReferenceSequenceFile ref = ReferenceSequenceFileFactory.getReferenceSequenceFile(refFile); + + + FileOutputStream outputStream = new FileOutputStream(outputFile); + EnumSet options = EnumSet.of(Options.INDEX_ON_THE_FLY); + final VariantContextWriter outputWriter = VariantContextWriterFactory.create(outputFile, outputStream, ref.getSequenceDictionary(), options); + + boolean firstFile = true; + int count =0; + //while(!queue.isEmpty()){ + while(!priorityQueue.isEmpty() ){ + count++; + //FeatureReader reader = queue.remove().getSecond(); + file = priorityQueue.remove().getSecond(); + if (!file.exists()) { + throw new UserException(String.format("File %s doesn't exist",file.getAbsolutePath())); + } + FeatureReader reader; + boolean useVCF = (file.getName().endsWith(".vcf") || file.getName().endsWith(".VCF")); + if(useVCF) + reader = AbstractFeatureReader.getFeatureReader(file.getAbsolutePath(), new VCFCodec(), false); + else + reader = AbstractFeatureReader.getFeatureReader(file.getAbsolutePath(), new BCF2Codec(), false); + + if(count%10 ==0) + System.out.print(count); + else + System.out.print("."); + if (firstFile){ + VCFHeader header = (VCFHeader)reader.getHeader(); + outputWriter.writeHeader(header); + firstFile = false; + } + + Iterator it = reader.iterator(); + + while (it.hasNext()){ + VariantContext vc = it.next(); + outputWriter.add(vc); + } + + reader.close(); + + } + System.out.println(); + + outputStream.close(); + outputWriter.close(); + + return 0; + } + + + public static void main(String[] args){ + try { + CatVariants instance = new CatVariants(); + start(instance, args); + System.exit(CommandLineProgram.result); + } catch ( UserException e ) { + printUsage(); + exitSystemWithUserError(e); + } catch ( Exception e ) { + exitSystemWithError(e); + } + } + + private static class PositionComparator implements Comparator> { + + @Override + public int compare(Pair p1, Pair p2) { + int startPositionP1 = p1.getFirst(); + int startPositionP2 = p2.getFirst(); + if (startPositionP1 == startPositionP2) + return 0; + return startPositionP1 < startPositionP2 ? -1 : 1 ; + } + } + +} From 35699a8376513783acd31084a11db03b044dd066 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Mon, 7 Jan 2013 15:41:21 -0500 Subject: [PATCH 09/25] Move bqsr utils to protected --- .../org/broadinstitute/sting/utils/recalibration/BQSRMode.java | 0 .../sting/utils/recalibration/BQSRReadTransformer.java | 0 .../sting/utils/recalibration/BaseRecalibration.java | 0 .../org/broadinstitute/sting/utils/recalibration/EventType.java | 0 .../broadinstitute/sting/utils/recalibration/QualQuantizer.java | 0 .../sting/utils/recalibration/QuantizationInfo.java | 0 .../broadinstitute/sting/utils/recalibration/ReadCovariates.java | 0 .../org/broadinstitute/sting/utils/recalibration/RecalDatum.java | 0 .../broadinstitute/sting/utils/recalibration/RecalDatumNode.java | 0 .../org/broadinstitute/sting/utils/recalibration/RecalUtils.java | 0 .../sting/utils/recalibration/RecalibrationReport.java | 0 .../sting/utils/recalibration/RecalibrationTables.java | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/BQSRMode.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/BQSRReadTransformer.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/BaseRecalibration.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/EventType.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/QualQuantizer.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/QuantizationInfo.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/ReadCovariates.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatumNode.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/RecalUtils.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationReport.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationTables.java (100%) diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/BQSRMode.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/BQSRMode.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/BQSRMode.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/BQSRMode.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/BQSRReadTransformer.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/BQSRReadTransformer.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/BQSRReadTransformer.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/BQSRReadTransformer.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/BaseRecalibration.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/BaseRecalibration.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/BaseRecalibration.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/BaseRecalibration.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/EventType.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/EventType.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/EventType.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/EventType.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/QualQuantizer.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/QualQuantizer.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/QualQuantizer.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/QualQuantizer.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/QuantizationInfo.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/QuantizationInfo.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/QuantizationInfo.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/QuantizationInfo.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/ReadCovariates.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/ReadCovariates.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/ReadCovariates.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/ReadCovariates.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatum.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatumNode.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatumNode.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatumNode.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalDatumNode.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/RecalUtils.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalUtils.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/RecalUtils.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalUtils.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationReport.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationReport.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationReport.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationReport.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationTables.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationTables.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationTables.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/RecalibrationTables.java From 47d030a52d5f93108738590572ad49c90c7e7a5b Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Mon, 7 Jan 2013 15:47:25 -0500 Subject: [PATCH 10/25] Oops, move the covariates over too --- .../sting/utils/recalibration/covariates/ContextCovariate.java | 0 .../sting/utils/recalibration/covariates/Covariate.java | 0 .../sting/utils/recalibration/covariates/CycleCovariate.java | 0 .../utils/recalibration/covariates/ExperimentalCovariate.java | 0 .../utils/recalibration/covariates/QualityScoreCovariate.java | 0 .../sting/utils/recalibration/covariates/ReadGroupCovariate.java | 0 .../utils/recalibration/covariates/RepeatLengthCovariate.java | 0 .../sting/utils/recalibration/covariates/RequiredCovariate.java | 0 .../sting/utils/recalibration/covariates/StandardCovariate.java | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ContextCovariate.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/covariates/Covariate.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/covariates/CycleCovariate.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ExperimentalCovariate.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/covariates/QualityScoreCovariate.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ReadGroupCovariate.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RepeatLengthCovariate.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RequiredCovariate.java (100%) rename {public => protected}/java/src/org/broadinstitute/sting/utils/recalibration/covariates/StandardCovariate.java (100%) diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ContextCovariate.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ContextCovariate.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ContextCovariate.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ContextCovariate.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/Covariate.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/Covariate.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/Covariate.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/Covariate.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/CycleCovariate.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/CycleCovariate.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/CycleCovariate.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/CycleCovariate.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ExperimentalCovariate.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ExperimentalCovariate.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ExperimentalCovariate.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ExperimentalCovariate.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/QualityScoreCovariate.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/QualityScoreCovariate.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/QualityScoreCovariate.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/QualityScoreCovariate.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ReadGroupCovariate.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ReadGroupCovariate.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ReadGroupCovariate.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/ReadGroupCovariate.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RepeatLengthCovariate.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RepeatLengthCovariate.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RepeatLengthCovariate.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RepeatLengthCovariate.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RequiredCovariate.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RequiredCovariate.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RequiredCovariate.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/RequiredCovariate.java diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/StandardCovariate.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/StandardCovariate.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/utils/recalibration/covariates/StandardCovariate.java rename to protected/java/src/org/broadinstitute/sting/utils/recalibration/covariates/StandardCovariate.java From 673ed0aaa67d6b2d49e654ecce317e0b8175e48e Mon Sep 17 00:00:00 2001 From: Ami Levy-Moonshine Date: Mon, 7 Jan 2013 17:07:23 -0500 Subject: [PATCH 11/25] remove public-protected dependency by commeting out some code that should be re-included after all the walkers will be in portected (added some todos) --- .../sting/gatk/walkers/indels/PairHMMIndelErrorModel.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java index 221093759..5f0407b13 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java @@ -33,7 +33,7 @@ import org.broadinstitute.sting.utils.MathUtils; import org.broadinstitute.sting.utils.clipping.ReadClipper; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.pairhmm.ExactPairHMM; -import org.broadinstitute.sting.utils.pairhmm.LoglessCachingPairHMM; +//import org.broadinstitute.sting.utils.pairhmm.LoglessCachingPairHMM; import org.broadinstitute.sting.utils.pairhmm.OriginalPairHMM; import org.broadinstitute.sting.utils.pairhmm.PairHMM; import org.broadinstitute.sting.utils.pileup.PileupElement; @@ -102,9 +102,9 @@ public class PairHMMIndelErrorModel { break; case CACHING: case LOGLESS_CACHING: //TODO: still not tested so please do not use yet - pairHMM = new LoglessCachingPairHMM(); - System.err.println("warning: this option (LOGLESS_CACHING in UG) is still under development"); - break; + //pairHMM = new LoglessCachingPairHMM(); //TODO - add it back when the figure out how to use the protected LoglessCachingPairHMM class + throw new UserException.BadArgumentValue("pairHMM"," this option (LOGLESS_CACHING in UG) is still under development"); + //break; default: throw new UserException.BadArgumentValue("pairHMM", "Specified pairHMM implementation is unrecognized or incompatible with the UnifiedGenotyper. Acceptable options are ORIGINAL, EXACT or LOGLESS_CACHING (the third option is still under development)."); } From 9e6c2afb28f1f29994771a4e8adb2c8e436aced5 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Mon, 7 Jan 2013 18:11:07 -0500 Subject: [PATCH 12/25] Not sure why IntelliJ didn't add this for commit like the other dirs --- .../sting/gatk/walkers/bqsr/BQSRGatherer.java | 86 +++ .../gatk/walkers/bqsr/BaseRecalibrator.java | 528 ++++++++++++++++++ .../walkers/bqsr/ReadRecalibrationInfo.java | 163 ++++++ .../bqsr/RecalibrationArgumentCollection.java | 251 +++++++++ .../walkers/bqsr/RecalibrationEngine.java | 216 +++++++ .../bqsr/RecalibrationPerformance.java | 110 ++++ 6 files changed, 1354 insertions(+) create mode 100755 protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGatherer.java create mode 100755 protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BaseRecalibrator.java create mode 100644 protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfo.java create mode 100755 protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationArgumentCollection.java create mode 100644 protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationEngine.java create mode 100755 protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationPerformance.java diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGatherer.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGatherer.java new file mode 100755 index 000000000..dbb628135 --- /dev/null +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGatherer.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2011 The Broad Institute + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.broadinstitute.sting.gatk.walkers.bqsr; + +import org.broadinstitute.sting.commandline.Gatherer; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; +import org.broadinstitute.sting.utils.exceptions.UserException; +import org.broadinstitute.sting.utils.recalibration.RecalUtils; +import org.broadinstitute.sting.utils.recalibration.RecalibrationReport; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.PrintStream; +import java.util.List; + +/** + * User: carneiro + * Date: 3/29/11 + */ + + +public class BQSRGatherer extends Gatherer { + + private static final String EMPTY_INPUT_LIST = "list of inputs files is empty"; + private static final String MISSING_OUTPUT_FILE = "missing output file name"; + + @Override + public void gather(List inputs, File output) { + final PrintStream outputFile; + try { + outputFile = new PrintStream(output); + } catch(FileNotFoundException e) { + throw new UserException.MissingArgument("output", MISSING_OUTPUT_FILE); + } + + RecalibrationReport generalReport = null; + for (File input : inputs) { + final RecalibrationReport inputReport = new RecalibrationReport(input); + if (generalReport == null) + generalReport = inputReport; + else + generalReport.combine(inputReport); + } + if (generalReport == null) + throw new ReviewedStingException(EMPTY_INPUT_LIST); + + generalReport.calculateQuantizedQualities(); + + RecalibrationArgumentCollection RAC = generalReport.getRAC(); + if ( RAC.RECAL_PDF_FILE != null ) { + RAC.RECAL_TABLE_FILE = output; + if ( RAC.existingRecalibrationReport != null ) { + final RecalibrationReport originalReport = new RecalibrationReport(RAC.existingRecalibrationReport); + RecalUtils.generateRecalibrationPlot(RAC, originalReport.getRecalibrationTables(), generalReport.getRecalibrationTables(), generalReport.getCovariates()); + } + else { + RecalUtils.generateRecalibrationPlot(RAC, generalReport.getRecalibrationTables(), generalReport.getCovariates()); + } + } + + generalReport.output(outputFile); + } +} diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BaseRecalibrator.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BaseRecalibrator.java new file mode 100755 index 000000000..3b0cb07d5 --- /dev/null +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/BaseRecalibrator.java @@ -0,0 +1,528 @@ +/* + * Copyright (c) 2010 The Broad Institute + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.broadinstitute.sting.gatk.walkers.bqsr; + +import net.sf.picard.reference.IndexedFastaSequenceFile; +import net.sf.samtools.CigarElement; +import net.sf.samtools.SAMFileHeader; +import org.broad.tribble.Feature; +import org.broadinstitute.sting.commandline.Advanced; +import org.broadinstitute.sting.commandline.Argument; +import org.broadinstitute.sting.commandline.ArgumentCollection; +import org.broadinstitute.sting.gatk.CommandLineGATK; +import org.broadinstitute.sting.gatk.contexts.ReferenceContext; +import org.broadinstitute.sting.gatk.filters.*; +import org.broadinstitute.sting.gatk.iterators.ReadTransformer; +import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.*; +import org.broadinstitute.sting.utils.MathUtils; +import org.broadinstitute.variant.utils.BaseUtils; +import org.broadinstitute.sting.utils.baq.BAQ; +import org.broadinstitute.sting.utils.clipping.ReadClipper; +import org.broadinstitute.sting.utils.collections.Pair; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; +import org.broadinstitute.sting.utils.exceptions.UserException; +import org.broadinstitute.sting.utils.help.DocumentedGATKFeature; +import org.broadinstitute.sting.utils.recalibration.*; +import org.broadinstitute.sting.utils.recalibration.covariates.Covariate; +import org.broadinstitute.sting.utils.sam.GATKSAMRecord; +import org.broadinstitute.sting.utils.sam.ReadUtils; + +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * First pass of the base quality score recalibration -- Generates recalibration table based on various user-specified covariates (such as read group, reported quality score, machine cycle, and nucleotide context). + * + *

+ * This walker is designed to work as the first pass in a two-pass processing step. It does a by-locus traversal operating + * only at sites that are not in dbSNP. We assume that all reference mismatches we see are therefore errors and indicative + * of poor base quality. This walker generates tables based on various user-specified covariates (such as read group, + * reported quality score, cycle, and context). Since there is a large amount of data one can then calculate an empirical + * probability of error given the particular covariates seen at this site, where p(error) = num mismatches / num observations. + * The output file is a table (of the several covariate values, num observations, num mismatches, empirical quality score). + *

+ * Note: ReadGroupCovariate and QualityScoreCovariate are required covariates and will be added for the user regardless of whether or not they were specified. + * + *

+ * + *

Input

+ *

+ * The input read data whose base quality scores need to be assessed. + *

+ * A database of known polymorphic sites to skip over. + *

+ * + *

Output

+ *

+ * A GATK Report file with many tables: + *

    + *
  1. The list of arguments
  2. + *
  3. The quantized qualities table
  4. + *
  5. The recalibration table by read group
  6. + *
  7. The recalibration table by quality score
  8. + *
  9. The recalibration table for all the optional covariates
  10. + *
+ * + * The GATK Report is intended to be easy to read by humans or computers. Check out the documentation of the GATKReport to learn how to manipulate this table. + *

+ * + *

Examples

+ *
+ * java -Xmx4g -jar GenomeAnalysisTK.jar \
+ *   -T BaseRecalibrator \
+ *   -I my_reads.bam \
+ *   -R resources/Homo_sapiens_assembly18.fasta \
+ *   -knownSites bundle/hg18/dbsnp_132.hg18.vcf \
+ *   -knownSites another/optional/setOfSitesToMask.vcf \
+ *   -o recal_data.grp
+ * 
+ */ + +@DocumentedGATKFeature(groupName = "BAM Processing and Analysis Tools", extraDocs = {CommandLineGATK.class}) +@BAQMode(ApplicationTime = ReadTransformer.ApplicationTime.FORBIDDEN) +@ReadFilters({MappingQualityZeroFilter.class, MappingQualityUnavailableFilter.class, UnmappedReadFilter.class, NotPrimaryAlignmentFilter.class, DuplicateReadFilter.class, FailsVendorQualityCheckFilter.class}) +@PartitionBy(PartitionType.READ) +public class BaseRecalibrator extends ReadWalker implements NanoSchedulable { + /** + * all the command line arguments for BQSR and it's covariates + */ + @ArgumentCollection + private final RecalibrationArgumentCollection RAC = new RecalibrationArgumentCollection(); + + /** + * When you have nct > 1, BQSR uses nct times more memory to compute its recalibration tables, for efficiency + * purposes. If you have many covariates, and therefore are using a lot of memory, you can use this flag + * to safely access only one table. There may be some CPU cost, but as long as the table is really big + * there should be relatively little CPU costs. + */ + @Argument(fullName = "lowMemoryMode", shortName="lowMemoryMode", doc="Reduce memory usage in multi-threaded code at the expense of threading efficiency", required = false) + public boolean lowMemoryMode = false; + + @Advanced + @Argument(fullName = "bqsrBAQGapOpenPenalty", shortName="bqsrBAQGOP", doc="BQSR BAQ gap open penalty (Phred Scaled). Default value is 40. 30 is perhaps better for whole genome call sets", required = false) + public double BAQGOP = BAQ.DEFAULT_GOP; + + /** + * an object that keeps track of the information necessary for quality score quantization + */ + private QuantizationInfo quantizationInfo; + + /** + * list to hold the all the covariate objects that were requested (required + standard + experimental) + */ + private Covariate[] requestedCovariates; + + private RecalibrationEngine recalibrationEngine; + + private int minimumQToUse; + + private static final String NO_DBSNP_EXCEPTION = "This calculation is critically dependent on being able to skip over known variant sites. Please provide a VCF file containing known sites of genetic variation."; + + private BAQ baq; // BAQ the reads on the fly to generate the alignment uncertainty vector + private IndexedFastaSequenceFile referenceReader; // fasta reference reader for use with BAQ calculation + private final static byte NO_BAQ_UNCERTAINTY = (byte)'@'; + + /** + * Parse the -cov arguments and create a list of covariates to be used here + * Based on the covariates' estimates for initial capacity allocate the data hashmap + */ + public void initialize() { + baq = new BAQ(BAQGOP); // setup the BAQ object with the provided gap open penalty + + if (RAC.FORCE_PLATFORM != null) + RAC.DEFAULT_PLATFORM = RAC.FORCE_PLATFORM; + + if (RAC.knownSites.isEmpty() && !RAC.RUN_WITHOUT_DBSNP) // Warn the user if no dbSNP file or other variant mask was specified + throw new UserException.CommandLineException(NO_DBSNP_EXCEPTION); + + if (RAC.LIST_ONLY) { + RecalUtils.listAvailableCovariates(logger); + System.exit(0); + } + RAC.existingRecalibrationReport = getToolkit().getArguments().BQSR_RECAL_FILE; // if we have a recalibration file, record it so it goes on the report table + + Pair, ArrayList> covariates = RecalUtils.initializeCovariates(RAC); // initialize the required and optional covariates + ArrayList requiredCovariates = covariates.getFirst(); + ArrayList optionalCovariates = covariates.getSecond(); + + requestedCovariates = new Covariate[requiredCovariates.size() + optionalCovariates.size()]; + int covariateIndex = 0; + for (final Covariate covariate : requiredCovariates) + requestedCovariates[covariateIndex++] = covariate; + for (final Covariate covariate : optionalCovariates) + requestedCovariates[covariateIndex++] = covariate; + + logger.info("The covariates being used here: "); + for (Covariate cov : requestedCovariates) { // list all the covariates being used + logger.info("\t" + cov.getClass().getSimpleName()); + cov.initialize(RAC); // initialize any covariate member variables using the shared argument collection + } + + try { + RAC.RECAL_TABLE = new PrintStream(RAC.RECAL_TABLE_FILE); + } catch (IOException e) { + throw new UserException.CouldNotCreateOutputFile(RAC.RECAL_TABLE_FILE, e); + } + + initializeRecalibrationEngine(); + minimumQToUse = getToolkit().getArguments().PRESERVE_QSCORES_LESS_THAN; + referenceReader = getToolkit().getReferenceDataSource().getReference(); + } + + /** + * Initialize the recalibration engine + */ + private void initializeRecalibrationEngine() { + int numReadGroups = 0; + for ( final SAMFileHeader header : getToolkit().getSAMFileHeaders() ) + numReadGroups += header.getReadGroups().size(); + + recalibrationEngine = new RecalibrationEngine(requestedCovariates, numReadGroups, RAC.RECAL_TABLE_UPDATE_LOG, lowMemoryMode); + } + + private boolean isLowQualityBase( final GATKSAMRecord read, final int offset ) { + return read.getBaseQualities()[offset] < minimumQToUse; + } + + /** + * For each read at this locus get the various covariate values and increment that location in the map based on + * whether or not the base matches the reference at this particular location + */ + public Long map( final ReferenceContext ref, final GATKSAMRecord originalRead, final RefMetaDataTracker metaDataTracker ) { + + final GATKSAMRecord read = ReadClipper.hardClipSoftClippedBases( ReadClipper.hardClipAdaptorSequence(originalRead) ); + if( read.isEmpty() ) { return 0L; } // the whole read was inside the adaptor so skip it + + RecalUtils.parsePlatformForRead(read, RAC); + if (!RecalUtils.isColorSpaceConsistent(RAC.SOLID_NOCALL_STRATEGY, read)) { // parse the solid color space and check for color no-calls + return 0L; // skip this read completely + } + + final int[] isSNP = calculateIsSNP(read, ref, originalRead); + final int[] isInsertion = calculateIsIndel(read, EventType.BASE_INSERTION); + final int[] isDeletion = calculateIsIndel(read, EventType.BASE_DELETION); + final int nErrors = nEvents(isSNP, isInsertion, isDeletion); + + // note for efficiency regions we don't compute the BAQ array unless we actually have + // some error to marginalize over. For ILMN data ~85% of reads have no error + final byte[] baqArray = nErrors == 0 ? flatBAQArray(read) : calculateBAQArray(read); + + if( baqArray != null ) { // some reads just can't be BAQ'ed + final ReadCovariates covariates = RecalUtils.computeCovariates(read, requestedCovariates); + final boolean[] skip = calculateSkipArray(read, metaDataTracker); // skip known sites of variation as well as low quality and non-regular bases + final double[] snpErrors = calculateFractionalErrorArray(isSNP, baqArray); + final double[] insertionErrors = calculateFractionalErrorArray(isInsertion, baqArray); + final double[] deletionErrors = calculateFractionalErrorArray(isDeletion, baqArray); + + // aggregate all of the info into our info object, and update the data + final ReadRecalibrationInfo info = new ReadRecalibrationInfo(read, covariates, skip, snpErrors, insertionErrors, deletionErrors); + recalibrationEngine.updateDataForRead(info); + return 1L; + } else { + return 0L; + } + } + + /** + * Compute the number of mutational events across all hasEvent vectors + * + * Simply the sum of entries in hasEvents + * + * @param hasEvents a vector a vectors of 0 (no event) and 1 (has event) + * @return the total number of events across all hasEvent arrays + */ + private int nEvents(final int[]... hasEvents) { + int n = 0; + for ( final int[] hasEvent : hasEvents ) { + n += MathUtils.sum(hasEvent); + } + return n; + } + + protected boolean[] calculateSkipArray( final GATKSAMRecord read, final RefMetaDataTracker metaDataTracker ) { + final byte[] bases = read.getReadBases(); + final boolean[] skip = new boolean[bases.length]; + final boolean[] knownSites = calculateKnownSites(read, metaDataTracker.getValues(RAC.knownSites)); + for( int iii = 0; iii < bases.length; iii++ ) { + skip[iii] = !BaseUtils.isRegularBase(bases[iii]) || isLowQualityBase(read, iii) || knownSites[iii] || badSolidOffset(read, iii); + } + return skip; + } + + protected boolean badSolidOffset( final GATKSAMRecord read, final int offset ) { + return ReadUtils.isSOLiDRead(read) && RAC.SOLID_RECAL_MODE != RecalUtils.SOLID_RECAL_MODE.DO_NOTHING && !RecalUtils.isColorSpaceConsistent(read, offset); + } + + protected boolean[] calculateKnownSites( final GATKSAMRecord read, final List features ) { + final int readLength = read.getReadBases().length; + final boolean[] knownSites = new boolean[readLength]; + Arrays.fill(knownSites, false); + for( final Feature f : features ) { + int featureStartOnRead = ReadUtils.getReadCoordinateForReferenceCoordinate(read.getSoftStart(), read.getCigar(), f.getStart(), ReadUtils.ClippingTail.LEFT_TAIL, true); // BUGBUG: should I use LEFT_TAIL here? + if( featureStartOnRead == ReadUtils.CLIPPING_GOAL_NOT_REACHED ) { + featureStartOnRead = 0; + } + + int featureEndOnRead = ReadUtils.getReadCoordinateForReferenceCoordinate(read.getSoftStart(), read.getCigar(), f.getEnd(), ReadUtils.ClippingTail.LEFT_TAIL, true); + if( featureEndOnRead == ReadUtils.CLIPPING_GOAL_NOT_REACHED ) { + featureEndOnRead = readLength; + } + + if( featureStartOnRead > readLength ) { + featureStartOnRead = featureEndOnRead = readLength; + } + + Arrays.fill(knownSites, Math.max(0, featureStartOnRead), Math.min(readLength, featureEndOnRead + 1), true); + } + return knownSites; + } + + // BUGBUG: can be merged with calculateIsIndel + protected static int[] calculateIsSNP( final GATKSAMRecord read, final ReferenceContext ref, final GATKSAMRecord originalRead ) { + final byte[] readBases = read.getReadBases(); + final byte[] refBases = Arrays.copyOfRange(ref.getBases(), read.getAlignmentStart() - originalRead.getAlignmentStart(), ref.getBases().length + read.getAlignmentEnd() - originalRead.getAlignmentEnd()); + final int[] snp = new int[readBases.length]; + int readPos = 0; + int refPos = 0; + for ( final CigarElement ce : read.getCigar().getCigarElements() ) { + final int elementLength = ce.getLength(); + switch (ce.getOperator()) { + case M: + case EQ: + case X: + for( int iii = 0; iii < elementLength; iii++ ) { + snp[readPos] = ( BaseUtils.basesAreEqual(readBases[readPos], refBases[refPos]) ? 0 : 1 ); + readPos++; + refPos++; + } + break; + case D: + case N: + refPos += elementLength; + break; + case I: + case S: // ReferenceContext doesn't have the soft clipped bases! + readPos += elementLength; + break; + case H: + case P: + break; + default: + throw new ReviewedStingException("Unsupported cigar operator: " + ce.getOperator()); + } + } + return snp; + } + + protected static int[] calculateIsIndel( final GATKSAMRecord read, final EventType mode ) { + final byte[] readBases = read.getReadBases(); + final int[] indel = new int[readBases.length]; + Arrays.fill(indel, 0); + int readPos = 0; + for ( final CigarElement ce : read.getCigar().getCigarElements() ) { + final int elementLength = ce.getLength(); + switch (ce.getOperator()) { + case M: + case EQ: + case X: + case S: + { + readPos += elementLength; + break; + } + case D: + { + final int index = ( read.getReadNegativeStrandFlag() ? readPos : ( readPos > 0 ? readPos - 1 : readPos ) ); + indel[index] = ( mode.equals(EventType.BASE_DELETION) ? 1 : 0 ); + break; + } + case I: + { + final boolean forwardStrandRead = !read.getReadNegativeStrandFlag(); + if( forwardStrandRead ) { + indel[(readPos > 0 ? readPos - 1 : readPos)] = ( mode.equals(EventType.BASE_INSERTION) ? 1 : 0 ); + } + for (int iii = 0; iii < elementLength; iii++) { + readPos++; + } + if( !forwardStrandRead ) { + indel[(readPos < indel.length ? readPos : readPos - 1)] = ( mode.equals(EventType.BASE_INSERTION) ? 1 : 0 ); + } + break; + } + case N: + case H: + case P: + break; + default: + throw new ReviewedStingException("Unsupported cigar operator: " + ce.getOperator()); + } + } + return indel; + } + + protected static double[] calculateFractionalErrorArray( final int[] errorArray, final byte[] baqArray ) { + if(errorArray.length != baqArray.length ) { + throw new ReviewedStingException("Array length mismatch detected. Malformed read?"); + } + + final int BLOCK_START_UNSET = -1; + + final double[] fractionalErrors = new double[baqArray.length]; + Arrays.fill(fractionalErrors, 0.0); + boolean inBlock = false; + int blockStartIndex = BLOCK_START_UNSET; + int iii; + for( iii = 0; iii < fractionalErrors.length; iii++ ) { + if( baqArray[iii] == NO_BAQ_UNCERTAINTY ) { + if( !inBlock ) { + fractionalErrors[iii] = (double) errorArray[iii]; + } else { + calculateAndStoreErrorsInBlock(iii, blockStartIndex, errorArray, fractionalErrors); + inBlock = false; // reset state variables + blockStartIndex = BLOCK_START_UNSET; // reset state variables + } + } else { + inBlock = true; + if( blockStartIndex == BLOCK_START_UNSET ) { blockStartIndex = iii; } + } + } + if( inBlock ) { + calculateAndStoreErrorsInBlock(iii-1, blockStartIndex, errorArray, fractionalErrors); + } + if( fractionalErrors.length != errorArray.length ) { + throw new ReviewedStingException("Output array length mismatch detected. Malformed read?"); + } + return fractionalErrors; + } + + private static void calculateAndStoreErrorsInBlock( final int iii, + final int blockStartIndex, + final int[] errorArray, + final double[] fractionalErrors ) { + int totalErrors = 0; + for( int jjj = Math.max(0,blockStartIndex-1); jjj <= iii; jjj++ ) { + totalErrors += errorArray[jjj]; + } + for( int jjj = Math.max(0, blockStartIndex-1); jjj <= iii; jjj++ ) { + fractionalErrors[jjj] = ((double) totalErrors) / ((double)(iii - Math.max(0,blockStartIndex-1) + 1)); + } + } + + /** + * Create a BAQ style array that indicates no alignment uncertainty + * @param read the read for which we want a BAQ array + * @return a BAQ-style non-null byte[] counting NO_BAQ_UNCERTAINTY values + * // TODO -- could be optimized avoiding this function entirely by using this inline if the calculation code above + */ + private byte[] flatBAQArray(final GATKSAMRecord read) { + final byte[] baq = new byte[read.getReadLength()]; + Arrays.fill(baq, NO_BAQ_UNCERTAINTY); + return baq; + } + + /** + * Compute an actual BAQ array for read, based on its quals and the reference sequence + * @param read the read to BAQ + * @return a non-null BAQ tag array for read + */ + private byte[] calculateBAQArray( final GATKSAMRecord read ) { + baq.baqRead(read, referenceReader, BAQ.CalculationMode.RECALCULATE, BAQ.QualityMode.ADD_TAG); + return BAQ.getBAQTag(read); + } + + /** + * Initialize the reduce step by returning 0L + * + * @return returns 0L + */ + public Long reduceInit() { + return 0L; + } + + /** + * The Reduce method doesn't do anything for this walker. + * + * @param mapped Result of the map. This value is immediately ignored. + * @param sum The summing CountedData used to output the CSV data + * @return returns The sum used to output the CSV data + */ + public Long reduce(Long mapped, Long sum) { + sum += mapped; + return sum; + } + + @Override + public void onTraversalDone(Long result) { + recalibrationEngine.finalizeData(); + + logger.info("Calculating quantized quality scores..."); + quantizeQualityScores(); + + logger.info("Writing recalibration report..."); + generateReport(); + logger.info("...done!"); + + if ( RAC.RECAL_PDF_FILE != null ) { + logger.info("Generating recalibration plots..."); + generatePlots(); + } + + logger.info("Processed: " + result + " reads"); + } + + private RecalibrationTables getRecalibrationTable() { + return recalibrationEngine.getFinalRecalibrationTables(); + } + + private void generatePlots() { + File recalFile = getToolkit().getArguments().BQSR_RECAL_FILE; + if (recalFile != null) { + RecalibrationReport report = new RecalibrationReport(recalFile); + RecalUtils.generateRecalibrationPlot(RAC, report.getRecalibrationTables(), getRecalibrationTable(), requestedCovariates); + } + else + RecalUtils.generateRecalibrationPlot(RAC, getRecalibrationTable(), requestedCovariates); + } + + /** + * go through the quality score table and use the # observations and the empirical quality score + * to build a quality score histogram for quantization. Then use the QuantizeQual algorithm to + * generate a quantization map (recalibrated_qual -> quantized_qual) + */ + private void quantizeQualityScores() { + quantizationInfo = new QuantizationInfo(getRecalibrationTable(), RAC.QUANTIZING_LEVELS); + } + + private void generateReport() { + RecalUtils.outputRecalibrationReport(RAC, quantizationInfo, getRecalibrationTable(), requestedCovariates, RAC.SORT_BY_ALL_COLUMNS); + } +} \ No newline at end of file diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfo.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfo.java new file mode 100644 index 000000000..b884b89db --- /dev/null +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfo.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2012 The Broad Institute + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.broadinstitute.sting.gatk.walkers.bqsr; + +import com.google.java.contract.Ensures; +import com.google.java.contract.Requires; +import org.broadinstitute.sting.utils.QualityUtils; +import org.broadinstitute.sting.utils.recalibration.EventType; +import org.broadinstitute.sting.utils.recalibration.ReadCovariates; +import org.broadinstitute.sting.utils.sam.GATKSAMRecord; + +/** + * Created with IntelliJ IDEA. + * User: depristo + * Date: 12/18/12 + * Time: 3:50 PM + * + * TODO -- merge in ReadCovariates? + */ +public final class ReadRecalibrationInfo { + private final GATKSAMRecord read; + private final int length; + private final ReadCovariates covariates; + private final boolean[] skips; + private final byte[] baseQuals, insertionQuals, deletionQuals; + private final double[] snpErrors, insertionErrors, deletionErrors; + + public ReadRecalibrationInfo(final GATKSAMRecord read, + final ReadCovariates covariates, + final boolean[] skips, + final double[] snpErrors, + final double[] insertionErrors, + final double[] deletionErrors) { + if ( read == null ) throw new IllegalArgumentException("read cannot be null"); + if ( covariates == null ) throw new IllegalArgumentException("covariates cannot be null"); + if ( skips == null ) throw new IllegalArgumentException("skips cannot be null"); + if ( snpErrors == null ) throw new IllegalArgumentException("snpErrors cannot be null"); + if ( insertionErrors == null ) throw new IllegalArgumentException("insertionErrors cannot be null"); + if ( deletionErrors == null ) throw new IllegalArgumentException("deletionErrors cannot be null"); + + this.read = read; + this.baseQuals = read.getBaseQualities(); + this.length = baseQuals.length; + this.covariates = covariates; + this.skips = skips; + this.insertionQuals = read.getExistingBaseInsertionQualities(); + this.deletionQuals = read.getExistingBaseDeletionQualities(); + this.snpErrors = snpErrors; + this.insertionErrors = insertionErrors; + this.deletionErrors = deletionErrors; + + if ( skips.length != length ) throw new IllegalArgumentException("skips.length " + snpErrors.length + " != length " + length); + if ( snpErrors.length != length ) throw new IllegalArgumentException("snpErrors.length " + snpErrors.length + " != length " + length); + if ( insertionErrors.length != length ) throw new IllegalArgumentException("insertionErrors.length " + snpErrors.length + " != length " + length); + if ( deletionErrors.length != length ) throw new IllegalArgumentException("deletionErrors.length " + snpErrors.length + " != length " + length); + } + + /** + * Get the qual score for event type at offset + * + * @param eventType the type of event we want the qual for + * @param offset the offset into this read for the qual + * @return a valid quality score for event at offset + */ + @Requires("validOffset(offset)") + @Ensures("validQual(result)") + public byte getQual(final EventType eventType, final int offset) { + switch ( eventType ) { + case BASE_SUBSTITUTION: return baseQuals[offset]; + // note optimization here -- if we don't have ins/del quals we just return the default byte directly + case BASE_INSERTION: return insertionQuals == null ? GATKSAMRecord.DEFAULT_INSERTION_DELETION_QUAL : insertionQuals[offset]; + case BASE_DELETION: return deletionQuals == null ? GATKSAMRecord.DEFAULT_INSERTION_DELETION_QUAL : deletionQuals[offset]; + default: throw new IllegalStateException("Unknown event type " + eventType); + } + } + + /** + * Get the error fraction for event type at offset + * + * The error fraction is a value between 0 and 1 that indicates how much certainty we have + * in the error occurring at offset. A value of 1 means that the error definitely occurs at this + * site, a value of 0.0 means it definitely doesn't happen here. 0.5 means that half the weight + * of the error belongs here + * + * @param eventType the type of event we want the qual for + * @param offset the offset into this read for the qual + * @return a fractional weight for an error at this offset + */ + @Requires("validOffset(offset)") + @Ensures("result >= 0.0 && result <= 1.0") + public double getErrorFraction(final EventType eventType, final int offset) { + switch ( eventType ) { + case BASE_SUBSTITUTION: return snpErrors[offset]; + case BASE_INSERTION: return insertionErrors[offset]; + case BASE_DELETION: return deletionErrors[offset]; + default: throw new IllegalStateException("Unknown event type " + eventType); + } + } + + /** + * Get the read involved in this recalibration info + * @return a non-null GATKSAMRecord + */ + @Ensures("result != null") + public GATKSAMRecord getRead() { + return read; + } + + /** + * Should offset in this read be skipped (because it's covered by a known variation site?) + * @param offset a valid offset into this info + * @return true if offset should be skipped, false otherwise + */ + @Requires("validOffset(offset)") + public boolean skip(final int offset) { + return skips[offset]; + } + + /** + * Get the ReadCovariates object carrying the mapping from offsets -> covariate key sets + * @return a non-null ReadCovariates object + */ + @Ensures("result != null") + public ReadCovariates getCovariatesValues() { + return covariates; + } + + /** + * Ensures an offset is valid. Used in contracts + * @param offset a proposed offset + * @return true if offset is valid w.r.t. the data in this object, false otherwise + */ + private boolean validOffset(final int offset) { + return offset >= 0 && offset < baseQuals.length; + } + + private boolean validQual(final byte result) { + return result >= 0 && result <= QualityUtils.MAX_QUAL_SCORE; + } +} diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationArgumentCollection.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationArgumentCollection.java new file mode 100755 index 000000000..622413b18 --- /dev/null +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationArgumentCollection.java @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2010 The Broad Institute + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.broadinstitute.sting.gatk.walkers.bqsr; + +import org.broad.tribble.Feature; +import org.broadinstitute.sting.commandline.*; +import org.broadinstitute.sting.gatk.report.GATKReportTable; +import org.broadinstitute.sting.utils.recalibration.RecalUtils; + +import java.io.File; +import java.io.PrintStream; +import java.util.Collections; +import java.util.List; + +/** + * Created by IntelliJ IDEA. + * User: rpoplin + * Date: Nov 27, 2009 + * + * A collection of the arguments that are common to both CovariateCounterWalker and TableRecalibrationWalker. + * This set of arguments will also be passed to the constructor of every Covariate when it is instantiated. + */ + +public class RecalibrationArgumentCollection { + + /** + * This algorithm treats every reference mismatch as an indication of error. However, real genetic variation is expected to mismatch the reference, + * so it is critical that a database of known polymorphic sites is given to the tool in order to skip over those sites. This tool accepts any number of RodBindings (VCF, Bed, etc.) + * for use as this database. For users wishing to exclude an interval list of known variation simply use -XL my.interval.list to skip over processing those sites. + * Please note however that the statistics reported by the tool will not accurately reflected those sites skipped by the -XL argument. + */ + @Input(fullName = "knownSites", shortName = "knownSites", doc = "A database of known polymorphic sites to skip over in the recalibration algorithm", required = false) + public List> knownSites = Collections.emptyList(); + + /** + * After the header, data records occur one per line until the end of the file. The first several items on a line are the + * values of the individual covariates and will change depending on which covariates were specified at runtime. The last + * three items are the data- that is, number of observations for this combination of covariates, number of reference mismatches, + * and the raw empirical quality score calculated by phred-scaling the mismatch rate. Use '/dev/stdout' to print to standard out. + */ + @Gather(BQSRGatherer.class) + @Output(doc = "The output recalibration table file to create", required = true) + public File RECAL_TABLE_FILE = null; + public PrintStream RECAL_TABLE; + + /** + * If not provided, then no plots will be generated (useful for queue scatter/gathering). + * However, we *highly* recommend that users generate these plots whenever possible for QC checking. + */ + @Output(fullName = "plot_pdf_file", shortName = "plots", doc = "The output recalibration pdf file to create", required = false) + public File RECAL_PDF_FILE = null; + + /** + * If not provided, then a temporary file is created and then deleted upon completion. + * For advanced users only. + */ + @Advanced + @Argument(fullName = "intermediate_csv_file", shortName = "intermediate", doc = "The intermediate csv file to create", required = false) + public File RECAL_CSV_FILE = null; + + /** + * Note that the --list argument requires a fully resolved and correct command-line to work. + */ + @Argument(fullName = "list", shortName = "ls", doc = "List the available covariates and exit", required = false) + public boolean LIST_ONLY = false; + + /** + * Note that the ReadGroup and QualityScore covariates are required and do not need to be specified. + * Also, unless --no_standard_covs is specified, the Cycle and Context covariates are standard and are included by default. + * Use the --list argument to see the available covariates. + */ + @Argument(fullName = "covariate", shortName = "cov", doc = "One or more covariates to be used in the recalibration. Can be specified multiple times", required = false) + public String[] COVARIATES = null; + + /* + * The Cycle and Context covariates are standard and are included by default unless this argument is provided. + * Note that the ReadGroup and QualityScore covariates are required and cannot be excluded. + */ + @Argument(fullName = "no_standard_covs", shortName = "noStandard", doc = "Do not use the standard set of covariates, but rather just the ones listed using the -cov argument", required = false) + public boolean DO_NOT_USE_STANDARD_COVARIATES = false; + + /** + * This calculation is critically dependent on being able to skip over known polymorphic sites. Please be sure that you know what you are doing if you use this option. + */ + @Advanced + @Argument(fullName = "run_without_dbsnp_potentially_ruining_quality", shortName = "run_without_dbsnp_potentially_ruining_quality", required = false, doc = "If specified, allows the recalibrator to be used without a dbsnp rod. Very unsafe and for expert users only.") + public boolean RUN_WITHOUT_DBSNP = false; + + /** + * CountCovariates and TableRecalibration accept a --solid_recal_mode flag which governs how the recalibrator handles the + * reads which have had the reference inserted because of color space inconsistencies. + */ + @Argument(fullName = "solid_recal_mode", shortName = "sMode", required = false, doc = "How should we recalibrate solid bases in which the reference was inserted? Options = DO_NOTHING, SET_Q_ZERO, SET_Q_ZERO_BASE_N, or REMOVE_REF_BIAS") + public RecalUtils.SOLID_RECAL_MODE SOLID_RECAL_MODE = RecalUtils.SOLID_RECAL_MODE.SET_Q_ZERO; + + /** + * CountCovariates and TableRecalibration accept a --solid_nocall_strategy flag which governs how the recalibrator handles + * no calls in the color space tag. Unfortunately because of the reference inserted bases mentioned above, reads with no calls in + * their color space tag can not be recalibrated. + */ + @Argument(fullName = "solid_nocall_strategy", shortName = "solid_nocall_strategy", doc = "Defines the behavior of the recalibrator when it encounters no calls in the color space. Options = THROW_EXCEPTION, LEAVE_READ_UNRECALIBRATED, or PURGE_READ", required = false) + public RecalUtils.SOLID_NOCALL_STRATEGY SOLID_NOCALL_STRATEGY = RecalUtils.SOLID_NOCALL_STRATEGY.THROW_EXCEPTION; + + /** + * The context covariate will use a context of this size to calculate it's covariate value for base mismatches + */ + @Argument(fullName = "mismatches_context_size", shortName = "mcs", doc = "size of the k-mer context to be used for base mismatches", required = false) + public int MISMATCHES_CONTEXT_SIZE = 2; + + /** + * The context covariate will use a context of this size to calculate it's covariate value for base insertions and deletions + */ + @Argument(fullName = "indels_context_size", shortName = "ics", doc = "size of the k-mer context to be used for base insertions and deletions", required = false) + public int INDELS_CONTEXT_SIZE = 3; + + /** + * The cycle covariate will generate an error if it encounters a cycle greater than this value. + * This argument is ignored if the Cycle covariate is not used. + */ + @Argument(fullName = "maximum_cycle_value", shortName = "maxCycle", doc = "the maximum cycle value permitted for the Cycle covariate", required = false) + public int MAXIMUM_CYCLE_VALUE = 500; + + /** + * A default base qualities to use as a prior (reported quality) in the mismatch covariate model. This value will replace all base qualities in the read for this default value. Negative value turns it off (default is off) + */ + @Argument(fullName = "mismatches_default_quality", shortName = "mdq", doc = "default quality for the base mismatches covariate", required = false) + public byte MISMATCHES_DEFAULT_QUALITY = -1; + + /** + * A default base qualities to use as a prior (reported quality) in the insertion covariate model. This parameter is used for all reads without insertion quality scores for each base. (default is on) + */ + @Argument(fullName = "insertions_default_quality", shortName = "idq", doc = "default quality for the base insertions covariate", required = false) + public byte INSERTIONS_DEFAULT_QUALITY = 45; + + /** + * A default base qualities to use as a prior (reported quality) in the mismatch covariate model. This value will replace all base qualities in the read for this default value. Negative value turns it off (default is off) + */ + @Argument(fullName = "deletions_default_quality", shortName = "ddq", doc = "default quality for the base deletions covariate", required = false) + public byte DELETIONS_DEFAULT_QUALITY = 45; + + /** + * Reads with low quality bases on either tail (beginning or end) will not be considered in the context. This parameter defines the quality below which (inclusive) a tail is considered low quality + */ + @Argument(fullName = "low_quality_tail", shortName = "lqt", doc = "minimum quality for the bases in the tail of the reads to be considered", required = false) + public byte LOW_QUAL_TAIL = 2; + + /** + * BQSR generates a quantization table for quick quantization later by subsequent tools. BQSR does not quantize the base qualities, this is done by the engine with the -qq or -BQSR options. + * This parameter tells BQSR the number of levels of quantization to use to build the quantization table. + */ + @Argument(fullName = "quantizing_levels", shortName = "ql", required = false, doc = "number of distinct quality scores in the quantized output") + public int QUANTIZING_LEVELS = 16; + + /** + * The tag name for the binary tag covariate (if using it) + */ + @Argument(fullName = "binary_tag_name", shortName = "bintag", required = false, doc = "the binary tag covariate name if using it") + public String BINARY_TAG_NAME = null; + + /* + * whether GATK report tables should have rows in sorted order, starting from leftmost column + */ + @Argument(fullName = "sort_by_all_columns", shortName = "sortAllCols", doc = "Sort the rows in the tables of reports", required = false) + public Boolean SORT_BY_ALL_COLUMNS = false; + + ///////////////////////////// + // Debugging-only Arguments + ///////////////////////////// + + @Hidden + @Argument(fullName = "default_platform", shortName = "dP", required = false, doc = "If a read has no platform then default to the provided String. Valid options are illumina, 454, and solid.") + public String DEFAULT_PLATFORM = null; + + @Hidden + @Argument(fullName = "force_platform", shortName = "fP", required = false, doc = "If provided, the platform of EVERY read will be forced to be the provided String. Valid options are illumina, 454, and solid.") + public String FORCE_PLATFORM = null; + + @Hidden + @Output(fullName = "recal_table_update_log", shortName = "recal_table_update_log", required = false, doc = "If provided, log all updates to the recalibration tables to the given file. For debugging/testing purposes only") + public PrintStream RECAL_TABLE_UPDATE_LOG = null; + + public File existingRecalibrationReport = null; + + public GATKReportTable generateReportTable(final String covariateNames) { + GATKReportTable argumentsTable; + if(SORT_BY_ALL_COLUMNS) { + argumentsTable = new GATKReportTable("Arguments", "Recalibration argument collection values used in this run", 2, GATKReportTable.TableSortingWay.SORT_BY_COLUMN); + } else { + argumentsTable = new GATKReportTable("Arguments", "Recalibration argument collection values used in this run", 2); + } + argumentsTable.addColumn("Argument"); + argumentsTable.addColumn(RecalUtils.ARGUMENT_VALUE_COLUMN_NAME); + argumentsTable.addRowID("covariate", true); + argumentsTable.set("covariate", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, covariateNames); + argumentsTable.addRowID("no_standard_covs", true); + argumentsTable.set("no_standard_covs", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, DO_NOT_USE_STANDARD_COVARIATES); + argumentsTable.addRowID("run_without_dbsnp", true); + argumentsTable.set("run_without_dbsnp", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, RUN_WITHOUT_DBSNP); + argumentsTable.addRowID("solid_recal_mode", true); + argumentsTable.set("solid_recal_mode", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, SOLID_RECAL_MODE); + argumentsTable.addRowID("solid_nocall_strategy", true); + argumentsTable.set("solid_nocall_strategy", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, SOLID_NOCALL_STRATEGY); + argumentsTable.addRowID("mismatches_context_size", true); + argumentsTable.set("mismatches_context_size", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, MISMATCHES_CONTEXT_SIZE); + argumentsTable.addRowID("indels_context_size", true); + argumentsTable.set("indels_context_size", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, INDELS_CONTEXT_SIZE); + argumentsTable.addRowID("mismatches_default_quality", true); + argumentsTable.set("mismatches_default_quality", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, MISMATCHES_DEFAULT_QUALITY); + argumentsTable.addRowID("insertions_default_quality", true); + argumentsTable.set("insertions_default_quality", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, INSERTIONS_DEFAULT_QUALITY); + argumentsTable.addRowID("low_quality_tail", true); + argumentsTable.set("low_quality_tail", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, LOW_QUAL_TAIL); + argumentsTable.addRowID("default_platform", true); + argumentsTable.set("default_platform", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, DEFAULT_PLATFORM); + argumentsTable.addRowID("force_platform", true); + argumentsTable.set("force_platform", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, FORCE_PLATFORM); + argumentsTable.addRowID("quantizing_levels", true); + argumentsTable.set("quantizing_levels", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, QUANTIZING_LEVELS); + argumentsTable.addRowID("recalibration_report", true); + argumentsTable.set("recalibration_report", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, existingRecalibrationReport == null ? "null" : existingRecalibrationReport.getAbsolutePath()); + argumentsTable.addRowID("plot_pdf_file", true); + argumentsTable.set("plot_pdf_file", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, RECAL_PDF_FILE == null ? "null" : RECAL_PDF_FILE.getAbsolutePath()); + argumentsTable.addRowID("binary_tag_name", true); + argumentsTable.set("binary_tag_name", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, BINARY_TAG_NAME == null ? "null" : BINARY_TAG_NAME); + return argumentsTable; + } + +} diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationEngine.java new file mode 100644 index 000000000..ca9fb4bca --- /dev/null +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationEngine.java @@ -0,0 +1,216 @@ +/* + * Copyright (c) 2012 The Broad Institute + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.broadinstitute.sting.gatk.walkers.bqsr; + +import com.google.java.contract.Requires; +import org.broadinstitute.sting.utils.collections.NestedIntegerArray; +import org.broadinstitute.sting.utils.recalibration.*; +import org.broadinstitute.sting.utils.recalibration.covariates.Covariate; +import org.broadinstitute.sting.utils.sam.GATKSAMRecord; + +import java.io.PrintStream; +import java.util.LinkedList; +import java.util.List; + +public class RecalibrationEngine { + final protected Covariate[] covariates; + final private int numReadGroups; + final private PrintStream maybeLogStream; + final private boolean lowMemoryMode; + + /** + * Has finalizeData() been called? + */ + private boolean finalized = false; + + /** + * The final (merged, etc) recalibration tables, suitable for downstream analysis. + */ + private RecalibrationTables finalRecalibrationTables = null; + + private final List recalibrationTablesList = new LinkedList(); + + private final ThreadLocal threadLocalTables = new ThreadLocal() { + private synchronized RecalibrationTables makeAndCaptureTable() { + final RecalibrationTables newTable = new RecalibrationTables(covariates, numReadGroups, maybeLogStream); + recalibrationTablesList.add(newTable); + return newTable; + } + + @Override + protected synchronized RecalibrationTables initialValue() { + if ( lowMemoryMode ) { + return recalibrationTablesList.isEmpty() ? makeAndCaptureTable() : recalibrationTablesList.get(0); + } else { + return makeAndCaptureTable(); + } + } + }; + + /** + * Get a recalibration table suitable for updating the underlying RecalDatums + * + * May return a thread-local version, or a single version, depending on the initialization + * arguments of this instance. + * + * @return updated tables + */ + protected RecalibrationTables getUpdatableRecalibrationTables() { + return threadLocalTables.get(); + } + + /** + * Initialize the recalibration engine + * + * Called once before any calls to updateDataForRead are made. The engine should prepare itself + * to handle any number of updateDataForRead calls containing ReadRecalibrationInfo containing + * keys for each of the covariates provided. + * + * The engine should collect match and mismatch data into the recalibrationTables data. + * + * @param covariates an array of the covariates we'll be using in this engine, order matters + * @param numReadGroups the number of read groups we should use for the recalibration tables + * @param maybeLogStream an optional print stream for logging calls to the nestedhashmap in the recalibration tables + */ + public RecalibrationEngine(final Covariate[] covariates, final int numReadGroups, final PrintStream maybeLogStream, final boolean enableLowMemoryMode) { + if ( covariates == null ) throw new IllegalArgumentException("Covariates cannot be null"); + if ( numReadGroups < 1 ) throw new IllegalArgumentException("numReadGroups must be >= 1 but got " + numReadGroups); + + this.covariates = covariates.clone(); + this.numReadGroups = numReadGroups; + this.maybeLogStream = maybeLogStream; + this.lowMemoryMode = enableLowMemoryMode; + } + + /** + * Update the recalibration statistics using the information in recalInfo + * @param recalInfo data structure holding information about the recalibration values for a single read + */ + @Requires("recalInfo != null") + public void updateDataForRead( final ReadRecalibrationInfo recalInfo ) { + final GATKSAMRecord read = recalInfo.getRead(); + final ReadCovariates readCovariates = recalInfo.getCovariatesValues(); + final RecalibrationTables tables = getUpdatableRecalibrationTables(); + final NestedIntegerArray qualityScoreTable = tables.getQualityScoreTable(); + + for( int offset = 0; offset < read.getReadBases().length; offset++ ) { + if( ! recalInfo.skip(offset) ) { + + for (final EventType eventType : EventType.values()) { + final int[] keys = readCovariates.getKeySet(offset, eventType); + final int eventIndex = eventType.ordinal(); + final byte qual = recalInfo.getQual(eventType, offset); + final double isError = recalInfo.getErrorFraction(eventType, offset); + + RecalUtils.incrementDatumOrPutIfNecessary(qualityScoreTable, qual, isError, keys[0], keys[1], eventIndex); + + for (int i = 2; i < covariates.length; i++) { + if (keys[i] < 0) + continue; + + RecalUtils.incrementDatumOrPutIfNecessary(tables.getTable(i), qual, isError, keys[0], keys[1], keys[i], eventIndex); + } + } + } + } + } + + + /** + * Finalize, if appropriate, all derived data in recalibrationTables. + * + * Called once after all calls to updateDataForRead have been issued. + * + * Assumes that all of the principal tables (by quality score) have been completely updated, + * and walks over this data to create summary data tables like by read group table. + */ + public void finalizeData() { + if ( finalized ) throw new IllegalStateException("FinalizeData() has already been called"); + + // merge all of the thread-local tables + finalRecalibrationTables = mergeThreadLocalRecalibrationTables(); + + final NestedIntegerArray byReadGroupTable = finalRecalibrationTables.getReadGroupTable(); + final NestedIntegerArray byQualTable = finalRecalibrationTables.getQualityScoreTable(); + + // iterate over all values in the qual table + for ( NestedIntegerArray.Leaf leaf : byQualTable.getAllLeaves() ) { + final int rgKey = leaf.keys[0]; + final int eventIndex = leaf.keys[2]; + final RecalDatum rgDatum = byReadGroupTable.get(rgKey, eventIndex); + final RecalDatum qualDatum = leaf.value; + + if ( rgDatum == null ) { + // create a copy of qualDatum, and initialize byReadGroup table with it + byReadGroupTable.put(new RecalDatum(qualDatum), rgKey, eventIndex); + } else { + // combine the qual datum with the existing datum in the byReadGroup table + rgDatum.combine(qualDatum); + } + } + + finalized = true; + } + + /** + * Merge all of the thread local recalibration tables into a single one. + * + * Reuses one of the recalibration tables to hold the merged table, so this function can only be + * called once in the engine. + * + * @return the merged recalibration table + */ + @Requires("! finalized") + private RecalibrationTables mergeThreadLocalRecalibrationTables() { + if ( recalibrationTablesList.isEmpty() ) throw new IllegalStateException("recalibration tables list is empty"); + + RecalibrationTables merged = null; + for ( final RecalibrationTables table : recalibrationTablesList ) { + if ( merged == null ) + // fast path -- if there's only only one table, so just make it the merged one + merged = table; + else { + merged.combine(table); + } + } + + return merged; + } + + /** + * Get the final recalibration tables, after finalizeData() has been called + * + * This returns the finalized recalibration table collected by this engine. + * + * It is an error to call this function before finalizeData has been called + * + * @return the finalized recalibration table collected by this engine + */ + public RecalibrationTables getFinalRecalibrationTables() { + if ( ! finalized ) throw new IllegalStateException("Cannot get final recalibration tables until finalizeData() has been called"); + return finalRecalibrationTables; + } +} diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationPerformance.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationPerformance.java new file mode 100755 index 000000000..dc7c27db0 --- /dev/null +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/bqsr/RecalibrationPerformance.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2010 The Broad Institute + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.broadinstitute.sting.gatk.walkers.bqsr; + +import org.broadinstitute.sting.commandline.*; +import org.broadinstitute.sting.gatk.contexts.AlignmentContext; +import org.broadinstitute.sting.gatk.contexts.ReferenceContext; +import org.broadinstitute.sting.gatk.filters.*; +import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.report.GATKReport; +import org.broadinstitute.sting.gatk.report.GATKReportTable; +import org.broadinstitute.sting.gatk.walkers.*; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; +import org.broadinstitute.sting.utils.recalibration.*; + +import java.io.*; + +/** + */ + +@ReadFilters({MappingQualityZeroFilter.class, MappingQualityUnavailableFilter.class, UnmappedReadFilter.class, NotPrimaryAlignmentFilter.class, DuplicateReadFilter.class, FailsVendorQualityCheckFilter.class}) +@PartitionBy(PartitionType.READ) +public class RecalibrationPerformance extends RodWalker implements NanoSchedulable { + + @Output(doc="Write output to this file", required = true) + public PrintStream out; + + @Input(fullName="recal", shortName="recal", required=false, doc="The input covariates table file") + public File RECAL_FILE = null; + + public void initialize() { + out.println("Cycle\tQrep\tQemp\tIsJoint\tObservations\tErrors"); + + final GATKReport report = new GATKReport(RECAL_FILE); + final GATKReportTable table = report.getTable(RecalUtils.ALL_COVARIATES_REPORT_TABLE_TITLE); + for ( int row = 0; row < table.getNumRows(); row++ ) { + + final int nObservations = (int)asDouble(table.get(row, RecalUtils.NUMBER_OBSERVATIONS_COLUMN_NAME)); + final int nErrors = (int)Math.round(asDouble(table.get(row, RecalUtils.NUMBER_ERRORS_COLUMN_NAME))); + final double empiricalQuality = asDouble(table.get(row, RecalUtils.EMPIRICAL_QUALITY_COLUMN_NAME)); + + final byte QReported = Byte.parseByte((String) table.get(row, RecalUtils.QUALITY_SCORE_COLUMN_NAME)); + + final double jointEstimateQemp = RecalDatum.bayesianEstimateOfEmpiricalQuality(nObservations, nErrors, QReported); + + //if ( Math.abs((int)(jointEstimateQemp - empiricalQuality)) > 1 ) + // System.out.println(String.format("Qreported = %f, nObservations = %f, nErrors = %f, point Qemp = %f, joint Qemp = %f", estimatedQReported, nObservations, nErrors, empiricalQuality, jointEstimateQemp)); + + if ( table.get(row, RecalUtils.COVARIATE_NAME_COLUMN_NAME).equals("Cycle") && + table.get(row, RecalUtils.EVENT_TYPE_COLUMN_NAME).equals("M") && + table.get(row, RecalUtils.READGROUP_COLUMN_NAME).equals("20FUKAAXX100202.6") && + (QReported == 6 || QReported == 10 || QReported == 20 || QReported == 30 || QReported == 45) ) { + out.println(String.format("%s\t%d\t%d\t%s\t%d\t%d", table.get(row, RecalUtils.COVARIATE_VALUE_COLUMN_NAME), QReported, Math.round(empiricalQuality), "False", (int)nObservations, (int)nErrors)); + out.println(String.format("%s\t%d\t%d\t%s\t%d\t%d", table.get(row, RecalUtils.COVARIATE_VALUE_COLUMN_NAME), QReported, (int)jointEstimateQemp, "True", (int)nObservations, (int)nErrors)); + } + } + + } + + @Override + public boolean isDone() { + return true; + } + + private double asDouble(final Object o) { + if ( o instanceof Double ) + return (Double)o; + else if ( o instanceof Integer ) + return (Integer)o; + else if ( o instanceof Long ) + return (Long)o; + else + throw new ReviewedStingException("Object " + o + " is expected to be either a double, long or integer but its not either: " + o.getClass()); + } + + @Override + public Integer map(RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) { return 0; } + + @Override + public Integer reduceInit() { return 0; } + + @Override + public Integer reduce(Integer counter, Integer sum) { return 0; } + + @Override + public void onTraversalDone(Integer sum) {} +} \ No newline at end of file From dfe4cf13014c27bad575c26ab24eae6e2d85c50f Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Tue, 8 Jan 2013 09:24:12 -0500 Subject: [PATCH 13/25] When merging the PerReadAlleleLikelihoodMap classes, I forgot to initialize the underlying objects. This was causing the LargeScaleTests to fail. --- .../sting/utils/genotyper/PerReadAlleleLikelihoodMap.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/protected/java/src/org/broadinstitute/sting/utils/genotyper/PerReadAlleleLikelihoodMap.java b/protected/java/src/org/broadinstitute/sting/utils/genotyper/PerReadAlleleLikelihoodMap.java index 5dcd5eb6c..2379ccd1d 100644 --- a/protected/java/src/org/broadinstitute/sting/utils/genotyper/PerReadAlleleLikelihoodMap.java +++ b/protected/java/src/org/broadinstitute/sting/utils/genotyper/PerReadAlleleLikelihoodMap.java @@ -41,7 +41,10 @@ public class PerReadAlleleLikelihoodMap { protected List alleles; protected Map> likelihoodReadMap; - public PerReadAlleleLikelihoodMap() {} + public PerReadAlleleLikelihoodMap() { + likelihoodReadMap = new LinkedHashMap>(); + alleles = new ArrayList(); + } public void add(GATKSAMRecord read, Allele a, Double likelihood) { Map likelihoodMap; From b099e2b4ae8d4ae72fddf6b3c5081a1220362859 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Tue, 8 Jan 2013 09:34:08 -0500 Subject: [PATCH 14/25] Moving integration tests to protected --- .../sting/gatk/walkers/annotator/SnpEffUnitTest.java | 0 .../gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java | 0 .../sting/gatk/walkers/annotator/WalkerTestIntegrationTest.java | 0 .../sting/gatk/walkers/beagle/BeagleIntegrationTest.java | 0 .../sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java | 0 .../sting/gatk/walkers/bqsr/ReadRecalibrationInfoUnitTest.java | 0 .../walkers/diagnostics/ErrorRatePerCycleIntegrationTest.java | 0 .../walkers/diagnostics/ReadGroupPropertiesIntegrationTest.java | 0 .../sting/gatk/walkers/diffengine/DiffEngineUnitTest.java | 0 .../sting/gatk/walkers/diffengine/DiffNodeUnitTest.java | 0 .../sting/gatk/walkers/diffengine/DiffObjectsIntegrationTest.java | 0 .../sting/gatk/walkers/diffengine/DiffableReaderUnitTest.java | 0 .../sting/gatk/walkers/diffengine/DifferenceUnitTest.java | 0 .../walkers/fasta/FastaAlternateReferenceIntegrationTest.java | 0 .../gatk/walkers/filters/VariantFiltrationIntegrationTest.java | 0 .../gatk/walkers/genotyper/ArtificialReadPileupTestProvider.java | 0 .../sting/gatk/walkers/genotyper/DiploidGenotypeUnitTest.java | 0 .../gatk/walkers/genotyper/IndelGenotypeLikelihoodsUnitTest.java | 0 .../gatk/walkers/genotyper/UnifiedGenotyperLargeScaleTest.java | 0 .../sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java | 0 .../sting/gatk/walkers/indels/IndelRealignerLargeScaleTest.java | 0 .../walkers/indels/RealignerTargetCreatorIntegrationTest.java | 0 .../gatk/walkers/indels/RealignerTargetCreatorLargeScaleTest.java | 0 .../gatk/walkers/phasing/PhaseByTransmissionIntegrationTest.java | 0 .../gatk/walkers/phasing/ReadBackedPhasingIntegrationTest.java | 0 .../walkers/validation/ValidationAmpliconsIntegrationTest.java | 0 .../walkers/validation/ValidationSiteSelectorIntegrationTest.java | 0 .../gatk/walkers/varianteval/VariantEvalIntegrationTest.java | 0 .../sting/gatk/walkers/varianteval/VariantEvalWalkerUnitTest.java | 0 .../stratifications/manager/StratificationManagerUnitTest.java | 0 .../variantrecalibration/VariantGaussianMixtureModelUnitTest.java | 0 .../VariantRecalibrationWalkersIntegrationTest.java | 0 .../gatk/walkers/variantutils/CombineVariantsIntegrationTest.java | 0 .../sting/gatk/walkers/variantutils/CombineVariantsUnitTest.java | 0 .../walkers/variantutils/LeftAlignVariantsIntegrationTest.java | 0 .../walkers/variantutils/LiftoverVariantsIntegrationTest.java | 0 .../gatk/walkers/variantutils/SelectVariantsIntegrationTest.java | 0 .../variantutils/SelectVariantsParallelIntegrationTest.java | 0 .../gatk/walkers/variantutils/VCFStreamingIntegrationTest.java | 0 .../walkers/variantutils/ValidateVariantsIntegrationTest.java | 0 .../walkers/variantutils/VariantsToBinaryPedIntegrationTest.java | 0 .../gatk/walkers/variantutils/VariantsToTableIntegrationTest.java | 0 .../gatk/walkers/variantutils/VariantsToVCFIntegrationTest.java | 0 43 files changed, 0 insertions(+), 0 deletions(-) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/annotator/SnpEffUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/annotator/WalkerTestIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/beagle/BeagleIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfoUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycleIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadGroupPropertiesIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngineUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNodeUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjectsIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReaderUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DifferenceUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/fasta/FastaAlternateReferenceIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/ArtificialReadPileupTestProvider.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperLargeScaleTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerLargeScaleTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorLargeScaleTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmissionIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasingIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmpliconsIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationSiteSelectorIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalWalkerUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratificationManagerUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModelUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrationWalkersIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariantsIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariantsIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsParallelIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VCFStreamingIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariantsIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToBinaryPedIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTableIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCFIntegrationTest.java (100%) diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/SnpEffUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/annotator/SnpEffUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/SnpEffUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/annotator/SnpEffUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/WalkerTestIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/annotator/WalkerTestIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/WalkerTestIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/annotator/WalkerTestIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/beagle/BeagleIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/beagle/BeagleIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/beagle/BeagleIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/beagle/BeagleIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/BQSRGathererUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfoUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfoUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfoUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/bqsr/ReadRecalibrationInfoUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycleIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycleIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycleIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycleIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadGroupPropertiesIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadGroupPropertiesIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadGroupPropertiesIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/ReadGroupPropertiesIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngineUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngineUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngineUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngineUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNodeUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNodeUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNodeUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNodeUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjectsIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjectsIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjectsIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjectsIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReaderUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReaderUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReaderUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReaderUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DifferenceUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DifferenceUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DifferenceUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/diffengine/DifferenceUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/fasta/FastaAlternateReferenceIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/fasta/FastaAlternateReferenceIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/fasta/FastaAlternateReferenceIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/fasta/FastaAlternateReferenceIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/ArtificialReadPileupTestProvider.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/ArtificialReadPileupTestProvider.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/ArtificialReadPileupTestProvider.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/ArtificialReadPileupTestProvider.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/IndelGenotypeLikelihoodsUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperLargeScaleTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperLargeScaleTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperLargeScaleTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperLargeScaleTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerLargeScaleTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerLargeScaleTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerLargeScaleTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerLargeScaleTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorLargeScaleTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorLargeScaleTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorLargeScaleTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/indels/RealignerTargetCreatorLargeScaleTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmissionIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmissionIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmissionIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmissionIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasingIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasingIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasingIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/phasing/ReadBackedPhasingIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmpliconsIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmpliconsIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmpliconsIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationAmpliconsIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationSiteSelectorIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationSiteSelectorIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationSiteSelectorIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/validation/ValidationSiteSelectorIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalWalkerUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalWalkerUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalWalkerUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalWalkerUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratificationManagerUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratificationManagerUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratificationManagerUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/varianteval/stratifications/manager/StratificationManagerUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModelUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModelUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModelUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModelUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrationWalkersIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrationWalkersIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrationWalkersIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibrationWalkersIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariantsUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariantsIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariantsIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariantsIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LeftAlignVariantsIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariantsIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariantsIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariantsIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/LiftoverVariantsIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsParallelIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsParallelIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsParallelIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariantsParallelIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VCFStreamingIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VCFStreamingIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VCFStreamingIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VCFStreamingIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariantsIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariantsIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariantsIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariantsIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToBinaryPedIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToBinaryPedIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToBinaryPedIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToBinaryPedIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTableIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTableIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTableIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTableIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCFIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCFIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCFIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCFIntegrationTest.java From d6146d369a517db2195806151ac027d2e72052d8 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Tue, 8 Jan 2013 12:58:31 -0500 Subject: [PATCH 15/25] Remove all of the references to ProgramElementDoc --- .../sting/utils/help/HelpConstants.java | 44 ------------------- 1 file changed, 44 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/utils/help/HelpConstants.java b/public/java/src/org/broadinstitute/sting/utils/help/HelpConstants.java index da66ff33d..21885cba7 100644 --- a/public/java/src/org/broadinstitute/sting/utils/help/HelpConstants.java +++ b/public/java/src/org/broadinstitute/sting/utils/help/HelpConstants.java @@ -24,13 +24,6 @@ package org.broadinstitute.sting.utils.help; -import com.sun.javadoc.FieldDoc; -import com.sun.javadoc.PackageDoc; -import com.sun.javadoc.ProgramElementDoc; -import org.broadinstitute.sting.utils.classloader.JVMUtils; - -import java.lang.reflect.Field; - public class HelpConstants { public final static String BASE_GATK_URL = "http://www.broadinstitute.org/gatk"; @@ -41,41 +34,4 @@ public class HelpConstants { public static String forumPost(String post) { return GATK_FORUM_URL + post; } - - protected static boolean assignableToClass(ProgramElementDoc classDoc, Class lhsClass, boolean requireConcrete) { - try { - Class type = getClassForDoc(classDoc); - return lhsClass.isAssignableFrom(type) && (!requireConcrete || JVMUtils.isConcrete(type)); - } catch (Throwable t) { - // Ignore errors. - return false; - } - } - - protected static Class getClassForDoc(ProgramElementDoc doc) throws ClassNotFoundException { - return Class.forName(getClassName(doc)); - } - - protected static Field getFieldForFieldDoc(FieldDoc fieldDoc) { - try { - Class clazz = getClassForDoc(fieldDoc.containingClass()); - return JVMUtils.findField(clazz, fieldDoc.name()); - } catch (ClassNotFoundException e) { - throw new RuntimeException(e); - } - } - - /** - * Reconstitute the class name from the given class JavaDoc object. - * - * @param doc the Javadoc model for the given class. - * @return The (string) class name of the given class. - */ - protected static String getClassName(ProgramElementDoc doc) { - PackageDoc containingPackage = doc.containingPackage(); - return containingPackage.name().length() > 0 ? - String.format("%s.%s", containingPackage.name(), doc.name()) : - String.format("%s", doc.name()); - } - } \ No newline at end of file From 9cbb2b868fadc50bb14ff2c63fca997c131f7c40 Mon Sep 17 00:00:00 2001 From: Tad Jordan Date: Tue, 8 Jan 2013 14:53:07 -0500 Subject: [PATCH 17/25] ErrorRatePerCycleIntegrationTest fix -- sorting by row is required --- .../sting/gatk/walkers/diagnostics/ErrorRatePerCycle.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycle.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycle.java index 98e581e21..5972322f8 100755 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycle.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/diagnostics/ErrorRatePerCycle.java @@ -124,7 +124,7 @@ public class ErrorRatePerCycle extends LocusWalker { public void initialize() { report = new GATKReport(); - report.addTable(reportName, reportDescription, 6); + report.addTable(reportName, reportDescription, 6, GATKReportTable.TableSortingWay.SORT_BY_ROW); table = report.getTable(reportName); table.addColumn("readgroup"); table.addColumn("cycle"); From f0bd1b5ae5a4c8fb1eb0385425a235c41db8f26a Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Tue, 8 Jan 2013 15:46:32 -0500 Subject: [PATCH 18/25] Okay, all public->protected dependencies are gone except for the BQSR arguments. I'll need to think through this but should be able to make that work too. --- .../gatk/arguments/StandardCallerArgumentCollection.java | 0 .../genotyper/SNPGenotypeLikelihoodsCalculationModel.java | 1 + .../sting/gatk/examples/GATKPaperGenotyper.java | 8 +++++--- .../sting/utils}/genotyper/DiploidGenotype.java | 2 +- .../sting/utils/recalibration/BQSRMode.java | 0 .../sting/utils/recalibration/EventType.java | 0 6 files changed, 7 insertions(+), 4 deletions(-) rename {public => protected}/java/src/org/broadinstitute/sting/gatk/arguments/StandardCallerArgumentCollection.java (100%) rename {protected/java/src/org/broadinstitute/sting/gatk/walkers => public/java/src/org/broadinstitute/sting/utils}/genotyper/DiploidGenotype.java (98%) rename {protected => public}/java/src/org/broadinstitute/sting/utils/recalibration/BQSRMode.java (100%) rename {protected => public}/java/src/org/broadinstitute/sting/utils/recalibration/EventType.java (100%) diff --git a/public/java/src/org/broadinstitute/sting/gatk/arguments/StandardCallerArgumentCollection.java b/protected/java/src/org/broadinstitute/sting/gatk/arguments/StandardCallerArgumentCollection.java similarity index 100% rename from public/java/src/org/broadinstitute/sting/gatk/arguments/StandardCallerArgumentCollection.java rename to protected/java/src/org/broadinstitute/sting/gatk/arguments/StandardCallerArgumentCollection.java diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java index 80a787fe0..4cc152d53 100755 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SNPGenotypeLikelihoodsCalculationModel.java @@ -37,6 +37,7 @@ import org.broadinstitute.sting.utils.MathUtils; import org.broadinstitute.sting.utils.baq.BAQ; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.genotyper.PerReadAlleleLikelihoodMap; +import org.broadinstitute.sting.utils.genotyper.DiploidGenotype; import org.broadinstitute.sting.utils.pileup.PileupElement; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; import org.broadinstitute.sting.utils.pileup.ReadBackedPileupImpl; diff --git a/public/java/src/org/broadinstitute/sting/gatk/examples/GATKPaperGenotyper.java b/public/java/src/org/broadinstitute/sting/gatk/examples/GATKPaperGenotyper.java index 6482354a9..1c227170d 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/examples/GATKPaperGenotyper.java +++ b/public/java/src/org/broadinstitute/sting/gatk/examples/GATKPaperGenotyper.java @@ -33,8 +33,7 @@ import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.walkers.LocusWalker; import org.broadinstitute.sting.gatk.walkers.TreeReducible; -import org.broadinstitute.sting.gatk.walkers.genotyper.UnifiedGenotyperEngine; -import org.broadinstitute.sting.gatk.walkers.genotyper.DiploidGenotype; +import org.broadinstitute.sting.utils.genotyper.DiploidGenotype; import org.broadinstitute.sting.utils.MathUtils; import org.broadinstitute.sting.utils.help.DocumentedGATKFeature; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; @@ -50,6 +49,9 @@ import java.io.PrintStream; */ @DocumentedGATKFeature( groupName = "Variant Discovery Tools", extraDocs = {CommandLineGATK.class} ) public class GATKPaperGenotyper extends LocusWalker implements TreeReducible { + + public static final double HUMAN_SNP_HETEROZYGOSITY = 1e-3; + // the possible diploid genotype strings private static enum GENOTYPE { AA, AC, AG, AT, CC, CG, CT, GG, GT, TT } @@ -73,7 +75,7 @@ public class GATKPaperGenotyper extends LocusWalker implements Tre ReadBackedPileup pileup = context.getBasePileup().getPileupWithoutMappingQualityZeroReads(); double likelihoods[] = getReferencePolarizedPriors(ref.getBase(), - UnifiedGenotyperEngine.HUMAN_SNP_HETEROZYGOSITY, + HUMAN_SNP_HETEROZYGOSITY, 0.01); // get the bases and qualities from the pileup byte bases[] = pileup.getBases(); diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotype.java b/public/java/src/org/broadinstitute/sting/utils/genotyper/DiploidGenotype.java similarity index 98% rename from protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotype.java rename to public/java/src/org/broadinstitute/sting/utils/genotyper/DiploidGenotype.java index 86047d30b..6d90038d7 100755 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotype.java +++ b/public/java/src/org/broadinstitute/sting/utils/genotyper/DiploidGenotype.java @@ -23,7 +23,7 @@ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package org.broadinstitute.sting.gatk.walkers.genotyper; +package org.broadinstitute.sting.utils.genotyper; import org.broadinstitute.variant.utils.BaseUtils; diff --git a/protected/java/src/org/broadinstitute/sting/utils/recalibration/BQSRMode.java b/public/java/src/org/broadinstitute/sting/utils/recalibration/BQSRMode.java similarity index 100% rename from protected/java/src/org/broadinstitute/sting/utils/recalibration/BQSRMode.java rename to public/java/src/org/broadinstitute/sting/utils/recalibration/BQSRMode.java diff --git a/protected/java/src/org/broadinstitute/sting/utils/recalibration/EventType.java b/public/java/src/org/broadinstitute/sting/utils/recalibration/EventType.java similarity index 100% rename from protected/java/src/org/broadinstitute/sting/utils/recalibration/EventType.java rename to public/java/src/org/broadinstitute/sting/utils/recalibration/EventType.java From ee7d85c6e608fc58ede79f08f7dbc8de9ebd3019 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Tue, 8 Jan 2013 15:53:11 -0500 Subject: [PATCH 19/25] Move around the DiploidGenotype classes (so it can be used by the GATKPaperGenotyper) --- .../gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java | 1 + .../walkers => utils}/genotyper/DiploidGenotypeUnitTest.java | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) rename protected/java/test/org/broadinstitute/sting/{gatk/walkers => utils}/genotyper/DiploidGenotypeUnitTest.java (95%) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java index 290c33b2b..4f108005d 100755 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidSNPGenotypeLikelihoods.java @@ -31,6 +31,7 @@ import org.broadinstitute.sting.utils.MathUtils; import org.broadinstitute.sting.utils.QualityUtils; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.fragments.FragmentCollection; +import org.broadinstitute.sting.utils.genotyper.DiploidGenotype; import org.broadinstitute.sting.utils.pileup.PileupElement; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; diff --git a/protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeUnitTest.java b/protected/java/test/org/broadinstitute/sting/utils/genotyper/DiploidGenotypeUnitTest.java similarity index 95% rename from protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeUnitTest.java rename to protected/java/test/org/broadinstitute/sting/utils/genotyper/DiploidGenotypeUnitTest.java index 4e72b37a4..c6dff6fe7 100644 --- a/protected/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeUnitTest.java +++ b/protected/java/test/org/broadinstitute/sting/utils/genotyper/DiploidGenotypeUnitTest.java @@ -1,6 +1,5 @@ -package org.broadinstitute.sting.gatk.walkers.genotyper; +package org.broadinstitute.sting.utils.genotyper; -import org.broadinstitute.sting.gatk.walkers.genotyper.DiploidGenotype; import org.testng.Assert; import org.broadinstitute.sting.BaseTest; From 264cc9e78d473c12d9daa6e61e62f10caa0cef72 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Tue, 8 Jan 2013 16:23:29 -0500 Subject: [PATCH 20/25] Resolve protected->public dependencies for BQSR by wrapping the BQSR-specific arguments in a new class. Instead of the GATK Engine creating a new BaseRecalibrator (not clean), it just keeps track of the arguments (clean). There are still some dependency issues, but it looks like they are related to Ami's code. Need to look into it further. --- .../recalibration/BQSRReadTransformer.java | 9 ++- .../sting/gatk/GenomeAnalysisEngine.java | 14 ++-- .../arguments/GATKArgumentCollection.java | 6 +- .../utils/recalibration/BQSRArgumentSet.java | 77 +++++++++++++++++++ 4 files changed, 93 insertions(+), 13 deletions(-) create mode 100644 public/java/src/org/broadinstitute/sting/utils/recalibration/BQSRArgumentSet.java diff --git a/protected/java/src/org/broadinstitute/sting/utils/recalibration/BQSRReadTransformer.java b/protected/java/src/org/broadinstitute/sting/utils/recalibration/BQSRReadTransformer.java index fae0e8c09..de1ed5602 100644 --- a/protected/java/src/org/broadinstitute/sting/utils/recalibration/BQSRReadTransformer.java +++ b/protected/java/src/org/broadinstitute/sting/utils/recalibration/BQSRReadTransformer.java @@ -14,12 +14,15 @@ import org.broadinstitute.sting.utils.sam.GATKSAMRecord; */ public class BQSRReadTransformer extends ReadTransformer { private boolean enabled; - private BaseRecalibration bqsr; + private BaseRecalibration bqsr = null; @Override public ApplicationTime initializeSub(final GenomeAnalysisEngine engine, final Walker walker) { - this.enabled = engine.hasBaseRecalibration(); - this.bqsr = engine.getBaseRecalibration(); + this.enabled = engine.hasBQSRArgumentSet(); + if ( enabled ) { + final BQSRArgumentSet args = engine.getBQSRArgumentSet(); + this.bqsr = new BaseRecalibration(args.getRecalFile(), args.getQuantizationLevels(), args.shouldDisableIndelQuals(), args.getPreserveQscoresLessThan(), args.shouldEmitOriginalQuals()); + } final BQSRMode mode = WalkerManager.getWalkerAnnotation(walker, BQSRMode.class); return mode.ApplicationTime(); } diff --git a/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java b/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java index 54907f9f2..da6e68697 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java +++ b/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java @@ -58,7 +58,7 @@ import org.broadinstitute.sting.utils.collections.Pair; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.interval.IntervalUtils; -import org.broadinstitute.sting.utils.recalibration.BaseRecalibration; +import org.broadinstitute.sting.utils.recalibration.BQSRArgumentSet; import org.broadinstitute.sting.utils.threading.ThreadEfficiencyMonitor; import java.io.File; @@ -209,11 +209,11 @@ public class GenomeAnalysisEngine { /** * Base Quality Score Recalibration helper object */ - private BaseRecalibration baseRecalibration = null; - public BaseRecalibration getBaseRecalibration() { return baseRecalibration; } - public boolean hasBaseRecalibration() { return baseRecalibration != null; } - public void setBaseRecalibration(final File recalFile, final int quantizationLevels, final boolean disableIndelQuals, final int preserveQLessThan, final boolean emitOriginalQuals) { - baseRecalibration = new BaseRecalibration(recalFile, quantizationLevels, disableIndelQuals, preserveQLessThan, emitOriginalQuals); + private BQSRArgumentSet bqsrArgumentSet = null; + public BQSRArgumentSet getBQSRArgumentSet() { return bqsrArgumentSet; } + public boolean hasBQSRArgumentSet() { return bqsrArgumentSet != null; } + public void setBaseRecalibration(final GATKArgumentCollection args) { + bqsrArgumentSet = new BQSRArgumentSet(args); } /** @@ -242,7 +242,7 @@ public class GenomeAnalysisEngine { // if the use specified an input BQSR recalibration table then enable on the fly recalibration if (args.BQSR_RECAL_FILE != null) - setBaseRecalibration(args.BQSR_RECAL_FILE, args.quantizationLevels, args.disableIndelQuals, args.PRESERVE_QSCORES_LESS_THAN, args.emitOriginalQuals); + setBaseRecalibration(args); // Determine how the threads should be divided between CPU vs. IO. determineThreadAllocation(); diff --git a/public/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java b/public/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java index d9c7c9008..3a3a3d705 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java +++ b/public/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java @@ -284,15 +284,15 @@ public class GATKArgumentCollection { @Argument(fullName = "preserve_qscores_less_than", shortName = "preserveQ", doc = "Bases with quality scores less than this threshold won't be recalibrated (with -BQSR)", required = false) public int PRESERVE_QSCORES_LESS_THAN = QualityUtils.MIN_USABLE_Q_SCORE; - @Argument(fullName="defaultBaseQualities", shortName = "DBQ", doc = "If reads are missing some or all base quality scores, this value will be used for all base quality scores", required=false) - public byte defaultBaseQualities = -1; - // -------------------------------------------------------------------------------------------------------------- // // Other utility arguments // // -------------------------------------------------------------------------------------------------------------- + @Argument(fullName="defaultBaseQualities", shortName = "DBQ", doc = "If reads are missing some or all base quality scores, this value will be used for all base quality scores", required=false) + public byte defaultBaseQualities = -1; + @Argument(fullName = "validation_strictness", shortName = "S", doc = "How strict should we be with validation", required = false) public SAMFileReader.ValidationStringency strictnessLevel = SAMFileReader.ValidationStringency.SILENT; diff --git a/public/java/src/org/broadinstitute/sting/utils/recalibration/BQSRArgumentSet.java b/public/java/src/org/broadinstitute/sting/utils/recalibration/BQSRArgumentSet.java new file mode 100644 index 000000000..fbd69c762 --- /dev/null +++ b/public/java/src/org/broadinstitute/sting/utils/recalibration/BQSRArgumentSet.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010 The Broad Institute + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.broadinstitute.sting.utils.recalibration; + +import org.broadinstitute.sting.gatk.arguments.GATKArgumentCollection; + +import java.io.File; + +public class BQSRArgumentSet { + // declare public, STL-style for easier and more efficient access: + private File BQSR_RECAL_FILE; + private int quantizationLevels; + private boolean disableIndelQuals; + private boolean emitOriginalQuals; + private int PRESERVE_QSCORES_LESS_THAN; + + public BQSRArgumentSet(final GATKArgumentCollection args) { + this.BQSR_RECAL_FILE = args.BQSR_RECAL_FILE; + this.quantizationLevels = args.quantizationLevels; + this.disableIndelQuals = args.disableIndelQuals; + this.emitOriginalQuals = args.emitOriginalQuals; + this.PRESERVE_QSCORES_LESS_THAN = args.PRESERVE_QSCORES_LESS_THAN; + } + + public File getRecalFile() { return BQSR_RECAL_FILE; } + + public int getQuantizationLevels() { return quantizationLevels; } + + public boolean shouldDisableIndelQuals() { return disableIndelQuals; } + + public boolean shouldEmitOriginalQuals() { return emitOriginalQuals; } + + public int getPreserveQscoresLessThan() { return PRESERVE_QSCORES_LESS_THAN; } + + public void setRecalFile(final File BQSR_RECAL_FILE) { + this.BQSR_RECAL_FILE = BQSR_RECAL_FILE; + } + + public void setQuantizationLevels(final int quantizationLevels) { + this.quantizationLevels = quantizationLevels; + } + + public void setDisableIndelQuals(final boolean disableIndelQuals) { + this.disableIndelQuals = disableIndelQuals; + } + + public void setEmitOriginalQuals(final boolean emitOriginalQuals) { + this.emitOriginalQuals = emitOriginalQuals; + } + + public void setPreserveQscoresLessThan(final int PRESERVE_QSCORES_LESS_THAN) { + this.PRESERVE_QSCORES_LESS_THAN = PRESERVE_QSCORES_LESS_THAN; + } +} From c87ad8c0ef9868a86463e58343322261b0e4fe77 Mon Sep 17 00:00:00 2001 From: Ryan Poplin Date: Wed, 9 Jan 2013 10:00:46 -0500 Subject: [PATCH 21/25] Bug fixes related to HC's GGA mode. Tracking just the artificial allele isn't sufficient when there are multiple GGA records that change the reference basis. Also, duplicated records screw up the tracking of merged alleles. --- .../haplotypecaller/GenotypingEngine.java | 33 +++++++++----- .../SimpleDeBruijnAssembler.java | 5 ++- .../broadinstitute/sting/utils/Haplotype.java | 43 +++++++++++++------ 3 files changed, 55 insertions(+), 26 deletions(-) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java index 0c7e43525..7c25ab551 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java @@ -115,19 +115,31 @@ public class GenotypingEngine { } } } else { // we are in GGA mode! + int compCount = 0; for( final VariantContext compVC : activeAllelesToGenotype ) { if( compVC.getStart() == loc ) { - priorityList.clear(); int alleleCount = 0; for( final Allele compAltAllele : compVC.getAlternateAlleles() ) { ArrayList alleleSet = new ArrayList(2); alleleSet.add(compVC.getReference()); alleleSet.add(compAltAllele); - priorityList.add("Allele" + alleleCount); - eventsAtThisLoc.add(new VariantContextBuilder(compVC).alleles(alleleSet).source("Allele"+alleleCount).make()); + final String vcSourceName = "Comp" + compCount + "Allele" + alleleCount; + // check if this event is already in the list of events due to a repeat in the input alleles track + final VariantContext candidateEventToAdd = new VariantContextBuilder(compVC).alleles(alleleSet).source(vcSourceName).make(); + boolean alreadyExists = false; + for( final VariantContext eventToTest : eventsAtThisLoc ) { + if( eventToTest.hasSameAllelesAs(candidateEventToAdd) ) { + alreadyExists = true; + } + } + if( !alreadyExists ) { + priorityList.add(vcSourceName); + eventsAtThisLoc.add(candidateEventToAdd); + } alleleCount++; } } + compCount++; } } @@ -137,14 +149,14 @@ public class GenotypingEngine { final Map> eventMapper = createEventMapper(loc, eventsAtThisLoc, haplotypes); // Sanity check the priority list for mistakes - sanityCheckPriorityList( priorityList, eventsAtThisLoc ); + validatePriorityList( priorityList, eventsAtThisLoc ); // Merge the event to find a common reference representation final VariantContext mergedVC = VariantContextUtils.simpleMerge(eventsAtThisLoc, priorityList, VariantContextUtils.FilteredRecordMergeType.KEEP_IF_ANY_UNFILTERED, VariantContextUtils.GenotypeMergeType.PRIORITIZE, false, false, null, false, false); if( mergedVC == null ) { continue; } if( eventsAtThisLoc.size() != mergedVC.getAlternateAlleles().size() ) { - throw new ReviewedStingException("Something went wrong in the merging of alleles."); + throw new ReviewedStingException("Record size mismatch! Something went wrong in the merging of alleles."); } final HashMap mergeMap = new HashMap(); mergeMap.put(null, mergedVC.getReference()); // the reference event (null) --> the reference allele @@ -198,7 +210,7 @@ public class GenotypingEngine { return genotypes; } - private void sanityCheckPriorityList( final ArrayList priorityList, final ArrayList eventsAtThisLoc ) { + private void validatePriorityList( final ArrayList priorityList, final ArrayList eventsAtThisLoc ) { for( final VariantContext vc : eventsAtThisLoc ) { if( !priorityList.contains(vc.getSource()) ) { throw new ReviewedStingException("Event found on haplotype that wasn't added to priority list. Something went wrong in the merging of alleles."); @@ -453,8 +465,7 @@ public class GenotypingEngine { protected static Map> createEventMapper( final int loc, final List eventsAtThisLoc, final List haplotypes ) { final Map> eventMapper = new HashMap>(eventsAtThisLoc.size()+1); - final Allele refAllele = eventsAtThisLoc.get(0).getReference(); - VariantContext refVC = eventsAtThisLoc.get(0); + VariantContext refVC = eventsAtThisLoc.get(0); // the genome loc is the only safe thing to pull out of this VC because ref/alt pairs might change reference basis eventMapper.put(new Event(null), new ArrayList()); for( final VariantContext vc : eventsAtThisLoc ) { eventMapper.put(new Event(vc), new ArrayList()); @@ -464,11 +475,11 @@ public class GenotypingEngine { for( final Haplotype h : haplotypes ) { if( h.isArtificialHaplotype() && loc == h.getArtificialAllelePosition() ) { final ArrayList alleles = new ArrayList(2); - alleles.add(refAllele); - alleles.add(h.getArtificialAllele()); + alleles.add(h.getArtificialRefAllele()); + alleles.add(h.getArtificialAltAllele()); final Event artificialVC = new Event( (new VariantContextBuilder()).source("artificialHaplotype") .alleles(alleles) - .loc(refVC.getChr(), refVC.getStart(), refVC.getStart() + refAllele.length() - 1).make() ); + .loc(refVC.getChr(), refVC.getStart(), refVC.getStart() + h.getArtificialRefAllele().length() - 1).make() ); if( eventMapper.containsKey(artificialVC) ) { eventMapper.get(artificialVC).add(h); } diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/SimpleDeBruijnAssembler.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/SimpleDeBruijnAssembler.java index 0a98f54e9..87db5c9f7 100755 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/SimpleDeBruijnAssembler.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/SimpleDeBruijnAssembler.java @@ -379,8 +379,9 @@ public class SimpleDeBruijnAssembler extends LocalAssemblyEngine { h.setAlignmentStartHapwrtRef( swConsensus2.getAlignmentStart2wrt1() ); h.setCigar( AlignmentUtils.leftAlignIndel(swConsensus2.getCigar(), ref, h.getBases(), swConsensus2.getAlignmentStart2wrt1(), 0) ); - if ( haplotype.isArtificialHaplotype() ) - h.setArtificialAllele(haplotype.getArtificialAllele(), haplotype.getArtificialAllelePosition()); + if ( haplotype.isArtificialHaplotype() ) { + h.setArtificialEvent(haplotype.getArtificialEvent()); + } h.leftBreakPoint = leftBreakPoint; h.rightBreakPoint = rightBreakPoint; if( swConsensus2.getCigar().toString().contains("S") || swConsensus2.getCigar().getReferenceLength() != activeRegionStop - activeRegionStart ) { // protect against SW failures diff --git a/public/java/src/org/broadinstitute/sting/utils/Haplotype.java b/public/java/src/org/broadinstitute/sting/utils/Haplotype.java index 2476a666e..dfca05fcd 100755 --- a/public/java/src/org/broadinstitute/sting/utils/Haplotype.java +++ b/public/java/src/org/broadinstitute/sting/utils/Haplotype.java @@ -46,8 +46,7 @@ public class Haplotype { private int alignmentStartHapwrtRef; public int leftBreakPoint = 0; public int rightBreakPoint = 0; - private Allele artificialAllele = null; - private int artificialAllelePosition = -1; + private Event artificialEvent = null; /** * Create a simple consensus sequence with provided bases and a uniform quality over all bases of qual @@ -70,10 +69,9 @@ public class Haplotype { this(bases, 0); } - protected Haplotype( final byte[] bases, final Allele artificialAllele, final int artificialAllelePosition ) { + protected Haplotype( final byte[] bases, final Event artificialEvent ) { this(bases, 0); - this.artificialAllele = artificialAllele; - this.artificialAllelePosition = artificialAllelePosition; + this.artificialEvent = artificialEvent; } public Haplotype( final byte[] bases, final GenomeLoc loc ) { @@ -152,20 +150,27 @@ public class Haplotype { } public boolean isArtificialHaplotype() { - return artificialAllele != null; + return artificialEvent != null; } - public Allele getArtificialAllele() { - return artificialAllele; + public Event getArtificialEvent() { + return artificialEvent; + } + + public Allele getArtificialRefAllele() { + return artificialEvent.ref; + } + + public Allele getArtificialAltAllele() { + return artificialEvent.alt; } public int getArtificialAllelePosition() { - return artificialAllelePosition; + return artificialEvent.pos; } - public void setArtificialAllele(final Allele artificialAllele, final int artificialAllelePosition) { - this.artificialAllele = artificialAllele; - this.artificialAllelePosition = artificialAllelePosition; + public void setArtificialEvent( final Event artificialEvent ) { + this.artificialEvent = artificialEvent; } @Requires({"refInsertLocation >= 0"}) @@ -179,7 +184,7 @@ public class Haplotype { newHaplotypeBases = ArrayUtils.addAll(newHaplotypeBases, ArrayUtils.subarray(bases, 0, haplotypeInsertLocation)); // bases before the variant newHaplotypeBases = ArrayUtils.addAll(newHaplotypeBases, altAllele.getBases()); // the alt allele of the variant newHaplotypeBases = ArrayUtils.addAll(newHaplotypeBases, ArrayUtils.subarray(bases, haplotypeInsertLocation + refAllele.length(), bases.length)); // bases after the variant - return new Haplotype(newHaplotypeBases, altAllele, genomicInsertLocation); + return new Haplotype(newHaplotypeBases, new Event(refAllele, altAllele, genomicInsertLocation)); } public static class HaplotypeBaseComparator implements Comparator, Serializable { @@ -244,4 +249,16 @@ public class Haplotype { return haplotypeMap; } + + private static class Event { + public Allele ref; + public Allele alt; + public int pos; + + public Event( final Allele ref, final Allele alt, final int pos ) { + this.ref = ref; + this.alt = alt; + this.pos = pos; + } + } } From 676e79542aad40283da659a4bea4021a1785a170 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Wed, 9 Jan 2013 10:39:48 -0500 Subject: [PATCH 22/25] Bring CombineVariants back to public since it's used for SG. I needed to break ChromosomeCountConstants out of ChromosomeCounts to make this work. --- .../walkers/annotator/ChromosomeCounts.java | 12 +---- .../annotator/ChromosomeCountConstants.java | 44 +++++++++++++++++++ .../walkers/variantutils/CombineVariants.java | 4 +- 3 files changed, 48 insertions(+), 12 deletions(-) create mode 100755 public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCountConstants.java rename {protected => public}/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariants.java (99%) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java index 5b1a1e236..517cb0df0 100755 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java @@ -35,10 +35,8 @@ import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompa import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.utils.genotyper.PerReadAlleleLikelihoodMap; -import org.broadinstitute.variant.vcf.VCFConstants; import org.broadinstitute.variant.vcf.VCFHeaderLine; import org.broadinstitute.variant.vcf.VCFInfoHeaderLine; -import org.broadinstitute.variant.vcf.VCFStandardHeaderLines; import org.broadinstitute.variant.variantcontext.VariantContext; import org.broadinstitute.variant.variantcontext.VariantContextUtils; @@ -52,12 +50,6 @@ import java.util.*; */ public class ChromosomeCounts extends InfoFieldAnnotation implements StandardAnnotation, ActiveRegionBasedAnnotation { - public static final String[] keyNames = { VCFConstants.ALLELE_NUMBER_KEY, VCFConstants.ALLELE_COUNT_KEY, VCFConstants.ALLELE_FREQUENCY_KEY }; - public static final VCFInfoHeaderLine[] descriptions = { - VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_FREQUENCY_KEY), - VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_COUNT_KEY), - VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_NUMBER_KEY) }; - private Set founderIds = new HashSet(); public Map annotate(final RefMetaDataTracker tracker, @@ -78,8 +70,8 @@ public class ChromosomeCounts extends InfoFieldAnnotation implements StandardAnn } public List getKeyNames() { - return Arrays.asList(keyNames); + return Arrays.asList(ChromosomeCountConstants.keyNames); } - public List getDescriptions() { return Arrays.asList(descriptions); } + public List getDescriptions() { return Arrays.asList(ChromosomeCountConstants.descriptions); } } \ No newline at end of file diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCountConstants.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCountConstants.java new file mode 100755 index 000000000..26f3bb8d9 --- /dev/null +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCountConstants.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2010. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.broadinstitute.sting.gatk.walkers.annotator; + +import org.broadinstitute.variant.vcf.VCFConstants; +import org.broadinstitute.variant.vcf.VCFInfoHeaderLine; +import org.broadinstitute.variant.vcf.VCFStandardHeaderLines; + + +/** + * Keys and descriptions for the common chromosome count annotations + */ +public class ChromosomeCountConstants { + + public static final String[] keyNames = { VCFConstants.ALLELE_NUMBER_KEY, VCFConstants.ALLELE_COUNT_KEY, VCFConstants.ALLELE_FREQUENCY_KEY }; + + public static final VCFInfoHeaderLine[] descriptions = { + VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_FREQUENCY_KEY), + VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_COUNT_KEY), + VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_NUMBER_KEY) }; +} \ No newline at end of file diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariants.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariants.java similarity index 99% rename from protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariants.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariants.java index 78b89d615..27b0e5201 100755 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariants.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/CombineVariants.java @@ -35,7 +35,7 @@ import org.broadinstitute.sting.gatk.walkers.Reference; import org.broadinstitute.sting.gatk.walkers.RodWalker; import org.broadinstitute.sting.gatk.walkers.TreeReducible; import org.broadinstitute.sting.gatk.walkers.Window; -import org.broadinstitute.sting.gatk.walkers.annotator.ChromosomeCounts; +import org.broadinstitute.sting.gatk.walkers.annotator.ChromosomeCountConstants; import org.broadinstitute.sting.utils.SampleUtils; import org.broadinstitute.sting.utils.variant.GATKVCFUtils; import org.broadinstitute.variant.vcf.*; @@ -217,7 +217,7 @@ public class CombineVariants extends RodWalker implements Tree if ( SET_KEY != null ) headerLines.add(new VCFInfoHeaderLine(SET_KEY, 1, VCFHeaderLineType.String, "Source VCF for the merged record in CombineVariants")); if ( !ASSUME_IDENTICAL_SAMPLES ) - headerLines.addAll(Arrays.asList(ChromosomeCounts.descriptions)); + headerLines.addAll(Arrays.asList(ChromosomeCountConstants.descriptions)); VCFHeader vcfHeader = new VCFHeader(headerLines, samples); vcfHeader.setWriteCommandLine(!SUPPRESS_COMMAND_LINE_HEADER); vcfWriter.writeHeader(vcfHeader); From 396bce1f28ee622f3ebfd1237e975a3cd30e16ba Mon Sep 17 00:00:00 2001 From: Ryan Poplin Date: Wed, 9 Jan 2013 10:51:30 -0500 Subject: [PATCH 23/25] Reverting this change until we can figure out the right thing to do here. --- .../walkers/haplotypecaller/LikelihoodCalculationEngine.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LikelihoodCalculationEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LikelihoodCalculationEngine.java index 8e90285d9..e416b489b 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LikelihoodCalculationEngine.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/LikelihoodCalculationEngine.java @@ -124,8 +124,8 @@ public class LikelihoodCalculationEngine { final Haplotype haplotype = haplotypes.get(jjj); // TODO -- need to test against a reference/position with non-standard bases - if ( !Allele.acceptableAlleleBases(haplotype.getBases(), false) ) - continue; + //if ( !Allele.acceptableAlleleBases(haplotype.getBases(), false) ) + // continue; final int haplotypeStart = ( previousHaplotypeSeen == null ? 0 : computeFirstDifferingPosition(haplotype.getBases(), previousHaplotypeSeen.getBases()) ); previousHaplotypeSeen = haplotype; From 4fa439d89e4786f645c7c3d1b28ae48cfa02d0ea Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Wed, 9 Jan 2013 11:06:10 -0500 Subject: [PATCH 24/25] Move some classes back to public because they are used in the engine. Move some test classes to protected. We should have no more public->protected dependancies now --- .../diagnostics/targets/DiagnoseTargetsIntegrationTest.java | 0 .../gatk/walkers/diagnostics/targets/LocusStatisticsUnitTest.java | 0 .../walkers/diagnostics/targets/SampleStatisticsUnitTest.java | 0 .../sting/utils/recalibration/ContextCovariateUnitTest.java | 0 .../sting/utils/recalibration/CycleCovariateUnitTest.java | 0 .../sting/utils/recalibration/QualQuantizerUnitTest.java | 0 .../sting/utils/recalibration/ReadCovariatesUnitTest.java | 0 .../sting/utils/recalibration/ReadGroupCovariateUnitTest.java | 0 .../sting/utils/recalibration/RecalDatumUnitTest.java | 0 .../sting/utils/recalibration/RecalUtilsUnitTest.java | 0 .../sting/utils/recalibration/RecalibrationReportUnitTest.java | 0 .../sting/utils/recalibration/RecalibrationTablesUnitTest.java | 0 .../sting/utils/recalibration/RecalibrationTestUtils.java | 0 .../broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java | 0 .../broadinstitute/sting/gatk/walkers/coverage/DoCOutputType.java | 0 .../broadinstitute/sting/gatk/walkers/diffengine/DiffElement.java | 0 .../broadinstitute/sting/gatk/walkers/diffengine/DiffEngine.java | 0 .../broadinstitute/sting/gatk/walkers/diffengine/DiffNode.java | 0 .../broadinstitute/sting/gatk/walkers/diffengine/DiffObjects.java | 0 .../broadinstitute/sting/gatk/walkers/diffengine/DiffValue.java | 0 .../sting/gatk/walkers/diffengine/DiffableReader.java | 0 .../broadinstitute/sting/gatk/walkers/diffengine/Difference.java | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/DiagnoseTargetsIntegrationTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/LocusStatisticsUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/SampleStatisticsUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/utils/recalibration/ContextCovariateUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/utils/recalibration/CycleCovariateUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/utils/recalibration/QualQuantizerUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/utils/recalibration/ReadCovariatesUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/utils/recalibration/ReadGroupCovariateUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/utils/recalibration/RecalDatumUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/utils/recalibration/RecalUtilsUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationReportUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationTablesUnitTest.java (100%) rename {public => protected}/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationTestUtils.java (100%) rename {protected => public}/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java (100%) rename {protected => public}/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DoCOutputType.java (100%) rename {protected => public}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffElement.java (100%) rename {protected => public}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngine.java (100%) rename {protected => public}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNode.java (100%) rename {protected => public}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjects.java (100%) rename {protected => public}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffValue.java (100%) rename {protected => public}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReader.java (100%) rename {protected => public}/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/Difference.java (100%) diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/DiagnoseTargetsIntegrationTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/DiagnoseTargetsIntegrationTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/DiagnoseTargetsIntegrationTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/DiagnoseTargetsIntegrationTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/LocusStatisticsUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/LocusStatisticsUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/LocusStatisticsUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/LocusStatisticsUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/SampleStatisticsUnitTest.java b/protected/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/SampleStatisticsUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/SampleStatisticsUnitTest.java rename to protected/java/test/org/broadinstitute/sting/gatk/walkers/diagnostics/targets/SampleStatisticsUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/utils/recalibration/ContextCovariateUnitTest.java b/protected/java/test/org/broadinstitute/sting/utils/recalibration/ContextCovariateUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/utils/recalibration/ContextCovariateUnitTest.java rename to protected/java/test/org/broadinstitute/sting/utils/recalibration/ContextCovariateUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/utils/recalibration/CycleCovariateUnitTest.java b/protected/java/test/org/broadinstitute/sting/utils/recalibration/CycleCovariateUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/utils/recalibration/CycleCovariateUnitTest.java rename to protected/java/test/org/broadinstitute/sting/utils/recalibration/CycleCovariateUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/utils/recalibration/QualQuantizerUnitTest.java b/protected/java/test/org/broadinstitute/sting/utils/recalibration/QualQuantizerUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/utils/recalibration/QualQuantizerUnitTest.java rename to protected/java/test/org/broadinstitute/sting/utils/recalibration/QualQuantizerUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/utils/recalibration/ReadCovariatesUnitTest.java b/protected/java/test/org/broadinstitute/sting/utils/recalibration/ReadCovariatesUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/utils/recalibration/ReadCovariatesUnitTest.java rename to protected/java/test/org/broadinstitute/sting/utils/recalibration/ReadCovariatesUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/utils/recalibration/ReadGroupCovariateUnitTest.java b/protected/java/test/org/broadinstitute/sting/utils/recalibration/ReadGroupCovariateUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/utils/recalibration/ReadGroupCovariateUnitTest.java rename to protected/java/test/org/broadinstitute/sting/utils/recalibration/ReadGroupCovariateUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/utils/recalibration/RecalDatumUnitTest.java b/protected/java/test/org/broadinstitute/sting/utils/recalibration/RecalDatumUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/utils/recalibration/RecalDatumUnitTest.java rename to protected/java/test/org/broadinstitute/sting/utils/recalibration/RecalDatumUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/utils/recalibration/RecalUtilsUnitTest.java b/protected/java/test/org/broadinstitute/sting/utils/recalibration/RecalUtilsUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/utils/recalibration/RecalUtilsUnitTest.java rename to protected/java/test/org/broadinstitute/sting/utils/recalibration/RecalUtilsUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationReportUnitTest.java b/protected/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationReportUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationReportUnitTest.java rename to protected/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationReportUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationTablesUnitTest.java b/protected/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationTablesUnitTest.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationTablesUnitTest.java rename to protected/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationTablesUnitTest.java diff --git a/public/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationTestUtils.java b/protected/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationTestUtils.java similarity index 100% rename from public/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationTestUtils.java rename to protected/java/test/org/broadinstitute/sting/utils/recalibration/RecalibrationTestUtils.java diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java similarity index 100% rename from protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DoCOutputType.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DoCOutputType.java similarity index 100% rename from protected/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DoCOutputType.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DoCOutputType.java diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffElement.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffElement.java similarity index 100% rename from protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffElement.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffElement.java diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngine.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngine.java similarity index 100% rename from protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngine.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffEngine.java diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNode.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNode.java similarity index 100% rename from protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNode.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffNode.java diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjects.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjects.java similarity index 100% rename from protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjects.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffObjects.java diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffValue.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffValue.java similarity index 100% rename from protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffValue.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffValue.java diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReader.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReader.java similarity index 100% rename from protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReader.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/DiffableReader.java diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/Difference.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/Difference.java similarity index 100% rename from protected/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/Difference.java rename to public/java/src/org/broadinstitute/sting/gatk/walkers/diffengine/Difference.java From 3a0dd4b175e960522061eb7b3f367bfe73ef05e1 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Wed, 9 Jan 2013 11:12:28 -0500 Subject: [PATCH 25/25] Oops, I broke the build. NOW we shouldn't have any more public->protected dependancies. --- .../sting/gatk/walkers/variantutils/SelectVariants.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java index cffd405b1..dd92961cf 100755 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java @@ -33,6 +33,7 @@ import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.walkers.RodWalker; import org.broadinstitute.sting.gatk.walkers.TreeReducible; +import org.broadinstitute.sting.gatk.walkers.annotator.ChromosomeCountConstants; import org.broadinstitute.sting.gatk.walkers.annotator.ChromosomeCounts; import org.broadinstitute.sting.gatk.walkers.genotyper.GenotypeLikelihoodsCalculationModel; import org.broadinstitute.sting.gatk.walkers.genotyper.UnifiedArgumentCollection; @@ -423,7 +424,7 @@ public class SelectVariants extends RodWalker implements TreeR headerLines.add(new VCFInfoHeaderLine("AF_Orig", 1, VCFHeaderLineType.Float, "Original AF")); headerLines.add(new VCFInfoHeaderLine("AN_Orig", 1, VCFHeaderLineType.Integer, "Original AN")); } - headerLines.addAll(Arrays.asList(ChromosomeCounts.descriptions)); + headerLines.addAll(Arrays.asList(ChromosomeCountConstants.descriptions)); headerLines.add(VCFStandardHeaderLines.getInfoLine(VCFConstants.DEPTH_KEY)); for (int i = 0; i < SELECT_EXPRESSIONS.size(); i++) {