File: Profile.pm

package info (click to toggle)
psortb 3.0.6%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 121,044 kB
  • sloc: perl: 3,652; ansic: 698; cpp: 338; sh: 27; makefile: 23
file content (65 lines) | stat: -rw-r--r-- 1,614 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package Bio::Tools::PSort::Module::Profile;

use Bio::Tools::PSort::Module::AnalysisI;
use Bio::Tools::PSort::Report::Result;
use Bio::Tools::PSort::Profile;

use vars qw(@ISA);
@ISA = qw(Bio::Tools::PSort::Module::AnalysisI);

use strict;

sub new {
  my ($class, @args) = @_;
  my $self = $class->SUPER::new(@args);

  #profile module must receive: 1 the path to the prosite profiles 2. the path to pfscan, 3. the path to the file containing the SCL's for each of the profile_ids
  my ($profiledb, $pfscan, $profileids) = $self->_rearrange([qw(DATABASE PROGRAM PROFILEIDS)], @args);

  #pass up the paths to Bio::Tools::Profile.
  $self->{profile} = new Bio::Tools::PSort::Profile(-database => $profiledb, 
                                             -program => $pfscan,
                                             -profileids => $profileids) ||
    $self->throw("Couldn't create new Bio::Tools::PSort::Profile object");

  return $self;
}


sub run {

  my ($self, $seq) = @_;

  my @res = map {
    my $detail = "matched " . $_->profile_id . ": " . $_->comment;
    new Bio::Tools::PSort::Report::Result(-details => [ $detail ],
					  -score   => 0,
					  -loc     => $_->localization);
  } $self->{profile}->match($seq);

  @res ? @res : new Bio::Tools::PSort::Report::Result(-loc => 'Unknown',
						      -details => ['No matches to profiles found']);
}

1;

=head1 NAME

=head1 SYNOPSIS

=head1 DESCRIPTION

=head1 CONSTRUCTOR

=head1 METHODS

=head1 SEE ALSO

=head1 AUTHOR
 
Fiona Brinkman, Chris Walsh, Matthew Laird <psort-mail@sfu.ca>
Brinkman Lab, Simon Fraser University, Canada

=cut

__END__