Commit Graph

3154 Commits (5f84a4ad82ee7ae445e3c0a8ba13d83256e16e7e)

Author SHA1 Message Date
Eric Banks 75d5b88a3d Enabling the Recal Report unit test (which looks like it was never ever enabled) 2012-12-26 15:35:50 -05:00
Eric Banks efceb0d48c Check for well-encoded reads while fixing mis-encoded ones 2012-12-26 14:30:51 -05:00
Mark DePristo af9746af52 Fix merge failure 2012-12-24 13:43:04 -05:00
Mark DePristo 04cc75aaec Minor cleanup and expansion of the RecalDatum unit tests 2012-12-24 13:35:58 -05:00
Mark DePristo 7bf1f67273 BQSR optimization: read group x quality score calibration table is thread-local
-- AdvancedRecalibrationEngine now uses a thread-local table for the quality score table, and in finalizeData merges these thread-local tables into the final table.  Radically reduces the contention for RecalDatum in this very highly used table
-- Refactored the utility function to combine two tables into RecalUtils, and created UnitTests for this function, as well as all of RecalibrationTables.  Updated combine in RecalibrationReport to use this table combiner function
-- Made several core functions in RecalDatum into final methods for performance
-- Added RecalibrationTestUtils, a home for recalibration testing utilities
2012-12-24 13:35:58 -05:00
Mark DePristo 7d250a789a ArtificialReadPileupTestProvider now creates GATKSamRecords with good header values 2012-12-24 13:35:57 -05:00
Mark DePristo 295455eee2 NanoScheduler optimizations and simplification
-- The previous model was to enqueue individual map jobs (with a resolution of 1 map job per map call), to track the number of map calls submitted via a counter and a semaphore, and to use this information in each map job and reduce to control the number of map jobs, when reduce was complete, etc.  All hideously complex.
-- This new model is vastly simply.  The reducer basically knows nothing about the control mechanisms in the NanoScheduler.  It just supports multi-threaded reduce.  The NanoScheduler enqueues exactly nThread jobs to be run, which continually loop reading, mapping, and reducing until they run out of material to read, when they shut down.  The master thread of the NS just holds a CountDownLatch, initialized to nThreads, and when each thread exits it reduces the latch by 1.  The master thread gets the final reduce result when its free by the latch reaching 0.  It's all super super simple.
-- Because this model uses vastly fewer synchronization primitives within the NS itself, it's naturally much faster at getting things done, without any of the overhead obvious in profiles of BQSR -nct 2.
2012-12-24 13:35:57 -05:00
Mark DePristo aa3ee29929 Handle case where the ReadGroup is null in GATKSAMRecord 2012-12-24 13:35:57 -05:00
Mark DePristo bf81db40f7 NanoScheduler reducer optimizations
-- reduceAsMuchAsPossible no longer blocks threads via synchronization, but instead uses an explicit lock to manage access.  If the lock is already held (because some thread is doing reduce) then the thread attempting to reduce immediately exits the call and continues doing productive work.  They removes one major source of blocking contention in the NanoScheduler
2012-12-24 13:35:57 -05:00
Mark DePristo 161487b4a4 MapResult compareTo() is now unit tested
-- Thanks clover!
2012-12-24 13:35:57 -05:00
Mark DePristo 940816f16a GATKSamRecord now checks that the read group is a GATKReadGroupRecord, and if not makes one 2012-12-24 13:35:57 -05:00
Mark DePristo 14944b5d73 Incorporating clover into build.xml
-- See http://gatkforums.broadinstitute.org/discussion/2002/clover-coverage-analysis-with-ant for use docs
-- Fix for artificial reads not having proper read groups, causing NPE in some tests
-- Added clover itself to private/resources
2012-12-24 13:35:57 -05:00
Mark DePristo 7796ba7601 Minor optimizations for NanoScheduler
-- Reducer.maybeReleaseLatch is no longer synchronized
-- NanoScheduler only prints progress every 100 or so map calls
2012-12-24 13:35:56 -05:00
Mark DePristo 0f04485c24 NanoScheduler optimization: don't use a PriorityBlockingQueue for the MapResultsQueue
-- Created a separate, limited interface MapResultsQueue object that previously was set to the PriorityBlockingQueue.
-- The MapResultsQueue is now backed by a synchronized ExpandingArrayList, since job ids are integers incrementing from 0 to N.  This means we avoid the n log n sort in the priority queue which was generating a lot of cost in the reduce step
-- Had to update ReducerUnitTest because the test itself was brittle, and broken when I changed the underlying code.
-- A few bits of minor code cleanup through the system (removing unused constructors, local variables, etc)
-- ExpandingArrayList called ensureCapacity so that we increase the size of the arraylist once to accommodate the upcoming size needs
2012-12-24 13:35:56 -05:00
Mark DePristo b92f563d06 NanoScheduler optimization for TraverseReadsNano
-- Pre-read MapData into a list, which is actually faster than dealing with future lock contention issues with lots of map threads
-- Increase the ReadShard default size to 100K reads by default
2012-12-24 13:35:56 -05:00
Mark DePristo f849910c4e BQSR optimization: only compute BAQ when there's at least one error to delocalize
-- Saves something like 2/3 of the compute cost of BQSR
2012-12-24 13:35:56 -05:00
Mark DePristo 0f0188ddb1 Optimization of BQSR
-- Created a ReadRecalibrationInfo class that holds all of the information (read, base quality vectors, error vectors) for a read for the call to updateDataForRead in RecalibrationEngine.  This object has a restrictive interface to just get information about specific qual and error values at offset and for event type.  This restrict allows us to avoid creating an vector of byte 45 for each read to represent BI and BD values not in the reads.  Shaves 5% of the runtime off the entire code.
-- Cleaned up code and added lots more docs
-- With this commit we no longer have much in the way of low-hanging fruit left in the optimization of BQSR.  95% of the runtime is spent in BAQing the read, and updating the RecalData in the NestedIntegerArrays.
2012-12-24 13:35:09 -05:00
Mark DePristo f6d5499582 The GATK engine now ensures that incoming GATKSAMRecords have GATKSAMReadGroupRecord objects in their header
-- Update SAMDataSource so that the merged header contains GATKSAMReadGroupRecord
-- Now getting the NGSPlatform for a GATKSAMRecord is actually efficient, instead of computing the NGS platform over and over from the PL string
-- Updated a few places in the code where the input argument is actually a GATKSAMRecord, not a SAMRecord for type safety
2012-12-24 13:35:09 -05:00
Tad Jordan b491c177ff Added functionality of outputting sorted GATKReport Tables
- Added an optional argument to BaseRecalibrator to produce sorted GATKReport Tables
- Modified BSQR Integration Tests to include the optional argument. Tests now produce sorted tables
2012-12-20 14:02:21 -05:00
Eric Banks 6c3f5eefe9 Merged bug fix from Stable into Unstable 2012-12-19 22:29:21 -05:00
xingwei2012 22d13ccdab Bug fix for Queue LSF v8.3
the function ls_getLicenseUsage() is not supported by LSF v8.x, comment the line:

