Bio-MUST-Core
view release on metacpan or search on metacpan
lib/Bio/MUST/Core/SeqId.pm view on Meta::CPAN
# TODO: check if this optimized way always work for us
my $key = $args{full_id};
# return the existing instance
return $instance_for{$key} if defined $instance_for{$key};
# create a new instance
my $instance = $class->new(%args);
$instance_for{$key} = $instance;
# Note: do not weaken reference or this will defeat the purpose.
# However, this could lead to memory leak in some extreme cases.
# Scalar::Util::weaken $instance_for{$key};
return $instance;
}
# class methods to build modern MUST-compliant id from NCBI components
sub new_with { ## no critic (RequireArgUnpacking)
my $class = shift;
( run in 0.580 second using v1.01-cache-2.11-cpan-65fba6d93b7 )