Commit 97134e11 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

New feature collection code with new class structure. Using

RepeatFeature as the test case for now.  Won't do anything useful just
yet.
parent bdba1f01
package Bio::EnsEMBL::Collection;
use strict;
use warnings;
use Bio::EnsEMBL::Utils::Argument ('rearrange');
use Bio::EnsEMBL::Utils::Exception ('throw');
sub _remap {
my ( $features, $mapper, $slice ) = @_;
return $features;
}
sub _create_feature {
my ( $this, $feature_type, $args ) = @_;
my ( $dbid, $start, $end, $strand, $slice ) =
rearrange( [ 'DBID', 'START', 'END', 'STRAND', 'SLICE' ],
@{$args} );
return [ $dbid, $slice->get_seq_region_id(), $start, $end, $strand ];
}
sub _create_feature_fast {
my ( $this, $feature_type, $args ) = @_;
return [ $args->{'dbID'}, $args->{'slice'}->get_seq_region_id(),
$args->{'start'}, $args->{'end'},
$args->{'strand'} ];
}
1;
# $Id$
package Bio::EnsEMBL::Collection::RepeatFeature;
use strict;
use warnings;
use Bio::EnsEMBL::Utils::Argument ('rearrange');
use Bio::EnsEMBL::Utils::Exception ('throw');
use base( 'Bio::EnsEMBL::Collection',
'Bio::EnsEMBL::DBSQL::RepeatFeatureAdaptor' );
sub _create_feature {
my ( $this, $feature_type, $args ) = @_;
my @feature =
@{ $this->SUPER::_create_feature( $feature_type, $args ) };
my ( $hstart, $hend, $score, $repeat_consensus, $analysis ) =
rearrange( [ 'HSTART', 'HEND',
'SCORE', 'REPEAT_CONSENSUS',
'ANALYSIS'
],
@{$args} );
push( @feature,
$hstart, $hend, $score, $repeat_consensus->dbID(),
$analysis->dbID() );
return \@feature;
}
sub _create_feature_fast {
my ( $this, $feature_type, $args ) = @_;
my @feature =
@{ $this->SUPER::_create_feature_fast( $feature_type, $args ) };
push( @feature,
$args->{'hstart'}, $args->{'hend'}, $args->{'score'},
$args->{'repeat_consensus'}->dbID(),
$args->{'analysis'}->dbID() );
return \@feature;
}
1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment