| 1234567891011121314151617181920212223242526272829303132333435363738 |
- "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 fs_1 = __importDefault(require("fs"));
- (() => __awaiter(void 0, void 0, void 0, function* () {
- // wget ftp://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/RefSeqGene/LRG_RefSeqGene
- const LRGPath = '/home/thomas/NGS/ref/ncbi/LRG_RefSeqGene';
- // 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
- const tablePath = '/home/thomas/NGS/ref/ncbi/GCF_000001405.39_GRCh38.p13_feature_table.txt';
- // wget ftp://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/biological_region/human.biological_region.gbff.gz
- const regionDBPath = '/home/thomas/NGS/ref/ncbi/REGIONS/human.biological_region.gbff';
- // wget ftp://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/RefSeqGene/refseqgene.[1-7].genomic.gbff.gz
- const geneDBPath = [1, 2, 3, 4, 5, 6, 7].map(n => '/home/thomas/NGS/ref/ncbi/GENES/refseqgene.' + n + '.genomic.gbff');
- // wget ftp://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/mRNA_Prot/human.[1-10].rna.gbff.gz
- const rnaDBPath = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(n => '/home/thomas/NGS/ref/ncbi/RNA/human.' + n + '.rna.gbff');
- // const res = await getSymbol('NOTCH1', LRGPath, tablePath, geneDBPath, rnaDBPath)
- // await makeRefSeqFromReg(rnaDBPath, /NM_/, '/home/thomas/NGS/ref/ncbi/RNA/human_NM.fa')
- // await makeRefSeqFromReg(rnaDBPath, /NM_/, 'test/human_NM.fa', 10)
- // const res = await getOffsets(rnaDBPath.map(e => e + '.jsi'), /NR_/)
- //const res = await getData(rnaDBPath, /NM_/, 'test/test-NM.json', '{"name": features[type="gene"].name, "accession": version}')
- //const res = await getData(geneDBPath, /^NG_007458/, 'test/NOCTH1-gene.json')
- // await fs.promises.writeFile('test/NOCTH1-gene.json', JSON.stringify(res, null , 4))
- const txt = yield fs_1.default.promises.readFile('test/NOCTH1-gene.json');
- const json = JSON.parse(txt.toString());
- console.log(json[0].features.filter((f) => f.type !== 'variation'));
- yield fs_1.default.promises.writeFile('test/gene-feat.json', JSON.stringify(json[0].features.filter((f) => f.type !== 'variation'), null, 4));
- }))();
|