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

Diff of /FigKernelPackages/ExpressionDir.pm

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

revision 1.2, Thu Jan 6 22:57:32 2011 UTC revision 1.3, Fri Jan 7 17:27:15 2011 UTC
# Line 14  Line 14 
14    
15  =head3 new  =head3 new
16    
17      my $edir = ExpressionDir->new($genome_dir);      my $edir = ExpressionDir->new($genome_source);
18    
19  Create a new ExpressionDir object to be associated with the given genome directory.  Create a new ExpressionDir object to be associated with the given genome directory.
20  If a subdirectory ExpressionData does not yet exist, one is created.  If a subdirectory ExpressionData does not yet exist, one is created.
# Line 331  Line 331 
331      my $merged_clusters = catfile($self->expr_dir, "merged.clusters");      my $merged_clusters = catfile($self->expr_dir, "merged.clusters");
332  }  }
333    
334    sub get_experiment_names
335    {
336        my($self) = @_;
337        my $f = catfile($self->expr_dir, "experiment.names");
338        my $fh;
339        open($fh, "<", $f) or confess "Could not open $f: $!";
340        my @out = map { chomp; my($num, $name) = split(/\t/); $name } <$fh>;
341        close($fh);
342        return @out;
343    }
344    
345    sub get_experiment_on_off_calls
346    {
347        my($self, $expt) = @_;
348    
349        my $f= catfile($self->expr_dir, "final_on_off_calls.txt");
350        my $fh;
351        open($fh, "<", $f) or confess "Could not open $f: $!";
352        my $names = <$fh>;
353        chomp $names;
354        my @names = split(/\t/, $names);
355        my $idx = 0;
356        my $expt_idx;
357        foreach my $n (@names)
358        {
359            if ($n eq $expt)
360            {
361                $expt_idx = $idx;
362                last;
363            }
364            $idx++;
365        }
366        if (!defined($expt_idx))
367        {
368            confess("Could not find experiment $expt in $f");
369        }
370    
371        my $calls = {};
372        while (<$fh>)
373        {
374            chomp;
375            my($peg, @calls) = split(/\t/);
376            #
377            # +1 because the row[0] element is the peg, and our index is
378            # zero-based.
379            #
380            $calls->{$peg} = $calls[$expt_idx + 1];
381        }
382    
383        close($fh);
384        return($calls);
385    
386    }
387    
388    =head3 save_model_gene_activity
389    
390        $e->save_model_gene_activity($data)
391    
392    Save the results of a modeling run for a given experiment.
393    
394    $data is of the form { experiment_id => $data_hash }
395    
396    =cut
397    
398    sub save_model_gene_activity
399    {
400        my($self, $data) = @_;
401    }
402    
403  1;  1;
404    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3