Giter Site home page Giter Site logo

Comments (9)

bmpvieira avatar bmpvieira commented on September 28, 2024 1

After #32 is merged, this should work:

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

from bionode-ncbi.

bmpvieira avatar bmpvieira commented on September 28, 2024

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.

sjackman avatar sjackman commented on September 28, 2024

Perfect! Thanks, Bruno.

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

from bionode-ncbi.

sjackman avatar sjackman commented on September 28, 2024

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.

sjackman avatar sjackman commented on September 28, 2024

npm install -g bionode-ncbi json

from bionode-ncbi.

bmpvieira avatar bmpvieira commented on September 28, 2024

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.

bmpvieira avatar bmpvieira commented on September 28, 2024

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

terfilip avatar terfilip commented on September 28, 2024

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.

sjackman avatar sjackman commented on September 28, 2024

Nice. Thanks, Bruno!

from bionode-ncbi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.