private static ExitCodes ProgramExecution() { using var mitoHeteroplasmyParser = new MitoHeteroplasmyParser(GZipUtilities.GetAppropriateReadStream(_inputFile)); using var tsvStream = FileUtilities.GetCreateStream(Path.Combine(_outputDirectory, OutFileName)); using var tsvWriter = new StreamWriter(tsvStream); tsvWriter.WriteLine(HeaderLine); foreach (var line in mitoHeteroplasmyParser.GetOutputLines()) { tsvWriter.WriteLine(line); } return(ExitCodes.Success); }
private static ExitCodes ProgramExecution() { var referenceProvider = new ReferenceSequenceProvider(FileUtilities.GetReadStream(_compressedReference)); var version = DataSourceVersionReader.GetSourceVersion(_inputFile + ".version"); string outFileName = $"{version.Name}_{version.Version}"; using (var primateAiParser = new MitoHeteroplasmyParser(GZipUtilities.GetAppropriateReadStream(_inputFile), referenceProvider)) using (var nsaStream = FileUtilities.GetCreateStream(Path.Combine(_outputDirectory, outFileName + SaCommon.SaFileSuffix))) using (var indexStream = FileUtilities.GetCreateStream(Path.Combine(_outputDirectory, outFileName + SaCommon.SaFileSuffix + SaCommon.IndexSufix))) using (var nsaWriter = new NsaWriter(nsaStream, indexStream, version, referenceProvider, SaCommon.MitoHeteroplasmyTag, true, false, SaCommon.SchemaVersion, false)) { nsaWriter.Write(primateAiParser.GetItems()); } return(ExitCodes.Success); }