CanvasSNV.SNVReviewer.Run C# (CSharp) Method

Run() public method

public Run ( ) : int
return int
        public int Run()
        {
            if (!File.Exists(VcfPath))
            {
                Console.Error.WriteLine("Error: Input vcf file not found at {0}", VcfPath);
                return 1;
            }
            if (!File.Exists(BamPath))
            {
                Console.Error.WriteLine("Error: Input bam file not found at {0}", BamPath);
                return 1;
            }

            this.LoadVariants(VcfPath);
            ReferenceCounts = new int[Variants.Count];
            VariantCounts = new int[Variants.Count];
            this.ProcessBamFile(BamPath);
            this.WriteResults(OutputPath);
            return 0;
        }

Usage Example

Exemplo n.º 1
0
        // Arguments: chromosome, NormalVCFPath, TumorBamPath, OutputPath
        static int Main(string[] arguments)
        {
            CanvasCommon.Utilities.LogCommandLine(arguments);
            if (arguments.Length < 4)
            {
                Console.WriteLine("Usage: Chromosome NormalVCFPath TumorBAMPath OutputPath [MinMapQ]");
                return(1);
            }

            string chromosome = arguments[0];
            string vcfPath    = arguments[1];
            string bamPath    = arguments[2];
            string outputPath = arguments[3];
            int    minMapQ    = 0; // only use reads with MAPQ greater than this number

            if (arguments.Length > 4)
            {
                minMapQ = int.Parse(arguments[4]);
            }

            // Handle some special cases, if the "chromosome" is a special string:
            switch (chromosome.ToLowerInvariant())
            {
            case "histogram":
                return(BuildEmpiricalHistograms(vcfPath, bamPath, outputPath));

            case "regionhistogram":
                return(BuildRegionHistograms(vcfPath, bamPath, outputPath));

            default:
                // Ordinary chromosome name.
                break;
            }

            // Standard logic: Process one chromosome, write output to the specified file path:
            SNVReviewer processor = new SNVReviewer(chromosome, vcfPath, bamPath, outputPath, minMapQ);

            return(processor.Run());
        }
All Usage Examples Of CanvasSNV.SNVReviewer::Run