[Bioperl-l] Bio::Tools::Genemark question

Heikki Lehvaslaiho heikki at ebi.ac.uk
Thu Apr 24 10:43:49 EDT 2003


Charles,

You are absolutely right. The mistake seems to be in adding the gene
into prediction array only when a line with a new gene is parsed. You
can fix it by removing the line marked '## old' and adding it into '##
new'. It will be in CVS shortly.


	    if($prednr != $current_gene_no) {
 	        # a new gene, store the old one if it exists
		if (defined ($gene)) {
		    $gene->seq_id($seqname);
                    #$self->_add_prediction($gene);    ## old	
		    $gene = undef ;
		}
		#and make a new one
		$gene = Bio::Tools::Prediction::Gene->new
		    (
		     '-primary' => "GenePrediction$prednr",
		     '-source' => $prediction_source);
                $self->_add_prediction($gene);		## new
		$current_gene_no = $prednr;
	    } 

Yours,
	-Heikki

On Wed, 2003-04-23 at 21:11, Charles Hauser wrote:
> Hi,
> 
> I'm trying to generate GFF files from GeneMark gene model predictions.
> 
> Problem is my script is not parsing the last gene entry in the file.
> 
> In example below, script fails to parse gene #63.  I tried appending a
> duplicate copy of the gene 63 data to the end of the file (2 copies) to
> no avail. 
> 
> Charles
> 
> 
> 
> synopsis:
> 
> my $Genemark = Bio::Tools::Genemark->new(-file => $infile);
> 
> while(my $gene = $Genemark->next_prediction()) {
>     foreach my $feat (@exon_arr) {
> 	my @tags = $feat->get_all_tags();
> 	$feat->seq_id($scaffold);
> 	$feat->source_tag('GeneMark');
> 	$feat->add_tag_value('genemark','genemark_'.$num_scaffold .".".$ver);
> 	$gffout->write_feature($feat);
>     }
> }
> 
> 
> data:
> 
> GeneMark.hmm (Version 2.2a)
> Sequence name: scaffold_1
> Sequence length: 376197 bp
> G+C content: 64.06%
> Matrix: Chlamydomonas reinhardtii
> Wed Apr 23 15:35:57 2003
> 
> Predicted genes/exons
> 
> Gene Exon Strand Exon           Exon Range     Exon      Start/End
>   #    #         Type                         Length       Frame
> 
>   1     3   -  Terminal      8808      8854      47          3 2
>   1     2   -  Internal      8962      9023      62          1 3
>   1     1   -  Initial       9198      9226      29          2 1
> 
> <snip>
> 
> 
>  62     1   +  Initial     364788    364821      34          1 1
>  62     2   +  Internal    365037    365139     103          2 2
>  62     3   +  Internal    365362    365419      58          3 3
>  62     4   +  Internal    365848    365950     103          1 1
>  62     5   +  Internal    366152    366225      74          2 3
>  62     6   +  Internal    366671    366827     157          1 1
>  62     7   +  Internal    367066    367219     154          2 2
>  62     8   +  Internal    367915    368032     118          3 3
>  62     9   +  Terminal    368348    368359      12          1 3
> 
>  63     2   -  Terminal    369209    369289      81          3 1
>  63     1   -  Internal    369503    369719     217          3 3
> 
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
-- 
______ _/      _/_____________________________________________________
      _/      _/                      http://www.ebi.ac.uk/mutations/
     _/  _/  _/  Heikki Lehvaslaiho          heikki at ebi.ac.uk
    _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
   _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
  _/  _/  _/  Cambs. CB10 1SD, United Kingdom
     _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
___ _/_/_/_/_/________________________________________________________



More information about the Bioperl-l mailing list