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

Diff of /FigKernelScripts/parse_genbank.pl

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

revision 1.13, Mon May 29 00:04:13 2006 UTC revision 1.14, Thu Nov 30 20:52:40 2006 UTC
# Line 1  Line 1 
1    ########################################################################
2  #  #
3  # Copyright (c) 2003-2006 University of Chicago and Fellowship  # Copyright (c) 2003-2006 University of Chicago and Fellowship
4  # for Interpretations of Genomes. All Rights Reserved.  # for Interpretations of Genomes. All Rights Reserved.
# Line 99  Line 100 
100              next;              next;
101          }          }
102    
103          if ($record =~ /\n {0,4}ORGANISM\s+(\S[^\n]+\S)((\n\s{10,14}\S[^\n]+\S)+)/s)          if ($record =~ /\n {0,4}ORGANISM\s+(\S[^\n]+(\n\s{10,14}\S[^\n]+)*)/s)
104          {          {
105              $genome = $1;              my $block = $1;
106              $tax = $2;              my @lines = split(/\n/,$block);
107    
108                my @genome = ();
109                my @full_tax = ();
110                for ($i=0; ($i < @lines) && ($lines[$i] !~ /;/); $i++)
111                {
112                    push(@genome,$lines[$i]);
113                }
114                while ($i < @lines)
115                {
116                    push(@full_tax,$lines[$i]);
117                    $i++;
118                }
119    
120                $genome = join(" ",map { $_ =~ s/^\s*(\S.*\S).*$/$1/; $1 } @genome);
121                $tax    = join(" ",map { $_ =~ s/^\s*(\S.*\S).*$/$1/; $1 } @full_tax);
122    
123              $tax =~ s/\n\s+//g;              $tax =~ s/\n\s+//g;
124              $tax =~ s/ {2,}/ /g;              $tax =~ s/ {2,}/ /g;
125              if (! $written_genome)              if (! $written_genome)

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3