|
|
@@ -18,25 +18,7 @@ const piscina_1 = __importDefault(require("piscina"));
|
|
|
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);
|
|
|
+ // https://www.ncbi.nlm.nih.gov/books/NBK25499/
|
|
|
const orders = [
|
|
|
// {
|
|
|
// params: {
|
|
|
@@ -55,15 +37,102 @@ const piscina_1 = __importDefault(require("piscina"));
|
|
|
// retmode: 'xml',
|
|
|
// endpoint: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi'
|
|
|
// },
|
|
|
+ // {
|
|
|
+ // term: 'NOTCH1 AND Human AND Refseq',
|
|
|
+ // db: 'nuccore',
|
|
|
+ // endpoint: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi',
|
|
|
+ // query: `$..Id`
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // term: 'NOTCH1[Gene Name]+AND+Human',
|
|
|
+ // db: 'gene',
|
|
|
+ // endpoint: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi',
|
|
|
+ // query: `$..Id`
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // db: 'pubmed',
|
|
|
+ // id: '19393038',
|
|
|
+ // retmode: 'xml',
|
|
|
+ // endpoint: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi',
|
|
|
+ // //query: `$..AbstractText[?(@.Label==='RESULTS')]`
|
|
|
+ // query: `$..AbstractText`
|
|
|
+ // },
|
|
|
{
|
|
|
- db: 'pubmed',
|
|
|
- id: '19393038',
|
|
|
+ db: 'gene',
|
|
|
+ id: '4851',
|
|
|
retmode: 'xml',
|
|
|
endpoint: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi',
|
|
|
- //query: `$..AbstractText[?(@.Label==='RESULTS')]`
|
|
|
- query: `$..AbstractText`
|
|
|
+ query: [
|
|
|
+ `{ "Locus" : **.Gene_ref_locus,
|
|
|
+ "Synonyms" : [**.Entrezgene_gene.**.Gene_ref_syn_E],
|
|
|
+ "Update_Date" : **.Gene_track_update_date.Date.Date_std.Date_std.{"Year": Date_std_year, "Month": Date_std_month, "Day": Date_std_month},
|
|
|
+ "Location" : **.Gene_ref_maploc,
|
|
|
+ "Summary" : **.Entrezgene_summary,
|
|
|
+ "Genomic_Position": **.Entrezgene_locus.Gene_commentary[Gene_commentary_type.value='genomic'][0].{
|
|
|
+ "Accession": Gene_commentary_accession,
|
|
|
+ "Positions": $.{
|
|
|
+ "from" : Gene_commentary_seqs.**.Seq_interval_from,
|
|
|
+ "to" : Gene_commentary_seqs.**.Seq_interval_to,
|
|
|
+ "strand": Gene_commentary_seqs.**.Na_strand.value
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "Gene_Ontology" : **.Entrezgene_properties.Gene_commentary[Gene_commentary_heading='GeneOntology'].Gene_commentary_comment.{
|
|
|
+ "Functions" : Gene_commentary[Gene_commentary_label='Function'].Gene_commentary_comment.Gene_commentary.{
|
|
|
+ "ID" : Gene_commentary_source.Other_source.**.Object_id_id,
|
|
|
+ "Pre_Text": Gene_commentary_source.Other_source.Other_source_pre_text,
|
|
|
+ "Anchor" : Gene_commentary_source.Other_source.Other_source_anchor
|
|
|
+ },
|
|
|
+ "Processes" : Gene_commentary[Gene_commentary_label='Process'].Gene_commentary_comment.Gene_commentary.{
|
|
|
+ "ID" : Gene_commentary_source.Other_source.**.Object_id_id,
|
|
|
+ "Pre_Text": Gene_commentary_source.Other_source.Other_source_pre_text,
|
|
|
+ "Anchor" : Gene_commentary_source.Other_source.Other_source_anchor
|
|
|
+ },
|
|
|
+ "Components" : Gene_commentary[Gene_commentary_label='Component'].Gene_commentary_comment.Gene_commentary.{
|
|
|
+ "ID" : Gene_commentary_source.Other_source.**.Object_id_id,
|
|
|
+ "Pre_Text": Gene_commentary_source.Other_source.Other_source_pre_text,
|
|
|
+ "Anchor" : Gene_commentary_source.Other_source.Other_source_anchor
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "Transcript": {
|
|
|
+ "Accession" : **.'Entrezgene_comments'.'Gene_commentary'[Gene_commentary_heading='NCBI Reference Sequences (RefSeq)'].**.Gene_commentary[Gene_commentary_heading='mRNA Sequence'][0].Gene_commentary_accession,
|
|
|
+ "Exon_Count": **.'Entrezgene_properties'.'Gene_commentary'[Gene_commentary_label='Exon count'].Gene_commentary_text
|
|
|
+ },
|
|
|
+ "Products": **.'Entrezgene_comments'.'Gene_commentary'[Gene_commentary_heading='NCBI Reference Sequences (RefSeq)'].**.Gene_commentary[Gene_commentary_heading='mRNA Sequence'][0].Gene_commentary_products.Gene_commentary[Gene_commentary_heading='Product'][0].{
|
|
|
+ "Accession": Gene_commentary_accession,
|
|
|
+ "Domains" : Gene_commentary_comment.Gene_commentary[Gene_commentary_heading='Conserved Domains'].Gene_commentary_comment.Gene_commentary.{
|
|
|
+ "DB" : Gene_commentary_source.**.Dbtag_db,
|
|
|
+ "ID" : Gene_commentary_source.**.Object_id_id,
|
|
|
+ "Anchor" : Gene_commentary_source.**.Other_source_anchor,
|
|
|
+ "Location": Gene_commentary_comment.**.Gene_commentary_text
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "Biblio_PMID": **.PubMedId
|
|
|
+ }`
|
|
|
+ ]
|
|
|
},
|
|
|
+ // {
|
|
|
+ // db: 'gene',
|
|
|
+ // id: '4851',
|
|
|
+ // retmode: 'xml',
|
|
|
+ // endpoint: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi',
|
|
|
+ // //query: `$..AbstractText[?(@.Label==='RESULTS')]`
|
|
|
+ // query: [
|
|
|
+ // `$..Name`,
|
|
|
+ // `$..Description`,
|
|
|
+ // `$..MapLocation`,
|
|
|
+ // '$..OtherAliases',
|
|
|
+ // `$..OtherDesignations`,
|
|
|
+ // '$..ChrLoc',
|
|
|
+ // `$..GenomicInfoType..ChrAccVer`,
|
|
|
+ // '$..GenomicInfoType..ChrStart',
|
|
|
+ // '$..GenomicInfoType..ChrStop',
|
|
|
+ // '$..ExonCount',
|
|
|
+ // '$..GeneWeight',
|
|
|
+ // '$..Summary',
|
|
|
+ // ]
|
|
|
+ // },
|
|
|
];
|
|
|
const results = yield Promise.all(orders.map(e => getEsearch.run(e)));
|
|
|
- console.log(...results);
|
|
|
+ console.log(orders.map((e, i) => (Object.assign(Object.assign({}, e), { results: results[i] })))[0].results.value);
|
|
|
+ // await fs.promises.writeFile('test.json',JSON.stringify(orders.map((e:any, i) => ({...e, results: results[i]})).map(e => e.results)[0]))
|
|
|
}))();
|