Bio::Matrix::PSM PsmHeader
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Summary
Bio::Matrix::PSM::PsmHeader - PSM mast parser implementation
Package variables
No package variables defined.
Included modules
Bio::Matrix::PSM::IO
Bio::Matrix::PSM::InstanceSite
Bio::Matrix::PSM::Psm
Bio::Matrix::PSM::PsmHeaderI
Bio::Root::Root
strict
Inherit
Bio::Matrix::PSM::PsmHeaderI Bio::Root::Root
Synopsis
  # See Bio::Matrix::PSM::IO for detailed documentation on how to use
  # PSM parsers
Description
Parser for mast. This driver unlike meme or transfac for example is
dedicated more to PSM sequence matches
Methods
newDescriptionCode
_initialize
No description
Code
seqDescriptionCode
hidDescriptionCode
lengthDescriptionCode
instancesDescriptionCode
weightDescriptionCode
unstructured
No description
Code
versionDescriptionCode
releaseDescriptionCode
_checkDescriptionCode
Methods description
newcode    nextTop
 Title   : new
 Usage   : my $header= new Bio::Matrix::PSM::PsmHeader(-seq=>\%seq, 
						       -mid=>\%mid, 
						       -width=>\%width,
                                                       -instances=>\%instances,
						       -header=>\@header,
						       -type=>'mast');
 Function: Creates a new Bio::Matrix::PSM::PsmHeader object
 Throws  :
 Example :
 Returns :  Bio::Matrix::PSM::PsmHeader object
 Args    :  hash
seqcodeprevnextTop
 Title   : seq
 Usage   : my %seq= $header->seq();
 Function: Returns the sequence data as a hash, indexed by a sequence ID (motif id or accession number)
           In case the input data is a motif it would return the consenus seq for each of them (mast).
 Throws  :
 Example :
 Returns :   hash
 Args    :
hidcodeprevnextTop
 Title   : hid
 Usage   : my @hid= $header->hid();
 Function: Returns array with the motif ids
 Throws  :
 Example :
 Returns :   array
 Args    :
lengthcodeprevnextTop
 Title   : length
 Usage   : my %length= $header->length();
 Function: Returns the length of the input sequence or motifs as a hash, indexed
           by a sequence ID (motif id or accession number)
 Throws  :
 Example :
 Returns :  hash
 Args    :
instancescodeprevnextTop
 Title   : instances
 Usage   : my %instances= $header->instances();
 Function: Returns the info about the input data, contained in the header
 Throws  :
 Example :
 Returns : hash
 Args    :
weightcodeprevnextTop
 Title   : weight
 Usage   : my %weights= $header->weight();
 Function: Returns the weights of the input sequence as a hash, indexed
           by a sequence ID
 Throws  :
 Example :
 Returns :  hash
 Args    :
versioncodeprevnextTop
 Title   : version
 Usage   : my $version= $header->version;
 Function: Returns the version of the file being parsed if such exists
 Throws  :
 Example :
 Returns :  string
 Args    :
releasecodeprevnextTop
 Title   : release
 Usage   : my $release= $header->release;
 Function: Returns the release of the file being parsed if such exists
 Throws  :
 Example :
 Returns :  string
 Args    :
_checkcodeprevnextTop
 Title   : _check
 Usage   : if ($self->_check('weights') { #do something} else {return undef;}
 Function: Checks if the method called is aplicable to the file format
 Throws  :
 Example :
 Returns :  boolean
 Args    :  string
Methods code
newdescriptionprevnextTop
sub new {
    my ($class,@args)=@_;
    my $self = $class->SUPER::new(@args);
    return $self;
}
_initializedescriptionprevnextTop
sub _initialize {
    my $self = shift;
    my $type=ref($self);
    $type=~s/\w+:://g;
$self->{_type} = $type; my $dat=join(" ",grep(/version|release/i,@{$self->{unstructured}})); if ($dat && ($dat=~/version\b/i)) { $self->{version}=substr($dat,$+[0]+1); $self->{version}=~s/\s.+[^\d\.\:\/]//g;
$self->{version}=~s/^\D//;
} if ($dat && ($dat=~/release\b/i)) { my $rel=substr($dat,$+[0]+1); $rel=~s/[^\d\.\:\/\-]//g;
$rel=~s/^\D//;
if ($rel=~/\d\d:\d\d:\d\d/) { #Reformat if time is available too
my $time=substr($rel,$-[0]+1); my $dat= substr($rel,0,$-[0]); $self->{release}="$dat $time"; } else { $self->{release}=$rel; } } return $self;
}
seqdescriptionprevnextTop
sub seq {
    my $self = shift;
    return () unless ($self->_check('seq'));
    return %{$self->{seq}};
}
hiddescriptionprevnextTop
sub hid {
    my $self = shift;
    return undef unless ($self->_check('hid'));
    my @header=@{$self->{hid}};
    return @header;
}
lengthdescriptionprevnextTop
sub length {
     my $self = shift;
     return undef unless ($self->_check('length'));
    return $self->{length};
}
instancesdescriptionprevnextTop
sub instances {
      my $self = shift;
     return undef unless ($self->_check('instances'));
    return %{$self->{instances}};
}
weightdescriptionprevnextTop
sub weight {
    my $self = shift;
    return () unless ($self->_check('weight'));
    return %{$self->{weight}};
}
unstructureddescriptionprevnextTop
sub unstructured {
    my $self = shift;
    return @{$self->{unstructured}};
}
versiondescriptionprevnextTop
sub version {
    my $self = shift;
    return $self->{version};
}
releasedescriptionprevnextTop
sub release {
    my $self = shift;
    return $self->{release};
}
_checkdescriptionprevnextTop
sub _check {
    my ($self,$method) = @_;
    my $type= $self->{'_type'};
  TYPE: {
      if ($type eq 'meme') { return undef unless (grep(/$method/,@Bio::Matrix::PSM::PsmHeader::MEMEHEADER)); last TYPE; }
      if ($type eq 'mast') { return undef unless (grep(/$method/,@Bio::Matrix::PSM::PsmHeader::MASTHEADER)); last TYPE; }
      if ($type eq 'transfac') { return undef unless (grep(/$method/,@Bio::Matrix::PSM::PsmHeader::TRANSFACHEADER)); last TYPE; }
  }
    return 1;
}
General documentation
FEEDBACKTop
Mailing ListsTop
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to one
of the Bioperl mailing lists. Your participation is much appreciated.
  bioperl-l@bioperl.org                 - General discussion
  http://bio.perl.org/MailList.html     - About the mailing lists
Reporting BugsTop
Report bugs to the Bioperl bug tracking system to help us keep track
the bugs and their resolution. Bug reports can be submitted via the
web:
  http://bugzilla.bioperl.org/
AUTHOR - Stefan KirovTop
Email skirov@utk.edu
APPENDIXTop
unstucturedTop
 Title   : unstuctured
 Usage   : my @unstructured= $header->unstuctured();
 Function: Returns the unstructured data in the header as an array, one line per
           array element, all control symbols are removed with \W
 Throws  :
 Example :
 Returns :  array
 Args    :