link to this entry Tue, 26 Feb 2008 How to split a fasta file the ruby way This is the ruby way to split a fasta file. Pure poetry. #!/usr/bin/env ruby sample = "indian_macaque_" File.open(ARGV[0], "r").read.scan(/^>Chr[0-9A-Za-z]+\n[ACTG\n]+/) { |chrm| File.open(sample + />(Chr[0-9A-Za-z]+)/.match(chrm).to_a[1], "w").puts(chrm) } posted at: 23:39 | path: /bioinformatics | permanent