Skip to content

Commit

Permalink
Merge pull request #3 from bionode/travis_yml
Browse files Browse the repository at this point in the history
Added a .travis.yml file.
  • Loading branch information
bmpvieira authored Oct 4, 2017
2 parents e61cbd3 + 1244fff commit 598917d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
node_js:
- "7"
7 changes: 3 additions & 4 deletions addTaxonToBlast/addTaxonToBlast.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ var taxonToAdd = process.argv[3]
// NCBI query function
var queryStream = through.obj(query)

function query(line, encoding, next) {
uid = line.split('\t')[16]
function query (line, encoding, next) {
var uid = line.split('\t')[16]
ncbi.fetch('taxonomy', uid + '[uid]', (taxonomy) => {
try {
var taxons = taxonomy[0].TaxaSet.Taxon[0].LineageEx[0].Taxon
var taxClass = taxons.filter(t => t.Rank[0] === taxonToAdd)[0].ScientificName[0]
}
catch (error) {
} catch (error) {
var taxClass = 'NA'
}
this.push(line + '\t' + taxClass.toString() + '\n')
Expand Down
2 changes: 1 addition & 1 deletion addTaxonToBlast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Add taxonomic information to a tab separated BLAST output file",
"main": "addTaxonToBlast.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "standard && dependency-check . && mocha"
},
"author": "Bruno Vieira",
"license": "MIT",
Expand Down

0 comments on commit 598917d

Please sign in to comment.