Exemplo n.º 1
0
 public VeadGroupSource(IAlignmentExtractor alignmentExtractor, BamFilterParameters options, bool debugMode, string logFolder)
 {
     _alignmentExtractor = alignmentExtractor;
     _options            = options;
     _debugMode          = debugMode;
     _debugLogRoot       = logFolder;
 }
Exemplo n.º 2
0
        public VcfWriterConfig(VariantCallingParameters callerOptions,
                               VcfWritingParameters outputOptions, BamFilterParameters bamFilterOptions, SampleAggregationParameters sampleAggregationParameters,
                               bool debugMode, bool outputBiasFiles, bool hasForcedGT = false)
        {
            DepthFilterThreshold                = outputOptions.OutputGvcfFile ? callerOptions.MinimumCoverage : (callerOptions.LowDepthFilter > callerOptions.MinimumCoverage) ? callerOptions.LowDepthFilter : (int?)null;
            IndelRepeatFilterThreshold          = callerOptions.IndelRepeatFilter > 0 ? callerOptions.IndelRepeatFilter : (int?)null;
            VariantQualityFilterThreshold       = callerOptions.MinimumVariantQScoreFilter;
            GenotypeQualityFilterThreshold      = callerOptions.LowGenotypeQualityFilter.HasValue && callerOptions.MinimumVariantQScoreFilter > callerOptions.MinimumVariantQScore ? callerOptions.LowGenotypeQualityFilter : null;
            StrandBiasFilterThreshold           = callerOptions.StrandBiasAcceptanceCriteria < 1 ? callerOptions.StrandBiasAcceptanceCriteria : (float?)null;
            AmpliconBiasFilterThreshold         = callerOptions.AmpliconBiasFilterThreshold > 0 ? callerOptions.AmpliconBiasFilterThreshold : (float?)null;
            FrequencyFilterThreshold            = GetMinFreqFilterForVcfHeader(callerOptions);
            MinFrequencyThreshold               = callerOptions.MinimumFrequency;
            ShouldOutputNoCallFraction          = outputOptions.ReportNoCalls;
            ShouldOutputStrandBiasAndNoiseLevel = ShouldOutputNoiseLevelAndStrandBias(debugMode, outputBiasFiles, callerOptions.StrandBiasAcceptanceCriteria);
            ShouldFilterOnlyOneStrandCoverage   = callerOptions.FilterOutVariantsPresentOnlyOneStrand;
            EstimatedBaseCallQuality            = callerOptions.NoiseLevelUsedForQScoring;
            ShouldOutputRcCounts                = outputOptions.ReportRcCounts;
            ShouldOutputTsCounts                = outputOptions.ReportTsCounts;
            AllowMultipleVcfLinesPerLoci        = outputOptions.AllowMultipleVcfLinesPerLoci;
            PloidyModel = callerOptions.PloidyModel;
            RMxNFilterMaxLengthRepeat = callerOptions.RMxNFilterMaxLengthRepeat;
            RMxNFilterMinRepetitions  = callerOptions.RMxNFilterMinRepetitions;
            RMxNFilterFrequencyLimit  = callerOptions.RMxNFilterFrequencyLimit;
            NoiseModel            = callerOptions.NoiseModel;
            ShouldReportGp        = outputOptions.ReportGp;
            NoCallFilterThreshold = callerOptions.NoCallFilterThreshold;
            ShouldOutputSuspiciousCoverageFraction = outputOptions.ReportSuspiciousCoverageFraction;

            if (sampleAggregationParameters != null)
            {
                ShouldOutputProbeBias        = true;
                ProbePoolBiasFilterThreshold = sampleAggregationParameters.ProbePoolBiasThreshold;
            }
            HasForcedGt = hasForcedGT;
        }
Exemplo n.º 3
0
        //if I was not in a hurry, we could refactor this into the Config class and let it be re-used by Scylla and VQR...
        private static VcfWriterConfig GetWriterConfigToMatchInputVcf(string vcfIn)
        {
            List <string> vcfHeaderLines;

            using (var reader = new VcfReader(vcfIn))
            {
                vcfHeaderLines = reader.HeaderLines;
            }


            PiscesOptionsParser piscesOptionsParser = VcfConsumerAppParsingUtils.GetPiscesOptionsFromVcfHeader(vcfHeaderLines);

            if (piscesOptionsParser.ParsingFailed)
            {
                Logger.WriteToLog("Unable to parse the original Pisces commandline");
                throw new ArgumentException("Unable to parse the input vcf header: " + vcfIn);
            }

            VariantCallingParameters variantCallingParams = piscesOptionsParser.PiscesOptions.VariantCallingParameters;
            VcfWritingParameters     vcfWritingParams     = piscesOptionsParser.PiscesOptions.VcfWritingParameters;
            BamFilterParameters      bamFilterParams      = piscesOptionsParser.PiscesOptions.BamFilterParameters;

            var config = new VcfWriterConfig(variantCallingParams, vcfWritingParams, bamFilterParams, null, false, false);

            return(config);
        }
Exemplo n.º 4
0
 public VeadGroupSource(IAlignmentExtractor alignmentExtractor, BamFilterParameters options, bool debugMode, string logFolder)
 {
     _alignmentExtractor = alignmentExtractor;
     _options            = options;
     _debugMode          = debugMode;
     _debugLogRoot       = logFolder;
     _readfilter         = new NeighborhoodReadFilter(_options);
 }
        public static Dictionary <string, OptionSet> GetBamFilterParsingMethods(BamFilterParameters options)
        {
            var bamFilterOps = new OptionSet
            {
                {
                    "minbq|minbasecallquality=",
                    OptionTypes.INT + " MinimumBaseCallQuality to use a base of the read",
                    value => options.MinimumBaseCallQuality = int.Parse(value)
                },
                {
                    "minmq|minmapquality=",
                    OptionTypes.INT + " MinimumMapQuality required to use a read",
                    value => options.MinimumMapQuality = int.Parse(value)
                },
                {
                    "filterduplicates|duplicatereadfilter=",
                    OptionTypes.BOOL + " To filter reads marked as duplicates",
                    value => options.RemoveDuplicates = bool.Parse(value)
                },
                {
                    "pp|onlyuseproperpairs=",
                    OptionTypes.BOOL + " Only use proper pairs, 'true' or 'false",
                    value => options.OnlyUseProperPairs = bool.Parse(value)
                }
            };


            var optionDict = new Dictionary <string, OptionSet>
            {
                { OptionSetNames.BamFiltering, bamFilterOps },
            };



            return(optionDict);
        }
Exemplo n.º 6
0
 public VeadFinder(BamFilterParameters bamFilterParams)
 {
     _bamFilterParams = bamFilterParams;
 }
        public static void AddBamFilterArgumentParsing(Dictionary <string, OptionSet> parsingMethods, BamFilterParameters options)
        {
            var bamfilterOptionDict = GetBamFilterParsingMethods(options);


            foreach (var key in bamfilterOptionDict.Keys)
            {
                foreach (var optSet in bamfilterOptionDict[key])
                {
                    if (!parsingMethods.ContainsKey(key))
                    {
                        parsingMethods.Add(key, new OptionSet());
                    }

                    parsingMethods[key].Add(optSet);
                }
            }
        }
Exemplo n.º 8
0
 public VariantCaller(VariantCallingParameters callerParams, BamFilterParameters bamParams)
 {
     _bamParams    = bamParams;
     _callerParams = callerParams;
 }
 public NeighborhoodReadFilter(BamFilterParameters options)
 {
     _options = options;
 }