Created
July 21, 2010 02:14
-
-
Save audy/483932 to your computer and use it in GitHub Desktop.
This file contains 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
# Playing code-golf | |
# Averages sequences in a FASTA file (wrapped or unwrapped) | |
a,b=0,[];File.new(ARGV.shift).each do |i|;if i[0]!=62;a+=i.length;else;b.push a;a=0;end;end;puts b.inject{|s,v|s+=v}/b.length |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment