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

Diff of /FigKernelPackages/model.pm

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

revision 1.12, Wed May 30 14:18:03 2007 UTC revision 1.13, Wed May 30 16:10:24 2007 UTC
# Line 311  Line 311 
311    
312      foreach my $path (@$assembly_paths)      foreach my $path (@$assembly_paths)
313      {      {
314          my $paths_dir = $fig->scenario_directory() . "/" . join "/" , @$path;          my $paths_dir = $fig->model_directory() . "/" . join "/" , @$path;
315    
316          my $drxn = "$path->[-3]/$path->[-2]/$path->[-1]_R";          my $drxn = "$path->[-3]/$path->[-2]/$path->[-1]_R";
317    
# Line 2634  Line 2634 
2634  sub clear_dir_for_genome  sub clear_dir_for_genome
2635  {  {
2636      my ($genome) = @_;      my ($genome) = @_;
2637      rmtree($fig->scenario_directory($genome));      rmtree($fig->model_directory($genome));
2638  }  }
2639    
2640  sub load_superset_file  sub load_superset_file
# Line 2691  Line 2691 
2691  sub run_scenario  sub run_scenario
2692  {  {
2693      my($genome,$superset,$subsystem,$scenario,$find_first) = @_;      my($genome,$superset,$subsystem,$scenario,$find_first) = @_;
2694      my $scenario_dir = $fig->scenario_directory($genome) . "/Scenarios/$superset/$subsystem/$scenario";      my $scenario_dir = $fig->model_directory($genome) . "/Scenarios/$superset/$subsystem/$scenario";
2695    
2696      system("rm", "-rf", $scenario_dir);      system("rm", "-rf", $scenario_dir);
2697    
# Line 2706  Line 2706 
2706  {  {
2707      my($genome,$superset,$ss_name,$scenario_name) = @_;      my($genome,$superset,$ss_name,$scenario_name) = @_;
2708      my @genome_paths;      my @genome_paths;
2709      my $scenario_dir_all = $fig->scenario_directory('All') . "/Scenarios/$superset/$ss_name/$scenario_name";      my $scenario_dir_all = $fig->model_directory('All') . "/Scenarios/$superset/$ss_name/$scenario_name";
2710      my $subsystem = $fig->get_subsystem($ss_name);      my $subsystem = $fig->get_subsystem($ss_name);
2711      my @additional_reactions = @{$subsystem->get_hope_additional_reactions($scenario_name)};      my @additional_reactions = @{$subsystem->get_hope_additional_reactions($scenario_name)};
2712      my %additional_reactions;      my %additional_reactions;
# Line 2764  Line 2764 
2764    
2765      # now check all paths found for this particular organism, and make sure they      # now check all paths found for this particular organism, and make sure they
2766      # are in the appropriate All subdirectory      # are in the appropriate All subdirectory
2767      my $scenario_dir_genome = $fig->scenario_directory($genome). "/Scenarios/$superset/$ss_name/$scenario_name";      my $scenario_dir_genome = $fig->model_directory($genome). "/Scenarios/$superset/$ss_name/$scenario_name";
2768    
2769      opendir (DIR_GENOME,$scenario_dir_genome) or die("$scenario_dir_genome");      opendir (DIR_GENOME,$scenario_dir_genome) or die("$scenario_dir_genome");
2770      @sub_dirs  = readdir DIR_GENOME; shift @sub_dirs; shift @sub_dirs; # get rid of . and ..      @sub_dirs  = readdir DIR_GENOME; shift @sub_dirs; shift @sub_dirs; # get rid of . and ..
# Line 2989  Line 2989 
2989    
2990      my @ss_scenarios = $subsystem_obj->get_hope_scenario_names;      my @ss_scenarios = $subsystem_obj->get_hope_scenario_names;
2991    
2992      my $dir = $fig->scenario_directory($genome) . "/Scenarios/$superset/$subsystem";      my $dir = $fig->model_directory($genome) . "/Scenarios/$superset/$subsystem";
2993      system("rm", "-rf",  $dir);      system("rm", "-rf",  $dir);
2994      &FIG::verify_dir($dir);      &FIG::verify_dir($dir);
2995    
# Line 3057  Line 3057 
3057      my @subsystems = @{$superset_to_ss{$superset_name}};      my @subsystems = @{$superset_to_ss{$superset_name}};
3058    
3059    
3060      my $dir = $fig->scenario_directory($genome) . "/Scenarios/$superset_name";      my $dir = $fig->model_directory($genome) . "/Scenarios/$superset_name";
3061      system("rm", "-rf", $dir);      system("rm", "-rf", $dir);
3062      &FIG::verify_dir($dir);      &FIG::verify_dir($dir);
3063    
# Line 3200  Line 3200 
3200          else #This is a assembly path          else #This is a assembly path
3201          {          {
3202              #read in the input/output compounds and mark main's correctly              #read in the input/output compounds and mark main's correctly
3203              my $path = $fig->scenario_directory() . "/" . join "/" , @$scenario;              my $path = $fig->model_directory() . "/" . join "/" , @$scenario;
3204    
3205              open(M_IN,"$path/inputs_main");              open(M_IN,"$path/inputs_main");
3206              while(<M_IN>)              while(<M_IN>)
# Line 3239  Line 3239 
3239      print STDERR $paths , "\n" , @$paths, "\n";      print STDERR $paths , "\n" , @$paths, "\n";
3240      print STDERR $genome . "\n";      print STDERR $genome . "\n";
3241      print STDERR $write_name . "\n";      print STDERR $write_name . "\n";
3242      my $dir = $fig->scenario_directory($genome) . "/Assemblies/$write_name";      my $dir = $fig->model_directory($genome) . "/Assemblies/$write_name";
3243      system("rm", "-rf", $dir);      system("rm", "-rf", $dir);
3244      &FIG::verify_dir($dir);      &FIG::verify_dir($dir);
3245      write_scenario(internal_assembly($paths,[],[],$one_path),$dir);      write_scenario(internal_assembly($paths,[],[],$one_path),$dir);
# Line 3287  Line 3287 
3287      if($count !=0)      if($count !=0)
3288      {      {
3289  #read this path, and pull out all the sub-directories.  #read this path, and pull out all the sub-directories.
3290          my $model_dir = $fig->scenario_directory() . "/$path/";          my $model_dir = $fig->model_directory() . "/$path/";
3291    
3292          print STDERR "reading directory $model_dir\n" if $debug;          print STDERR "reading directory $model_dir\n" if $debug;
3293          opendir (DIR, $model_dir) or die("$path");          opendir (DIR, $model_dir) or die("$path");
# Line 3354  Line 3354 
3354    
3355      #setup the filesystem to store the scenario/paths      #setup the filesystem to store the scenario/paths
3356      my $superset = $ss_to_superset{$ssa};      my $superset = $ss_to_superset{$ssa};
3357      my $base_dir = $fig->scenario_directory($genome) . "/Scenarios/$superset/$ssa/$sc_name/";      my $base_dir = $fig->model_directory($genome) . "/Scenarios/$superset/$ssa/$sc_name/";
3358      system("rm", "-rf", $base_dir);      system("rm", "-rf", $base_dir);
3359      &FIG::verify_dir($base_dir);      &FIG::verify_dir($base_dir);
3360    
# Line 3428  Line 3428 
3428      chomp $genome;      chomp $genome;
3429      chomp $name;      chomp $name;
3430      #setup the filesystem to store the assembly      #setup the filesystem to store the assembly
3431      my $base_dir = $fig->scenario_directory($genome). "/Assemblies/$name";      my $base_dir = $fig->model_directory($genome). "/Assemblies/$name";
3432      system("rm", "-rf", $base_dir);      system("rm", "-rf", $base_dir);
3433      &FIG::verify_dir($base_dir);      &FIG::verify_dir($base_dir);
3434    
# Line 3633  Line 3633 
3633  sub analyze_scenario_connections  sub analyze_scenario_connections
3634  {  {
3635      my ($genome_id) = @_;      my ($genome_id) = @_;
3636      my $scenario_dir = $fig->scenario_directory($genome_id)."/Scenarios";      my $scenario_dir = $fig->model_directory($genome_id)."/Scenarios";
3637      my @paths = `find -L $scenario_dir -type d -name "path_*"`;  
3638        #
3639        # Mac and Linux don't have the same find options for following symlinks.
3640        #
3641        my $uname = `uname`;
3642        my @paths;
3643        if ($uname =~ /^Darwin/)
3644        {
3645            @paths = `find -L $scenario_dir -type d -name "path_*"`;
3646        }
3647        else
3648        {
3649            @paths = `find $scenario_dir -follow -type d -name "path_*"`;
3650        }
3651    
3652      my %inputs;      my %inputs;
3653      my %outputs;      my %outputs;
# Line 3679  Line 3692 
3692          close M_OUTPUTS;          close M_OUTPUTS;
3693      }      }
3694    
3695      my $analysis_dir = $fig->scenario_directory($genome_id) . "/Analysis";      my $analysis_dir = $fig->model_directory($genome_id) . "/Analysis";
3696      rmtree $analysis_dir;      rmtree $analysis_dir;
3697      mkdir $analysis_dir;      mkdir $analysis_dir;
3698    

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3