0.7.1 • Published 3 years ago

ts-dna v0.7.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

ts-dna

A simple typescript utility library for working with nucleic acids, amino acids, and polypeptides. Going from DNA -> RNA -> Polypeptides has never been easier!

Description

ts-dna aims to model and offer utilities for the biological relationship between nucleic acids, amino acids, and polypeptides. All classes are immutable, and validation is enforced on construction. Therefor, all instances of the classes will always be valid once constructed. ts-dna is a zero dependency library.

Installing

npm:

npm install ts-dna

yarn:

yarn add ts-dna

Library Documentation

Check out the full library documentation here.

Examples

Below are some very brief (and contrived) examples of how some of this library's classes and its utilities might be used.

//Create complex IUPAC nucleotide symbol pattern regular expressions
const nucleotidePattern = new NucleotidePattern('^N*Y?A+(WY){3}$');
const dnaMatch = new DNA('ATCGATCGATCGATCGCAAAACTCTC');
nucleotidePattern.matches(dnaMatch); // --> true
nucleotidePattern.patternRegex; // --> '^[AaGgCcTt]*[CcTt]?[Aa]+([AaTt][CcTt]){3}$'

//Go from DNA -> RNA -> Polypeptide
const dna = new DNA('ATGTGCGACGAATTC');
const rna = convertToRNA(dna);
const polypeptide = new Polypeptide(rna);


//Get and compare amino acids
const met1 = getAminoAcidByCodon(new RNA('AUG'));
const met2 = new AminoAcid(new RNA('AUG'));
met1?.equals(met2); // --> true

License

This project is licensed under the MIT License - see the LICENSE.md file for details

0.7.1

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.5.3

3 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.3

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.6

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago