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

Diff of /FigKernelPackages/FIG.pm

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

revision 1.321, Wed Jul 27 19:41:56 2005 UTC revision 1.322, Thu Jul 28 18:03:24 2005 UTC
# Line 11  Line 11 
11  use Sim;  use Sim;
12  use Blast;  use Blast;
13  use FIG_Config;  use FIG_Config;
14    use FullLocation;
15  use tree_utilities;  use tree_utilities;
16  use Subsystem;  use Subsystem;
17  use SeedDas;  use SeedDas;
# Line 11297  Line 11298 
11298      return $x->{$fid};      return $x->{$fid};
11299  }  }
11300    
11301    
11302    =head3 call_start
11303    
11304    usage: $fig->call_start($genome,$loc,$translation,$against)
11305    
11306    This routine can be invoked to produce an estimate of the correct start, given
11307    a location in a genome believed to be a protein-encoding gene, along with a set
11308    of PEGs that are believed to be orthologs.  It returns a string representing
11309    the estimated start.
11310    
11311    =cut
11312    
11313    sub call_start {
11314        my($self,$genome,$loc,$tran,$against) = @_;
11315        my($peg);
11316    
11317        open(TMP,"| start_data_for_set_of_pegs use-close > $FIG_Config::temp/tmp.objects$$")
11318            || die "could not set up pipe to start_data_for_set_of_pegs";
11319        print TMP "new|$genome\.peg\.1\t$loc\t$tran\n";
11320        foreach $peg (@$against)
11321        {
11322            print TMP "$peg\tno_recall\n";
11323        }
11324        close(TMP);
11325    
11326        &FIG::run("predict_starts $FIG_Config::temp/tmp.objects$$ $FIG_Config::temp/clear$$ $FIG_Config::temp/proposed$$ > /dev/null");
11327        if (-s "$FIG_Config::temp/proposed$$")
11328        {
11329            my @changes = `changed_starts $FIG_Config::temp/proposed$$ /dev/null`;
11330            if ((@changes == 1) && ($changes[0] =~ /^\S+\t\S+\t(\S+)/))
11331            {
11332                unlink("$FIG_Config::temp/tmp.objects$$","$FIG_Config::temp/clear$$","$FIG_Config::temp/proposed$$");
11333                return $1;
11334            }
11335        }
11336        unlink("$FIG_Config::temp/tmp.objects$$","$FIG_Config::temp/clear$$","$FIG_Config::temp/proposed$$");
11337        return $loc;
11338    }
11339    
11340    
11341    =head3 call_start
11342    
11343    usage: $fig->pick_gene_boundaries($genome,$loc,$translation)
11344    
11345    This routine can be invoked to expand a region of similarity to potential
11346    gene boundaries.  It does not try to find the best start, but only the one that
11347    is first after the beginning of the ORF.  It returns a list containing
11348    the predicted location and the expanded translation.  Thus, you might use
11349    
11350    ($new_loc,$new_tran) = $fig->pick_gene_boundaries($genome,$loc,$tran);
11351    $recalled            = $fig->call_start($genome,$new_loc,$new_tran,\@others);
11352    
11353    to get the location of a recalled gene (in, for example, the process of correcting
11354    a frameshift).
11355    
11356    =cut
11357    
11358    sub pick_gene_boundaries {
11359        my($self,$genome,$loc,$tran) = @_;
11360    
11361        my $full_loc = new FullLocation($self,$genome,$loc,$tran);
11362    
11363        my $leftStop   = $full_loc->Search("taa|tga|tag",$full_loc->PrevPoint,"-",9000);
11364        my $firstStart = $full_loc->Search("atg|gtg|ttg",$leftStop,"+",9000);
11365        my $rightStop  = $full_loc->Search("taa|tga|tag",$full_loc->NextPoint,"+",9000);
11366        $full_loc->Extend($firstStart,$full_loc->Adjusted($rightStop,-1));
11367    
11368        return ($full_loc->SeedString,$full_loc->Translation);
11369    }
11370    
11371    
11372  =head3 change_location_of_feature  =head3 change_location_of_feature
11373    
11374  usage: $fig->change_location_of_feature($fid,$location,$translation)  usage: $fig->change_location_of_feature($fid,$location,$translation)

Legend:
Removed from v.1.321  
changed lines
  Added in v.1.322

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3