| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- 'use strict';
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- };
- var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- const path_1 = __importDefault(require("path"));
- const piscina_1 = __importDefault(require("piscina"));
- (() => __awaiter(void 0, void 0, void 0, function* () {
- const getEsearch = new piscina_1.default({
- filename: path_1.default.resolve(__dirname, './workers/esearch.js')
- });
- // const orders =
- // [
- // {
- // params: {
- // db: 'nuccore',
- // term: 'NM_001143971.2'
- // },
- // xpath: 'string((//Id)[1])'
- // },
- // {
- // params: {
- // db: 'gene',
- // term: 'NM_001143971.2'
- // },
- // xpath: 'string((//Id)[1])'
- // },
- // ]
- // const results = await Promise.all(orders.map(e => getEsearch.run(e)))
- // console.log(results);
- const orders = [
- // {
- // params: {
- // db: 'nuccore',
- // id: '1674999401',
- // rettype: 'gb',
- // retmode: 'text'
- // },
- // xpath: '/',
- // endpoint: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi'
- // },
- // {
- // db: 'nuccore',
- // id: '1674999401',
- // rettype: 'native',
- // retmode: 'xml',
- // endpoint: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi'
- // },
- {
- db: 'pubmed',
- id: '19393038',
- retmode: 'xml',
- endpoint: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi',
- query: `**.AbstractText`
- },
- ];
- const results = yield Promise.all(orders.map(e => getEsearch.run(e)));
- console.log(results);
- }))();
|