JWS-112 Bumping version of Mafft to version 7.310.
[jabaws.git] / binaries / src / mafft / core / makemergetable.rb
diff --git a/binaries/src/mafft/core/makemergetable.rb b/binaries/src/mafft/core/makemergetable.rb
new file mode 100644 (file)
index 0000000..f2cec73
--- /dev/null
@@ -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