public void Execute() { if (_knownIndels != null) { _stateManager.AddCandidates(_knownIndels); } var read = new Read(); const int chunkSize = 10000; var minLogThreshold = TimeSpan.FromSeconds(2); int lastChunk = 0; using (var tracker = new ElapsedTimeLogger($"Realign {_chrReference.Name}")) while (_extractorForCandidates.GetNextAlignment(read)) { // do not take candidates from reads with MapQ of zero, or secondary alignments var doSkip = ((_skipDuplicates || _skipAndRemoveDuplicates) && read.IsPcrDuplicate) || read.MapQuality == 0 || !read.IsPrimaryAlignment; if (!doSkip) { var candidates = _indelFinder.FindIndels(read, _chrReference.Sequence, _chrReference.Name); _stateManager.AddCandidates(candidates); _stateManager.AddAlleleCounts(read); } Realign(read.Position - 1); var thisChunk = read.Position / chunkSize; if (thisChunk > lastChunk) { tracker.LogIncrement( $"Realign {_chrReference.Name}:{lastChunk*chunkSize}-{thisChunk*chunkSize}", minLogThreshold); } lastChunk = thisChunk; } Realign(null); Logger.WriteToLog("Total realigned reads: " + TotalRealignedReads); }
public void NullLogTest() { var log = loggerFactory.CreateLogger <ElapsedTimeLoggerTests>(); log.LogInformation("Normal log"); using (ElapsedTimeLogger etl = ElapsedTimeLogger.Create(null, "toto", "beginContext", "endContext", " ")) { log.LogDebug("Normal log"); Thread.Sleep(600); etl.LogInformation("ETL log 10"); Thread.Sleep(20); using (etl.BeginScope("foo")) { etl.LogDebug("ETL log 20"); Thread.Sleep(400); etl.LogWarning("ETL log 30"); Thread.Sleep(500); } } log.LogInformation("Normal log"); }