0.1.0-alpha.3 • Published 5 years ago

bioutils v0.1.0-alpha.3

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

bioUtils

Work with Bioinformatics Files in JavaScript

Goals:

  • support sequence alignments and phylogenetic trees in fasta, fna, nexus and newick formats
  • simple, fast and light
  • fully tested, comprehensively documented
  • work in Node and in the browser
  • standardize input, output and formatting so that you can focus on analyzing the data

Docs: https://rdvelazquez.github.io/bioUtils/

Install

npm install bioutils

or

yarn add bioutils

Use

const bioUtils = require("bioutils");

// Read data from a file into a json object.
const exampleBioData = bioUtils.readFileSync("./exampleData.fasta");

// Get info about the data.
/*TODO: not sure if this will be implemented
// Some info is available in the "metaData".
const numberOfSequences = exampleBioData['metaData']['numberOfSequences'];
*/
// Other info can be obtained with functions.
const containsStopCodons = bioUtils.containsStopCodons(exampleBioData);

// Perform simple manipulations on the data.
const exampleBioDataWithoutStopCodons = bioUtils.replaceStopCodons(exampleBioData, "-");
const exampleBioDataAminoAcids = bioUtils.translateToAminoAcid(exampleBioData);

// Write the data to any file format you want.
bioUtils.writeFileSync(exampleBioDataWithoutStops, 'nexus', 'exampleOutputFile.nexus')
biUtils.writeFileSync(exampleBioDataAminoAcis, 'fasta', 'exampleOutputFileAA.fasta')

Previous/Similar Work

Test yarn test
Lint yarn lint
Build Docs yarn document
Publish to NPM... just npm publish