Skip to content
Snippets Groups Projects
Commit 590b8402 authored by Tiago Grego's avatar Tiago Grego
Browse files

added new_fast() to Biotype and used it from BiotypeAdaptor

parent 8edd9fec
No related branches found
No related tags found
2 merge requests!228Biotype in Core schema,!228Biotype in Core schema
......@@ -64,6 +64,7 @@ use Bio::EnsEMBL::Storable;
use Bio::EnsEMBL::Utils::Exception qw(throw deprecate warning);
use Bio::EnsEMBL::Utils::Scalar qw(check_ref assert_ref);
use Bio::EnsEMBL::Utils::Argument qw(rearrange);
use Scalar::Util qw(weaken isweak);
use base qw(Bio::EnsEMBL::Storable);
......@@ -115,6 +116,25 @@ sub new {
return $self;
}
=head2 new_fast
Arg [1] : hashref to be blessed
Description: Construct a new Bio::EnsEMBL::Biotype using the hashref.
Exceptions : none
Returntype : Bio::EnsEMBL::Biotype
=cut
sub new_fast {
my ( $class, $hashref ) = @_;
my $self = bless $hashref, $class;
weaken($self->{adaptor}) if ( ! isweak($self->{adaptor}) );
return $self;
}
=head2 name
Arg [1] : (optional) string $name
......
......@@ -115,16 +115,16 @@ sub _objs_from_sth {
while($sth->fetch()) {
push( @biotypes,
my $feat = Bio::EnsEMBL::Biotype->new(
-BIOTYPE_ID => $dbID,
-NAME => $name,
-OBJECT_TYPE => $object_type,
-DB_TYPE => $db_type,
-ATTRIB_TYPE_ID => $attrib_type_id,
-DESCRIPTION => $description,
-BIOTYPE_GROUP => $biotype_group,
-SO_ACC => $so_acc,
)
my $feat = Bio::EnsEMBL::Biotype->new_fast( {
'dbID' => $dbID,
'name' => $name,
'object_type' => $object_type,
'db_type' => $db_type,
'attrib_type_id' => $attrib_type_id,
'description' => $description,
'biotype_group' => $biotype_group,
'so_acc' => $so_acc,
} )
);
}
......
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