[Bio] / FigKernelScripts / genbank2gff3.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/genbank2gff3.pl

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

revision 1.2, Wed Aug 10 15:11:28 2005 UTC revision 1.3, Wed Aug 10 15:33:59 2005 UTC
# Line 51  Line 51 
51    #$feat is a Bio::SeqFeature::Generic    #$feat is a Bio::SeqFeature::Generic
52    my @gff3;    my @gff3;
53    my $col9;    my $col9;
54    my $id; my $label;    my $id; my $label; my $peg;
55    if ($feature->primary_tag eq "CDS")    if ($feature->primary_tag eq "CDS")
56    {    {
57     $id="fig|".$genomeid.".peg.".++$genecount;     $peg="fig|".$genomeid.".peg.".++$genecount;
58     $label="cds";     $label="cds";
59       $id="cds.".$genecount;
60     # translate the protein. Here we actually make a new sequence object containing the DNA sequence and then use bioperl to     # translate the protein. Here we actually make a new sequence object containing the DNA sequence and then use bioperl to
61     # do the translation. There are some things in bioperl that return objects (like translate) and somethings that don't (like subseq)     # do the translation. There are some things in bioperl that return objects (like translate) and somethings that don't (like subseq)
62     # note we also need a rev comp if the strand is -1. If we don't know the strand (or it is not -1) we return the forward translation     # note we also need a rev comp if the strand is -1. If we don't know the strand (or it is not -1) we return the forward translation
# Line 68  Line 69 
69    }    }
70    elsif ($feature->primary_tag eq "tRNA" || $feature->primary_tag eq "rRNA")    elsif ($feature->primary_tag eq "tRNA" || $feature->primary_tag eq "rRNA")
71    {    {
72     $id="fig|".$genomeid.".rna.".++$rnacount;     $peg="fig|".$genomeid.".rna.".++$rnacount;
73     $label=$feature->primary_tag;     $label=$feature->primary_tag;
74       $id="rna.".$rnacount;
75    }    }
76    elsif ($feature->primary_tag eq "gene")    elsif ($feature->primary_tag eq "gene")
77    {    {
# Line 93  Line 95 
95      push @{$col9->{$tag}}, $feature->get_tag_values($tag)      push @{$col9->{$tag}}, $feature->get_tag_values($tag)
96    }    }
97    
98    push @gff3, join(";", map {"$_=" . uri_escape(join(",", @{$col9->{$_}}))} keys %$col9);    push @gff3, join(";", "ID=$id", map {"$_=" . uri_escape(join(",", @{$col9->{$_}}))} keys %$col9);
99    print join("\t", @gff3), "\n";    print join("\t", @gff3), "\n";
100   }   }
101   # now print out the translations   # now print out the translations

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3