Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/ruby
- fasta = ARGF.gets.split.drop(1).map do |in_file|
- open(in_file).slice_before(/\A>/).map do |lines|
- [lines.first.match(/\A>(\S+)/)[1], lines]
- end
- end.flatten(1).to_h
- ARGF.each do |line|
- out_file, *ids = line.split
- open(out_file, 'w') do |f|
- ids.each do |id|
- f.puts fasta[id].join
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement