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

Diff of /FigKernelPackages/FIGO.pm

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

revision 1.19, Mon Mar 19 19:49:25 2007 UTC revision 1.32, Thu Dec 6 13:59:34 2007 UTC
# Line 17  Line 17 
17  #  #
18  ########################################################################  ########################################################################
19    
20    =head1 TODO
21    
22    =over 4
23    
24    =item Null arg to ContigO::dna_seq() should return entire contig seq.
25    
26    =item Add method to access "FIG::crude_estimate_of_distance()"
27    
28    =back
29    
30    =cut
31    
32  =head1 Overview  =head1 Overview
33    
34  This module is a set of packages encapsulating the SEED's core methods  This module is a set of packages encapsulating the SEED's core methods
35  using an "OOP-like" style.  using an "OOP-like" style.
36    
37  There are several modules clearly related to "individual genomes:"  There are several modules clearly related to "individual genomes:"
38  FIGO, GenomeO, ContigO, FeatureO (and I<maybe> AnnotationO).  GenomeO, ContigO, FeatureO (and I<maybe> AnnotationO).
39    
40  There are also modules that deal with complex relationships between  There are also modules that deal with complex relationships between
41  pairs or sets of features in one, two, or more genomes,  pairs or sets of features in one, two, or more genomes,
# Line 32  Line 44 
44    
45  Finally, the methods in "Attribute" might in principle attach  Finally, the methods in "Attribute" might in principle attach
46  "atributes" to any type of object.  "atributes" to any type of object.
47  (Likewise, in principle one might like to attach an "annotation"  (Likewise, in principle one might also want to attach an "annotation"
48  to any type of object  to any type of object,
49    although currently we only support annotations of "features.")
50    
51  Four of the modules dealing with "genomes" have a reasonable clear  The three modules that act on "individual genomes" have a reasonable clear
52  "implied heirarchy:"  "implied heirarchy" relative to FIGO:
53    
54  =over 4  =over 4
55    
# Line 52  Line 65 
65  We have chosen to in many cases sidestep the entire issue of inheritance  We have chosen to in many cases sidestep the entire issue of inheritance
66  via an I<ad hoc> mechanism:  via an I<ad hoc> mechanism:
67  If a "child" object needs access to its "ancestors'" methods,  If a "child" object needs access to its "ancestors'" methods,
68  we pass it references to its "ancestors" using subroutine arguments.  we will explicitly pass it references to its "ancestors,"
69    as subroutine arguments.
70  This is admittedly ugly, clumsy, and potentially error-prone ---  This is admittedly ugly, clumsy, and potentially error-prone ---
71  but it has the advantage that, unlike multiple inheritance,  but it has the advantage that, unlike multiple inheritance,
72  we understand how to do it...  we understand how to do it...
# Line 72  Line 86 
86  use SproutFIG;  use SproutFIG;
87  use Tracer;  use Tracer;
88  use Data::Dumper;  use Data::Dumper;
89    use Carp;
90  use FigFams;  use FigFams;
91  use gjoparseblast;  use gjoparseblast;
92    
# Line 90  Line 105 
105    
106  =item USAGE:  =item USAGE:
107    
108  C<< my $figo = FIGO->new();           #...Subclass defaults to FIG >>      my $figo = FIGO->new();           #...Subclass defaults to FIG
109    
110  C<< my $figo = FIGO->new('SPROUT');   #...Subclass is a SPROUT object >>      my $figo = FIGO->new('SPROUT');   #...Subclass is a SPROUT object
111    
112  =back  =back
113    
# Line 117  Line 132 
132      return bless $self, $class;      return bless $self, $class;
133  }  }
134    
135    sub function_of {
136        my($self,$id) = @_;
137    
138        my $fig  = $self->{_fig};
139        my $func = $fig->function_of($id);
140    
141        return ($func ? $func : "");
142    }
143    
144  =head3 genomes  =head3 genomes
145    
# Line 128  Line 150 
150    
151  =item USAGE:  =item USAGE:
152    
153  C<< my @tax_ids = $figo->genomes(); >>      my @tax_ids = $figo->genomes();
154    
155  C<< my @tax_ids = $figo->genomes( @constraints ); >>      my @tax_ids = $figo->genomes( @constraints );
156    
157  =item @constraints  =item @constraints
158    
# Line 249  Line 271 
271    
272  =item USAGE:  =item USAGE:
273    
274  C<< foreach $fam ($figO->all_figfams) { #...Do something } >>      foreach $fam ($figO->all_figfams) { #...Do something }
275    
276  =item RETURNS:  =item RETURNS:
277    
# Line 278  Line 300 
300    
301  =item USAGE:  =item USAGE:
302    
303  C<< my ($fam, $sims) = $figO->family_containing($seq); >>      my ($fam, $sims) = $figO->family_containing($seq);
304    
305  =item $seq:  =item $seq:
306    
# Line 318  Line 340 
340    
341  =item USAGE:  =item USAGE:
342    
343  C<< my $fam = $figO->figfam($family_id); >>      my $fam = $figO->figfam($family_id);
344    
345  =item $family_id;  =item $family_id;
346    
# Line 357  Line 379 
379    
380  =item USAGE:  =item USAGE:
381    
382  C<< my $org = GenomeO->new($figo, $tax_id); >>      my $orgO = GenomeO->new($figO, $tax_id);
383    
384  =item RETURNS:  =item RETURNS:
385    
386      A new GenomeO object.  A new "GenomeO" object.
387    
388  =back  =back
389    
# Line 384  Line 406 
406    
407  =item USAGE:  =item USAGE:
408    
409  C<< my $tax_id = $org->id(); >>      my $tax_id = $orgO->id();
410    
411  =item RETURNS:  =item RETURNS:
412    
413      Taxonomy-ID of GenomeO object.  Taxonomy-ID of "GenomeO" object.
414    
415  =back  =back
416    
# Line 408  Line 430 
430    
431  =item USAGE:  =item USAGE:
432    
433  C<< $gs = $genome->genus_species(); >>      $gs = $orgO->genus_species();
434    
435  =item RETURNS:  =item RETURNS:
436    
# Line 426  Line 448 
448  }  }
449    
450    
451    
452    
453    =head3 taxonomy_of
454    
455    =over 4
456    
457    =item FUNCTION:
458    
459    Return the TAXONOMY string of a "GenomeO" object.
460    
461    =item USAGE:
462    
463        my $taxonomy = $orgO->taxonomy_of();
464    
465    =item RETURNS:
466    
467    TAXONOMY string.
468    
469    =back
470    
471    =cut
472    
473    sub taxonomy_of {
474        my ($self) = @_;
475    
476        my $figO = $self->{_figO};
477        my $fig  = $figO->{_fig};
478    
479        return $fig->taxonomy_of($self->{_id});
480    }
481    
482    
483  =head3 contigs_of  =head3 contigs_of
484    
485  =over 4  =over 4
# Line 454  Line 508 
508    
509  =head3 features_of  =head3 features_of
510    
511    =over 4
512    
513    =item FUNCTION:
514    
515    Returns a list of "FeatureO" objects contained in a "GenomeO" object.
516    
517    =item USAGE:
518    
519        my @featureOs = $orgO->features_of();        #...Fetch all features
520    
521    or
522    
523        my @featureOs = $orgO->features_of('peg');   #...Fetch only PEGs
524    
525    =item RETURNS:
526    
527    List of "FeatureO" objects.
528    
529    =back
530    
531  =cut  =cut
532    
533  sub features_of {  sub features_of {
# Line 474  Line 548 
548    
549  =item USAGE:  =item USAGE:
550    
551  C<< $genome->display(); >>      $genome->display();
552    
553  =item RETURNS:  =item RETURNS:
554    
# Line 511  Line 585 
585    
586  =item USAGE:  =item USAGE:
587    
588  C<< $contig = ContigO->new( $figO, $genomeId, $contigId); >>      $contig = ContigO->new( $figO, $genomeId, $contigId);
589    
590  =item $figO:  =item $figO:
591    
# Line 570  Line 644 
644    
645  =item USAGE:  =item USAGE:
646    
647  C<< my $tax_id = $contig->genome->id(); >>      my $tax_id = $contig->genome->id();
648    
649  =item RETURNS:  =item RETURNS:
650    
# Line 595  Line 669 
669    
670  =item USAGE:  =item USAGE:
671    
672  C<< my $len = $contig->contig_length(); >>      my $len = $contig->contig_length();
673    
674  =item RETURNS:  =item RETURNS:
675    
# Line 620  Line 694 
694    
695  =item USAGE:  =item USAGE:
696    
697  C<< my $seq = $contig->dna_seq(beg, $end); >>      my $seq = $contig->dna_seq(beg, $end);
698    
699  =item $beg:  =item $beg:
700    
# Line 632  Line 706 
706    
707  =item RETURNS:  =item RETURNS:
708    
709      string of DNA sequence running from $beg to $end  String containing DNA subsequence running from $beg to $end
710      (NOTE: if $beg > $end, returns reverse complement of DNA subsequence.)      (NOTE: if $beg > $end, returns reverse complement of DNA subsequence.)
711    
712  =back  =back
# Line 697  Line 771 
771  package FeatureO;  package FeatureO;
772  ########################################################################  ########################################################################
773  use Data::Dumper;  use Data::Dumper;
774    use Carp;
775    
776  =head1 FeatureO  =head1 FeatureO
777    
# Line 707  Line 782 
782    
783  =head3 new  =head3 new
784    
785  Constructor of "FeatureO" objects  Constructor of new "FeatureO" objects
786    
787  =over 4  =over 4
788    
789  =item USAGE:  =item USAGE:
790    
791  C<< my $feature = FeatureO->new( $figO, $fid ); >>      my $feature = FeatureO->new( $figO, $fid );
792    
793  =item C<$figO>:  =item C<$figO>:
794    
# Line 749  Line 824 
824    
825  =item USAGE:  =item USAGE:
826    
827  C<< my $fid = $feature->id(); >>      my $fid = $feature->id();
828    
829  =item RETURNS:  =item RETURNS:
830    
# Line 773  Line 848 
848    
849  =item USAGE:  =item USAGE:
850    
851  C<< my $taxid = $feature->genome(); >>      my $taxid = $feature->genome();
852    
853  =item RETURNS:  =item RETURNS:
854    
855  The TAxon-ID for the "GenomeO" object containg the feature.  The Taxon-ID for the "GenomeO" object containing the feature.
856    
857  =back  =back
858    
# Line 798  Line 873 
873    
874  =item USAGE:  =item USAGE:
875    
876  C<< my $feature_type = $feature->type(); >>      my $feature_type = $feature->type();
877    
878  =item RETURNS:  =item RETURNS:
879    
# Line 823  Line 898 
898    
899  =item USAGE:  =item USAGE:
900    
901  C<< my $loc = $feature->location(); >>      my $loc = $feature->location();
902    
903  =item RETURNS:  =item RETURNS:
904    
# Line 848  Line 923 
923    
924  =item USAGE:  =item USAGE:
925    
926  C<< my $contig = $feature->contig(); >>      my $contig = $feature->contig();
927    
928  =item RETURNS:  =item RETURNS:
929    
# Line 876  Line 951 
951    
952  =item USAGE:  =item USAGE:
953    
954  C<< my $beg = $feature->begin(); >>      my $beg = $feature->begin();
955    
956  =item RETURNS:  =item RETURNS:
957    
# Line 901  Line 976 
976    
977  =item USAGE:  =item USAGE:
978    
979  C<< my $end = $feature->end(); >>      my $end = $feature->end();
980    
981  =item RETURNS:  =item RETURNS:
982    
# Line 926  Line 1001 
1001    
1002  =item USAGE:  =item USAGE:
1003    
1004  C<< my $dna_seq = $feature->dna_seq(); >>      my $dna_seq = $feature->dna_seq();
1005    
1006  =item RETURNS:  =item RETURNS:
1007    
# Line 956  Line 1031 
1031    
1032  =item USAGE:  =item USAGE:
1033    
1034  C<< my $dna_seq = $feature->prot_seq(); >>      my $dna_seq = $feature->prot_seq();
1035    
1036  =item RETURNS:  =item RETURNS:
1037    
# Line 984  Line 1059 
1059    
1060  =item USAGE:  =item USAGE:
1061    
1062  C<< my $func = $feature->function_of(); >>      my $func = $feature->function_of();
1063    
1064  =item RETURNS:  =item RETURNS:
1065    
# Line 1011  Line 1086 
1086    
1087  =item USAGE:  =item USAGE:
1088    
1089  C<< my @coupled_features = $feature->coupled_to(); >>      my @coupled_features = $feature->coupled_to();
1090    
1091  =item RETURNS:  =item RETURNS:
1092    
1093  A list of L<CouplingO> objects describing the evidence for functional coupling  A list of "CouplingO" objects describing the evidence for functional coupling
1094  between this feature and other nearby features.  between this feature and other nearby features.
1095    
1096  =back  =back
# Line 1046  Line 1121 
1121    
1122  =item USAGE:  =item USAGE:
1123    
1124  C<< my @annot_list = $feature->annotations(); >>      my @annot_list = $feature->annotations();
1125    
1126  =item RETURNS:  =item RETURNS:
1127    
1128  A list of L<AnnotationO> objects allowing access to the annotations for this feature.  A list of "AnnotationO" objects allowing access to the annotations for this feature.
1129    
1130  =back  =back
1131    
# Line 1072  Line 1147 
1147    
1148  =item USAGE:  =item USAGE:
1149    
1150  C<< my @subsys_list = $feature->in_subsystems(); >>      my @subsys_list = $feature->in_subsystems();
1151    
1152  =item RETURNS:  =item RETURNS:
1153    
1154  A list of L<SubsystemO> objects allowing access to the subsystems  A list of "SubsystemO" objects allowing access to the subsystems
1155  that this feature particupates in.  that this feature particupates in.
1156    
1157  =back  =back
# Line 1098  Line 1173 
1173    
1174  =item USAGE:  =item USAGE:
1175    
1176  C<< my $trunc = $feature->possibly_truncated(); >>      my $trunc = $feature->possibly_truncated();
1177    
1178  =item RETURNS:  =item RETURNS:
1179    
# Line 1125  Line 1200 
1200    
1201  =item USAGE:  =item USAGE:
1202    
1203  C<< my $fs = $feature->possible_frameshift(); >>      my $fs = $feature->possible_frameshift();
1204    
1205  =item RETURNS:  =item RETURNS:
1206    
# Line 1142  Line 1217 
1217  sub possible_frameshift {  sub possible_frameshift {
1218      my($self) = @_;      my($self) = @_;
1219      my $figO = $self->{_figO};      my $figO = $self->{_figO};
1220      my($tmp_dir) = $figO->{_tmp_dir};      my $fig = $figO->{_fig};
1221    
1222      if (! $self->possibly_truncated)      return $fig->possible_frameshift($self->id);
     {  
         my @sims = $self->sims( -max => 1, -cutoff => 1.0e-50);  
         if (my $sim = shift @sims)  
         {  
             my $peg2 = $sim->id2;  
             my $ln1  = $sim->ln1;  
             my $ln2  = $sim->ln2;  
             my $b2   = $sim->b2;  
             my $e2   = $sim->e2;  
             my $adjL = 100 + (($b2-1) * 3);  
             my $adjR = 100 + (($ln2 - $e2) * 3);  
             if ($ln2 > (1.2 * $ln1))  
             {  
                 my $loc = $self->location;  
                 if ($loc =~ /^(\S+)_(\d+)_(\d+)/)  
                 {  
                     my $contig = $1;  
                     my $beg    = $2;  
                     my $end = $3;  
                     my $contigO = new ContigO($figO,$self->genome->id,$contig);  
                     my $begA = &max(1,$beg - $adjL);  
                     my $endA = &min($end+$adjR,$contigO->contig_length);  
                     my $dna  = $contigO->dna_seq($begA,$endA);  
                     open(TMP,">$tmp_dir/tmp_dna") || die "couild not open tmp_dna";  
                     print TMP ">dna\n$dna\n";  
                     close(TMP);  
   
                     my $peg2O = new FeatureO($figO,$peg2);  
                     my $prot  = $peg2O->prot_seq;  
                     open(TMP,">$tmp_dir/tmp_prot") || die "could not open tmp_prot";  
                     print TMP ">tmp_prot\n$prot\n";  
                     close(TMP);  
                     &run("formatdb -i $tmp_dir/tmp_dna -pF");  
                     open(BLAST,"blastall -i $tmp_dir/tmp_prot -d $tmp_dir/tmp_dna -p tblastn -FF -e 1.0e-50 |")  
                         || die "could not blast";  
   
                     my $db_seq_out = &gjoparseblast::next_blast_subject(\*BLAST,1);  
                     my @hsps       = sort { $a->[0] <=> $b->[0] }  
                                      map { [$_->[9],$_->[10],$_->[12],$_->[13]] }  
                                      grep { $_->[1] < 1.0e-50 }  
                                      @{$db_seq_out->[6]};  
                     my @prot = map { [$_->[0],$_->[1]] } @hsps;  
                     my @dna  = map { [$_->[2],$_->[3]] } @hsps;  
                     if (&covers(\@prot,length($prot),3,0) && &covers(\@dna,3*length($prot),9,1))  
                     {  
                         return 1;  
                     }  
                 }  
             }  
         }  
     }  
     return 0;  
1223  }  }
1224    
1225    
# Line 1213  Line 1236 
1236    
1237  =item USAGE:  =item USAGE:
1238    
1239  C<< $feature->run($cmd); >>      $feature->run($cmd);
1240    
1241  =item RETURNS:  =item RETURNS:
1242    
# Line 1226  Line 1249 
1249    
1250  sub run {  sub run {
1251      my($cmd) = @_;      my($cmd) = @_;
1252      (system($cmd) == 0) || Confess("FAILED: $cmd");      (system($cmd) == 0) || confess("FAILED: $cmd");
1253  }  }
1254    
1255    
# Line 1239  Line 1262 
1262    
1263  =item USAGE:  =item USAGE:
1264    
1265  C<< my $max = $feature->max($x, $y); >>      my $max = $feature->max($x, $y);
1266    
1267  =item C<$x>  =item C<$x> and  C<$y>
1268    
1269  Numerical value.  Numerical values.
1270    
1271  =item C<$y>  =item RETURNS:
   
 Numerical value.  
   
 =items RETURNS:  
1272    
1273  The larger of the two numerical values C<$x> and C<$y>.  The larger of the two numerical values C<$x> and C<$y>.
1274    
# Line 1272  Line 1291 
1291    
1292  =item USAGE:  =item USAGE:
1293    
1294  C<< my $min = $feature->min($x, $y); >>      my $min = $feature->min($x, $y);
   
 =item C<$x>  
1295    
1296  Numerical value.  =item C<$x> and C<$y>
1297    
1298  =item C<$y>  Numerical values.
   
 Numerical value.  
1299    
1300  =item RETURNS:  =item RETURNS:
1301    
# Line 1295  Line 1310 
1310      return ($x < $y) ? $x : $y;      return ($x < $y) ? $x : $y;
1311  }  }
1312    
   
   
 =head3 covers  
   
 (Question: Should this function be considered "PRIVATE" ???)  
   
 USAGE:  
     C<< if (&covers(\@hits, $len, $diff, $must_shift)) { #...Do stuff } >>  
   
 Returns boolean C<TRUE> if a set of BLAST HSPs "cover" more than 90%  
 of the database sequence(?).  
   
 =cut  
   
 sub covers {  
     my($hsps,$ln,$diff,$must_shift) = @_;  
   
     my $hsp1 = shift @$hsps;  
     my $hsp2;  
     my $merged = 0;  
     while ($hsp1 && ($hsp2 = shift @$hsps) &&  
            ($must_shift ? &diff_frames($hsp1,$hsp2) : 1) &&  
            ($hsp1 = &merge($hsp1,$hsp2,$diff))) { $merged = 1 }  
     return ($merged && $hsp1 && (($hsp1->[1] - $hsp1->[0]) > (0.9 * $ln)));  
 }  
   
 sub diff_frames {  
     my($hsp1,$hsp2) = @_;  
     return (($hsp1->[0] % 3) != ($hsp2->[0] % 3));  
 }  
   
   
   
 =head3 merge  
   
 Merge two HSPs unless their overlap or separation is too large.  
   
 RETURNS: Merged boundaries if merger succeeds, and C<undef> if merger fails.  
   
 =cut  
   
 sub merge {  
     my($hsp1,$hsp2,$diff) = @_;  
   
     my($b1,$e1) = @$hsp1;  
     my($b2,$e2) = @$hsp2;  
     return (($e2 > $e1) && (abs($b2-$e1) <= $diff)) ? [$b1,$e2] : undef;  
 }  
   
   
   
1313  =head3 sims  =head3 sims
1314    
1315  =over 4  =over 4
# Line 1356  Line 1320 
1320    
1321  =item USAGE:  =item USAGE:
1322    
1323  C<< my @sims = $pegO->sims( -all, -cutoff => 1.0e-10); >>      my @sims = $pegO->sims( -all, -cutoff => 1.0e-10);
1324    
1325  C<< my @sims = $pegO->sims( -max => 50, -cutoff => 1.0e-10); >>      my @sims = $pegO->sims( -max => 50, -cutoff => 1.0e-10);
1326    
1327  =item RETURNS: List of sim objects.  =item RETURNS: List of sim objects.
1328    
# Line 1374  Line 1338 
1338      my $fig  = $figO->{_fig};      my $fig  = $figO->{_fig};
1339    
1340      my $cutoff = $args{-cutoff} ? $args{-cutoff} : 1.0e-5;      my $cutoff = $args{-cutoff} ? $args{-cutoff} : 1.0e-5;
1341      my $all    = $args{-all}    ? $args{-all}    : "fig";      my $all    = $args{-all}    ? 'all'          : "fig";
1342      my $max    = $args{-max}    ? $args{-max}    : 10000;      my $max    = $args{-max}    ? $args{-max}    : 10000;
1343    
1344      return $fig->sims($self->id,$max,$cutoff,$all);      my @sims = $fig->sims($self->id,$max,$cutoff,$all);
1345    
1346        if (@sims) {
1347            my $peg1 = FeatureO->new($figO, $sims[0]->[0]);
1348    
1349            foreach my $sim (@sims) {
1350    #           $sim->[0] = $peg1;
1351    #           $sim->[1] = FeatureO->new($figO, $sim->[1]);
1352            }
1353        }
1354    
1355        return @sims;
1356  }  }
1357    
1358    
# Line 1393  Line 1368 
1368    
1369  =item USAGE:  =item USAGE:
1370    
1371  C<< my @bbhs = $pegO->bbhs(); >>      my @bbhs = $pegO->bbhs();
1372    
1373  =item List of BBHO objects.  =item RETURNS:
1374    
1375    List of BBHO objects.
1376    
1377  =back  =back
1378    
# Line 1416  Line 1393 
1393                                                  },'BBHO') } @bbhs;                                                  },'BBHO') } @bbhs;
1394  }  }
1395    
1396    
1397  =head3 display  =head3 display
1398    
1399    =over 4
1400    
1401    =item FUNCTION:
1402    
1403  Prints info about a "FeatureO" object to STDOUT.  Prints info about a "FeatureO" object to STDOUT.
1404    
1405  USAGE:  =item USAGE:
1406    
1407        $pegO->display();
1408    
1409  C<< $pegO->display(); >>  =item RETURNS;
1410    
1411    (void)
1412    
1413    =back
1414    
1415  =cut  =cut
1416    
# Line 1475  Line 1463 
1463    
1464  =item USAGE:  =item USAGE:
1465    
1466  C<< my $peg1 = $bbh->peg1(); >>      my $peg1 = $bbh->peg1();
1467    
1468  =item RETURNS:  =item RETURNS:
1469    
# Line 1499  Line 1487 
1487    
1488  =item USAGE:  =item USAGE:
1489    
1490  C<< my $peg2 = $bbh->peg2(); >>      my $peg2 = $bbh->peg2();
1491    
1492  =item RETURNS:  =item RETURNS:
1493    
# Line 1525  Line 1513 
1513    
1514  =item USAGE:  =item USAGE:
1515    
1516  C<< my $psc = $bbh->psc(); >>      my $psc = $bbh->psc();
1517    
1518  =item RETURNS:  =item RETURNS:
1519    
# Line 1550  Line 1538 
1538    
1539  =item USAGE:  =item USAGE:
1540    
1541  C<< my $bsc = $bbh->norm_bitscore(); >>      my $bsc = $bbh->norm_bitscore();
1542    
1543  =item RETURNS:  =item RETURNS:
1544    
# Line 1582  Line 1570 
1570    
1571  =head3 new  =head3 new
1572    
1573    =over 4
1574    
1575    =item FUNCTION:
1576    
1577    Cronstruct a new "AnnotationO" object
1578    
1579    =item USAGE:
1580    
1581        my $annotO = AnnotationO->new( $fid, $timestamp, $who, $text);
1582    
1583    =item C<$fid>
1584    
1585    A feature identifier.
1586    
1587    =item C<$timestamp>
1588    
1589    The C<UN*X> timestamp one wishes to associate with the annotation.
1590    
1591    =item C<$who>
1592    
1593    The annotator's user-name.
1594    
1595    =item C<$text>
1596    
1597    The textual content of the annotation.
1598    
1599    =item RETURNS:
1600    
1601    An "AnnotationO" object.
1602    
1603    =back
1604    
1605  =cut  =cut
1606    
1607  sub new {  sub new {
# Line 1599  Line 1619 
1619    
1620  =head3 fid  =head3 fid
1621    
1622    =over 4
1623    
1624    =item FUNCTION:
1625    
1626    Extract the feature-ID that was annotated.
1627    
1628    =item USAGE:
1629    
1630        my $fid = $annotO->fid();
1631    
1632    =item RETURNS;
1633    
1634    The feature-ID as a string.
1635    
1636    =back
1637    
1638  =cut  =cut
1639    
1640  sub fid {  sub fid {
# Line 1611  Line 1647 
1647    
1648  =head3 timestamp  =head3 timestamp
1649    
1650    =over 4
1651    
1652    =item FUNCTION:
1653    
1654    Extract the C<UN*X> timestamp of the annotation.
1655    
1656    =item USAGE:
1657    
1658        my $fid = $annotO->timestamp();
1659    
1660    =item RETURNS;
1661    
1662    The timestamp as a string.
1663    
1664    =back
1665    
1666  =cut  =cut
1667    
1668  sub timestamp {  sub timestamp {
# Line 1630  Line 1682 
1682    
1683  =head3 made_by  =head3 made_by
1684    
1685    =over 4
1686    
1687    =item FUNCTION:
1688    
1689    Extract the annotator's user-name.
1690    
1691    =item USAGE:
1692    
1693        my $fid = $annotO->made_by();
1694    
1695    =item RETURNS;
1696    
1697    The username of the annotator, as a string.
1698    
1699    =back
1700    
1701  =cut  =cut
1702    
1703  sub made_by {  sub made_by {
# Line 1644  Line 1712 
1712    
1713  =head3 text  =head3 text
1714    
1715    =over 4
1716    
1717    =item FUNCTION:
1718    
1719    Extract the text of the annotation.
1720    
1721    =item USGAE:
1722    
1723        my $text = $annotO->text();
1724    
1725    =item RETURNS:
1726    
1727    The text of the annotation, as a string.
1728    
1729    =back
1730    
1731  =cut  =cut
1732    
1733  sub text {  sub text {
# Line 1656  Line 1740 
1740    
1741  =head3 display  =head3 display
1742    
1743    =over 4
1744    
1745    =item FUNCTION:
1746    
1747    Print the contents of an "AnnotationO" object to B<STDOUT>
1748    in human-readable form.
1749    
1750    =item USAGE:
1751    
1752        my $annotO->display();
1753    
1754    =item RETURNS:
1755    
1756    (void)
1757    
1758    =back
1759    
1760  =cut  =cut
1761    
1762  sub display {  sub display {
# Line 1682  Line 1783 
1783    
1784  =head3 new  =head3 new
1785    
1786    =over 4
1787    
1788    =item FUNCTION:
1789    
1790    Construct a new "CouplingO" object
1791    encapsulating the "functional coupling" score
1792    between a pair of features in some genome.
1793    
1794    =item USAGE:
1795    
1796        $couplingO = CouplingO->new($figO, $fid1, $fid2, $sc);
1797    
1798    =item C<$figO>
1799    
1800    Parent "FIGO" object.
1801    
1802    =item C<$fid1> and C<$fid2>
1803    
1804    A pair of feature-IDs.
1805    
1806    =item C<$sc>
1807    
1808    A functional-coupling score
1809    
1810    =item RETURNS:
1811    
1812    A "CouplingO" object.
1813    
1814    =back
1815    
1816  =cut  =cut
1817    
1818  sub new {  sub new {
# Line 1701  Line 1832 
1832    
1833  =head3 peg1  =head3 peg1
1834    
1835    =over 4
1836    
1837    =item FUNCTION:
1838    
1839    Returns a "FeatureO" object corresponding to the first FID in a coupled pair.
1840    
1841    =item USAGE:
1842    
1843        my $peg1 = $couplingO->peg1();
1844    
1845    =item RETURNS:
1846    
1847    A "FeatureO" object.
1848    
1849    =back
1850    
1851  =cut  =cut
1852    
1853  sub peg1 {  sub peg1 {
# Line 1712  Line 1859 
1859    
1860    
1861    
1862  =head3 peg1  =head3 peg2
1863    
1864    =over 4
1865    
1866    =item FUNCTION:
1867    
1868    Returns a "FeatureO" object corresponding to the second FID in a coupled pair.
1869    
1870    =item USAGE:
1871    
1872        my $peg2 = $couplingO->peg2();
1873    
1874    =item RETURNS:
1875    
1876    A "FeatureO" object.
1877    
1878    =back
1879    
1880  =cut  =cut
1881    
# Line 1727  Line 1890 
1890    
1891  =head3 sc  =head3 sc
1892    
1893    =over 4
1894    
1895    =item FUNCTION:
1896    
1897    Extracts the "functional coupling" score from a "CouplingO" object.
1898    
1899    =item USAGE:
1900    
1901        my $sc = $couplingO->sc();
1902    
1903    =item RETURNS:
1904    
1905    A scalar score.
1906    
1907    =back
1908    
1909  =cut  =cut
1910    
1911  sub sc {  sub sc {
# Line 1739  Line 1918 
1918    
1919  =head3 evidence  =head3 evidence
1920    
1921    =over 4
1922    
1923    =item FUNCTION:
1924    
1925    Fetch the evidence for a "functional coupling" between two close PEGs,
1926    in the form of a list of objects describing the "Pairs of Close Homologs" (PCHs)
1927    supporting the existence of a functional coupling between the two close PEGs.
1928    
1929    =item USAGE:
1930    
1931        my $evidence = $couplingO->evidence();
1932    
1933    =item RETURNS
1934    
1935    List of pairs of "FeatureO" objects.
1936    
1937    =back
1938    
1939  =cut  =cut
1940    
1941  sub evidence {  sub evidence {
# Line 1761  Line 1958 
1958    
1959  =head3 display  =head3 display
1960    
1961    =over 4
1962    
1963    =item FUNCTION:
1964    
1965    Print the contents of a "CouplingO" object to B<STDOUT> in human-readable form.
1966    
1967    =item USAGE:
1968    
1969        $couplingO->display();
1970    
1971    =item RETURNS:
1972    
1973    (Void)
1974    
1975    =back
1976    
1977  =cut  =cut
1978    
1979  sub display {  sub display {

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.32

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3