Esempio n. 1
0
        public AnnotationResources(string refSequencePath, string inputCachePrefix, List <string> saDirectoryPaths, List <SaUrls> customAnnotations, string pluginDirectory, bool disableRecomposition, bool forceMitochondrialAnnotation)
        {
            SequenceProvider = ProviderUtilities.GetSequenceProvider(refSequencePath);

            var annotationFiles = new AnnotationFiles();

            saDirectoryPaths?.ForEach(x => annotationFiles.AddFiles(x));
            customAnnotations?.ForEach(x => annotationFiles.AddFiles(x));

            TranscriptAnnotationProvider = ProviderUtilities.GetTranscriptAnnotationProvider(inputCachePrefix, SequenceProvider);
            SaProvider             = ProviderUtilities.GetNsaProvider(annotationFiles);
            ConservationProvider   = ProviderUtilities.GetConservationProvider(annotationFiles);
            RefMinorProvider       = ProviderUtilities.GetRefMinorProvider(annotationFiles);
            GeneAnnotationProvider = ProviderUtilities.GetGeneAnnotationProvider(annotationFiles);
            Plugins = PluginUtilities.LoadPlugins(pluginDirectory);

            Annotator = ProviderUtilities.GetAnnotator(TranscriptAnnotationProvider, SequenceProvider, SaProvider,
                                                       ConservationProvider, GeneAnnotationProvider, Plugins);

            Recomposer = disableRecomposition
                ? new NullRecomposer()
                : Phantom.Recomposer.Recomposer.Create(SequenceProvider, TranscriptAnnotationProvider);
            DataSourceVersions = GetDataSourceVersions(Plugins, TranscriptAnnotationProvider, SaProvider,
                                                       GeneAnnotationProvider, ConservationProvider).ToList();
            VepDataVersion = TranscriptAnnotationProvider.VepVersion + "." + CacheConstants.DataVersion + "." +
                             SaCommon.DataVersion;

            ForceMitochondrialAnnotation = forceMitochondrialAnnotation;
        }
Esempio n. 2
0
        public AnnotationResources(string refSequencePath, string inputCachePrefix, List <string> saDirectoryPaths, List <SaUrls> customAnnotations,
                                   string customStrTsvPath, bool disableRecomposition, bool forceMitochondrialAnnotation, bool useLegacyVids, PerformanceMetrics metrics)
        {
            Metrics = metrics;
            PerformanceMetrics.ShowInitializationHeader();

            SequenceProvider = ProviderUtilities.GetSequenceProvider(refSequencePath);

            var annotationFiles = new AnnotationFiles();

            saDirectoryPaths?.ForEach(x => annotationFiles.AddFiles(x));
            customAnnotations?.ForEach(x => annotationFiles.AddFiles(x));

            ProteinConservationProvider = ProviderUtilities.GetProteinConservationProvider(annotationFiles);
            ProteinConservationProvider?.Load();

            metrics.Cache.Start();
            TranscriptAnnotationProvider = ProviderUtilities.GetTranscriptAnnotationProvider(inputCachePrefix, SequenceProvider, ProteinConservationProvider);
            metrics.ShowCacheLoad();

            SaProvider             = ProviderUtilities.GetNsaProvider(annotationFiles);
            ConservationProvider   = ProviderUtilities.GetConservationProvider(annotationFiles);
            LcrProvider            = ProviderUtilities.GetLcrProvider(annotationFiles);
            RefMinorProvider       = ProviderUtilities.GetRefMinorProvider(annotationFiles);
            GeneAnnotationProvider = ProviderUtilities.GetGeneAnnotationProvider(annotationFiles);

            IRepeatExpansionProvider repeatExpansionProvider = GetRepeatExpansionProvider(SequenceProvider.Assembly,
                                                                                          SequenceProvider.RefNameToChromosome, SequenceProvider.RefIndexToChromosome.Count, customStrTsvPath);

            MitoHeteroplasmyProvider = MitoHeteroplasmyReader.GetProvider();

            Annotator = new Annotator(TranscriptAnnotationProvider, SequenceProvider, SaProvider, ConservationProvider, LcrProvider, GeneAnnotationProvider,
                                      repeatExpansionProvider);

            if (useLegacyVids)
            {
                VidCreator = new LegacyVariantId(SequenceProvider.RefNameToChromosome);
            }
            else
            {
                VidCreator = new VariantId();
            }

            Recomposer = disableRecomposition
                ? new NullRecomposer()
                : Phantom.Recomposer.Recomposer.Create(SequenceProvider, TranscriptAnnotationProvider, VidCreator);
            DataSourceVersions = GetDataSourceVersions(TranscriptAnnotationProvider, SaProvider, GeneAnnotationProvider, ConservationProvider, LcrProvider, MitoHeteroplasmyProvider)
                                 .ToList();
            VepDataVersion = TranscriptAnnotationProvider.VepVersion + "." + CacheConstants.DataVersion + "." + SaCommon.DataVersion;

            ForceMitochondrialAnnotation = forceMitochondrialAnnotation;
        }