-
-
Save nakao/8051285 to your computer and use it in GitHub Desktop.
a bioruby code for http://twitter.com/motthy/status/413701761468084224
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
# Split a multi fasta file into single fasta files (1.fasta, 2.fasta, ...) | |
# > ruby a.rb multi.fasta | |
require 'rubygems' | |
gem 'bio' | |
Bio::FlatFile.auto($<).each_with_index do |entry, i| | |
File.open("#{i+1}.fasta", "w") do |f| | |
f.puts entry.to_s | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment