| Summary | Included libraries | Package variables | Synopsis | Description | General documentation | Methods |
use Bio::Matrix::PSM::IO;
my $psmIO= new Bio::Matrix::PSM::IO(-file=>$file, -format=>'transfac');
my $release=$psmIO->release; #Using Bio::Matrix::PSM::PsmHeader methods
my $release=$psmIO->release;
while (my $psm=$psmIO->next_psm) {
my %psm_header=$psm->header;
my $ic=$psm_header{IC};
my $sites=$psm_header{sites};
my $width=$psm_header{width};
my $score=$psm_header{e_val};
my $IUPAC=$psm->IUPAC;
}
my $instances=$psm->instances;
foreach my $instance (@{$instances}) {
my $id=$instance->primary_id;
}
my $psmIO= new Bio::Matrix::PSM::IO(file=>$file, format=>'transfac'); my %seq=$psmIO->seq;will return an empty hash. To see all methods and how to use them go
| new | Description | Code |
| fh | Description | Code |
| _load_format_module | Description | Code |
| _guess_format | Description | Code |
| next_psm | Description | Code |
| _parseMatrix | Description | Code |
| _parseInstance | Description | Code |
| _parse_coordinates | Description | Code |
| header | Description | Code |
| _make_matrix | Description | Code |
| DESTROY | No description | Code |
| new | code | next | Top |
Title : new
Usage : my $psmIO = new Bio::Matrix::PSM::IO(-format=>'meme',
-file=>$file);
Function: Associates a file with the appropriate parser
Throws : Throws if the file passed is in HTML format or
if some criteria for the file
format are not met. See Bio::Matrix::PSM::IO::meme and |
| fh | code | prev | next | Top |
Title : fh
Usage : $obj->fh
Function: Get a filehandle type access to the matrix parser
Example : $fh = $obj->fh; # make a tied filehandle
$matrix = <$fh>; # read a matrix object
Returns : filehandle tied to Bio::Matrix::PSM::IO class
Args : none |
| _load_format_module | code | prev | next | Top |
Title : _load_format_module Usage : *INTERNAL Matrix::PSM::IO stuff* Function: Loads up (like use) a module at run time on demand |
| _guess_format | code | prev | next | Top |
Title : _guess_format Usage : $obj->_guess_format($filename) Returns : guessed format of filename (lower case) Args : filename |
| next_psm | code | prev | next | Top |
Title : next_psm
Usage : my $psm=$psmIO->next_psm();
Function: Reads the next PSM from the input file, associated with this object
Throws : Throws if there ara format violations in the input file (checking is not
very strict with all drivers).
Example :
Returns : Bio::Matrix::PSM::Psm object
Args : none |
| _parseMatrix | code | prev | next | Top |
Title : _parseMatrix Usage : Function: Parses the next site matrix information in the meme file Throws : Example : Internal stuff Returns : hash as for constructing a SiteMatrix object (see SiteMatrixI) Args : string |
| _parseInstance | code | prev | next | Top |
Title : _parseInstance Usage : Function: Parses the next sites instances from the meme file Throws : Example : Internal stuff Returns : Bio::Matrix::PSM::SiteMatrix object Args : array references |
| _parse_coordinates | code | prev | next | Top |
Title : _parse_coordinates Usage : Function: Throws : Example : Internal stuff Returns : Args : |
| header | code | prev | next | Top |
Title : header Usage : my %header=$psmIO->header; Function: Returns the header for the PSM file, format specific Throws : Example : Returns : Hash or a single string with driver specific information Args : none |
| _make_matrix | code | prev | next | Top |
Title : _make_matrix Usage : Function: makes a matrix from 4 array references (A C G T) Throws : Example : Returns : SiteMatrix object Args : array of references(A C G T) |
| new | description | prev | next | Top |
my($caller,@args) = @_; my $class = ref($caller) || $caller; my $self; # or do we want to call SUPER on an object if $caller is an}
# object?
if( $class =~ /Bio::Matrix::PSM::IO(\S+)/ ) { $self = $class->SUPER::new(@args); $self->_initialize(@args); return $self; } else { my %param = @args; @param{ map { lc $_ } keys %param } = values %param; # lowercase keys
my $format = $param{'-format'} || $class->_guess_format( $param{'-file'} || $ARGV[0] ) || 'scoring'; $self->throw("$format format unrecognized or an argument error occured\n.") if (!grep(/$format/,@Bio::Matrix::PSM::IO::PSMFORMATS)); $format = "\L$format"; # normalize capitalization to lower case
# normalize capitalization
return undef unless( $class->_load_format_module($format) ); return "Bio::Matrix::PSM::IO::$format"->new(@args); }
| fh | description | prev | next | Top |
my $self = shift; my $class = ref($self) || $self; my $s = Symbol::gensym; tie $$s,$class,$self; return $s;}
| _load_format_module | description | prev | next | Top |
my ($self,$format) = @_; my $module = "Bio::Matrix::PSM::IO::" . $format; my $ok; eval { $ok = $self->_load_module($module); }; if ( $@ ) { print STDERR <<END}
$self: $format cannot be found
Exception $@
For more information about the Matrix::PSM::IO system please see the
Matrix::PSM::IO docs. This includes ways of checking for formats at
compile time, not run time
END
; } return $ok;
| _guess_format | description | prev | next | Top |
my $class = shift; return unless $_ = shift; return 'meme' if /.meme$|meme.html$/i; return 'transfac' if /\.dat$/i; return 'mast' if /^mast\.|\.mast.html$|.mast$/i;}
| next_psm | description | prev | next | Top |
my $self = shift; $self->throw_not_implemented();}
| _parseMatrix | description | prev | next | Top |
my $self = shift; $self->throw_not_implemented();}
| _parseInstance | description | prev | next | Top |
my $self = shift; $self->throw_not_implemented();}
| _parse_coordinates | description | prev | next | Top |
my $self = shift; $self->throw_not_implemented();}
| header | description | prev | next | Top |
my $self = shift; $self->throw_not_implemented();}
| _make_matrix | description | prev | next | Top |
my $self = shift; $self->throw_not_implemented();}
| DESTROY | description | prev | next | Top |
my $self = shift; $self->close();}
| See also | Top |
| FEEDBACK | Top |
| Mailing Lists | Top |
bioperl-l@bioperl.org - General discussion http://bio.perl.org/MailList.html - About the mailing lists
| Reporting Bugs | Top |
bioperl-bugs@bio.perl.org http://bugzilla.bioperl.org/
| AUTHOR - Stefan Kirov | Top |
| APPENDIX | Top |