private static ExitCodes ProgramExecution() { var rootDirectory = new FileInfo(MitoMapFileNames[0]).Directory; if (rootDirectory == null) { return(ExitCodes.PathNotFound); } var version = DataSourceVersionReader.GetSourceVersion(Path.Combine(rootDirectory.ToString(), "mitoMapVar")); var sequenceProvider = new ReferenceSequenceProvider(FileUtilities.GetReadStream(_compressedReference)); var chrom = sequenceProvider.RefNameToChromosome["chrM"]; sequenceProvider.LoadChromosome(chrom); MitoMapInputDb mitoMapInputDb = MitoMapDatabaseUtilities.Create(_mitoMapDatabase); var mitoMapVarReaders = MitoMapFileNames.Select(mitoMapFileName => new MitoMapVariantReader(new FileInfo(mitoMapFileName), mitoMapInputDb, sequenceProvider)).ToList(); var mergedMitoMapVarItems = MitoMapVariantReader.GetMergeAndSortedItems(mitoMapVarReaders); string outFileName = $"{version.Name}_{version.Version}"; 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, sequenceProvider, SaCommon.MitoMapTag, false, true, SaCommon.SchemaVersion, false)) { nsaWriter.Write(mergedMitoMapVarItems); } return(ExitCodes.Success); }
public static List <string> GetPubMedIds(string field, MitoMapInputDb mitoMapInputDb) { if (field == "0") { return(default);