Skip to content
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
Closed

Download the GFF file of the Cycas taitungensis mitochondrion #11

sjackman opened this issue May 29, 2015 · 9 comments
Assignees
Milestone

Comments

@sjackman
Copy link

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
Copy link
Member

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
Copy link
Author

sjackman commented Jun 4, 2015

Perfect! Thanks, Bruno.

http://togows.org/entry/nucleotide/166895601.gff

@sjackman
Copy link
Author

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
Copy link
Author

npm install -g bionode-ncbi json

@bmpvieira
Copy link
Member

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
Copy link
Member

@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
Copy link
Contributor

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 the 1.8.0 milestone Apr 7, 2017
bmpvieira added a commit that referenced this issue Apr 22, 2017
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
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
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
Copy link
Member

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 added a commit that referenced this issue Apr 23, 2017
@sjackman
Copy link
Author

Nice. Thanks, Bruno!

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

No branches or pull requests

3 participants