Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

central-dogma

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

central-dogma - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

dist/index.js

14

package.json
{
"name": "central-dogma",
"version": "0.0.4",
"version": "0.0.5",
"description": "used to manipulate and convert genetic strings from nucleotide to codon to protein",
"main": "index.js",
"main": "dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "webpack --mode production"
},

@@ -26,3 +26,9 @@ "repository": {

},
"homepage": "https://github.com/NathanEscandor/codon#readme"
"homepage": "https://github.com/NathanEscandor/codon#readme",
"devDependencies": {
"@babel/core": "^7.7.2",
"babel-loader": "^8.0.6",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
}
}

@@ -23,3 +23,3 @@ # central-dogma

const dnaSequence = 'CCTATTAATAAA';
const dnaCodons = nuc.toCodon(dnaSequence); // toCodon = ['CCT', 'ATT', 'AAT', 'AAA']
const dnaCodons = nuc.toCodon(dnaSequence); // dnaCodons = ['CCT', 'ATT', 'AAT', 'AAA']
const aminoAcids = cod.sequenceToAminoAcid(dnaCodons);

@@ -39,8 +39,8 @@ console.log(aminoAcids) // --> ['P', 'I', 'N', 'K']

const dnaSequence = 'GTGCTTGAGGACCGA';
const complement = nuc.toComplement(dnaSequence); //complement = 'GTGCTTGAGGACCGA'
const rnaComplement = nuc.dnaToRna(complement); //rnaComplement = 'GUGCUUGAGGACCGA'
const rnaCodons = nuc.toCodon(rnaComplement); //rnaCodons = ['GUG', 'CUU', 'GAG', 'GAC', 'CGA']
const complement = nuc.toComplement(dnaSequence); // complement = 'GTGCTTGAGGACCGA'
const rnaComplement = nuc.dnaToRna(complement); // rnaComplement = 'GUGCUUGAGGACCGA'
const rnaCodons = nuc.toCodon(rnaComplement); // rnaCodons = ['GUG', 'CUU', 'GAG', 'GAC', 'CGA']
cod.setBase('rna') //change the lookup table from DNA to RNA
const rnaCodonNumbers = cod.toNumber(rnaCodons); //rnaCodonNumbers = [ 25, 58, 17, 19, 52 ]
cod.setBase('rna') // change the lookup table from DNA to RNA
const rnaCodonNumbers = cod.toNumber(rnaCodons); // rnaCodonNumbers = [ 25, 58, 17, 19, 52 ]
const aminoAcids = cod.numberToAminoAcid(rnaCodonNumbers);

@@ -50,3 +50,54 @@ console.log(aminoAcids) // --> ['H', 'E', 'L', 'L', 'A']

### Future Directions
# Functions
### Nucleotide
`nuc.setBase(baseType)`
- input: 'dna' or 'rna'
- changes lookup table to DNA or RNA (swap thymine for uracil)
`nuc.toValue(nucSeq)`
- input: nucleotide string sequence (eg "TCCTTG")
- Converts sequence of nucleotides to number representation
`nuc.toSequence(nucSeq)`
- input: number representation string sequence (eg "011003")
- Converts sequence of numbers [0-3] to nucleotides
`nuc.toComplement(nucSeq)`
- input: nucleotide string sequence
- Returns the complement sequence of the input string (T <-> C, A <-> G)
`nuc.toCodon(nucSeq)`
- input: nucleotide string sequence
- Splits into an array of triplet codons
`nuc.dnaToRna(nucSeq)`
- input: nucleotide string sequence
- Replaces Thymine (T) with Uracil (U)
`nuc.rnaToDna(nucSeq)`
- input: nucleotide string sequence
- Replaces Uracil (U) with Thymine (T)
### Codon
`cod.setBase(baseType)`
- input: 'dna' or 'rna'
- changes lookup table to DNA or RNA (swap thymine for uracil)
`cod.toNumber(codArray)`
- input: array of nucleotide string codons (eg ['TCC', 'ATT'])
- Converts each codon in the array to number representation [0-63]
`cod.toSequence(codArray)`
- input: array of codon numbers (eg [5, 32])
- Converts each number to its nucleotide codon
`cod.numberToAminoAcid(codArray)`
- input: array of codon numbers (eg [5, 32])
- Returns array of amino acids that the codons encode for
`cod.sequenceToAminoAcid(codArray)`
- input: array of nucleotide string codons
- Returns array of amino acids that the codons encode for
# Future Directions
In future versions, I intend to implement:

@@ -57,3 +108,2 @@ - a conversion from single character amino acid representation to 3 character and full amino acid name (eg: 'Y' --> 'TYR' --> 'Tyrosine')

[Central Dogma of Biology]: <https://en.wikipedia.org/wiki/Central_dogma_of_molecular_biology>
[Central Dogma of Biology]: <https://en.wikipedia.org/wiki/Central_dogma_of_molecular_biology>
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc