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

Diff of /FigKernelPackages/Observation.pm

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

revision 1.4, Wed Jun 13 16:40:25 2007 UTC revision 1.5, Wed Jun 13 17:56:35 2007 UTC
# Line 88  Line 88 
88  sub description {  sub description {
89    my ($self) = @_;    my ($self) = @_;
90    
91    return $self->{acc};    return $self->{description};
92  }  }
93    
94  =head3 class()  =head3 class()
# Line 332  Line 332 
332    # read sims    # read sims
333    get_sims_observations($fid,\@matched_datasets);    get_sims_observations($fid,\@matched_datasets);
334    
335      # read identical proteins list of sequences
336      get_identical_proteins($fid,\@matched_datasets);
337    
338    # read sims + bbh (enrich BBHs with sims coordindates etc)    # read sims + bbh (enrich BBHs with sims coordindates etc)
339    # read pchs    # read pchs
340    # read figfam match data from 48hr directory (BobO knows how do do this!)    # read figfam match data from 48hr directory (BobO knows how do do this!)
# Line 518  Line 521 
521      }      }
522  }  }
523    
524    =head3 get_identical_proteins() (internal)
525    
526    This methods retrieves sims fills the internal data structures.
527    
528    =cut
529    
530    sub get_identical_proteins{
531    
532        my ($fid,$datasets_ref) = (@_);
533        my $fig = new FIG;
534        my @funcs = ();
535    
536        my @maps_to = grep { $_ ne $fid and $_ !~ /^xxx/ } map { $_->[0] } $fig->mapped_prot_ids($fid);
537    
538        foreach my $id (@maps_to) {
539            my ($tmp, $who);
540            if (($id ne $fid) && ($tmp = $fig->function_of($fid))) {
541                if ($id =~ /^fig\|/)           { $who = "FIG" }
542                elsif ($id =~ /^gi\|/)            { $who = "NCBI" }
543                elsif ($id =~ /^^[NXYZA]P_/)      { $who = "RefSeq" }
544                elsif ($id =~ /^sp\|/)            { $who = "SwissProt" }
545                elsif ($id =~ /^uni\|/)           { $who = "UniProt" }
546                elsif ($id =~ /^tigr\|/)          { $who = "TIGR" }
547                elsif ($id =~ /^pir\|/)           { $who = "PIR" }
548                elsif ($id =~ /^kegg\|/)          { $who = "KEGG" }
549                elsif ($id =~ /^tr\|/)            { $who = "TrEMBL" }
550                elsif ($id =~ /^eric\|/)          { $who = "ASAP" }
551    
552                push(@funcs, [$id,$who,$tmp]);
553            }
554        }
555    
556        my ($dataset);
557        foreach my $row (@funcs){
558            my $id = $row->[0];
559            my $organism = $fig->org_of($fid);
560            my $who = $row->[1];
561            my $assignment = $row->[2];
562            $dataset = [ { name => 'class', value => "IDENTICAL" },
563                         { name => 'id' , value => $id},
564                         { name => 'organism', value => "$organism"} ,
565                         { name => 'database', value => $who },
566                         { name => 'description' , value => $assignment}
567                         ];
568            push (@{$datasets_ref} ,$dataset);
569        }
570    
571    }
572    
573    
574  =head3 get_sims_and_bbhs() (internal)  =head3 get_sims_and_bbhs() (internal)
575    
576  This methods retrieves sims and also BBHs and fills the internal data structures.  This methods retrieves sims and also BBHs and fills the internal data structures.
# Line 583  Line 636 
636              display_method => '',              display_method => '',
637              feature_id => '',              feature_id => '',
638              rank => '',              rank => '',
639              supports_annotation => ''              supports_annotation => '',
640                id => '',
641                organism => '',
642                who => ''
643            };            };
644    
645    bless($self, 'Observation');    bless($self, 'Observation');
# Line 602  Line 658 
658    
659    return $self->{feature_id};    return $self->{feature_id};
660  }  }
661    
662    =head3 id (internal)
663    
664    Returns the ID  of the identical sequence
665    
666    =cut
667    
668    sub id {
669        my ($self) = @_;
670    
671        return $self->{id};
672    }
673    
674    =head3 organism (internal)
675    
676    Returns the organism  of the identical sequence
677    
678    =cut
679    
680    sub organism {
681        my ($self) = @_;
682    
683        return $self->{organism};
684    }
685    
686    =head3 database (internal)
687    
688    Returns the database of the identical sequence
689    
690    =cut
691    
692    sub database {
693        my ($self) = @_;
694    
695        return $self->{database};
696    }
697    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3