private PiscesOptionsParser GetParsedApplicationOptions(string arguments)
        {
            var parsedOptions = new PiscesOptionsParser();

            parsedOptions.ParseArgs(arguments.Split(' '), false);
            return(parsedOptions);
        }
Ejemplo n.º 2
0
        private static void CheckHeader(AlleleReader reader)
        {
            string piscesCmd       = reader.HeaderLines.FirstOrDefault(str => str.Contains("##Pisces_cmdline")).Split("\"\"")[1];
            var    appOptionParser = new PiscesOptionsParser();

            appOptionParser.ParseArgs(piscesCmd.Split(null));

            // Check if VCF is diploid
            if (appOptionParser.PiscesOptions.VariantCallingParameters.PloidyModel == PloidyModel.DiploidByAdaptiveGT ||
                appOptionParser.PiscesOptions.VariantCallingParameters.PloidyModel == PloidyModel.DiploidByThresholding)
            {
                throw new VariantReaderException("Adaptive Genotyper should be used with VCFs that are called as somatic " +
                                                 "VCFs by Pisces.  Please check the input VCF file.");
            }

            // Check if VCF is crushed
            else if (appOptionParser.PiscesOptions.VcfWritingParameters.ForceCrush == true)
            {
                throw new VariantReaderException("Adaptive Genotyper should be used with uncrushed VCFs.  Please check the input VCF file.");
            }

            // Check if GVCF or --minvq 0
            else if (!appOptionParser.PiscesOptions.VcfWritingParameters.OutputGvcfFile &&
                     (appOptionParser.PiscesOptions.VariantCallingParameters.MinimumVariantQScore > 0 ||
                      appOptionParser.PiscesOptions.VariantCallingParameters.MinimumFrequency > 0.02))
            {
                throw new VariantReaderException("Adaptive Genotyper should be used with GVCFs or with option -minvq 0.  Please" +
                                                 " check in the input VCF file.");
            }
        }