public PumiceValidator(string truthDirectory, string inputBamDirectory, bool makevcf, string outputDirectory, VariantCallMethod method, double minFreq = 0.0001, string program = null, string fixedArguments = null)
        {
            TruthBySample = new Dictionary <string, TruthItem>();
            BamFiles      = new List <string>();

            _makevcf         = makevcf;
            _method          = method;
            _outputDirectory = outputDirectory;
            _program         = program;
            _fixedArguments  = fixedArguments;
            _minFreq         = minFreq;

            var sampleTruthFiles = Directory.GetFiles(truthDirectory, "*_truth.txt");

            foreach (var sampleTruthFile in sampleTruthFiles)
            {
                var tmpFileName = Path.GetFileNameWithoutExtension(sampleTruthFile);
                var sampleId    = tmpFileName.Split('_')[0];

                //read truthFile
                TruthItem t = new TruthItem(sampleTruthFile, sampleId);
                TruthBySample.Add(sampleId, t);


                var sampleBamFiles = Directory.GetFiles(inputBamDirectory, sampleId + "*.bam",
                                                        SearchOption.AllDirectories);
                if (sampleBamFiles.Length <= 0)
                {
                    continue;
                }
                BamFiles.AddRange(sampleBamFiles);
            }
        }
        public VcfReader(string vcfPath, VariantCallMethod method)
        {
            var fileStream = new FileStream(vcfPath, FileMode.Open, FileAccess.Read, FileShare.Read);

            _vcfStreamReader = new StreamReader(fileStream);
            _method          = method;
            _isLofreq        = _method == VariantCallMethod.Lofreq;
        }
 public Validator(List <string> bamFiles, Dictionary <string, TruthItem> truthBySample, VariantCallMethod method,
                  string outDir, double minFreq)
 {
     _bamFiles      = bamFiles;
     _truthBySample = truthBySample;
     _method        = method;
     _minimumFreq   = minFreq;
     _outPutDir     = outDir;
 }
 private void WriteToVariantLog(string rootFileName, VcfVariant variant, VariantCallMethod method, string type, StreamWriter writer)
 {
     writer.WriteLine($"{rootFileName}\t{variant.RefName}\t{variant.RefPosition}\t{variant.RefAllele}\t{variant.VariantAlleles[0]}\t" + method + $"\t{type}" + "\t" + variant.VariantFreq.ToString("0.####"));
 }