1
#---------------------------------------------------------
2
# $Id: PsmHeaderI.pm,v 1.3 2003/10/25 15:00:57 heikki Exp $
6
Bio::Matrix::PSM::PsmHeaderI
10
use Bio::Matrix::PSM::IO;
11
#Obtain an Bio::Matrix::PSM::IO object:
12
my $psmIO= new Bio::Matrix::PSM::IO(-file=>$file, -format=>'mast');
14
#Get some general data about the file you are parsing:
15
my $release=$psmIO->release;
16
my $version=$psmIO->version;
18
print "This analysis was performed using MAST version $version, release $release\n";
20
#Now let's see what are the consensus sequences of the motifs fed as an input:
23
#let's cycle through all consensus sequences now:
25
foreach my $id ($psmIO->hid) {
26
print "Motif $id is \t",$seq{$id},"\n";
29
#Finally look at the stuff we do not parse:
30
my @inputfile=grep(/datafile/i,$psmIO->unstructured);
34
Generally you should not use this object directly, you can access the
35
information through a PSM driver (See Bio::Matrix::PSM::IO). It is
36
handling the header data from a PSM file which may be very
37
different. This means that some of the methods will return undef
38
naturally, because this information is not present in the file which
39
is parsed. Some important data might be left over in the unstructured
40
part, and you might have to parse it yourself. I will try to
41
'structure' this header more in the near future.
48
User feedback is an integral part of the evolution of this
49
and other Bioperl modules. Send your comments and suggestions preferably
50
to one of the Bioperl mailing lists.
51
Your participation is much appreciated.
53
bioperl-l@bioperl.org - General discussion
54
http://bio.perl.org/MailList.html - About the mailing lists
58
Report bugs to the Bioperl bug tracking system to help us keep track
59
the bugs and their resolution.
60
Bug reports can be submitted via email or the web:
62
bioperl-bugs@bio.perl.org
63
http://bugzilla.bioperl.org/
65
=head1 AUTHOR - Stefan Kirov
74
# Let the code begin...
75
package Bio::Matrix::PSM::PsmHeaderI;
76
use Bio::Matrix::PSM::InstanceSite;
77
use Bio::Matrix::PSM::Psm;
78
use Bio::Matrix::PSM::IO;
81
@ISA=qw(Bio::Matrix::PSM::Psm Bio::Root::Root);
83
#Accessor methods, based on the driver
84
@Bio::Matrix::PSM::PsmHeader::MASTHEADER=qw(html version release
85
seq hid length instances
87
@Bio::Matrix::PSM::PsmHeader::MEMEHEADER=qw(html version release hid
88
weight length unstructured);
89
@Bio::Matrix::PSM::PsmHeader::TRANSFACHEADER=qw(unstructured version release);
90
@Bio::Matrix::PSM::PsmHeader::ALLHEADER=qw(header release type version html
91
release weight length hid
92
seq instances unstructured);
97
Usage : my $header= new Bio::Matrix::PSM::PsmHeader
98
( -seq=>\%seq, -mid=>\%mid, -width=>\%width,
99
-instances=>\%instances, -header=>\@header, -type=>'mast');
100
Function: Creates a new Bio::Matrix::PSM::PsmHeader object
103
Returns : Bio::Matrix::PSM::PsmHeader object
112
Usage : my %seq= $header->seq();
113
Function: Returns the sequence data as a hash, indexed by a
114
sequence ID (motif id or accession number)
115
In case the input data is a motif it would return the
116
consenus seq for each of them (mast).
127
$self->throw_not_implemented();
134
Usage : my @ids= $header->hid();
135
Function: Returns array with the motif/instance ids
146
$self->throw_not_implemented();
152
Usage : my %length= $header->length();
153
Function: Returns the length of the input sequence or motifs as a hash, indexed
154
by a sequence ID (motif id or accession number)
165
$self->throw_not_implemented();
171
Usage : my %instances= $header->length();
172
Function: Returns the instance, used as a hash, indexed
173
by a sequence ID (motif id or accession number)
176
Returns : hash of Bio::Matrix::PSM::InstanceSite objects
184
$self->throw_not_implemented();
190
Usage : my %weights= $header->weights();
191
Function: Returns the weights of the input sequence as a hash, indexed
203
$self->throw_not_implemented();
210
Usage : my @unstructured= $header->unstuctured();
211
Function: Returns the unstructured data in the header as an array, one line per
212
array element, all control symbols are removed with \W
223
$self->throw_not_implemented();
229
Usage : my $version= $header->version;
230
Function: Returns the version of the file being parsed if such exists
241
$self->throw_not_implemented();
247
Usage : my $revision= $header->revision;
248
Function: Returns the revision of the file being parsed if such exists
259
$self->throw_not_implemented();
265
Usage : if ($self->_check('weights') { #do something} else {return undef;}
266
Function: Checks if the method called is aplicable to the file format
277
$self->throw_not_implemented();
1
#---------------------------------------------------------
2
# $Id: PsmHeaderI.pm,v 1.10.4.1 2006/10/02 23:10:22 sendu Exp $
6
Bio::Matrix::PSM::PsmHeaderI
10
use Bio::Matrix::PSM::IO;
11
#Obtain an Bio::Matrix::PSM::IO object:
12
my $psmIO= new Bio::Matrix::PSM::IO(-file=>$file, -format=>'mast');
14
#Get some general data about the file you are parsing:
15
my $release=$psmIO->release;
16
my $version=$psmIO->version;
18
print "This analysis was performed using MAST version $version, release $release\n";
20
#Now let's see what are the consensus sequences of the motifs fed as an input:
23
#let's cycle through all consensus sequences now:
25
foreach my $id ($psmIO->hid) {
26
print "Motif $id is \t",$seq{$id},"\n";
29
#Finally look at the stuff we do not parse:
30
my @inputfile=grep(/datafile/i,$psmIO->unstructured);
34
Generally you should not use this object directly, you can access the
35
information through a PSM driver (See Bio::Matrix::PSM::IO). It is
36
handling the header data from a PSM file which may be very
37
different. This means that some of the methods will return undef
38
naturally, because this information is not present in the file which
39
is parsed. Some important data might be left over in the unstructured
40
part, and you might have to parse it yourself. I will try to
41
'structure' this header more in the near future.
48
User feedback is an integral part of the evolution of this
49
and other Bioperl modules. Send your comments and suggestions preferably
50
to one of the Bioperl mailing lists.
51
Your participation is much appreciated.
53
bioperl-l@bioperl.org - General discussion
54
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
58
Report bugs to the Bioperl bug tracking system to help us keep track
59
the bugs and their resolution. Bug reports can be submitted via the
62
http://bugzilla.open-bio.org/
64
=head1 AUTHOR - Stefan Kirov
73
# Let the code begin...
74
package Bio::Matrix::PSM::PsmHeaderI;
75
use Bio::Matrix::PSM::InstanceSite;
76
use Bio::Matrix::PSM::Psm;
77
use Bio::Matrix::PSM::IO;
79
use base qw(Bio::Matrix::PSM::PsmI);
81
#Accessor methods, based on the driver
82
@Bio::Matrix::PSM::PsmHeader::MASTHEADER=qw(html version release
83
seq hid length instances
85
@Bio::Matrix::PSM::PsmHeader::MEMEHEADER=qw(html version release hid
86
weight length unstructured);
87
@Bio::Matrix::PSM::PsmHeader::TRANSFACHEADER=qw(unstructured version release);
88
@Bio::Matrix::PSM::PsmHeader::ALLHEADER=qw(header release type version html
89
release weight length hid
90
seq instances unstructured);
95
Usage : my $header= new Bio::Matrix::PSM::PsmHeader
96
( -seq=>\%seq, -mid=>\%mid, -width=>\%width,
97
-instances=>\%instances, -header=>\@header, -type=>'mast');
98
Function: Creates a new Bio::Matrix::PSM::PsmHeader object
101
Returns : Bio::Matrix::PSM::PsmHeaderI object
110
Usage : my %seq= $header->seq();
111
Function: Returns the sequence data as a hash, indexed by a
112
sequence ID (motif id or accession number)
113
In case the input data is a motif it would return the
114
consenus seq for each of them (mast).
125
$self->throw_not_implemented();
132
Usage : my @ids= $header->hid();
133
Function: Returns array with the motif/instance ids
144
$self->throw_not_implemented();
150
Usage : my %length= $header->length();
151
Function: Returns the length of the input sequence or motifs as a hash, indexed
152
by a sequence ID (motif id or accession number)
163
$self->throw_not_implemented();
169
Usage : my %instances= $header->length();
170
Function: Returns the instance, used as a hash, indexed
171
by a sequence ID (motif id or accession number)
174
Returns : hash of Bio::Matrix::PSM::InstanceSite objects
182
$self->throw_not_implemented();
188
Usage : my %weights= $header->weights();
189
Function: Returns the weights of the input sequence as a hash, indexed
201
$self->throw_not_implemented();
208
Usage : my @unstructured= $header->unstuctured();
209
Function: Returns the unstructured data in the header as an array, one line per
210
array element, all control symbols are removed with \W
221
$self->throw_not_implemented();
227
Usage : my $version= $header->version;
228
Function: Returns the version of the file being parsed if such exists
239
$self->throw_not_implemented();
245
Usage : my $revision= $header->revision;
246
Function: Returns the revision of the file being parsed if such exists
257
$self->throw_not_implemented();
263
Usage : if ($self->_check('weights') { #do something} else {return 0;}
264
Function: Checks if the method called is aplicable to the file format
275
$self->throw_not_implemented();