Exemple #1
0
 public StrainIndexer(Configuration config, IDbDriver database, NcbiClient ncbiClient,
                      CountryCodeHelper countryCodeHelper, DoiClient doiClient, Dictionary <string, int> sitList)
 {
     Config            = config;
     Database          = database;
     NcbiClient        = ncbiClient;
     CountryCodeHelper = countryCodeHelper;
     DoiClient         = doiClient;
     SitList           = sitList;
 }
Exemple #2
0
        static async Task Main(string[] args)
        {
            IServiceCollection services = new ServiceCollection();

            services.AddEasyCaching(option =>
            {
                option.UseLiteDB(c =>
                {
                    c.DBConfig = new LiteDBDBOptions
                    {
                        FileName = "doi.db"
                    };
                }, "doi");
                option.UseLiteDB(c =>
                {
                    c.DBConfig = new LiteDBDBOptions
                    {
                        FileName = "ncbi.db"
                    };
                }, "ncbi");
            });
            IServiceProvider serviceProvider = services.BuildServiceProvider();
            var factory = serviceProvider.GetService <IEasyCachingProviderFactory>();

            var doiClient  = new DoiClient(factory.GetCachingProvider("doi"));
            var ncbiClient = new NcbiClient(factory.GetCachingProvider("ncbi"));

            ncbiClient.AllowQuery = true;
            var config = Configuration.FromYaml("/home/gaetan/API/Web/Data/config.yaml");

            Directory.Delete("Index", true);
            var db     = new LiteDatabase("db");
            var driver = new LiteDbDriver(db);
            // var driver = new RavenDbDriver(@"C:\Users\Gaetan\RiderProjects\API\Web\bin\Debug\net5.0\RavenDB");
            var countryHelper = new CountryCodeHelper();
            var sit           = await LoadSIT(@"/home/gaetan/API/Web/Data/spol/sit.tsv");

            // var geneIndexer = new GffGeneIndexer(driver, "/home/gaetan/API/Web/Data/genes/H37Rv.gff3");
            // await geneIndexer.Index();
            //
            // var snpIndexer = new SnpIndexer(config, driver, doiClient);
            // await snpIndexer.Index();

            var strainIndexer = new StrainIndexer(config, driver, ncbiClient, countryHelper, doiClient, sit);
            await strainIndexer.Index();

            await driver.ComputeKeywordStat();

            Console.WriteLine("gg");
        }
Exemple #3
0
        private static NcbiClient CreateNcbiClient()
        {
            IServiceCollection services = new ServiceCollection();

            services.AddEasyCaching(option =>
            {
                option.UseLiteDB(c =>
                {
                    c.DBConfig = new LiteDBDBOptions
                    {
                        FileName = "ncbi.db"
                    };
                }, "ncbi");
            });
            IServiceProvider serviceProvider = services.BuildServiceProvider();
            var factory    = serviceProvider.GetService <IEasyCachingProviderFactory>();
            var ncbiClient = new NcbiClient(factory.GetCachingProvider("ncbi"));

            ncbiClient.AllowQuery = true;
            return(ncbiClient);
        }
Exemple #4
0
 public GetNcbiRun(NcbiClient client)
 {
     Client = client;
 }