[Bioperl-l] gff to embl or genbank

Jason Stajich jason.stajich at duke.edu
Wed Feb 9 18:57:42 EST 2005


It is probably easiest to just group things and make a split location.  
You will have the most control over the objects you create.

my %genes;
while( my $f = $gff->next_feature ) {
   my ($group) = $feature->get_tag_values('Group'); # substitute group 
with whatever you have in the group field
  push @{$gene{$group}}, $feature;
}
# get a Bio::Seq object called $seq somehow, either by reading in a 
fasta sequence file, etc...
while( my ($gene,$features) = each %genes ) {
  my $location = Bio::Location::Split->new();
  for my $f ( @$features ) {
    $location->add_sub_Location($f->location);
  }
  my $genef = Bio::SeqFeature::Generic->new(-location =>$location, 
-primary_tag => 'CDS');
  $seq->add_SeqFeature($genef);
}
my $seqio = Bio::SeqIO->new(-format => 'genbank');
$seqio->write_seq($seq);

-jason
--
Jason Stajich
jason.stajich at duke.edu
http://www.duke.edu/~jes12/

On Feb 9, 2005, at 4:23 PM, Jianli Dai wrote:

> I am trying to combine a gff file and a fasta to an
> embl or genbank file. I have tried Marc Logghe's
> suggestion
> (http://portal.open-bio.org/pipermail/bioperl-l/2004-June/016247.html).
> It converts every exon into 1 feature. I want to
> combined them into 1 gene which has several locations
> of exons. I have tried to put exons into a
> Bio::SeqFeature::Gene::GeneStructure object and then
> add_SeqFeature to the Bio::SeqIO fasta sequence. It
> gave me this error:"MSG:
> Bio::SeqFeature::Generic=HASH(0x8012b8) does not
> implement Bio::SeqFeature::Gene::ExonI". Please help.
> Jianli
>
>
>
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Find what you need with new enhanced search.
> http://info.mail.yahoo.com/mail_250
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://portal.open-bio.org/pipermail/bioperl-l/attachments/20050209/3fdd543e/PGP.bin


More information about the Bioperl-l mailing list