Skip to content

Instantly share code, notes, and snippets.

@gr33n7007h
Created May 30, 2016 10:13
Show Gist options
  • Save gr33n7007h/3cd24aeb025741dc23524e222604b70b to your computer and use it in GitHub Desktop.
Save gr33n7007h/3cd24aeb025741dc23524e222604b70b to your computer and use it in GitHub Desktop.
Counting DNA Nucleotides
File.read('rosalind_dna.txt').chomp.chars.each_with_object(%w{A C G T}.zip([0].cycle).to_h) { |c, h| h[c] += 1 }.values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment