test.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. "use strict";
  2. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4. return new (P || (P = Promise))(function (resolve, reject) {
  5. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9. });
  10. };
  11. var __importDefault = (this && this.__importDefault) || function (mod) {
  12. return (mod && mod.__esModule) ? mod : { "default": mod };
  13. };
  14. Object.defineProperty(exports, "__esModule", { value: true });
  15. const _1 = require(".");
  16. const fs_1 = __importDefault(require("fs"));
  17. (() => __awaiter(void 0, void 0, void 0, function* () {
  18. // wget ftp://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/RefSeqGene/LRG_RefSeqGene
  19. const LRGPath = '/home/thomas/NGS/ref/ncbi/LRG_RefSeqGene';
  20. // wget https://ftp.ncbi.nlm.nih.gov/genomes/all/annotation_releases/9606/109.20211119/GCF_000001405.39_GRCh38.p13/GCF_000001405.39_GRCh38.p13_feature_table.txt.gz
  21. const tablePath = '/home/thomas/NGS/ref/ncbi/GCF_000001405.39_GRCh38.p13_feature_table.txt';
  22. // wget ftp://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/biological_region/human.biological_region.gbff.gz
  23. const regionDBPath = '/home/thomas/NGS/ref/ncbi/REGIONS/human.biological_region.gbff';
  24. // wget ftp://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/RefSeqGene/refseqgene.[1-7].genomic.gbff.gz
  25. const geneDBPath = [1, 2, 3, 4, 5, 6, 7].map(n => '/home/thomas/NGS/ref/ncbi/GENES/refseqgene.' + n + '.genomic.gbff');
  26. // wget ftp://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/mRNA_Prot/human.[1-10].rna.gbff.gz
  27. const rnaDBPath = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(n => '/home/thomas/NGS/ref/ncbi/RNA/human.' + n + '.rna.gbff');
  28. // const res = await getSymbol('NOTCH1', LRGPath, tablePath, geneDBPath, rnaDBPath)
  29. // await makeRefSeqFromReg(rnaDBPath, /NM_/, '/home/thomas/NGS/ref/ncbi/RNA/human_NM.fa')
  30. // await makeRefSeqFromReg(rnaDBPath, /NM_/, 'test/human_NM.fa', 10)
  31. // const res = await getOffsets(rnaDBPath.map(e => e + '.jsi'), /NR_/)
  32. const res = yield (0, _1.getData)(rnaDBPath, /NR_/, '{"name": features[type="gene"].name, "accession": version}');
  33. yield fs_1.default.promises.writeFile('test/test-NR.json', JSON.stringify(res, null, 4));
  34. }))();