[Bio] / FigKernelPackages / gjogenbank.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/gjogenbank.pm

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

revision 1.15, Fri Dec 11 21:05:09 2015 UTC revision 1.16, Wed Jul 27 17:46:37 2016 UTC
# Line 150  Line 150 
150  #  #
151  #     $gene              = gene( $ftr )  #     $gene              = gene( $ftr )
152  #     @gene_and_synonyms = gene( $ftr )  #     @gene_and_synonyms = gene( $ftr )
153    #
154  #     $product = product( $ftr )  #     $product = product( $ftr )
155  #  #
156  #     @EC_number = EC_number( $ftr )  #     @EC_number = EC_number( $ftr )
# Line 540  Line 540 
540                  # Long genome names may split into additional lines in the value; we need                  # Long genome names may split into additional lines in the value; we need
541                  # to bring them into the org name. We will bring in values until we get                  # to bring them into the org name. We will bring in values until we get
542                  # one with a ; since that begins the taxonomy.                  # one with a ; since that begins the taxonomy.
543                    #
544                  $entry{ ORGANISM } = $org;                  $entry{ ORGANISM } = $org;
545                  while (@value && $value[0] !~ /\.$/ && $value[0] !~ /;/)                  while (@value && $value[0] !~ /\.$/ && $value[0] !~ /;/)
546                  {                  {
# Line 660  Line 661 
661                  else                  else
662                  {                  {
663                      $value =~ s/""/"/g  if $value =~ s/^"(.*)"$/$1/;                      $value =~ s/""/"/g  if $value =~ s/^"(.*)"$/$1/;
664                        $value =~ s/ +$//;
665                      $value =~ s/ +//g   if $qualif eq 'translation';                      $value =~ s/ +//g   if $qualif eq 'translation';
666                  }                  }
667    
# Line 1076  Line 1078 
1078  {  {
1079      my ( $ftr ) = @_;      my ( $ftr ) = @_;
1080    
1081      ( defined( $ftr )      defined( $ftr ) && ( ref( $ftr ) eq 'ARRAY' ) && ( @$ftr > 1 ) ? $ftr->[-2]
          && ( ref( $ftr ) eq 'ARRAY' )  
          && ( @$ftr > 1 ) )  
          ? $ftr->[-2]  
1082           : '';           : '';
1083  }  }
1084    
# Line 1361  Line 1360 
1360  #===============================================================================  #===============================================================================
1361  #  Utilities for locations and location strings.  #  Utilities for locations and location strings.
1362  #===============================================================================  #===============================================================================
1363  #  Convert GenBank location to a SEED location.  #  Convert GenBank location to a SEED location string.
1364  #  #
1365  #     $loc                           = genbank_loc_2_seed( $acc, $loc )  #     $loc                           = genbank_loc_2_seed( $acc, $loc )
1366  #   ( $loc, $partial_5, $partial_3 ) = genbank_loc_2_seed( $acc, $loc )  #   ( $loc, $partial_5, $partial_3 ) = genbank_loc_2_seed( $acc, $loc )
# Line 1376  Line 1375 
1375    
1376    
1377  #-------------------------------------------------------------------------------  #-------------------------------------------------------------------------------
1378  #  Convert GenBank location to a Sapling location.  #  Convert GenBank location to a Sapling location string.
1379  #  #
1380  #     $loc                           = genbank_loc_2_sapling( $acc, $loc )  #     $loc                           = genbank_loc_2_sapling( $acc, $loc )
1381  #   ( $loc, $partial_5, $partial_3 ) = genbank_loc_2_sapling( $acc, $loc )  #   ( $loc, $partial_5, $partial_3 ) = genbank_loc_2_sapling( $acc, $loc )
# Line 1496  Line 1495 
1495  #  #
1496  #    (\S+:)?<?\d+\.\.>?\d+  #    (\S+:)?<?\d+\.\.>?\d+
1497  #  #
1498    #      \@cbdl_list                           = gb_loc_range( $loc, $acc )
1499  #    ( \@cbdl_list, $partial_5, $partial_3 ) = gb_loc_range( $loc, $acc )  #    ( \@cbdl_list, $partial_5, $partial_3 ) = gb_loc_range( $loc, $acc )
1500  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1501  sub gb_loc_range  sub gb_loc_range
# Line 1510  Line 1510 
1510    
1511      #  GenBank standard is always $beg <= $end.  We will relax that.      #  GenBank standard is always $beg <= $end.  We will relax that.
1512    
1513      ( [ [ $acc2, $beg, (($end>=$beg)?'+':'-'), abs($end-$beg)+1 ] ], $p5, $p3 );      my $cbdl = [ [ $acc2, $beg, (($end>=$beg)?'+':'-'), abs($end-$beg)+1 ] ];
1514    
1515        wantarray ? ( $cbdl, $p5, $p3 ) : $cbdl;
1516  }  }
1517    
1518    
# Line 1521  Line 1523 
1523  #  #
1524  #    (\S+:)?<?\d+^>?\d+  #    (\S+:)?<?\d+^>?\d+
1525  #  #
1526    #      \@cbdl_list                           = gb_loc_site( $loc, $acc )
1527  #    ( \@cbdl_list, $partial_5, $partial_3 ) = gb_loc_site( $loc, $acc )  #    ( \@cbdl_list, $partial_5, $partial_3 ) = gb_loc_site( $loc, $acc )
1528  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1529  sub gb_loc_site  sub gb_loc_site
# Line 1535  Line 1538 
1538    
1539      #  GenBank standard is always $beg <= $end.  We will relax that.      #  GenBank standard is always $beg <= $end.  We will relax that.
1540    
1541      ( [ [ $acc2, $beg, (($end>=$beg)?'+':'-'), abs($end-$beg)+1 ] ], $p5, $p3 );      my $cbdl = [ [ $acc2, $beg, (($end>=$beg)?'+':'-'), abs($end-$beg)+1 ] ];
1542    
1543        wantarray ? ( $cbdl, $p5, $p3 ) : $cbdl;
1544  }  }
1545    
1546    
# Line 1544  Line 1549 
1549  #  #
1550  #    (\S+:)?\d+  #    (\S+:)?\d+
1551  #  #
1552    #      \@cbdl_list                           = gb_loc_position( $loc, $acc )
1553  #    ( \@cbdl_list, $partial_5, $partial_3 ) = gb_loc_position( $loc, $acc )  #    ( \@cbdl_list, $partial_5, $partial_3 ) = gb_loc_position( $loc, $acc )
1554  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1555  sub gb_loc_position  sub gb_loc_position
# Line 1555  Line 1561 
1561      my ( $acc2, $beg ) = $loc =~ /^$position_parts$/;      my ( $acc2, $beg ) = $loc =~ /^$position_parts$/;
1562      $beg or return ();      $beg or return ();
1563    
1564      ( [ [ $acc2 || $acc, $beg, '+', 1 ] ], '', '' );      my $cbdl = [ [ $acc2 || $acc, $beg, '+', 1 ] ];
1565    
1566        wantarray ? ( $cbdl, '', '' ) : $cbdl;
1567  }  }
1568    
1569    
1570  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1571    #      \@cbdl_list                           = gb_loc_complement( $loc, $acc )
1572  #    ( \@cbdl_list, $partial_5, $partial_3 ) = gb_loc_complement( $loc, $acc )  #    ( \@cbdl_list, $partial_5, $partial_3 ) = gb_loc_complement( $loc, $acc )
1573  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1574  sub gb_loc_complement  sub gb_loc_complement
# Line 1579  Line 1588 
1588      my ( $locs, $p5, $p3 ) = genbank_loc_2_cbdl( $loc2, $acc2 || $acc );      my ( $locs, $p5, $p3 ) = genbank_loc_2_cbdl( $loc2, $acc2 || $acc );
1589      $locs && ref( $locs ) eq 'ARRAY' && @$locs or return ();      $locs && ref( $locs ) eq 'ARRAY' && @$locs or return ();
1590    
1591      ( [ map { complement_cbdl( @$_ ) } reverse @$locs ], $p3, $p5 );      my $cbdl = [ map { complement_cbdl( @$_ ) } reverse @$locs ];
1592    
1593        wantarray ? ( $cbdl, $p5, $p3 ) : $cbdl;
1594  }  }
1595    
1596    
1597  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1598  #  #
1599    #      \@cbdl_list                           = gb_loc_join( $loc, $acc )
1600  #    ( \@cbdl_list, $partial_5, $partial_3 ) = gb_loc_join( $loc, $acc )  #    ( \@cbdl_list, $partial_5, $partial_3 ) = gb_loc_join( $loc, $acc )
1601  #  #
1602  #  There is no warning about partial sequences internal to list.  #  There is no warning about partial sequences internal to list.
# Line 1618  Line 1630 
1630                     $locs =~ m/($element)/g;                     $locs =~ m/($element)/g;
1631      @elements or return ();      @elements or return ();
1632    
1633      ( [ map { @{ $_->[0] } } @elements ], $elements[0]->[1], $elements[-1]->[2] );      my $cbdl = [ map { @{ $_->[0] } } @elements ];
1634    
1635        wantarray ? ( $cbdl, $elements[0]->[1], $elements[-1]->[2] ) : $cbdl;
1636  }  }
1637    
1638    
1639  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1640  #  Ordered list is treated as a join:  #  Ordered list is treated as a join:
1641  #  #
1642    #      \@cbdl_list                           = gb_loc_order( $loc, $acc )
1643  #    ( \@cbdl_list, $partial_5, $partial_3 ) = gb_loc_order( $loc, $acc )  #    ( \@cbdl_list, $partial_5, $partial_3 ) = gb_loc_order( $loc, $acc )
1644  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1645  sub gb_loc_order  sub gb_loc_order

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3