diff mafft/core/makemergetable.rb @ 18:e4d75f9efb90 draft

planemo upload commit b'4303231da9e48b2719b4429a29b72421d24310f4\n'-dirty
author nick
date Thu, 02 Feb 2017 18:44:31 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mafft/core/makemergetable.rb	Thu Feb 02 18:44:31 2017 -0500
@@ -0,0 +1,32 @@
+#!/bin/env ruby
+require 'getopts'
+
+seedoffset = 0
+
+if getopts( "s:" ) == nil ||  ARGV.length == 0 || $OPT_h then
+	puts "Usage: #{$0} [-s number_of_seeds] input_files"
+	exit
+end
+
+if $OPT_s
+    seedoffset = $OPT_s.to_i
+end
+
+
+files = ARGV
+
+
+num = seedoffset + 1
+for file in files
+	output = ""
+	STDERR.puts file
+	fp = File.open( file, "r" )
+	while line = fp.gets
+		if line =~ /^>/ then
+			output += " " + num.to_s
+			num += 1
+		end
+	end
+	fp.close
+	puts output + "  # " + file
+end