Skip to content

Instantly share code, notes, and snippets.

@campeterson
Created November 6, 2012 04:33
Show Gist options
  • Select an option

  • Save campeterson/4022562 to your computer and use it in GitHub Desktop.

Select an option

Save campeterson/4022562 to your computer and use it in GitHub Desktop.

Revisions

  1. campeterson created this gist Nov 6, 2012.
    10 changes: 10 additions & 0 deletions nucleotides.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/usr/bin/env ruby

    contents = File.read('1.dataset')

    A = contents.gsub(/[CcGgTt]/,'')
    C = contents.gsub(/[AaGgTt]/,'')
    G = contents.gsub(/[AaCcTt]/,'')
    T = contents.gsub(/[AaCcGg]/,'')

    puts "#{A.length} #{C.length} #{G.length} #{T.length}"