Changeset 235

Show
Ignore:
Timestamp:
07/14/09 23:23:44 (4 months ago)
Author:
cholt
Message:

fixed for abinit to pred_gff

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bin/maker2zff.pl

    r234 r235  
    4646my %exons = (); 
    4747my %hc = (); 
     48my %bad = (); 
    4849my %seq = (); 
    4950 
     
    6263 
    6364#### Go through the GFF file and determine which genes are HC  #### 
     65#### This step must finish before any output is produced since #### 
     66#### featues can be out of order #### 
     67 
     68my %index; #used to replace long maker names that mess up snap 
     69my $count = 0; 
    6470 
    6571foreach my $file (@files) { 
     
    96102                my $ishc = is_hc($qi, $AED); 
    97103                if ($ishc == 1 ) { 
    98                     $hc{$id} = 1
     104                    push(@{$hc{$seqid}}, $id)
    99105                } 
    100106            }elsif ($tag eq "CDS" && $source eq "maker") { 
    101107                my $parent = $annotation{'Parent'}; 
    102                 if ($strand eq "-") { 
    103                     my $temp = $start; 
    104                     $start = $end; 
    105                     $end = $temp; 
     108 
     109                #set alias 
     110                if(! $index{$parent}){ 
     111                    $index{$parent} = "MODEL$count"; 
     112                    $count++; 
    106113                } 
    107                 push @{$exons{$seqid}}, [$start, $end, $parent] 
     114 
     115                if($strand eq '-'){ 
     116                    ($start, $end) = ($end, $start); 
     117                } 
     118 
     119                push @{$exons{$seqid}{$parent}}, [$start, $end]; 
    108120            } 
    109121        } 
    110122    } 
    111123} 
     124 
     125#### Now filter out anything thats not high quality #### 
    112126 
    113127#### Print out the exon locations of the HC genes #### 
     
    116130open DNA, ">$outfile\.dna" or die $!; 
    117131 
    118 foreach my $seqid (sort {$a cmp $b} keys %exons) { 
    119     my @exons = @{$exons{$seqid}}; 
     132foreach my $seqid (sort {$a cmp $b} keys %hc) { 
    120133    print ZFF ">",$seqid,"\n"; 
    121134    print DNA ">",$seqid,"\n",$seq{$seqid},"\n"; 
    122     foreach my $e (@exons) { 
    123         my ($start, $end, $pname) = @{$e}; 
    124         if ($hc{$pname}) { 
    125             print ZFF join(" ", "Exon ",$start, $end, $pname),"\n"; 
     135 
     136    foreach my $mRNA (@{$hc{$seqid}}){ 
     137        my @exons = @{$exons{$seqid}{$mRNA}}; 
     138        my $pname = $index{$mRNA}; 
     139 
     140        next if (! @exons); 
     141 
     142        my $f = shift @exons; 
     143        if(! @exons){ 
     144            print ZFF join(" ", "Esngl ", $f->[0], $f->[1], $pname),"\n"; 
     145            next; 
     146        } 
     147        elsif($f->[0] < $f->[1]){ 
     148            print ZFF join(" ", "Einit ", $f->[0], $f->[1], $pname),"\n"; 
     149        } 
     150        else{ 
     151            print ZFF join(" ", "Eterm ", $f->[0], $f->[1], $pname),"\n"; 
     152        } 
     153 
     154        my $l = pop @exons; 
     155        if($l->[0] < $l->[1]){ 
     156            print ZFF join(" ", "Eterm ", $l->[0], $l->[1], $pname),"\n"; 
     157        } 
     158        else{ 
     159            print ZFF join(" ", "Einit ", $l->[0], $l->[1], $pname),"\n"; 
     160        } 
     161 
     162        foreach my $e (@exons) { 
     163            print ZFF join(" ", "Exon ", $e->[0], $e->[1], $pname),"\n"; 
    126164        } 
    127165    } 
    128166} 
     167 
     168close(ZFF); 
     169close(DNA); 
    129170 
    130171################## Subroutines ################### 
  • lib/GI.pm

    r232 r235  
    23162316   foreach my $p (@predictors) { 
    23172317       if ($p !~ /^snap$|^augustus$|^est2genome$|^fgenesh$/ && 
    2318            $p !~ /^genemark$|^jigsaw$|^model_gff$|^abinit$/ 
     2318           $p !~ /^genemark$|^jigsaw$|^model_gff$|^pred_gff$/ 
    23192319           ) { 
    23202320           $error .= "ERROR: Invalid predictor defined: $p\n". 
    2321                "Valid entries are: est2genome, model_gff, snap,\n". 
    2322                "genemark, augustus, fgenesh, and abinit\n\n"; 
     2321               "Valid entries are: est2genome, model_gff, pred_gff,\n". 
     2322               "snap, genemark, augustus, and fgenesh\n\n"; 
    23232323       } 
    23242324       else { 
  • lib/maker/auto_annotator.pm

    r202 r235  
    637637    } 
    638638     
    639     #---hint based gene prediction here 
     639    #---hint based gene prediction here (includes est2genome) 
    640640    foreach my $prdr (@{$CTL_OPTIONS->{_predictor}}){ 
    641         next if($prdr eq 'model_gff' || $prdr eq 'abinit' || $prdr eq 'genemark'); 
     641        next if($prdr eq 'model_gff' || $prdr eq 'pred_gff'); 
    642642        print STDERR "Producing $prdr hint based annotations\n" unless($main::quiet); 
    643643         
     
    673673                            $v_seq_ref, 
    674674                            $def, 
    675                             'abinit', 
     675                            'abinit', #all abinits not just pref_gff 
    676676                            $predictions, 
    677677                            $CTL_OPTIONS 
     
    683683                                   $chunk_number, 
    684684                                   $build, 
    685                                    'abinit', 
     685                                   'abinit', #all abinits not_just pred_gff 
    686686                                   $the_void, 
    687687                                   $CTL_OPTIONS 
    688688                                   ); 
    689      
    690     $annotations{'abinit'} = $all_ab; 
     689 
     690    $annotations{'abinit'} = $all_ab; #all abinit 
     691 
     692    #add abinits to their predictor type after they have been proccessed 
     693    #remeber they get treated differently so you want to add them as a 
     694    #seperate step. 
     695    foreach my $g (@$all_ab){ 
     696        if($g->{algorithm} =~ /^snap/i){ 
     697            push(@{$annotations{'snap'}}, $g); 
     698        } 
     699        elsif($g->{algorithm} =~ /^genemark/i){ 
     700            push(@{$annotations{'genemark'}}, $g); 
     701        } 
     702        elsif($g->{algorithm} =~ /^augustus/i){ 
     703            push(@{$annotations{'augustus'}}, $g); 
     704        } 
     705        elsif($g->{algorithm} =~ /^fgenesh/i){ 
     706            push(@{$annotations{'fgenesh'}}, $g); 
     707        } 
     708        elsif($g->{algorithm} =~ /^pred_gff/i){ 
     709            push(@{$annotations{'pred_gff'}}, $g); 
     710        } 
     711        else{ 
     712            die "ERROR: Not a supported algorithm: ".$g->{algorithm}."\n"; 
     713        } 
     714    } 
    691715     
    692716    add_abAED(\%annotations); 
    693  
    694     #fill genemark hint based with abinits since hints do not work 
    695     #but only if not using abinits already 
    696     if((grep {/^genemark$/} @{$CTL_OPTIONS->{_predictor}}) && 
    697        (! grep {/^abinit$/} @{$CTL_OPTIONS->{_predictor}}) 
    698       ){ 
    699         foreach my $g (@$all_ab){ 
    700             if($g->{algorithm} =~ /^genemark_masked$/i){ 
    701                 push(@{$annotations{'genemark'}}, $g); 
    702             } 
    703             elsif($CTL_OPTIONS->{_no_mask} && $g->{algorithm} =~ /^genemark$/i){ 
    704                 push(@{$annotations{'genemark'}}, $g); 
    705             } 
    706         } 
    707  
    708     } 
    709717 
    710718    return \%annotations; 
     
    789797    #collect all no UTR base models to get abAED 
    790798    foreach my $p (keys %$annotations){ 
     799        next if ($p eq 'abinit'); #these are redundant inside predictor type 
    791800        foreach my $g (@{$annotations->{$p}}){ 
    792801            if($g->{g_strand} == 1){ 
     
    851860    my @p_keepers; 
    852861    my @m_keepers; 
    853     if(@{$CTL_OPTIONS->{_predictor}} > 1 || grep {/^abinit$/} @{$CTL_OPTIONS->{_predictor}}){ 
     862 
     863    #keep all gff3 passthrough if there's nothing else 
     864    if(@{$CTL_OPTIONS->{_predictor}} == 1 && $CTL_OPTIONS->{_predictor}->[0] eq 'model_gff'){ 
     865        foreach my $g (@{$annotations->{'model_gff'}}){ 
     866            if($g->{g_strand} == 1){ 
     867                push(@p_keepers, $g); 
     868            } 
     869            elsif($g->{g_strand} == -1){ 
     870                push(@m_keepers, $g); 
     871            } 
     872        } 
     873    } 
     874    elsif(@{$CTL_OPTIONS->{_predictor}}){ 
    854875        #set up lists for plus and minus strands as well as possible mergers 
    855876        #predictor types are processed in the order given by control files 
     
    890911        push(@m_keepers, @$m_list); 
    891912    } 
    892     elsif(@{$CTL_OPTIONS->{_predictor}}){ 
    893         my $key = $CTL_OPTIONS->{_predictor}->[0]; 
    894         foreach my $g (@{$annotations->{$key}}){ 
    895             if($g->{g_strand} == 1){ 
    896                 push(@p_keepers, $g) if($g->{AED} < 1  || $key eq 'model_gff'); 
    897             } 
    898             elsif($g->{g_strand} == -1){ 
    899                 push(@m_keepers, $g) if($g->{AED} < 1  || $key eq 'model_gff'); 
    900             } 
    901         } 
    902     } 
    903913 
    904914    #remove CDS competition on opposite strand 
     
    12061216            next; 
    12071217        } 
    1208  
    1209         #------genemark does not have hints enabled  
    1210         return [] if ($predictor eq 'genemark'); 
    12111218         
    12121219        #------est2genome 
     
    12241231            next; 
    12251232        } 
     1233 
     1234        #------genemark does not have hints enabled  
     1235        return [] if ($predictor eq 'genemark'); 
    12261236         
    12271237        #------default hint based behavior 
     
    15441554   } 
    15451555    
    1546    #remove redundant tanscripts in gene 
     1556   #remove redundant transcripts in gene 
    15471557   my @keepers; 
    15481558   foreach my $c (@{$careful_clusters}) { 
     
    18501860#that don't overlap maker's final annotation set. The non-overlapping 
    18511861#set is filtered using abAED so that they don't overlap each other. 
     1862#Only masked ab inits are considered (otherwise I get a lot of revere 
     1863#transcriptase genes).  Unmasked are allowed when there is no masking 
     1864#performed. 
    18521865 
    18531866sub get_non_overlaping_abinits { 
     
    18741887   } 
    18751888 
    1876    #separate abinits by strand 
     1889   #separate abinits by strand (only masked unless I'm not masking) 
    18771890   my @p_ab; 
    18781891   my @m_ab;