Comments (5)
I'll put some time today into this.
from bionode-ncbi.
As I see it we have some options:
- Have an internal list of the valid db options and check it upfront request
- This can be created the first time the users uses the tool and use a cached version of it from that moment if hardcoding is not an option.
- This will also allow the usage of a string metric algorithm for suggestions in case the db is not found.
- Identify conflictive cases and create the specific mapping for them.
- This is a simple and fast solution. But won't protect the user from misspells.
- Do the request but if the following object is returned bail out and notify the user:
{
"header": {
"type": "esearch",
"version": "0.3"
},
"esearchresult": {
"ERROR": "Invalid db name specified: dst"
}
}
- The check can be done here bionode-ncbi.js#L523 skipping the retry loop.
- An internal list of valid dbs can be present for suggestions as in the first case
In my opinion the last option is the most suitable. @bmpvieira If you agree I'll create a pull request to solve it. Do you have any other idea?
from bionode-ncbi.
I think we should go with the first option, check if db is valid and if not present list of valid ones (hardcoded in an internal config file in JSON or YAML format).
Here's one retrieved from the select box on NCBI website (not sure if all work with eutils/biondo-ncbi):
"gquery","All Databases"
"assembly","Assembly"
"bioproject","BioProject"
"biosample","BioSample"
"biosystems","BioSystems"
"books","Books"
"clinvar","ClinVar"
"clone","Clone"
"cdd","Conserved Domains"
"gap","dbGaP"
"dbvar","dbVar"
"nucest","EST"
"gene","Gene"
"genome","Genome"
"gds","GEO DataSets"
"geoprofiles","GEO Profiles"
"nucgss","GSS"
"gtr","GTR"
"homologene","HomoloGene"
"medgen","MedGen"
"mesh,"MeSH"
"ncbisearch","NCBI Web Site"
"nlmcatalog","NLM Catalog"
"nuccore","Nucleotide"
"omim","OMIM"
"pmc","PMC"
"popset","PopSet"
"probe","Probe"
"protein","Protein"
"proteinclusters","Protein Clusters"
"pcassay","PubChem BioAssay"
"pccompound","PubChem Compound"
"pcsubstance","PubChem Substance
"pubmed,"PubMed"
"pubmedhealth","PubMed Health"
"snp","SNP"
"sparcle","Sparcle"
"sra","SRA"
"structure","Structure"
"taxonomy","Taxonomy"
"toolkit","ToolKit"
"toolkitall","ToolKitAll"
"toolkitbook","ToolKitBook"
"toolkitbookgh","ToolKitBookgh"
"unigene","UniGene"
from bionode-ncbi.
I've kind of solved this at the CLI level by switching to yargs (#32) but I think it would be nice to also have these kind of checks internally in the library. Maybe we could somehow reuse yargs choice
definition.
from bionode-ncbi.
Fixed by #33. Thanks!
from bionode-ncbi.
Related Issues (20)
- Implement efetch API
- Download the GFF file of the Cycas taitungensis mitochondrion HOT 9
- Uncaught, unspecified "error" event HOT 1
- How to look up metadata for an SRR file HOT 1
- Tests are broken because of NCBI side metadata changes (again) HOT 2
- rna_from_genomic instead of genomic.fna
- download in the examples printing too much info HOT 3
- We need a smaller assembly from NCBI for testing HOT 3
- Git rid of git-lfs
- Error handling when NCBI connection is lost HOT 4
- User-friendly CLI
- Modularize lib structure.
- Output some warning to terminal when there is no output
- Add Blast API HOT 2
- Use progress bar on download HOT 5
- Downloading one run download the whole Bioproject
- TypeError: Cannot create property 'Run' on string ' ' HOT 1
- Dependencies error: Prototype Pollution (lodash dependencies)
- Unexpected error when running 'bionode' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bionode-ncbi.