private static ExitCodes ProgramExecution() { var logger = new ConsoleLogger(); var bundle = DataBundle.GetDataBundle(_inputReferencePath, _inputPrefix); int numRefSeqs = bundle.SequenceReader.NumRefSeqs; var chromosome = ReferenceNameUtilities.GetChromosome(bundle.SequenceReader.RefNameToChromosome, _referenceName); bundle.Load(chromosome); string outputStub = GetOutputStub(chromosome, bundle.Source); var interval = new ChromosomeInterval(chromosome, _referencePosition, _referenceEndPosition); var transcripts = GetTranscripts(logger, bundle, interval); var sift = GetPredictionStaging(logger, "SIFT", transcripts, chromosome, bundle.SiftPredictions, bundle.SiftReader, x => x.SiftIndex, numRefSeqs); var polyphen = GetPredictionStaging(logger, "PolyPhen", transcripts, chromosome, bundle.PolyPhenPredictions, bundle.PolyPhenReader, x => x.PolyPhenIndex, numRefSeqs); string referenceBases = GetReferenceBases(logger, bundle.SequenceReader, interval); var regulatoryRegionIntervalArrays = GetRegulatoryRegionIntervalArrays(logger, bundle.TranscriptCache, interval, numRefSeqs); var transcriptIntervalArrays = PredictionUtilities.UpdateTranscripts(transcripts, bundle.SiftPredictions, sift.Predictions, bundle.PolyPhenPredictions, polyphen.Predictions, numRefSeqs); var transcriptStaging = GetTranscriptStaging(bundle.TranscriptCacheData.Header, transcriptIntervalArrays, regulatoryRegionIntervalArrays); WriteCache(logger, FileUtilities.GetCreateStream(CacheConstants.TranscriptPath(outputStub)), transcriptStaging, "transcript"); WriteCache(logger, FileUtilities.GetCreateStream(CacheConstants.SiftPath(outputStub)), sift.Staging, "SIFT"); WriteCache(logger, FileUtilities.GetCreateStream(CacheConstants.PolyPhenPath(outputStub)), polyphen.Staging, "PolyPhen"); WriteReference(logger, CacheConstants.BasesPath(outputStub), bundle.SequenceReader, chromosome, referenceBases, interval.Start); return(ExitCodes.Success); }