]> git.donarmstrong.com Git - function2gene.git/blobdiff - bin/name_chooser.pl
add bin files for search routines
[function2gene.git] / bin / name_chooser.pl
diff --git a/bin/name_chooser.pl b/bin/name_chooser.pl
new file mode 100644 (file)
index 0000000..9651fb2
--- /dev/null
@@ -0,0 +1,16 @@
+#! /usr/bin/perl
+
+use warnings;
+use strict;
+
+while (<>) {
+     chomp;
+     my @names = split /;\s*/;
+     @names = sort {length $b <=> length $a } @names;
+     # pick the longest name
+     my $name = $names[0];
+     # strip out long parenthetical statements
+     $name =~ s/[\[\(][^\]\)]{10,}[\]\)]//g;
+     $name =~ s/(\s)\s+/$1/g;
+     print $name,qq(\n);
+}