New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download the GFF file of the Cycas taitungensis mitochondrion #11

Closed
sjackman opened this Issue May 29, 2015 · 9 comments

Comments

3 participants
@sjackman

sjackman commented May 29, 2015

Hi. I'd like to download the annotation in GFF format of the Cycas taitungensis mitochondrion, NC_010303.1. I started with bionode ncbi search genome cycas taitungensis, but got nada back. Any suggestions?

@bmpvieira

This comment has been minimized.

Member

bmpvieira commented Jun 4, 2015

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
@sjackman

This comment has been minimized.

sjackman commented Jun 4, 2015

@sjackman

This comment has been minimized.

sjackman commented Jun 4, 2015

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
@sjackman

This comment has been minimized.

sjackman commented Jul 10, 2015

npm install -g bionode-ncbi json

@bmpvieira bmpvieira added the ready label Sep 10, 2015

@bmpvieira

This comment has been minimized.

Member

bmpvieira commented Sep 10, 2015

Thanks @sjackman for your comments. I haven't closed this yet because it could be a nice thing to add to bionode. /cc @terfn

@bmpvieira

This comment has been minimized.

Member

bmpvieira commented Nov 10, 2015

@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)
})

@bmpvieira bmpvieira added the bug label Nov 10, 2015

@terfilip

This comment has been minimized.

Contributor

terfilip commented Nov 11, 2015

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

@bmpvieira bmpvieira added this to Backlog in Bionode Project Board Apr 4, 2017

@bmpvieira bmpvieira added this to the 1.8.0 milestone Apr 7, 2017

@bmpvieira bmpvieira removed bug ready labels Apr 7, 2017

@bmpvieira bmpvieira moved this from Backlog to Next in Bionode Project Board Apr 7, 2017

bmpvieira added a commit that referenced this issue Apr 22, 2017

Better CLI, fix #30, #29, #20 and #11
Switch from minimist to yargs for CLI parsing
Add list of possible databases with yargs
Indent JSON output when --pretty
Allow piping JSON, even for fetch

bmpvieira added a commit that referenced this issue Apr 22, 2017

Better CLI, this fixes #31, #29, #20 and #11
Switch from minimist to yargs for CLI parsing
Add list of possible databases with yargs
Indent JSON output when --pretty
Allow piping JSON, even for fetch

bmpvieira added a commit that referenced this issue Apr 22, 2017

Better CLI, this fixes #31, #29, #20 and #11
Switch from minimist to yargs for CLI parsing
Add list of possible databases with yargs
Indent JSON output when `--pretty`
Allow piping JSON, even for fetch
@bmpvieira

This comment has been minimized.

Member

bmpvieira commented Apr 22, 2017

After #32 is merged, this should work:

echo -e '{"term": "NC_010303.1", "rettype": "fasta"}' | bionode-ncbi fetch nuccore -s

@bmpvieira bmpvieira self-assigned this Apr 22, 2017

@bmpvieira bmpvieira moved this from Next to In Progress in Bionode Project Board Apr 22, 2017

bmpvieira added a commit that referenced this issue Apr 23, 2017

Merge pull request #32 from bionode/better-cli
Better CLI, this fixes #31, #29, #20 and #11

@bmpvieira bmpvieira closed this Apr 23, 2017

@bmpvieira bmpvieira moved this from In Progress to Done in Bionode Project Board Apr 23, 2017

@sjackman

This comment has been minimized.

sjackman commented Apr 23, 2017

Nice. Thanks, Bruno!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment