A Javascript/NodeJS package for shredding strings into all possible substrings of length 'k'
Kmer.js is a NodeJS package designed for data/science applications. It addresses the 'k-mer' problem(substrings of length from a string) in a simple and performant manner. This library produces all of the n - k + 1
substrings of length k
from a string of length n
.
OS X & Linux:
npm install --save kmer.js
>var kmers = require('kmer.js');
>var fourmers = kmers("hello world!", 4)
[ 'hell',
'ello',
'llo ',
'lo w',
'o wo',
' wor',
'worl',
'orld',
'rld!' ]
npm test # MochaJS specs
npm run-script bench # benchmark.js performance tests, varying n and k
Created by Matthew Ralston - Scientist, Programmer, Musician - Email
Distributed under the GPL v3.0 license. See LICENSE.txt
for the copy distributed with this project. Open source software is not for everyone, but for those of us starting out and trying to put the ecosystem ahead of ego, we march into the information age with this ethos.
https://github.com/MatthewRalston/kmer.js
- Fork it (https://github.com/MatthewRalston/kmer.js/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request