[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.12, Fri Jun 22 00:22:32 2007 UTC revision 1.13, Fri Jun 22 20:30:38 2007 UTC
# Line 1514  Line 1514 
1514    
1515  sub html_enc { $_ = $_[0]; s/\&/&amp;/g; s/\>/&gt;/g; s/\</&lt;/g; $_ }  sub html_enc { $_ = $_[0]; s/\&/&amp;/g; s/\>/&gt;/g; s/\</&lt;/g; $_ }
1516    
1517    
1518    
1519    ############################
1520    package Observation::Cluster;
1521    
1522    use base qw(Observation);
1523    
1524    sub new {
1525    
1526        my ($class,$dataset) = @_;
1527        my $self = $class->SUPER::new($dataset);
1528    
1529        bless($self,$class);
1530        return $self;
1531    }
1532    
1533    sub display {
1534        my ($self,$gd, $fid) = @_;
1535    
1536        my $fig = new FIG;
1537    
1538        #get the organism genome
1539        my $genome = $fig->genome_of($fid);
1540    
1541        # get location of the gene
1542        my $data = $fig->feature_location($fid);
1543        my ($contig, $beg, $end);
1544    
1545        if ($data =~ /(.*)_(\d+)_(\d+)$/){
1546            $contig = $1;
1547            $beg = $2;
1548            $end = $3;
1549        }
1550    
1551        my ($region_start, $region_end);
1552        if ($beg < $end)
1553        {
1554            $region_start = $beg - 4000;
1555            $region_end = $end+4000;
1556        }
1557        else
1558        {
1559            $region_end = $end+4000;
1560            $region_start = $beg-4000;
1561        }
1562    
1563        # call genes in region
1564        my ($features, $reg_beg, $reg_end) = $fig->genes_in_region($genome, $contig, $region_start, $region_stop);
1565    
1566        # call to see what is coupled to main peg
1567        my ($ref_coupled_to) = $fig->coupled_to($fid);
1568        my @coupled_to = @$ref_coupled_to;
1569        my @array = ();
1570    
1571        foreach my $key (@coupled_to)
1572        {
1573            my $coupled_peg = @$key[0];
1574            my $score = @$key[1];
1575    
1576            my $tmp = $score . "_" . $coupled_peg;
1577            push (@array, $tmp);
1578        }
1579    
1580        my @new_array = sort {lc($b) cmp lc($a)} (@array);
1581        my %hash = ();
1582        my $count = 2;
1583    
1584        foreach my $element (@new_array)
1585        {
1586            my ($score, $peg) = split ("_", $element);
1587            $hash{$peg} = $count;
1588            $count++;
1589        }
1590        foreach my $feature ($@genes_in_region)
1591        {
1592            # start populatign the $gd object (shapes and colors, links)
1593    
1594    
1595        }
1596    
1597        # call coupling_and_evidence
1598    
1599        # read through each result and get the top hit
1600    
1601        # call get_genes_in_region foreach of the top hit
1602    
1603        foreach $tophit (@whatever)
1604        {
1605            #populate $gd object with the top hits (shapes, colors, links);
1606    
1607        }
1608    
1609    

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3