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

Diff of /FigKernelPackages/raelib.pm

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

revision 1.3, Wed Feb 2 01:07:44 2005 UTC revision 1.4, Fri Feb 11 21:26:25 2005 UTC
# Line 14  Line 14 
14  use FIG;  use FIG;
15  my $fig=new FIG;  my $fig=new FIG;
16    
17    =head2 features_on_contig
18    
19     Returns a reference to an array containing all the features on a contig in a genome.
20    
21     use:
22    
23     my $arrayref=$rae->features_on_contig($genome, $contig);
24    
25     or
26    
27     foreach my $peg (@{$rae->features_on_contig($genome, $contig)}) {
28      ... blah blah ...
29     }
30    
31     returns undef if contig is not a part of genome or there is nothing to return, otherwise returns a list of pegs
32    
33     v. experimental and guaranteed not to work!
34    
35    =cut
36    
37    sub features_on_contig {
38     my ($self, $genome, $contig)=@_;
39     # were this in FIG.pm you'd use this line:
40     #my $rdbH = $self->db_handle;
41    
42     my $rdbH = $fig->db_handle;
43     my $relational_db_response=$rdbH->SQL('SELECT id FROM features WHERE  (genome = \'' . $genome . '\' AND  location ~* \'' . $contig . '\')');
44     # this is complicated. A reference to an array of references to arrays, and we only want the first element.
45     # simplify.
46     my @results;
47     foreach my $res (@$relational_db_response) {push @results, $res->[0]}
48     return \@results;
49    }
50    
51    
52    
53    
54    
55    
56    
57  =head2 pirsfcorrespondance  =head2 pirsfcorrespondance
58    
59   Generate the pirsf->fig id correspondance. This is only done once and the correspondance file is written.   Generate the pirsf->fig id correspondance. This is only done once and the correspondance file is written.

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3