Created
April 15, 2018 22:24
-
-
Save nikhilmetrani/dc64338e88784cdb1d714e82c409072b to your computer and use it in GitHub Desktop.
Pairing DNA Nucleotides
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://fig.cox.miami.edu/~cmallery/150/gene/chargaff.htm | |
const pairDNA = (() => { | |
const basePairs = { A: 'T', T: 'A', C: 'G', G: 'C' }; | |
return dnaStr => dnaStr.split('').reduce((acc, nuc) => [...acc, [nuc, basePairs[nuc]]], []); | |
})(); | |
pairDNA("GCG"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment