public override void WriteHeader() { if (Writer == null) { throw new IOException("Stream already closed"); } var currentAssembly = Assembly.GetEntryAssembly().GetName(); //for GetCallingAssembly, originally from .net core var currentAssemblyVersion = Common.IO.PiscesSuiteAppInfo.Version; Writer.WriteLine("##fileformat=" + VcfVersion); Writer.WriteLine("##fileDate=" + string.Format("{0:yyyyMMdd}", DateTime.Now)); Writer.WriteLine("##source=" + currentAssembly.Name + " " + currentAssemblyVersion); Writer.WriteLine("##" + currentAssembly.Name + "_cmdline=\"" + (_context.QuotedCommandLineString == null? "" : string.Join(" ", _context.QuotedCommandLineString)) + "\""); Writer.WriteLine("##reference=" + _context.ReferenceName); //write Alt Allele Writer.WriteLine("##ALT=<ID=<M>,Description=\"There is an overlapping other allele that has been called in a separate VCF record\">"); // info fields Writer.WriteLine("##INFO=<ID=" + _formatter.DepthInfo + ",Number=1,Type=Integer,Description=\"Total Depth\">"); // filter fields var filterStringsForHeader = _formatter.GenerateFilterStringsByType(); foreach (var filter in filterStringsForHeader) { Writer.WriteLine(filter.Value); } // format fields Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=String,Description=\"Genotype\">", _formatter.GenotypeFormat); Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=Integer,Description=\"Genotype Quality\">", _formatter.GenotypeQualityFormat); Writer.WriteLine("##FORMAT=<ID={0},Number=.,Type=Integer,Description=\"Allele Depth\">", _formatter.AlleleDepthFormat); Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=Integer,Description=\"Total Depth Used For Variant Calling\">", _formatter.TotalDepthFormat); Writer.WriteLine("##FORMAT=<ID={0},Number=.,Type=Float,Description=\"Variant Frequency\">", _formatter.VariantFrequencyFormat); if (_config.ShouldOutputSuspiciousCoverageFraction) { Writer.WriteLine("##FORMAT=<ID={0},Number=.,Type=String,Description=\"Suspicious coverage statistics: (confident start coverage, suspicious start coverage, confident end coverage, suspicious end coverage, variant-specific suspicious coverage weighting factor\">", _formatter.FractionSuspiciousCoverageFormat); } if (_config.ShouldOutputProbeBias) { Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=Float,Description=\"ProbeBias Score\">", _formatter.ProbeBiasFormat); } if (_config.ShouldOutputAmpliconBias) { Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=Float,Description=\"AmpliconBias Score\">", _formatter.AmpliconBiasFormat); } if (_config.ShouldOutputStrandBiasAndNoiseLevel) { Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=Integer,Description=\"Applied BaseCall Noise Level\">", _formatter.NoiseLevelFormat); Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=Float,Description=\"StrandBias Score\">", _formatter.StrandBiasFormat); } if (_config.ShouldOutputNoCallFraction) { Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=Float,Description=\"Fraction of bases which were uncalled or with basecall quality below the minimum threshold\">", _formatter.FractionNoCallFormat); } if (_config.ShouldReportGp) { Writer.WriteLine("##FORMAT=<ID={0},Number=G,Type=Float,Description=\"Genotype Posterior\">", _formatter.GenotypePosterior); } if (_config.ShouldOutputRcCounts) { Writer.WriteLine("##FORMAT=<ID={0},Number=.,Type=Integer,Description=\"Supporting read type counts\">", _formatter.UmiStatsFormat); } WriteContigs(Writer); WriteColHeaders(Writer); }
public override void WriteHeader() { if (Writer == null) { throw new Exception("Stream already closed"); } var currentAssembly = Assembly.GetCallingAssembly().GetName(); Writer.WriteLine("##fileformat=" + VcfVersion); Writer.WriteLine("##fileDate=" + string.Format("{0:yyyyMMdd}", DateTime.Now)); Writer.WriteLine("##source=" + currentAssembly.Name + " " + currentAssembly.Version); Writer.WriteLine("##" + currentAssembly.Name + "_cmdline=\"" + (_context.CommandLine == null? "" : string.Join(" ", _context.CommandLine)) + "\""); Writer.WriteLine("##reference=" + _context.ReferenceName); // info fields Writer.WriteLine("##INFO=<ID=" + _formatter.DepthInfo + ",Number=1,Type=Integer,Description=\"Total Depth\">"); // filter fields var filterStringsForHeader = _formatter.GenerateFilterStringsByType(); // filter fields if (_config.VariantQualityFilterThreshold.HasValue) { Writer.WriteLine(filterStringsForHeader[FilterType.LowVariantQscore]); } if (_config.DepthFilterThreshold.HasValue) { Writer.WriteLine(filterStringsForHeader[FilterType.LowDepth]); } if (_config.StrandBiasFilterThreshold.HasValue && _config.ShouldFilterOnlyOneStrandCoverage) { Writer.WriteLine(filterStringsForHeader[FilterType.StrandBias]); } else if (_config.StrandBiasFilterThreshold.HasValue) { Writer.WriteLine(filterStringsForHeader[FilterType.StrandBias]); } else if (_config.ShouldFilterOnlyOneStrandCoverage) { Writer.WriteLine(filterStringsForHeader[FilterType.StrandBias]); } if (_config.FrequencyFilterThreshold.HasValue) { Writer.WriteLine(filterStringsForHeader[FilterType.LowVariantFrequency]); } if (_config.GenotypeQualityFilterThreshold.HasValue) { Writer.WriteLine(filterStringsForHeader[FilterType.LowGenotypeQuality]); } if (_config.IndelRepeatFilterThreshold.HasValue) { Writer.WriteLine(filterStringsForHeader[FilterType.IndelRepeatLength]); } if (_config.PloidyModel == PloidyModel.Diploid) { Writer.WriteLine(filterStringsForHeader[FilterType.MultiAllelicSite]); } if (_config.RMxNFilterMaxLengthRepeat.HasValue && _config.RMxNFilterMinRepetitions.HasValue) { Writer.WriteLine(filterStringsForHeader[FilterType.RMxN]); } // format fields Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=String,Description=\"Genotype\">", _formatter.GenotypeFormat); Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=Integer,Description=\"Genotype Quality\">", _formatter.GenotypeQualityFormat); Writer.WriteLine("##FORMAT=<ID={0},Number=.,Type=Integer,Description=\"Allele Depth\">", _formatter.AlleleDepthFormat); Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=Integer,Description=\"Total Depth Used For Variant Calling\">", _formatter.TotalDepthFormat); Writer.WriteLine("##FORMAT=<ID={0},Number=.,Type=Float,Description=\"Variant Frequency\">", _formatter.VariantFrequencyFormat); if (_config.ShouldOutputStrandBiasAndNoiseLevel) { Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=Integer,Description=\"Applied BaseCall Noise Level\">", _formatter.NoiseLevelFormat); Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=Float,Description=\"StrandBias Score\">", _formatter.StrandBiasFormat); } if (_config.ShouldOutputNoCallFraction) { Writer.WriteLine("##FORMAT=<ID={0},Number=1,Type=Float,Description=\"Fraction of bases which were uncalled or with basecall quality below the minimum threshold\">", _formatter.FractionNoCallFormat); } if (_config.ShouldOutputRcCounts) { Writer.WriteLine("##FORMAT=<ID={0},Number=.,Type=Integer,Description=\"Supporting read type counts\">", _formatter.UmiStatsFormat); } WriteContigs(Writer); WriteColHeaders(Writer); }