Comments (9)
After #32 is merged, this should work:
echo -e '{"term": "NC_010303.1", "rettype": "fasta"}' | bionode-ncbi fetch nuccore -s
from bionode-ncbi.
Hi, there's no ncbi "genome" or "assembly for Cycas taitungensis, but you can download the Genbank file and convert it to GFF, or just use togows.org to get it directly using the NCBI ID:
bionode-ncbi search nuccore NC_010303.1 | json uid | while read id; do wget http://togows.org/entry/nucleotide/$id.gff; done
from bionode-ncbi.
Perfect! Thanks, Bruno.
http://togows.org/entry/nucleotide/166895601.gff
from bionode-ncbi.
For future me, or someone else, here's my Makefile snippet:
# Cycas taitungensis
NC_010303.1.json: %.json:
bionode-ncbi search nuccore $* >$@
%.uid: %.json
json uid <$< >$@
%.fa: %.uid
curl http://togows.org/entry/nucleotide/`<$<`.fasta |seqtk seq >$@
%.gb: %.uid
curl -o $@ http://togows.org/entry/nucleotide/`<$<`.gb
%.gff: %.uid
curl -o $@ http://togows.org/entry/nucleotide/`<$<`.gff
from bionode-ncbi.
npm install -g bionode-ncbi json
from bionode-ncbi.
Thanks @sjackman for your comments. I haven't closed this yet because it could be a nice thing to add to bionode. /cc @terfn
from bionode-ncbi.
@terfn recently added NCBI efetch to bionode, so soon something like this should work:
echo -e "{'db': 'nuccore', 'term': 'NC_010303.1', 'rettype': 'fasta'}\n" | bionode-ncbi fetch -
It currently doesn't because of the way CLI is parsing things, but in JavaScript the following works and gives a fasta:
var ncbi = require('bionode-ncbi')
var fasta = require('bionode-fasta')
var json = require('JSONStream')
var opts = {
db: 'nuccore',
term: 'NC_010303.1',
rettype: 'fasta'
}
ncbi.fetch(opts)
.pipe(json.stringify()) // We shouldn't need this, bionode-fasta should accept objects
.pipe(fasta.write())
.on('data', function (data) {
console.log(data)
})
from bionode-ncbi.
By the way fasta is the default rettype for nuccore and some other dbs so it's not necessary to specify it. Also it is possible to get the GenBank flat file format from nuccore using efetch by specifying
rettype: 'gbwithparts'
If the goal is to convert it to a GFF later
@bmpvieira I'll take a look at making the CLI accept objects
from bionode-ncbi.
Nice. Thanks, Bruno!
from bionode-ncbi.
Related Issues (20)
- Implement efetch API
- 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
- geo is not searchable HOT 5
- 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.