# blastjs

> a blast+ wrapper

Latest version **1.6.7** (published 2018-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install blastjs
pnpm add blastjs
yarn add blastjs
bun add blastjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.7 |
| Published | 2018-06-20 |
| First published | 2015-09-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 58.9 KB |
| Known vulnerabilities | 0 (+15 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Martin Page |
| Maintainers | wookoouk |
| Keywords | blast, blast+ |

## Links

- npm: https://www.npmjs.com/package/blastjs
- Repository: https://github.com/wookoouk/blastjs
- Issues: https://github.com/wookoouk/blastjs/issues
- npm.io page: https://npm.io/package/blastjs

## Dependencies (6)

- [ftp](https://npm.io/package/ftp.md) ^0.3.10
- [tar](https://npm.io/package/tar.md) ^4.4.2
- [uuid](https://npm.io/package/uuid.md) ^2.0.3
- [lodash](https://npm.io/package/lodash.md) ^4.16.6
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.12
- [download](https://npm.io/package/download.md) ^4.2.0

## Recent versions

- 1.6.7 (latest) — 2018-06-20
- 1.5.3 — 2016-01-27
- 1.5.2 — 2016-01-27
- 1.5.1 — 2015-11-30
- 1.5.0 — 2015-09-08
- 1.3.0 — 2015-09-07
- 1.2.0 — 2015-09-07
- 1.1.0 — 2015-09-07
- 1.0.0 — 2015-09-07
- 0.5.2 — 2015-09-07
- 0.5.1 — 2015-09-04
- 0.5.0 — 2015-09-04
- 0.4.0 — 2015-09-04

## README

# blast.js
[![Build Status](https://travis-ci.org/TeamMacLean/blastjs.svg?branch=master)](https://travis-ci.org/TeamMacLean/blastjs)
>a BLAST+ wrapper for Node.js

a demo can be found at [github.com/teammaclean/blastjs-demo](https://github.com/teammaclean/blastjs-demo)

## Install

If you do not have Node.js installed you can get it at [https://nodejs.org](https://nodejs.org)

```bash
npm install blastjs
```

If Blast+ is not installed you can run:    
```bash
node util/getBlast.js
```
and the latest version of Blast+ will be downloaded and placed in the bin folder for you.

## Usage
### make database

```javascript
var blast = require('blastjs');

var type = 'nucl';
var fileIn = './test.fasta';
var outPath = './';
var name = 'example';


blast.makeDB(type, fileIn, outPath, name, function(err){
  if(err){
    console.error(err);   
  } else {
    console.log('database created at', outPath);
  }
});
```

### blast n
```javascript
var blast = require('blastjs');

blast.outputString(true); //optional, provides string output instead of JSON

var dbPath = './example';
var query = '>24.6jsd2.Tut\nGGTGTTGATCATGGCTCAGGACAAACGCTGGCGGCGTGCTTAATACATGCAAGTCGAACGGGCTACCTTCGGGTAGCTAGTG'
+'\n>24.6jsd3.Tut\nATGATCATGGCTCAGATTGAACGCTGGCGGCATGCCTTACACATGCAAGTCGAACGGCAGCACGGGGAAGGGGCAACTCTTT';

blast.blastN(dbPath, query, function (err, output) {
  if(!err){
    console.log(output);
  }
});

```

## API
* .makeDB(type, fileIn, outPath, name, cb)    
  callback is passed (err, stdOut, stdErr, fileOut).
  
* .blastN(db, query, cb)    
  callback is passed (err, output).
  
* .blastP(db, query, cb)    
  callback is passed (err, output).
  
* .blastX(db, query, cb)    
  callback is passed (err, output).
  
* .tblastN(db, query, cb)    
  callback is passed (err, output).
  
* .tblastX(db, query, cb)    
  callback is passed (err, output).
  
* .outputString(boolean)    
  this toggles the output being in a string (true) or as JSON (false).    
  default is JSON.

---
_Source: https://npm.io/package/blastjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
