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

Diff of /FigKernelScripts/sphinx_index_genome.pl

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

revision 1.4, Mon Jun 7 18:47:41 2010 UTC revision 1.5, Mon Jun 7 20:55:01 2010 UTC
# Line 10  Line 10 
10  <sphinx:schema>  <sphinx:schema>
11  <sphinx:field name="fid"/>  <sphinx:field name="fid"/>
12  <sphinx:field name="annotation"/>  <sphinx:field name="annotation"/>
13  <sphinx:field name="content"/>  <sphinx:field name="genome"/>
14    <sphinx:field name="alias"/>
15    <sphinx:field name="subsystem"/>
16  </sphinx:schema>  </sphinx:schema>
17  END  END
18    
# Line 23  Line 25 
25      $gs =~ s/&/&amp;/g;      $gs =~ s/&/&amp;/g;
26      $gs =~ s/</&lt;/g;      $gs =~ s/</&lt;/g;
27      $gs =~ s/>/&gt;/g;      $gs =~ s/>/&gt;/g;
28      for my $feature (@{$fig->all_features_detailed_fast($genome)})  
29        my $all_data = $fig->all_features_detailed_fast($genome);
30        my $all_aliases = $fig->feature_aliases_bulk([ map { $_->[0] } @$all_data ]);
31        for my $feature (@$all_data)
32      {      {
33          my($fid, $loc, $aliases, $type, $b, $e, $func, $who) = @$feature;          my($fid, $loc, $aliases, $type, $b, $e, $func, $who) = @$feature;
34    
35            $aliases = $all_aliases->{$fid};
36    
37          my @ss = $fig->peg_to_subsystems($fid, 1, 1);          my @ss = $fig->peg_to_subsystems($fid, 1, 1);
38          @ss = map { defined($_) ? encode_utf8($_) : () } @ss;          @ss = map { defined($_) ? encode_utf8($_) : () } @ss;
39          my $ss = join("\n", map { s/_/ /g; $_ } @ss);          my $ss = join("\n", map { s/_/ /g; $_ } @ss);
# Line 38  Line 45 
45          $func =~ s/&/&amp;/g;          $func =~ s/&/&amp;/g;
46          $func =~ s/</&lt;/g;          $func =~ s/</&lt;/g;
47          $func =~ s/>/&gt;/g;          $func =~ s/>/&gt;/g;
48            if ($aliases)
49            {
50                $aliases = join("\n", @$aliases);
51          $aliases =~ s/&/&amp;/g;          $aliases =~ s/&/&amp;/g;
52          $aliases =~ s/</&lt;/g;          $aliases =~ s/</&lt;/g;
53          $aliases =~ s/>/&gt;/g;          $aliases =~ s/>/&gt;/g;
54          $aliases =~ s/,/ /g;          }
55          if ($fid =~ /^fig\|(\d+)\.(\d+)\.([^.]+)\.(\d+)$/)          if ($fid =~ /^fig\|(\d+)\.(\d+)\.([^.]+)\.(\d+)$/)
56          {          {
57              my ($g, $ext, $type, $num) = ($1, $2, $3, $4);              my ($g, $ext, $type, $num) = ($1, $2, $3, $4);
# Line 51  Line 61 
61  <sphinx:document id="$enc">  <sphinx:document id="$enc">
62  <fid>$fid</fid>  <fid>$fid</fid>
63  <annotation>$func</annotation>  <annotation>$func</annotation>
64  <content>$genome $gs  <genome>$genome $gs</genome>
65  $aliases  <alias>$aliases</alias>
66  $ss</content>  <subsystem>$ss</subsystem>
67  </sphinx:document>  </sphinx:document>
68  END  END
69          }          }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3