[Bio] / FigKernelScripts / p3x-eval-bin-site.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/p3x-eval-bin-site.pl

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

revision 1.1, Tue Aug 21 20:35:55 2018 UTC revision 1.2, Fri Oct 19 16:06:14 2018 UTC
# Line 1  Line 1 
1  =head1 Create Master Web Site for Bin Evaluation Pages  =head1 Create Master Web Site for Bin Evaluation Pages
2    
3      p3-master-bin-site.pl [options] binDir webDir      p3x-eval-bin-site.pl [options] binDir webDir
4    
5  This will create a master web site in the specified location from all the completed bin evaluations in a specified binning sample directory.  This will create a master web site in the specified location from all the completed bin evaluations in a specified binning sample directory.
6  It will look for an C<Eval> subdirectory under the sample directory itself, parse the C<index.tbl>, and move all the HTML files to a web  It will look for an C<Eval> subdirectory under the sample directory itself, parse the C<index.tbl>, and move all the HTML files to a web
7  directory with the same name as the sample under the master web directory.  directory with the same name as the sample under the master web directory. In addition, a C<good.tbl> file will be created in the output
8    directory that lists all the good genomes.
9    
10  =head2 Parameters  =head2 Parameters
11    
# Line 56  Line 57 
57  # These structures will contain the data for the master index page.  # These structures will contain the data for the master index page.
58  my @s;  my @s;
59  my %master = (bad_count => 0, good_count => 0, sample_count => 0);  my %master = (bad_count => 0, good_count => 0, sample_count => 0);
60    # This will be the output file for the good genomes.
61    open(my $gh, ">$webDir/good.tbl") || die "Could not open good.tbl: $!";
62    print $gh "genome_id\tgenome_name\n";
63  # Get all the completed samples in the input directory.  # Get all the completed samples in the input directory.
64  print "Searching $binDir.\n";  print "Searching $binDir.\n";
65  opendir(my $dh, $binDir) || die "Could not open $binDir: $!";  opendir(my $dh, $binDir) || die "Could not open $binDir: $!";
# Line 71  Line 75 
75      # Initialize the counters.      # Initialize the counters.
76      my ($good, $bad, $total) = (0, 0, 0);      my ($good, $bad, $total) = (0, 0, 0);
77      open(my $ih, "<$inDir/index.tbl") || die "Could not open index file for $sample: $!";      open(my $ih, "<$inDir/index.tbl") || die "Could not open index file for $sample: $!";
78      my (undef, $cols) = P3Utils::find_headers($ih, indexFile => 'Bin ID', 'Good');      my (undef, $cols) = P3Utils::find_headers($ih, indexFile => 'Bin ID', 'Bin Name', 'Good');
79      while (! eof $ih) {      while (! eof $ih) {
80          my ($binID, $goodFlag) = P3Utils::get_cols($ih, $cols);          my ($binID, $binName, $goodFlag) = P3Utils::get_cols($ih, $cols);
81          # Copy this bin's HTML file.          # Copy this bin's HTML file.
82          File::Copy::Recursive::fcopy("$inDir/$binID.html", "$outDir/$binID.html") || die "Could not copy $binID for $sample: $!";          File::Copy::Recursive::fcopy("$inDir/$binID.html", "$outDir/$binID.html") || die "Could not copy $binID for $sample: $!";
83          # Count the bin.          # Count the bin.
84          $total++;          $total++;
85          if ($goodFlag) {          if ($goodFlag) {
86              $good++;              $good++;
87                print $gh "$binID\t$binName\n";
88          } else {          } else {
89              $bad++;              $bad++;
90          }          }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3