Bio::Tools::Analysis::DNA
ESEfinder
Summary
Bio::Tools::Analysis::DNA::ESEfinder - a wrapper around ESEfinder
server
Package variables
Privates (from "my" definitions)
$ANALYSIS_SPEC = { 'name' => 'ESEfinder', 'type' => 'DNA', 'version' => '2.0', 'supplier' => 'Krainer lab, Cold Spring Harbor Laboratory, POBOX100, Bungtown Rd, COld Spring Harbor, NY, USA', 'description' => 'to identify exonic splicing elements in human transcripts', }
$URL = 'http://exon.cshl.org/cgi-bin/ESE/esefinder.cgi'
$ANALYSIS_NAME = 'ESEfinder'
$INPUT_SPEC = [{ 'mandatory' => 'true', 'type' => 'Bio::PrimarySeqI', 'name' => 'sequence', }]
$RESULT_SPEC = { '' => 'bulk', 'Bio::SeqFeatureI' => 'ARRAY of Bio::SeqFeature::Generic', 'raw' => 'Array of [ SRprotein, position , motif,score]', 'all' => 'Bio::Seq::Meta::Array object' }
Included modules
Data::Dumper
HTML::HeadParser
HTTP::Request::Common qw ( POST )
IO::String
strict
Inherit
Synopsis
use Bio::Tools::Analysis::DNA::ESEfinder;
use strict;
my $seq; # a Bio::PrimarySeqI or Bio::SeqI object
$seq = Bio::Seq->new
(-primery_id => 'test',
-seq=>'atgcatgctaggtgtgtgttttgtgggttgtactagctagtgat'.
-alphabet=>'dna');
my $ese_finder = Bio::Tools::Analysis::DNA::ESEfinder->
new(-seq => $seq);
# run ESEfinder prediction on a DNA sequence
$ese_finder->run();
die "Could not get a result"
unless $ese_finder->status =~ /^COMPLETED/;
print $ese_finder->result; # print raw prediction to STDOUT
foreach my $feat ( $ese_finder->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::SeqI
$seq->add_SeqFeature($feat)
}
Description
This class is a wrapper around the ESEfinder web server which uses
experimentally defined scoring matrices to identify possible exonic
splicing enhancers in human transcripts.
The results can be retrieved in 4 ways.
1.
$ese_finder-E<gt>result('') retrieves the raw text output of the
program
2.
$ese_finder-E<gt>result('all') returns a Bio::Seq::Meta::Array object
with prediction scores for all residues in the sequence
3.
$ese_finder-E<gt>result('Bio::SeqFeatureI') returns an array of
Bio::SeqFeature objects for sequences with significant scores. Feature
tags are score, motif,SR_protein and method
4.
$ese_finder-E<gt>result('raw') returns an array of significant matches
with each element being a refernce to [Sprotein, position, motif,
score]
See
http://exon.cshl.org/ESE/index.htmlThis 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
| _init | No description | Code |
| _run | No description | Code |
| result | No description | Code |
Methods description
None available.
Methods code
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_NAME;
return $self; } |
sub _run
{ my $self = shift;
my $seq_fasta;
my $stringfh = new IO::String($seq_fasta);
my $seqout = new Bio::SeqIO(-fh => $stringfh,
-format => 'fasta');
$seqout->write_seq($self->seq);
$self->debug($seq_fasta);
$self->delay(1);
$self->sleep;
$self->status('TERMINATED_BY_ERROR');
my $request = POST $self->url,
Content_Type => 'x-www-form-urlencoded',
Content => [
protein1 => 1,
protein2 => 1,
protein3 => 1,
protein4 => 1,
sequence =>$seq_fasta,
];
my $content = $self->request($request);
if( $content->is_error ) {
$self->warn(ref($self)." Request Error:\n".$content->as_string);
return;
}
my $text = $content->content; my ($tmpfile) = $text =~ /value="(tmp.+txt)"/;
my $rq2 = POST 'http://exon.cshl.org/cgi-bin/ESE/resultfile.txt',
Content_Type => 'x-www-form-urlencoded',
Content => [
fname => $tmpfile,
];
my $ua2 = LWP::UserAgent->new;
my $content2 = $ua2->request($rq2);
if( $content2->is_error ) {
$self->warn(ref($self)." Request Error:\n".$content2->as_string);
return;
}
my $text2 = $content2->content;
$self->{'_result'} = $text2;
$self->status('COMPLETED') if $text2 ne '';
} |
sub result
{
my ($self,$value) = @_;
my @sig_pdctns;
my @fts;
if ($value ) {
my $result = IO::String->new($self->{'_result'});
my $current_SR;
my $all_st_flag = 0;
my %all;
while (my $line = <$result>) {
last if $line =~ /^All scores/ && $value ne 'all' or $line =~ /2001,/;
$all_st_flag++ if $line =~ /All scores/;
next if $value eq 'all' && $all_st_flag == 0;
if ($line =~ /^Protein/) {
($current_SR) = $line =~/:\s+(\S+)/;
$current_SR =~ s/\//_/; }
if ( $line =~/^\d+/ && $value ne 'all') {
push @sig_pdctns, [$current_SR, split /\s+/, $line] ;
} elsif ($line =~ /^\d+/) {
push @{$all{$current_SR}}, [split /\s+/, $line];
}
}
if ($value eq 'Bio::SeqFeatureI') {
foreach (@sig_pdctns) {
push @fts, Bio::SeqFeature::Generic->new
(
-start => $_->[1],
-end => $_->[1] + length($_->[2]) -1,
-source => 'ESEfinder',
-primary => 'ESE',
-tag =>{
score =>$_->[3],
motif=> $_->[2],
SR_protein=> $_->[0],
method=> 'ESEfinder',
},
);
}
return @fts;
}
elsif ($value eq 'all') {
bless ($self->seq, "Bio::Seq::Meta::Array");
$self->seq->isa("Bio::Seq::MetaI")
|| $self->throw("$self is not a Bio::Seq::MetaI");
for my $prot (keys %all) {
my @meta;
my $len = scalar @{$all{$prot}} ;
for (my $i = 0; $i < $len; $i++ ) {
$meta[$i] = $all{$prot}[$i][2];
}
$Bio::Seq::Meta::Array::DEFAULT_NAME = "ESEfinder_SRp55";
my $meta_name = $self->analysis_spec->{'name'} . "_" . "$prot";
$self->seq->named_meta($meta_name,\@meta );
}
return $self->seq;
}
return\@ sig_pdctns;
}
return $self->{'_result'};} |
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://bio.perl.org/MailList.html - About the mailing lists
Report bugs to the Bioperl bug tracking system to help us keep track
the bugs and their resolution. Bug reports can be submitted via email
or the web:
bioperl-bugs@bio.perl.org
http://bugzilla.bioperl.org/
The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _