~ubuntu-branches/ubuntu/precise/bioperl/precise

« back to all changes in this revision

Viewing changes to scripts/Bio-DB-GFF/genbank2gff3.PLS

  • Committer: Bazaar Package Importer
  • Author(s): Ilya Barygin
  • Date: 2010-01-27 22:48:22 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100127224822-ebot4qbrjxcv38au
Tags: 1.6.1-1ubuntu1
* Merge from Debian testing, remaining changes:
  - disable tests, they produce a FTBFS trying to access the network 
    during run.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/perl -w
2
2
 
3
 
#$Id: genbank2gff3.PLS 15088 2008-12-04 02:49:09Z bosborne $;
 
3
#$Id: genbank2gff3.PLS 15505 2009-02-05 18:22:58Z cjfields $;
4
4
 
5
5
=pod
6
6
 
684
684
      || $seq->annotation->get_Annotations("update-date")
685
685
      || $is_rich ? $seq->get_dates() : ();
686
686
  my ($comment)= $seq->annotation->get_Annotations("comment");
687
 
  my ($species)= $seq->annotation->get_Annotations("species") 
688
 
               || ( $seq->can('species') ? $seq->species()->binomial() : undef );
689
 
               
 
687
  my ($species)= $seq->annotation->get_Annotations("species");
 
688
  if (!$species 
 
689
       && $seq->can('species') 
 
690
       && defined $seq->species() 
 
691
       && $seq->species()->can('binomial') ) {
 
692
    $species= $seq->species()->binomial();
 
693
  }
 
694
 
690
695
  # update source feature with main GB fields
691
696
  $sf->add_tag_value( ID => $seq_name ) unless $sf->has_tag('ID');
692
697
  $sf->add_tag_value( Note => $desc ) if($desc && ! $sf->has_tag('Note'));
699
704
  foreach my $atag (sort keys %AnnotTagMap) {
700
705
    my $gtag= $AnnotTagMap{$atag}; next unless($gtag);
701
706
    my @anno = map{ 
702
 
          ref $_
703
 
         ? split( /[,;] */, $_->value) 
704
 
         : split( /[,;] */, "$_") if($_);
705
 
         } $seq->annotation->get_Annotations($atag);  
 
707
         if (ref $_ && $_->can('get_all_values')) { 
 
708
             split( /[,;] */, join ";", $_->get_all_values) 
 
709
         }
 
710
         elsif (ref $_ && $_->can('display_text')) { 
 
711
             split( /[,;] */, $_->display_text) 
 
712
         }
 
713
         elsif (ref $_ && $_->can('value')) { 
 
714
             split( /[,;] */, $_->value) 
 
715
         } 
 
716
         else {
 
717
             ();
 
718
         }
 
719
       } $seq->annotation->get_Annotations($atag);  
706
720
    foreach(@anno) { $sf->add_tag_value( $gtag => $_ ); }
707
721
    }
708
722