Skip to content

Instantly share code, notes, and snippets.

View bmpvieira's full-sized avatar

Bruno Vieira bmpvieira

  • Portugal
View GitHub Profile
@bmpvieira
bmpvieira / api-ncbi-sra-insects.js
Last active August 29, 2015 13:59
Tables of Hymenoptera, Isoptera and specifically ant genomes available on NCBI SRA. Useful to find what could be used for eusociality studies.
var request = require('request')
var async = require('async')
var xml2js = require('xml2js')
var xml2js_parseString = xml2js.parseString
var API = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/'
var DEFAULTS = 'retmode=json&usehistory=y&version=2.0'
var requestInterval = 500 //ms between biosamples requests
@bmpvieira
bmpvieira / 2014-07-11_assembly-Guillardia_theta
Created July 12, 2014 16:56
bionode-ncbi search assembly Guillardia theta on 2014-07-11
{
"coverage" : "0",
"wgs" : "AEIE01",
"seqreleasedate" : "2012/12/05 00:00",
"speciesname" : "Guillardia theta",
"meta" : {
"assembly-status" : "Scaffold",
"FtpSites" : {
"FtpPath" : {
"type" : "GenBank",
@bmpvieira
bmpvieira / 2014-07-12_assembly-Guillardia_theta
Created July 12, 2014 16:59
bionode-ncbi search assembly Guillardia theta on 2014-07-12
{
"coverage" : "0",
"wgs" : "AEIE01",
"seqreleasedate" : "2012/12/05 00:00",
"speciesname" : "Guillardia theta",
"meta" : {
"assembly-status" : "Scaffold",
"FtpSites" : {
"FtpPath" : [
{
@bmpvieira
bmpvieira / keybase.md
Created August 2, 2014 18:05
keybase.md

Keybase proof

I hereby claim:

  • I am bmpvieira on github.
  • I am bmpvieira (https://keybase.io/bmpvieira) on keybase.
  • I have a public key whose fingerprint is E8A8 539B 1294 B725 51D4 FCAB ECE9 9D4A B8EB 006E

To claim this, I am signing this object:

@bmpvieira
bmpvieira / heroku-dat-test.md
Created August 9, 2014 13:55
Test Dat on Heroku
  • Go to https://github.com/bmpvieira/heroku-dat-template and click Deploy;
  • Choose a name (like test-dat);
  • Wait for deploy to finish and click "View it" (http://test-dat.herokuapp.com);
  • Click import -> paste JSON -> Copy/Paste example;
  • Do dat clone http://test-dat.herokuapp.com and cd into folder;
  • Do dat serve and go to localhost:6461;
  • PROBLEM 1: No data;
  • Kill, do echo '{"hello":"world"}'|dat import --json and serve again;
  • Now there's some data, kill and do dat push http://test-dat.herokuapp.com
  • PROBLEM 2: Nothing changed on Heroku
@bmpvieira
bmpvieira / index.js
Last active August 29, 2015 14:06
requirebin sketch
var ncbi = require('bionode-ncbi')
ncbi.search('assembly', 'Solenopsis invicta').on('data', function(data) {
document.write(JSON.stringify(data, null, 2))
})
@bmpvieira
bmpvieira / index.js
Created September 3, 2014 15:17
requirebin sketch
var ncbi = require('bionode-ncbi')
ncbi.search('assembly', 'Solenopsis invicta').on('data', function(data) {
document.write(JSON.stringify(data, null, 2))
})
@bmpvieira
bmpvieira / index.js
Created September 3, 2014 22:09
requirebin sketch
// bionode-seq
// docs: https://rawgit.com/bionode/bionode-seq/master/docs/bionode-seq.html
var seq = require('bionode-seq')
document.write([
' 1 ' + seq.checkType("ATGACCCTGAGAA")
, ' 2 ' + seq.checkType("ATGACCCTGAGAAGAGCACCG")
, ' 3 ' + seq.checkType("AUGACCCUGAAGGUGAAUGAA")
, ' 4 ' + seq.checkType("MAYKSGKRPTFFEVFKAHCSDS")
@bmpvieira
bmpvieira / index.js
Created September 6, 2014 18:39
requirebin sketch
var fasta = require('bionode-fasta')
var data = ">contig1\nAGTCGATCTACGTA\nATGATCATGCGTAC\n>contig2\nAGTACGTACTGCATG\ACTGCATCG\n"
var parser = fasta.obj() // Returns objects
parser.write(data)
parser.end()
parser.on('data', function(data) { console.log(data) })