public static native lsfLicUsage.ByReference ls_getLicenseUsage()

Signed-off-by: Eric Banks <ebanks@broadinstitute.org>
2012-12-19 22:28:53 -05:00
Ryan Poplin 54e5c84018 Merge branch 'master' of github.com:broadinstitute/gsa-unstable 2012-12-19 11:31:40 -05:00
David Roazen 07b369ca7e Move VCF/BCF2/VariantContext to new standalone org.broadinstitute.variant package
This is an intermediate commit so that there is a record of these changes in our
commit history. Next step is to isolate the test classes as well, and then move
the entire package to the Picard repository and replace it with a jar in our repo.

-Removed all dependencies on org.broadinstitute.sting (still need to do the test classes,
though)

-Had to split some of the utility classes into "GATK-specific" vs generic methods
(eg., GATKVCFUtils vs. VCFUtils)

-Placement of some methods and choice of exception classes to replace the StingExceptions
and UserExceptions may need to be tweaked until everyone is happy, but this can be
done after the move.
2012-12-19 10:25:22 -05:00
Ryan Poplin cda0c48570 auto-merge 2012-12-19 10:12:49 -05:00
Mark DePristo 1ca13f9581 Fundamentally better model for the NanoScheduler
-- Now each map job reads a value, performs map, and does as much reducing as possible.  This ensures that we scale performance with the nct value, so -nct 2 should result in 2x performance, -nct 3 3x, etc.  All of this is accomplished using exactly NCT% of the CPU of the machine.
-- Has the additional value of actually simplifying the code
-- Resolves a long-standing annoyance with the nano scheduler.
2012-12-19 09:31:31 -05:00
David Roazen d0cd29cb36 Merged bug fix from Stable into Unstable 2012-12-19 02:20:28 -05:00
David Roazen 0d93330ab9 Fix bug in the PerSampleDownsamplingReadsIterator that could lead to excessive memory usage at traversal startup
This is a MUST-HAVE update for GATK 2.3 users who want to try out the new
ability to use -dcov with ReadWalkers.
2012-12-19 02:05:36 -05:00
Joel Thibault a29df3e094 oops 2012-12-18 19:03:12 -05:00
Joel Thibault ee22c1bf44 More TODOs 2012-12-18 18:47:43 -05:00
Joel Thibault 2b1db519d7 Add reads which overstep a boundary by a single base 2012-12-18 18:47:43 -05:00
Joel Thibault 9828b2990f Reads off the end of a contig fail SAM validation when using actual BAMs 2012-12-18 18:47:43 -05:00
Joel Thibault 72e2394b26 Create actual BAM 2012-12-18 18:47:43 -05:00
Joel Thibault d69d1f8988 Fun with varargs 2012-12-18 18:47:42 -05:00
Joel Thibault 1158c1529f Refactor region/read comparisons 2012-12-18 18:47:42 -05:00
Yossi Farjoun 6ed9eb3da9 GATKBAMIndex now passes unit test! Problem was that SeekableBufferedStream seems to have a bug: it will read beyond the end of a file if asked to. 2012-12-18 17:32:26 -05:00
Ryan Poplin 902ca7ea70 Merge branch 'master' of github.com:broadinstitute/gsa-unstable 2012-12-18 15:45:33 -05:00
Ryan Poplin 3950f7b3e3 Increasing the INFORMATIVE_LIKELIHOOD_THRESHOLD value to 0.2 2012-12-18 15:45:12 -05:00
Ryan Poplin b5d590ba92 Based on NA12878 knowledge base experiments updating HC to allow for a much smaller minimum kmer length in the assembly graph. 2012-12-18 15:43:56 -05:00
eitanbanks 002ce9c1d5 Merge pull request #8 from yfarjoun/master
Huge speedup in initial traversal of BAM index files (x20 speed!)
2012-12-18 10:16:53 -08:00
Mark DePristo 16eb1c5436 Optimization to TraverseReadsNano
-- Don't just read all inputs into a list, and then provide an iterator to that list, actually make a real iterator so NanoScheduler input thread can contribute meaningfully to the work load
-- Use NanoScheduler progress function, instead of home-grown updater
2012-12-18 10:14:47 -05:00
Mark DePristo b33f804cdc Inline increment function in RecalDatum to avoid minor duplication of work and multiple synchronized method calls 2012-12-17 16:47:27 -05:00
Mark DePristo 66d32f646b Minor cleanup of BAQ calculation (final variables, etc) 2012-12-17 16:47:27 -05:00
Mark DePristo 67fe81391c ProgressMeter optimization: don't do genome loc formatting, but instead create an object that only formats when printing is actually needed 2012-12-17 16:47:27 -05:00
Mark DePristo 1de2f527b9 Optimization of recalibrateRead
-- Refactor calculation so that upfront constant values are pre-computed, and cached, and their values just looked up during application
-- Trivial comment on how we might use BAQ better in BaseRecalibrator
2012-12-17 16:47:27 -05:00
Mark DePristo bd6cda7542 Trivial optimization of TraverseReadsNano -- don't format the shard toString if logger isn't debug enabled 2012-12-17 16:47:27 -05:00
Mark DePristo a481d006f0 Optimizations for applying BQSR table with PrintReads
-- Cleaned up code in updateDataForRead so that constant values where not computed in inner loops
-- BaseRecalibrator doesn't create it's own fasta index reader, it just piggy backs on the GATK one
-- ReadCovariates <init> now uses a thread local cache for it's int[][][] keys member variable.  This stops us from recreating an expensive array over and over.  In order to make this really work had to update recordValues in ContextCovariate so it writes 0s over base values its skipping because of low quality base clipping.  Previously the values in the ReadCovariates keys were 0 because they were never modified by ContextCovariates. Now these values are actually zero'd out explicitly by the covariates.
2012-12-17 16:47:27 -05:00
Mark DePristo 5ec25797b3 Optimizations for BaseRecalibrator
-- No longer computes at each update the overall read group table.  Now computes this derived table only at the end of the computation, using the ByQual table as input.  Reduces BQSR runtime by 1/3 in my test
2012-12-17 16:47:27 -05:00
Eric Banks e6f468b647 Refactored the quasi-useful IndelType annotation into the more useful VariantType.
The indels are still annotated as before, but now all other variant types are annotated too.
I'm doing this because of requests on the forum but am not making it standard.  If we find it to be useful we can turn it on by default later.
2012-12-17 11:54:47 -05:00
Eric Banks 762f184262 Bug fix for strict validation: rsID checking wasn't working if there were multiple IDs 2012-12-17 10:32:41 -05:00
Yossi Farjoun ea704d688f chose smaller buffer size for the bufferedStream 2012-12-15 13:01:38 -05:00