Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Added script to take hal tree output and replace 2 char species names with full names
authorelserj <elserj@localhost>
Thu, 14 Oct 2010 21:06:53 +0000 (21:06 +0000)
committerelserj <elserj@localhost>
Thu, 14 Oct 2010 21:06:53 +0000 (21:06 +0000)
svn path=/; revision=67

interactome_scripts/species_tree_names_fix.pl [new file with mode: 0755]

diff --git a/interactome_scripts/species_tree_names_fix.pl b/interactome_scripts/species_tree_names_fix.pl
new file mode 100755 (executable)
index 0000000..19d5689
--- /dev/null
@@ -0,0 +1,52 @@
+#!/usr/bin/perl
+
+#######################################################
+# Written by Justin Elser 9/30/10                     #
+#  takes the genome_map.tab and tree files from hal   #
+#   and writes a new tree file with 2 char id         #
+#   replaced by full genus + species                  #
+#                                                    #
+#######################################################
+
+use strict;
+use warnings;
+
+if($#ARGV != 2) {
+       print "usage: species_tree_names_fix.pl genome_map.tab tree_file output_tree_file\n";
+       exit;
+}
+
+my $tab_file = $ARGV[0];
+my $tree_file = $ARGV[1];
+my $out_file = $ARGV[2];
+
+open(table_file,"$tab_file");
+
+
+my %species_hash;
+while (<table_file>){
+       my $line = $_;
+       chomp $line;
+       my ($spec_id,$spec_name) = split("\t",$line);
+       $spec_name =~ s/\.fasta//g;
+       if(!defined($species_hash{$spec_id})) {
+               $species_hash{$spec_id} = $spec_name;
+       }else{
+               print "duplicate entries in hash!!!\n";
+               exit;
+       }
+}
+
+close(table_file);
+
+open(tree_file,"$tree_file");
+open(output_file, ">$out_file");
+
+while(<tree_file>) {
+       my $line = $_;
+       chomp $line;
+       foreach my $id (keys %species_hash) {
+               $line =~ s/$id\:/$species_hash{$id}\:/g;
+       }
+       print output_file "$line\n";
+}