Bio::EnsEMBL::Analysis::Tools
FragmentTranscriptFilter
Toolbar
Summary
Bio::EnsEMBL::Analysis::Tools::FragmentTranscriptFilter
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
my $filter = new Bio::EnsEMBL::Analysis::Tools::FragmentTranscriptFilter->
new->(
-coverage => 80,
-percent_id => 90,
);
my @filtered_results = @{$filter->filter_results(\@results)};
Description
This is a best-in-genome filter is designed for mapping proteins/cDNAs/ESTs to
a low-coverage, fragmented genome, where different parts a single transcribed sequence
may validly map to different top-level sequences in the target.
Methods
Methods description
Arg [1] : self Arg [2] : arrayref of Trancripts Function : filter the given Transcruipts in the tried and trusted manner Returntype: arrayref Exceptions: throws if passed nothing or not an arrayref Example : |
Returntype: Bio::EnsEMBL::Analysis::Tools::FragmentTranscriptFilter Exceptions: none Example : |
Methods code
sub filter_results
{ my ($self, $transcripts) = @_;
my %trans_by_hid;
foreach my $tran (@$transcripts) {
my ($sf) = @{$tran->get_all_supporting_features};
next if defined($self->min_score) and $sf->score < $self->min_score;
next if defined($self->min_percent) and $sf->percent_id < $self->min_percent;
push @{$trans_by_hid{$sf->hseqname}}, {
tran => $tran,
score => $sf->score,
};
}
my @good_transcripts;
foreach my $hid (keys %trans_by_hid) {
my @trans = map { $_->{tran} } sort { $b->{score} <=> $a->{score} } @{$trans_by_hid{$hid}};
my (@all_t_sfs);
TRANSCRIPT:
foreach my $tran (@trans) {
my @t_sfs;
foreach my $exon (@{$tran->get_all_Exons}) {
my ($sf) = @{$exon->get_all_supporting_features};
foreach my $f (@all_t_sfs) {
if ($sf->hstart <= $f->hend and $sf->hend >= $f->hstart) {
next TRANSCRIPT;
}
}
push @t_sfs, $sf;
}
push @all_t_sfs, @t_sfs;
push @good_transcripts, $tran;
}
}
return\@ good_transcripts;
}
} |
sub min_percent
{ my $self = shift;
$self->{'_min_percent'} = shift if(@_);
return exists($self->{'_min_percent'}) ? $self->{'_min_percent'} : undef; } |
sub min_score
{ my $self = shift;
$self->{'_min_score'} = shift if(@_);
return exists($self->{'_min_score'}) ? $self->{'_min_score'} : undef;
}
1; } |
sub new
{ my ($class,@args) = @_;
my $self = $class->SUPER::new(@args);
&verbose('WARNING');
my (
$min_percent,
$min_score,
) =
rearrange([
'PERCENT_ID',
'SCORE',
], @args);
$self->min_percent($min_percent) if defined $min_percent;
$self->min_score($min_score) if defined $min_score;
return $self;
}
} |
General documentation
No general documentation available.