Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
62f0a16f
Commit
62f0a16f
authored
Apr 24, 2012
by
Andy Yates
Browse files
Supporting empty array specification and using the value specified in the param_defaults
parent
59414cf7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
modules/Bio/EnsEMBL/Pipeline/FASTA/Base.pm
modules/Bio/EnsEMBL/Pipeline/FASTA/Base.pm
+17
-0
modules/Bio/EnsEMBL/Pipeline/FASTA/SpeciesFactory.pm
modules/Bio/EnsEMBL/Pipeline/FASTA/SpeciesFactory.pm
+3
-1
No files found.
modules/Bio/EnsEMBL/Pipeline/FASTA/Base.pm
View file @
62f0a16f
...
...
@@ -5,11 +5,28 @@ use warnings;
use
base
qw/Bio::EnsEMBL::Hive::Process/
;
use
Bio::EnsEMBL::Utils::
Exception
qw/throw/
;
use
Bio::EnsEMBL::Utils::
Scalar
qw/check_ref/
;
use
File::
Find
;
use
File::
Spec
;
use
File::
Path
qw/mkpath/
;
use
POSIX
qw/strftime/
;
# Takes in a key, checks if the current $self->param() was an empty array
# and replaces it with the value from $self->param_defaults()
sub
reset_empty_array_param
{
my
(
$self
,
$key
)
=
@_
;
my
$param_defaults
=
$self
->
param_defaults
();
my
$current
=
$self
->
param
(
$key
);
my
$replacement
=
$self
->
param_defaults
()
->
{
$key
};
if
(
check_ref
(
$current
,
'
ARRAY
')
&&
check_ref
(
$replacement
,
'
ARRAY
'))
{
if
(
!
@
{
$current
})
{
$self
->
fine
('
Restting param %s because the given array was empty
',
$key
);
$self
->
param
(
$key
,
$replacement
);
}
}
return
;
}
sub
get_Slices
{
my
(
$self
,
$type
)
=
@_
;
my
$sa
=
$self
->
get_DBAdaptor
(
$type
)
->
get_SliceAdaptor
();
...
...
modules/Bio/EnsEMBL/Pipeline/FASTA/SpeciesFactory.pm
View file @
62f0a16f
...
...
@@ -70,7 +70,6 @@ use warnings;
use
base
qw/Bio::EnsEMBL::Pipeline::FASTA::Base/
;
use
Bio::EnsEMBL::
Registry
;
use
Bio::EnsEMBL::Utils::
Scalar
qw/wrap_array/
;
sub
param_defaults
{
my
(
$self
)
=
@_
;
...
...
@@ -84,6 +83,9 @@ sub param_defaults {
sub
fetch_input
{
my
(
$self
)
=
@_
;
$self
->
reset_empty_array_param
('
sequence_type_list
');
$self
->
reset_empty_array_param
('
db_types
');
my
$core_dbas
=
$self
->
get_DBAdaptors
();
$self
->
info
('
Found %d core DBAdaptor(s) to process
',
scalar
(
@
{
$core_dbas
}));
$self
->
param
('
dbas
',
$core_dbas
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment