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

Diff of /FigKernelPackages/proml.pm

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

revision 1.5, Mon Jan 29 18:14:50 2007 UTC revision 1.7, Wed Jan 31 22:38:39 2007 UTC
# Line 332  Line 332 
332      unlink 'outfile' if -f 'outfile';  # Just checking      unlink 'outfile' if -f 'outfile';  # Just checking
333      unlink 'outtree' if -f 'outtree';  # ditto      unlink 'outtree' if -f 'outtree';  # ditto
334    
335      &write_infile( @align ) or print STDERR "proml::proml: Could write infile\n"      &write_infile( @align ) or print STDERR "proml::proml: Could not write infile\n"
336                                 and chdir $cwd                                 and chdir $cwd
337                                 and return ();                                 and return ();
338    
# Line 341  Line 341 
341                                  and return ();                                  and return ();
342    
343    
344      #  Start writing optoins for program:      #  Start writing options for program:
345    
346      if ( $categories )      if ( $categories )
347      {      {
# Line 368  Line 368 
368      print PROML "P\n"    if $model =~ m/PMB/i;      print PROML "P\n"    if $model =~ m/PMB/i;
369      print PROML "P\nP\n" if $model =~ m/PAM/i;      print PROML "P\nP\n" if $model =~ m/PAM/i;
370    
     print PROML "S\n" if $slow;  
   
371      if ( @user_trees )      if ( @user_trees )
372      {      {
373          &write_intree( @user_trees ) or print STDERR "proml::proml: Could write intree\n"          &write_intree( @user_trees ) or print STDERR "proml::proml: Could not write intree\n"
374                                          and chdir $cwd                                          and chdir $cwd
375                                          and return ();                                          and return ();
376          print PROML "U\n";          print PROML "U\n";
377          print PROML "V\n" if $rearrange || $global;          print PROML "V\n" if $rearrange || $global;
378          print PROML "L\n" if $user_lengths && ! $rearrange && ! $global;          print PROML "L\n" if $user_lengths && ! $rearrange && ! $global;
379      }      }
380        elsif ( $slow )  # Slow and user trees are mutually exclusive
381        {
382            print PROML "S\n";
383        }
384    
385      if ( $weights )      if ( $weights )
386      {      {
# Line 388  Line 390 
390          print PROML "W\n";          print PROML "W\n";
391      }      }
392    
393      #  All the options are written, try to lauch the run:      #  All the options are written, try to launch the run:
394    
395      print PROML "Y\n";      print PROML "Y\n";
396    
# Line 406  Line 408 
408          print PROML "$gamma_bins\n";          print PROML "$gamma_bins\n";
409          print PROML "$invar_frac\n" if $invar_frac;          print PROML "$invar_frac\n" if $invar_frac;
410      }      }
411      elsif ( $user_trees )  
412        if ( $user_trees )
413      {      {
414          print PROML "13\n";     #  Random number seed of unknown use          print PROML "13\n";     #  Random number seed of unknown use
415      }      }
# Line 446  Line 449 
449  #-------------------------------------------------------------------------------  #-------------------------------------------------------------------------------
450  #  A perl interface for using proml to estimate site-specific rates of change  #  A perl interface for using proml to estimate site-specific rates of change
451  #  #
452  #     ( $categories, $weights ) = estimate_protein_site_rates( \@align, $tree, proml_opts )  #     ( $categories, $weights ) = estimate_protein_site_rates( \@align, $tree,  %proml_opts )
453    #     ( $categories, $weights ) = estimate_protein_site_rates( \@align, $tree, \%proml_opts )
454  #  #
455  #     $categories = [ [ $rate1, ... ], $site_categories ];  #     $categories = [ [ $rate1, ... ], $site_categories ];
456  #  #
# Line 495  Line 499 
499    
500      my $kmin = 1 / ( gjonewicklib::newick_tree_length( $tree ) || 1 );      my $kmin = 1 / ( gjonewicklib::newick_tree_length( $tree ) || 1 );
501    
 #   print STDERR "Length = ", gjonewicklib::newick_tree_length( $tree ), "; kmin = $kmin\n"; ## DEBUG ##  
   
502      #  Generate "rate variation" by rescaling the supplied tree.  We could use a      #  Generate "rate variation" by rescaling the supplied tree.  We could use a
503      #  finer grain estimator, then categorize the inferred values.  This might      #  finer grain estimator, then categorize the inferred values.  This might
504      #  work slightly better (this is what DNArates currently does).      #  work slightly better (this is what DNArates currently does).
# Line 516  Line 518 
518      #  Adjust (a copy of) the proml opts:      #  Adjust (a copy of) the proml opts:
519    
520      my %proml_opts = ( ref( $proml_opts[0] ) eq 'HASH' ) ? %{ $proml_opts[0] } : @proml_opts;      my %proml_opts = ( ref( $proml_opts[0] ) eq 'HASH' ) ? %{ $proml_opts[0] } : @proml_opts;
521      $proml_opts{ alpha        } =  undef;  
     $proml_opts{ categories   } =  0;  
     $proml_opts{ coef_of_var  } =  0;  
     $proml_opts{ gamma_bins   } =  0;  
     $proml_opts{ invar_frac   } =  0;  
     $proml_opts{ jumble_seed  } =  0;  
     $proml_opts{ n_jumble     } =  0;  
     $proml_opts{ rearrange    } =  0;  
522      $proml_opts{ user_lengths } =  1;      $proml_opts{ user_lengths } =  1;
523      $proml_opts{ user_trees   } = \@trees;      $proml_opts{ user_trees   } = \@trees;
524      $proml_opts{ tree_format  } = 'gjo';      $proml_opts{ tree_format  } = 'gjo';
525    
526      #  Work throught the sites, finding their optimal categories:      delete $proml_opts{ alpha       } if exists $proml_opts{ alpha       };
527        delete $proml_opts{ categories  } if exists $proml_opts{ categories  };
528        delete $proml_opts{ coef_of_var } if exists $proml_opts{ coef_of_var };
529        delete $proml_opts{ gamma_bins  } if exists $proml_opts{ gamma_bins  };
530        delete $proml_opts{ invar_frac  } if exists $proml_opts{ invar_frac  };
531        delete $proml_opts{ jumble_seed } if exists $proml_opts{ jumble_seed };
532        delete $proml_opts{ n_jumble    } if exists $proml_opts{ n_jumble    };
533        delete $proml_opts{ rearrange   } if exists $proml_opts{ rearrange   };
534    
535        #  Work throught the sites, finding their optimal rates/categories:
536    
537      my @categories;      my @categories;
538      my @weights;      my @weights;

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.7

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3