Beispiel #1
0
        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}");
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
 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
 };
Beispiel #4
0
        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)));
        }