~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to Bio/DB/GFF/Adaptor/dbi/pg_fts.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package Bio::DB::GFF::Adaptor::dbi::pg_fts;
2
2
 
3
 
# $Id: pg_fts.pm,v 1.2.4.1 2006/10/02 23:10:16 sendu Exp $
 
3
# $Id: pg_fts.pm 11724 2007-10-16 19:28:22Z lstein $
4
4
 
5
5
=head1 NAME
6
6
 
141
141
use base qw(Bio::DB::GFF::Adaptor::dbi::pg);
142
142
 
143
143
use constant FULLTEXTSEARCH => <<END;
144
 
SELECT distinct gclass,gname,fattribute_value
145
 
    FROM fgroup,fattribute_to_feature,fdata
 
144
SELECT distinct gclass,gname,fattribute_value,fmethod,fsource
 
145
    FROM fgroup,fattribute_to_feature,fdata,ftype
146
146
     WHERE fgroup.gid=fdata.gid
147
147
       AND fdata.fid=fattribute_to_feature.fid
 
148
       AND fdata.ftypeid=ftype.ftypeid
148
149
       AND (fattribute_to_feature.idxfti @@ to_tsquery('default', ?))
149
150
END
150
151
;
151
152
 
152
153
use constant FULLTEXTWILDCARD => <<END;
153
 
SELECT distinct gclass,gname,fattribute_value
154
 
    FROM fgroup,fattribute_to_feature,fdata
 
154
SELECT distinct gclass,gname,fattribute_value,fmethod,fsource
 
155
    FROM fgroup,fattribute_to_feature,fdata,ftype
155
156
     WHERE fgroup.gid=fdata.gid
156
157
       AND fdata.fid=fattribute_to_feature.fid
 
158
       AND fdata.ftypeid=ftype.ftypeid
157
159
       AND lower(fattribute_to_feature.fattribute_value) LIKE lower(?)
158
160
END
159
161
;
212
214
  } 
213
215
  
214
216
  my @results;
215
 
  while (my ($class,$name,$note) = $sth->fetchrow_array) {
 
217
  while (my ($class,$name,$note,$method,$source) = $sth->fetchrow_array) {
216
218
 
217
219
     next unless $class && $name;    # sorry, ignore NULL objects
218
220
     my $featname = Bio::DB::GFF::Featname->new($class=>$name);
219
 
 
220
 
     push @results,[$featname,$note,0]; #gbrowse expects a score, but
221
 
                                        #pg doesn't give one, thus the 0
 
221
     my $type     = Bio::DB::GFF::Typename->new($method,$source);
 
222
     push @results,[$featname,$note,0,$type]; #gbrowse expects a score, but
 
223
                                              #pg doesn't give one, thus the 0
222
224
  }
223
225
 
224
226
  return @results;