private static string DescribeAnnotationRegion(AnnotationRange ar) { if (ar == null) { return("Whole VCF"); } string ret = $"{ar.Start.Chromosome}:{ar.Start.Position}-"; return(ar.End == null ? ret : $"{ret}{ar.End?.Chromosome}:{ar.End?.Position}"); }
internal static long GetTabixVirtualPosition(AnnotationRange annotationRange, Stream stream, IDictionary <string, IChromosome> refNameToChromosome) { // process the entire file if no range specified if (annotationRange == null) { return(0); } var tabixIndex = Reader.GetTabixIndex(stream, refNameToChromosome); return(tabixIndex.GetOffset(annotationRange.Start.Chromosome, annotationRange.Start.Position)); }
private static AnnotationConfig GetAnnotationConfig(NirvanaConfig config, AnnotationRange annotationRange, int jobIndex) => new AnnotationConfig { id = config.id + $"_job{jobIndex}", genomeAssembly = config.genomeAssembly, vcfUrl = config.vcfUrl, tabixUrl = config.tabixUrl, outputDir = config.outputDir, outputPrefix = GetIndexedPrefix(config.vcfUrl, jobIndex), supplementaryAnnotations = config.supplementaryAnnotations, customAnnotations = config.customAnnotations, customStrUrl = config.customStrUrl, annotationRange = annotationRange };
private static Task <AnnotationResultSummary> RunAnnotationJob(NirvanaConfig config, string annotationLambdaArn, ILambdaContext context, AnnotationRange range, int jobIndex) { var annotationConfig = GetAnnotationConfig(config, range, jobIndex); Logger.WriteLine($"Job: {jobIndex}, Annotation region: {DescribeAnnotationRegion(range)}"); string configString = JsonUtilities.Stringify(annotationConfig); var annotationJob = new AnnotationJob(context, jobIndex); return(Task.Run(() => annotationJob.Invoke(annotationLambdaArn, configString))); }