[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.616, Tue Sep 11 23:17:15 2007 UTC revision 1.617, Mon Sep 17 17:32:13 2007 UTC
# Line 762  Line 762 
762          warn "Failure copying $genomeF to $FIG_Config::organisms\n";          warn "Failure copying $genomeF to $FIG_Config::organisms\n";
763          return $rc;          return $rc;
764      }      }
765      $sysrc = system("chmod -R 777 $FIG_Config::organisms/$genome");  
766        my $genome_dir = "$FIG_Config::organisms/$genome";
767    
768        $sysrc = system("chmod -R 777 $genome_dir");
769      if ($sysrc != 0)      if ($sysrc != 0)
770      {      {
771          warn "Command failed: chmod -R 777 $FIG_Config::organisms/$genome\n";          warn "Command failed: chmod -R 777 $genome_dir\n";
772          return $rc;          return $rc;
773      }      }
774    
775      if (-s "$FIG_Config::organisms/$genome/COMPLETE")      if (-s "$genome_dir/COMPLETE")
776      {      {
777          if ($dont_mark_complete)          if ($dont_mark_complete)
778          {          {
779              print STDERR "$genome was marked as \"complete\", but moving to WAS_MARKED_COMPLETE\n";              print STDERR "$genome was marked as \"complete\", but moving to WAS_MARKED_COMPLETE\n";
780              rename("$FIG_Config::organisms/$genome/COMPLETE", "$FIG_Config::organisms/$genome/WAS_MARKED_COMPLETE");              rename("$genome_dir/COMPLETE", "$genome_dir/WAS_MARKED_COMPLETE");
781          }          }
782          else          else
783          {          {
# Line 787  Line 790 
790          # Not marked complete; assess completeness.          # Not marked complete; assess completeness.
791          #          #
792    
793          my $sysrc = system("assess_completeness $FIG_Config::organisms/$genome");          my $sysrc = system("$FIG_Config::bin/assess_completeness $genome_dir > $genome_dir/assess_completeness.out 2>&1");
794          if ($sysrc != 0)          if ($sysrc != 0)
795          {          {
796              warn "assess_completeness $FIG_Config::organisms/$genome failed; continuing with installation.\n";              warn "assess_completeness $genome_dir failed; continuing with installation.\n";
797          }          }
798          else          else
799          {          {
800              if (-s "$FIG_Config::organisms/$genome/PROBABLY_COMPLETE")              if (-s "$genome_dir/PROBABLY_COMPLETE")
801              {              {
802                  print STDERR "Assessed $genome to be probably complete\n";                  print STDERR "Assessed $genome to be probably complete\n";
803                  if ($dont_mark_complete)                  if ($dont_mark_complete)
# Line 803  Line 806 
806                  }                  }
807                  else                  else
808                  {                  {
809                      my $cp = "cp -p $FIG_Config::organisms/$genome/PROBABLY_COMPLETE " .                      my $cp = "cp -p $genome_dir/PROBABLY_COMPLETE $genome_dir/COMPLETE";
                                 "$FIG_Config::organisms/$genome/COMPLETE";  
810                      $sysrc = system($cp);                      $sysrc = system($cp);
811                      $sysrc == 0 or warn "Command failed, continuing: $cp\n";                      $sysrc == 0 or warn "Command failed, continuing: $cp\n";
812                  }                  }
# Line 816  Line 818 
818          }          }
819      }      }
820    
821        #
822        # If this was a RAST genome that has imp_annotations and imp_assigned_functions files,
823        # rename any existing annotations/assigned_functions files to rast_XX and copy
824        # imp_XX to XX.
825        #
826    
827        if (-f "$genome_dir/RAST")
828        {
829            for my $base ('annotations', 'assigned_functions')
830            {
831                my $imp = "$genome_dir/imp_$base";
832                my $file = "$genome_dir/$base";
833                my $rast = "$genome_dir/rast_$base";
834    
835                if (-f $base)
836                {
837                    print "Rename $base to $rast\n";
838                    rename($base, $rast);
839                }
840                if (-f $imp)
841                {
842                    print "Copy $imp to $base\n";
843                    copy($imp, $base);
844                }
845            }
846        }
847    
848      $sysrc = system("index_contigs $genome");      $sysrc = system("index_contigs $genome");
849      $sysrc == 0 or      $sysrc == 0 or
850          warn "index_contigs $genome failed; continuing with installation\n";          warn "index_contigs $genome failed; continuing with installation\n";
# Line 829  Line 858 
858          warn "load_features $genome failed; continuing with installation\n";          warn "load_features $genome failed; continuing with installation\n";
859    
860      $rc = 1;      $rc = 1;
861      if (-s "$FIG_Config::organisms/$genome/Features/peg/fasta")      if (-s "$genome_dir/Features/peg/fasta")
862      {      {
863    
864          $sysrc = system("index_translations $genome");          $sysrc = system("index_translations $genome");
# Line 848  Line 877 
877              # RDO 2007-09-06              # RDO 2007-09-06
878              #              #
879    
880              my @tmp = `cut -f1 $FIG_Config::organisms/$genome/Features/peg/tbl`;              my @tmp = `cut -f1 $genome_dir/Features/peg/tbl`;
881              if (@tmp == 0)              if (@tmp == 0)
882              {              {
883                  warn "Did not find any features in $FIG_Config::organisms/$genome/Features/peg/tbl\n";                  warn "Did not find any features in $genome_dir/Features/peg/tbl\n";
884              }              }
885              chomp @tmp;              chomp @tmp;
886              if (!$skipnr)              if (!$skipnr)
887              {              {
888                  $sysrc = system("cat $FIG_Config::organisms/$genome/Features/peg/fasta >> $FIG_Config::data/Global/nr");                  $sysrc = system("cat $genome_dir/Features/peg/fasta >> $FIG_Config::data/Global/nr");
889                  $sysrc == 0 or warn "error concatenating features ot NR; continuing with installation\n";                  $sysrc == 0 or warn "error concatenating features ot NR; continuing with installation\n";
890    
891                  # &run("formatdb -i $FIG_Config::data/Global/nr -p T");                  # &run("formatdb -i $FIG_Config::data/Global/nr -p T");
# Line 865  Line 894 
894          }          }
895      }      }
896    
897      if ((-s "$FIG_Config::organisms/$genome/assigned_functions") ||      if ((-s "$genome_dir/assigned_functions") ||
898          (-d "$FIG_Config::organisms/$genome/UserModels"))          (-d "$genome_dir/UserModels"))
899      {      {
900          $sysrc = system("add_assertions_of_function $genome");          $sysrc = system("add_assertions_of_function $genome");
901          $sysrc == 0 or warn "add_assertions_of_function $genome failed; continuing with installation\n";          $sysrc == 0 or warn "add_assertions_of_function $genome failed; continuing with installation\n";
# Line 878  Line 907 
907      # PCHs are installed with install_new_coupling_data.      # PCHs are installed with install_new_coupling_data.
908      #      #
909    
910      my $pchs = "$FIG_Config::organisms/$genome/pchs";      my $pchs = "$genome_dir/pchs";
911      my $pch_scores = "$FIG_Config::organisms/$genome/pchs.scored";      my $pch_scores = "$genome_dir/pchs.scored";
912    
913      if (-f $pchs and  -f $pch_scores)      if (-f $pchs and  -f $pch_scores)
914      {      {

Legend:
Removed from v.1.616  
changed lines
  Added in v.1.617

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3