2402
2403
# SPECIAL CASE FOR /ribosomal_slippage
2403
2404
# See: http://www.ncbi.nlm.nih.gov/collab/FT/
2404
2405
if (!$inside && $sf->has_tag('ribosomal_slippage')) {
2405
2406
if ($self->verbose > 0) {
2406
2407
printf STDERR " Checking for ribosomal_slippage\n";
2410
# TODO: rewrite this to match introns;
2411
# each slippage will be a "fake" small CDS exon
2408
2412
my @transcript_splice_sites = @container_coords;
2409
2413
my @cds_splice_sites = @coords;
2414
##printf STDERR "xxTR SSs: @transcript_splice_sites :: %s\n", $_->get_tag_values('product');
2415
##printf STDERR "xxCD SSs: @cds_splice_sites :: %s\n\n", $sf->get_tag_values('product');
2410
2417
# find the the first splice site within the CDS
2411
2418
while (scalar(@transcript_splice_sites) &&
2412
2419
$transcript_splice_sites[0] < $cds_splice_sites[0]) {
2413
2420
shift @transcript_splice_sites;
2416
if ($transcript_splice_sites[0] == $cds_splice_sites[0]) {
2423
##print STDERR "TR SSs: @transcript_splice_sites\n";
2424
##print STDERR "CD SSs: @cds_splice_sites\n\n";
2426
if (!(scalar(@transcript_splice_sites)) ||
2427
$transcript_splice_sites[0] == $cds_splice_sites[0]) {
2429
# we will now try and align all splice remaining sites in the transcript and CDS;
2430
# any splice site that can't be aligned is assumed to be a ribosomal slippage
2417
2432
my @slips = ();
2418
2433
my $in_exon = 1;
2419
2434
$inside = 1; # innocent until proven guilty..
2420
2435
while (@cds_splice_sites) {
2421
2436
if (!@transcript_splice_sites) {
2422
$inside = 0; # guilty!
2438
# ribosomal slippage is after the last transcript splice site
2439
# Example: (NC_00007, isoform 3 of PEG10)
2440
# mRNA join(85682..85903,92646..99007)
2441
# mRNA join(85682..85903,92646..99007)
2442
# CDS join(85899..85903,92646..93825,93825..94994)
2444
# OR: None of the splice sites align;
2445
# may be a single CDS exon with one slippage inside it.
2446
# Example: (NC_00007, isoform 4 of PEG10)
2447
# mRNA join(85637..85892,92646..99007)
2448
# CDS join(92767..93825,93825..94994)
2450
# Yes, this code is repeated below...
2451
my $p1 = shift @cds_splice_sites;
2452
my $p2 = shift @cds_splice_sites;
2453
if ($self->verbose > 0) {
2454
printf STDERR " Found the ribosomal_slippage: $p1..$p2\n";
2456
push(@slips, ($p2-$p1)-1);
2425
if ($cds_splice_sites[0] == $transcript_splice_sites[0]) {
2458
elsif ($cds_splice_sites[0] == $transcript_splice_sites[0]) {
2459
# splice sites align: this is not the slippage
2426
2460
shift @cds_splice_sites;
2427
2461
shift @transcript_splice_sites;
2462
##print STDERR "MATCH\n";