New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

blastinutils-ts

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blastinutils-ts

Super simple helper library to BLAST software from NCBI

latest
Source
npmnpm
Version
0.2.1-0
Version published
Maintainers
1
Created
Source

blastinutils-ts

npm License: CC0-1.0 pipeline status coverage report

Super simple helper library to BLAST software from NCBI

Install

npm install blastinutils-ts

Support

blastp makeblastdb

Usage

CommandToolKit

This is super simple, just build the parameters following the interfaces and ask to build the command.

import { CommandToolKit, interfaces } from 'blastinutils-ts'

const params: IBlastPParameters = {
  db: 'mydb',
  evalue: 1,
  num_threads: 4,
  out: 'myoutputFile.dat',
  outfmt: {
    format: 6,
    parameters: [
      'qseqid',
      'sseqid',
      'bitscore',
      'pident',
      'evalue',
      'length',
    ]
  },
  query: 'myquery'
}

const program: interfaces.supportedProgramsType = 'blastp'
const command = commandTk.build(program, params)
console.log(command)
// blastp -db mydb -evalue 1 -num_threads 4 -out myoutputFile.dat -outfmt "6 qseqid sseqid bitscore pident evalue length" -query myquery

NodesAndLinksStream

This is an experimental parser of BLAST results in output format 6. Because these tend to be long, we implemented as a write stream. After reading the stream, the class has a method: getData() which returns an object { nodes: [ ... ], links: [ ... ] } with the data.

import { NodesAndLinksStream } from 'blastinutils-ts'

const params = {
  format: 6,
  parameters: [
    'qseqid',
    'sseqid',
    'bitscore',
    'pident',
    'evalue',
    'length',
  ]
}

const nodesNlinks = new NodesAndLinksStream.ParseBlastResults(params)
  const blastResultsStream = fs.createReadStream('tabularBlastResults.fmt6.tab')
  blastResultsStream
    .pipe(nodesNlinks)
    .on('finish',() => {
      const data = nodesNlinks.getData()
      /* data.nodes = [
        'seq1',
        'seq2',
        ...
      ]
      // data.links = [
        {
          s: 0, // index of source in data.nodes
          t: 1, // index of target in data.nodes
          e: 20
        },
        {
          s: 0,
          t: 2,
          e: 10
        }
      ]

      */
    })

Documentation

Developer's documentation

...to be continued.

Written with ❤ in Typescript.

Keywords

bioinformatics

FAQs

Package last updated on 01 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts