Bio::Tools::Analysis::Protein
Mitoprot
Toolbar
Summary
Bio::Tools::Analysis::Protein::Mitoprot - a wrapper around Mitoprot
server
Package variables
Privates (from "my" definitions)
$ANALYSIS_SPEC = { 'name' => 'Mitoprot', 'type' => 'Protein', 'version' => '1.0a4', 'supplier' => 'Munich Information Center for ProteinSequences', 'description' => 'mitochondrial sig seq prediction', }
$URL = 'http://ihg.gsf.de/cgi-bin/paolo/mitofilter?'
$MIN_LEN = 60
$ANALYSIS_NAME = "Mitoprot"
$INPUT_SPEC = [ { 'mandatory' => 'true', 'type' => 'Bio::PrimarySeqI', 'name' => 'seq', }, ]
%STATUS = map { $_ => 1 } qw(CREATED COMPLETED TERMINATED_BY_ERROR)
$RESULT_SPEC = { '' => 'raw text results', 'Bio::SeqFeatureI' => 'ARRAY of Bio::SeqFeature::Generic', 'all' => 'hash of results', }
Included modules
HTTP::Request::Common qw ( GET )
IO::String
Inherit
Synopsis
use Bio::Tools::Analysis::Protein::Mitoprot;
use Bio::PrimarySeq;
my $seq = Bio::PrimarySeq->new
(-seq=>'IKLCVHHJHJHJHJHJHJHNLAILAKAHLIELALAL',
-primary_id=>'test'); # a Bio::PrimarySeqI object
my $mitoprot = Bio::Tools::Analysis::Protein::Mitoprot->new
( -seq => $seq
); # sequence must be >!5aa long and start with an M.
# run Mitoprot prediction on a DNA sequence
my $mitoprot->run();
die "Could not get a result" unless $mitoprot->status =~ /^COMPLETED/;
print $mitoprot->result; # print raw prediction to STDOUT
foreach my $feat ( $mitoprot->result('Bio::SeqFeatureI') ) {
# do something to SeqFeature
# e.g. print as GFF
print $feat->gff_string, "\n";
# or store within the sequence - if it is a Bio::RichSeqI
$seq->add_SeqFeature($feat);
}
Description
This class is a wrapper around the Mitoprot web server which
calculates the probability of a sequence containing a mitochondrial
targetting peptide. See
http://mips.gsf.de/cgi-bin/proj/medgen/mitofilter
for more details.
The results can be obtained in 3 formats:
1
The raw text of the program output
my $rawdata = $analysis_object->result;
2
An reference to a hash of scores :
my $data_ref = $analysis_object->result('parsed'); print "predicted
export prob is $data_ref->{'export_prob'}\n"; #
key values of returned hash are input_length, basic_aas, acidic_aas,
export_prob, charge, cleavage_site.
3
A Bio::SeqFeature::Generic object
my $ft = $analysis_object->result(Bio::SeqFeatureI);
print "export prob is ", ($ft->each_tag_value('export_prob'))[0] ,"\n";
This the second implentation of Bio::SimpleAnalysisI which hopefully
will make it easier to write wrappers on various services. This class
uses a web resource and therefore inherits from Bio::WebAgent.
Methods
Methods description
Usage : $job->result (...) Returns : a result created by running an analysis Args : various
The method returns a result of an executed job. If the job was terminated by an error the result may contain an error message instead of the real data. This implementation returns differently processed data depending on argument:
undef Returns the raw ASCII data stream but without HTML tags
'Bio::SeqFeatureI' The argument string defines the type of bioperl objects returned in an array. The objects are Bio::SeqFeature::Generic. Feature primary tag is "SigSeq". Feature tags are input_length , basic_aas, acidic_aas, export_prob, charge, cleavage_site, method.
'parsed' hash references of parsed results { input_length =>, basic_aas=>, acidic_aas=>, export_prob=>, charge=>, cleavage_site=>}.
|
Methods code
sub result
{ my ($self,$value) = @_;
my @sig_pdctns;
my @fts;
if ($value ) {
my $result = IO::String->new($self->{'_result'});
my %results;
while (my $line = <$result>) {
next unless $line =~ /\d/ || $line =~ /^Cle/;
if ($line =~ /^Net[^+\-\d]+ # Net, then anything except +,- or digit ((\+|-)?\d+)/x) {
$results{'charge'} = $1;
} elsif ($line =~ /^Input[^\d]+(\d+)/ ) {
$results{'input_length'} = $1;
} elsif ($line =~ /basic[^\d]+(\d+)$/ ) {
$results{'basic_aas'} = $1;
} elsif ($line =~ /acidic[^\d]+(\d+)$/) {
$results{'acidic_aas'} = $1;
} elsif ($line =~ /^Cleavage[^\d]+(\d+)$/) {
$results{'cleavage_site'} = $1;
} elsif ($line =~ /^Cleavage/) {
$results{'cleavage_site'} = 'not predictable';
} elsif ($line =~ /^of export[^\d]+((0|1)\.\d+)$/) {
$results{'export_prob'} = $1;
}
}
if ($value eq 'Bio::SeqFeatureI') {
push @fts, Bio::SeqFeature::Generic->new
(
-start => 1,
-end => ($results{'cleavage_site'} =~
/^\d+$/)?$results{'cleavage_site'}:$self->seq->length,
-source => 'Mitoprot',
-primary => 'Region',
-tag =>{
export_prob => $results{'export_prob'},
charge => $results{'charge'},
basic_aas => $results{'basic_aas'},
acid_aas => $results{'acidic_aas'},
region_name => 'Transit_peptide',
method => 'MitoProt',
cleavage_site => $results{'cleavage_site'},
},
);
return @fts; }
else {
return\% results; }
}
return $self->{'_result'};} |
sub _init
{ my $self = shift;
$self->url($URL);
$self->{'_ANALYSIS_SPEC'} =$ANALYSIS_SPEC;
$self->{'_INPUT_SPEC'} =$INPUT_SPEC;
$self->{'_RESULT_SPEC'} =$RESULT_SPEC;
$self->{'_ANALYSIS_NAME'} =$ANALYSIS_SPEC->{'name'};
return $self;} |
sub _process_arguments
{ my ($self, $args) = @_;
$self->SUPER::_process_arguments($args) ;
$self->throw ("1st_aa must be M") if $self->seq->subseq(1,1) !~ /M/i;
$self->throw ("sequence must be at least 15aa long") if $self->seq->length< 15;
return; } |
sub _run
{ my $self = shift;
$self->delay(1);
$self->sleep;
$self->status('TERMINATED_BY_ERROR');
my $url = $self->url . "seq=".lc($self->seq->seq). "&seqnam=";
my $request = GET $url;
my $content = $self->request($request);
my $text = $content->content;
$text =~ s/.*<PRE>(.*)<\/PRE>.*/$1/s;
$text =~ s/<[^>]+>//sg;
$self->status('COMPLETED') if $text ne '' && $self->seq->length > $MIN_LEN;
$self->{'_result'} = $text;
}
1; } |
General documentation
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://bioperl.org/wiki/Mailing_lists - About the mailing lists
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. Many experienced and
reponsive experts will be able look at the problem and quickly
address it. Please include a thorough description of the problem
with code and data examples if at all possible.
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:
https://redmine.open-bio.org/projects/bioperl/
The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _