Exemplo n.º 1
0
 public PairResultActionBlockFactory(IWriterSource writerSource, bool debug, bool lightDebug, string chrom,
                                     int refId, int maxDegreeOfParallelism, bool filterForProperPairs, int messySiteWidth,
                                     ConcurrentDictionary <string, int> progressTracker, ConcurrentDictionary <PairClassification, int> categoryLookup,
                                     int startPosition, int endPosition, int adjustedStartPosition,
                                     ConcurrentDictionary <int, uint> totalBinCounts, ConcurrentDictionary <int, uint> singleMismatchBinCounts, int numBins,
                                     ConcurrentDictionary <Task, int> allToWaitFor)
 {
     _writerSource            = writerSource;
     _debug                   = debug;
     _lightDebug              = lightDebug;
     _chrom                   = chrom;
     _refId                   = refId;
     _maxDegreeOfParallelism  = maxDegreeOfParallelism;
     _filterForProperPairs    = filterForProperPairs;
     _messySiteWidth          = messySiteWidth;
     _progressTracker         = progressTracker;
     _categoryLookup          = categoryLookup;
     _startPosition           = startPosition;
     _endPosition             = endPosition;
     _adjustedStartPosition   = adjustedStartPosition;
     _totalBinCounts          = totalBinCounts;
     _singleMismatchBinCounts = singleMismatchBinCounts;
     _numBins                 = numBins;
     _allToWaitFor            = allToWaitFor;
 }
Exemplo n.º 2
0
 public PairResultActionBlockFactoryProvider(IWriterSource writerSource, bool debug, bool lightDebug, string chrom, int refId, int maxDegreeOfParallelism, bool filterForProperPairs, int messySiteWidth, ConcurrentDictionary <string, int> progressTracker, ConcurrentDictionary <PairClassification, int> categoryLookup)
 {
     _writerSource           = writerSource;
     _debug                  = debug;
     _lightDebug             = lightDebug;
     _chrom                  = chrom;
     _refId                  = refId;
     _maxDegreeOfParallelism = maxDegreeOfParallelism;
     _filterForProperPairs   = filterForProperPairs;
     _messySiteWidth         = messySiteWidth;
     _progressTracker        = progressTracker;
     _categoryLookup         = categoryLookup;
 }
Exemplo n.º 3
0
        public IClassificationBlockProvider GetBlockProvider(Dictionary <int, string> refIdMapping, string chrom,
                                                             IWriterSource writerSource, ConcurrentDictionary <string, int> progressTracker,
                                                             ConcurrentDictionary <PairClassification, int> categoryLookup, ConcurrentDictionary <string, IndelEvidence> masterIndelLookup,
                                                             ConcurrentDictionary <HashableIndel, int[]> masterOutcomesLookup,
                                                             ConcurrentDictionary <HashableIndel, int> masterFinalIndels, ChrReference chrReference)
        {
            var actionBlockFactoryProvider = new PairResultActionBlockFactoryProvider(writerSource, _geminiOptions.Debug,
                                                                                      _geminiOptions.LightDebug, chrom, _geminiSampleOptions.RefId.Value, _maxDegreeOfParallelism,
                                                                                      _stitcherOptions.FilterForProperPairs, _geminiOptions.MessySiteWidth, progressTracker, categoryLookup);
            var aggregateProcessor = new AggregateRegionProcessor(chrReference, refIdMapping,
                                                                  _bamRealignmentFactory, _geminiOptions, _geminiFactory, chrom, _dataSourceFactory, _realignmentOptions, masterIndelLookup, masterOutcomesLookup, masterFinalIndels, _realignmentOptions.CategoriesForRealignment, progressTracker);
            var batchBlockFactory = new PairResultBatchBlockFactory(_geminiOptions.ReadCacheSize / 5);

            return(new ClassificationBlockProvider(_geminiOptions, chrom, progressTracker, categoryLookup, actionBlockFactoryProvider, aggregateProcessor,
                                                   _geminiOptions.LightDebug, batchBlockFactory, new BinEvidenceFactory(_geminiOptions, _geminiSampleOptions), _realignmentOptions.CategoriesForRealignment, _maxDegreeOfParallelism));
        }
Exemplo n.º 4
0
        private static void WriteAlignments(string chrom, IWriterSource writerSource, PairClassification classification,
                                            List <BamAlignment> alignments)
        {
            var idNum                = Thread.CurrentThread.ManagedThreadId;
            var writerHandle         = writerSource.BamWriterHandle(chrom, classification, idNum);
            var numAlignmentsWritten = 0;

            foreach (var alignment in alignments)
            {
                if (alignment == null)
                {
                    continue;
                }

                numAlignmentsWritten++;

                writerHandle.WriteAlignment(alignment);
            }

            alignments.Clear();
            writerSource.DoneWithWriter(chrom, classification, idNum, numAlignmentsWritten, writerHandle);
        }