vsm-dictionary-uniprot
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "vsm-dictionary-uniprot", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Implementation of a VSM-dictionary that interfaces with the Uniprot REST API", | ||
@@ -5,0 +5,0 @@ "main": "src/DictionaryUniprot.js", |
@@ -135,3 +135,3 @@ # vsm-dictionary-uniprot | ||
`DictionaryUniprot` object, which optimizes the above mapping for curator clarity | ||
and use. The **default value is true** and what it changes in the mapping table | ||
and use. The **default value is true** and what changes in the mapping table | ||
above (which is the mapping for `optimap: false` actually) is that the VSM's `str` | ||
@@ -141,3 +141,3 @@ entry/match object property takes the value of the `Entry name`. The reason behind | ||
internal id) and thus distinguishable, whereas in the original mapping the first | ||
protein name (which was used as `str`) was not. | ||
protein name (which was used as `str`) is not. | ||
@@ -144,0 +144,0 @@ ### Map Uniprot to Match VSM object |
@@ -11,3 +11,3 @@ const Dictionary = require('vsm-dictionary'); | ||
// optimized mapping for curator's | ||
// optimized mapping for curators | ||
this.optimap = (typeof opt.optimap === 'boolean') | ||
@@ -48,12 +48,5 @@ ? opt.optimap | ||
} else { | ||
// keep only the domain-specific dictID(s) | ||
let idList = options.filter.id.filter(dictID => | ||
dictID.trim() === this.uniprotDictID | ||
); | ||
if (idList.length === 0) { | ||
return cb(null, { items: [] }); | ||
} else { | ||
return cb(null, res); | ||
} | ||
return (options.filter.id.includes(this.uniprotDictID)) | ||
? cb(null, res) | ||
: cb(null, { items: [] }); | ||
} | ||
@@ -63,11 +56,5 @@ } | ||
getEntries(options, cb) { | ||
if (this.hasProperFilterDictIDProperty(options)) { | ||
// keep only the domain-specific dictID(s) | ||
let idList = options.filter.dictID.filter(dictID => | ||
dictID.trim() === this.uniprotDictID | ||
); | ||
if (idList.length === 0) { | ||
return cb(null, { items: [] }); | ||
} | ||
if (this.hasProperFilterDictIDProperty(options) | ||
&& !options.filter.dictID.includes(this.uniprotDictID)) { | ||
return cb(null, { items: [] }); | ||
} | ||
@@ -122,13 +109,7 @@ | ||
getEntryMatchesForString(str, options, cb) { | ||
if (!str) return cb(null, {items: []}); | ||
if ((!str) || (str.trim() === '')) return cb(null, {items: []}); | ||
if (this.hasProperFilterDictIDProperty(options)) { | ||
// keep only the domain-specific dictID(s) | ||
let idList = options.filter.dictID.filter(dictID => | ||
dictID.trim() === this.uniprotDictID | ||
); | ||
if (idList.length === 0) { | ||
return cb(null, { items: [] }); | ||
} | ||
if (this.hasProperFilterDictIDProperty(options) | ||
&& !options.filter.dictID.includes(this.pubMedDictID)) { | ||
return cb(null, { items: [] }); | ||
} | ||
@@ -135,0 +116,0 @@ |
@@ -38,3 +38,3 @@ const DictionaryUniprot = require('./DictionaryUniprot'); | ||
it('returns empty result when the list of dictIDs does not ' | ||
+ ' include the domain\'s dictID', cb => { | ||
+ 'include the domain\'s dictID', cb => { | ||
dict.getDictInfos({ filter: { id: [ | ||
@@ -41,0 +41,0 @@ ' ', |
Sorry, the diff of this file is too big to display
163006
1532