Changeset 194 for plone4bio.base/trunk

Show
Ignore:
Timestamp:
03/16/11 14:43:47 (14 months ago)
Author:
andrea
Message:

- aggiornato alla versione completa: colori e info per un maggiorn numero di

feature types

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plone4bio.base/trunk/src/plone4bio/base/png/perl/graphics.pm

    r119 r194  
    5252      TRANSIT => "gold", 
    5353      transit_peptide => "gold", 
    54       mat_peptide => "aquamarine",  
     54      mat_peptide => "aquamarine", 
    5555      PIRSF => "chartreuse", 
    5656      proprotein => "crimson", 
     57      ACT_SITE => "red", 
     58      METAL => "gold", 
     59      MOTIF => "green", 
     60      PROPEP => "azure", 
     61      HELIX => "red", 
     62      MOD_RES => "darkolivegreen", 
     63      MUTAGEN => "deeppink", 
     64      CARBOHYD => "greenyellow", 
     65      SITE => "maroon", 
     66      STRAND => "gold", 
     67      TURN => "mediumslateblue", 
     68      BINDING => "slateblue", 
     69      gene => "red", 
     70      polyA_signal => "fuchsia", 
     71      repeat_region => "green", 
     72      ncRNA => "blueviolet", 
     73      rep_origin => "mediumspringgreen", 
     74      variation => "yellow", 
     75      alpha_helix => "red", 
     76      beta_strand => "yellow", 
     77      transmembrane_region => "crimson", 
     78      cytoplasmic_region => "mediumblue", 
     79      non_cytoplasmic_region => "lightskyblue", 
     80      coiled_coil => "olivedrab", 
     81      peptide_coil => "aliceblue", 
     82      signal_peptide => "gold", 
    5783); 
    5884 
     
    76102      TIGRFAM => 1, 
    77103      PIRSF => 1, 
     104      CDS => 1, 
     105      gene => 1, 
     106      polyA_signal => 1, 
     107      repeat_region => 1, 
    78108); 
    79109 
     
    93123      CDS => \&ft_gene_description, 
    94124      source => \&source_map_description, 
    95       VARIANT => \&description,      
     125      VARIANT => \&description, 
    96126      CHAIN => \&description, 
    97127      Profile => \&hit_id_description, 
    98       Prosite_pattern => \&hit_id_description,  
    99       PROSITE => \&hit_id_description,  
    100       Prosite => \&hit_id_description,  
     128      Prosite_pattern => \&hit_id_description, 
     129      PROSITE => \&hit_id_description, 
     130      Prosite => \&hit_id_description, 
    101131      COMPBIAS => \&description, 
    102132      CONFLICT => \&description, 
     
    112142      PIRSF => \&hit_id_description, 
    113143      proprotein => \&note_description, 
     144      ACT_SITE => \&description, 
     145      METAL => \&description, 
     146      MOTIF => \&description, 
     147      PROPEP => \&description, 
     148      HELIX => \&description, 
     149      MOD_RES => \&description, 
     150      MUTAGEN => \&description, 
     151      CARBOHYD => \&description, 
     152      SITE => \&description, 
     153      STRAND => \&description, 
     154      TURN => \&description, 
     155      BINDING =>  \&description, 
     156      gene => \&ft_gene_description, 
     157      polyA_signal => \&ft_note_gene, 
     158      repeat_region => \&ft_note_rpt_type, 
     159      ncRNA => \&ft_note_gene, 
     160      rep_origin => \&note_description, 
     161      variation => \&note_description, 
    114162); 
    115163 
     
    120168      CONFLICT => "pinsertion", 
    121169      VAR_SEQ => "pinsertion", 
     170      METAL => "pinsertion", 
     171      CARBOHYD => "pinsertion", 
     172      BINDING => "pinsertion", 
     173      CDS => "transcript2", 
     174      gene => "transcript2", 
     175      polyA_signal => "transcript2", 
     176      repeat_region => "anchored_arrow", 
     177      variation => "pinsertion", 
    122178); 
    123179 
     
    314370} 
    315371 
     372sub ft_note_gene { 
     373  my $feature = shift; 
     374  my @notes1; 
     375  my @notes2; 
     376  foreach (qw(note)) { 
     377    @notes1 = eval{$feature->get_tag_values($_)}; 
     378    last; 
     379  } 
     380  foreach (qw(gene)) { 
     381    @notes2 = eval{$feature->get_tag_values($_)}; 
     382    last; 
     383  } 
     384  my $note = $notes1[0] . $notes2[0]; 
     385  return unless $note; 
     386  substr($note,120) = '...' if length $note > 120; 
     387  $note; 
     388} 
    316389 
    317390sub ft_gene_description { 
     
    358431} 
    359432 
     433sub ft_note_rpt_type { 
     434 my $feature = shift; 
     435  my @notes1; 
     436  my @notes2; 
     437  my @notes3; 
     438  foreach (qw(note)) { 
     439    @notes1 = eval{$feature->get_tag_values($_)}; 
     440    last; 
     441  } 
     442  foreach (qw(experiment)) { 
     443    @notes2 = eval{$feature->get_tag_values($_)}; 
     444    last; 
     445  } 
     446  foreach (qw(rpt_type)) { 
     447    @notes3 = eval{$feature->get_tag_values($_)}; 
     448    last; 
     449  } 
     450  my $note1 = ''; 
     451  my $note2 = ''; 
     452  my $note3 = ''; 
     453  my $note1 = 'note: '.$notes1[0] if  length $notes1[0] > 1; 
     454  my $note1 = 'note: '.$notes2[0] if  length $notes2[0] > 1; 
     455  my $note2 = 'rpt_type: '.$notes3[0] if  length $notes3[0] > 1; 
     456  my $note = $note1 . " " . $note2; 
     457  return unless $note; 
     458  substr($note,120) = '...' if length $note > 120; 
     459  $note; 
     460} 
     461 
    360462sub description { 
    361463 my $feature = shift;