Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-io
Commits
6765ee11
Commit
6765ee11
authored
Sep 27, 2018
by
Tiago Grego
Browse files
do not return undef, just return
parent
7ce07f86
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
33 additions
and
33 deletions
+33
-33
modules/Bio/EnsEMBL/IO/Adaptor/BAMAdaptor.pm
modules/Bio/EnsEMBL/IO/Adaptor/BAMAdaptor.pm
+2
-2
modules/Bio/EnsEMBL/IO/Adaptor/BigBedAdaptor.pm
modules/Bio/EnsEMBL/IO/Adaptor/BigBedAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/IO/Adaptor/BigWigAdaptor.pm
modules/Bio/EnsEMBL/IO/Adaptor/BigWigAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/IO/Adaptor/HTSAdaptor.pm
modules/Bio/EnsEMBL/IO/Adaptor/HTSAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/IO/ColumnBasedParser.pm
modules/Bio/EnsEMBL/IO/ColumnBasedParser.pm
+1
-1
modules/Bio/EnsEMBL/IO/ListBasedParser.pm
modules/Bio/EnsEMBL/IO/ListBasedParser.pm
+2
-2
modules/Bio/EnsEMBL/IO/Parser/BaseVCF4.pm
modules/Bio/EnsEMBL/IO/Parser/BaseVCF4.pm
+3
-3
modules/Bio/EnsEMBL/IO/Parser/Pileup.pm
modules/Bio/EnsEMBL/IO/Parser/Pileup.pm
+2
-2
modules/Bio/EnsEMBL/IO/Parser/VEP_input.pm
modules/Bio/EnsEMBL/IO/Parser/VEP_input.pm
+2
-2
modules/Bio/EnsEMBL/IO/Parser/VEP_output.pm
modules/Bio/EnsEMBL/IO/Parser/VEP_output.pm
+1
-1
modules/Bio/EnsEMBL/IO/Parser/Wig.pm
modules/Bio/EnsEMBL/IO/Parser/Wig.pm
+1
-1
modules/Bio/EnsEMBL/IO/Translator.pm
modules/Bio/EnsEMBL/IO/Translator.pm
+2
-2
modules/Bio/EnsEMBL/IO/Translator/StructuralVariationFeature.pm
...s/Bio/EnsEMBL/IO/Translator/StructuralVariationFeature.pm
+3
-3
modules/EnsEMBL/Web/File/Utils.pm
modules/EnsEMBL/Web/File/Utils.pm
+2
-2
modules/EnsEMBL/Web/File/Utils/FileSystem.pm
modules/EnsEMBL/Web/File/Utils/FileSystem.pm
+5
-5
modules/EnsEMBL/Web/File/Utils/IO.pm
modules/EnsEMBL/Web/File/Utils/IO.pm
+4
-4
No files found.
modules/Bio/EnsEMBL/IO/Adaptor/BAMAdaptor.pm
View file @
6765ee11
...
...
@@ -101,7 +101,7 @@ sub munge_chr_id {
my
$bam
=
$self
->
bam_open
;
warn
"
Failed to open BAM file
"
.
$self
->
url
unless
$bam
;
return
undef
unless
$bam
;
return
unless
$bam
;
my
$header
=
$bam
->
header
;
...
...
@@ -130,7 +130,7 @@ sub munge_chr_id {
}
warn
"
*** could not parse_region for BAM with
$chr_id
in file
"
.
$self
->
url
.
"
\n
";
return
undef
;
return
;
}
sub
fetch_paired_alignments
{
...
...
modules/Bio/EnsEMBL/IO/Adaptor/BigBedAdaptor.pm
View file @
6765ee11
...
...
@@ -130,7 +130,7 @@ sub munge_chr_id {
warn
"
Failed to open BigBed file
"
.
$self
->
url
unless
$bb
;
return
undef
unless
$bb
;
return
unless
$bb
;
my
$list
=
$bb
->
chromList
;
my
$head
=
$list
->
head
;
...
...
modules/Bio/EnsEMBL/IO/Adaptor/BigWigAdaptor.pm
View file @
6765ee11
...
...
@@ -77,7 +77,7 @@ sub munge_chr_id {
warn
"
Failed to open BigWig file
"
.
$self
->
url
unless
$bw
;
return
undef
unless
$bw
;
return
unless
$bw
;
my
$list
=
$bw
->
chromList
;
my
$head
=
$list
->
head
;
...
...
modules/Bio/EnsEMBL/IO/Adaptor/HTSAdaptor.pm
View file @
6765ee11
...
...
@@ -107,7 +107,7 @@ sub munge_chr_id {
}
warn
"
*** could not parse_region for BAM/CRAM with
$chr_id
in file
"
.
$self
->
url
.
"
\n
";
return
undef
;
return
;
}
sub
fetch_paired_alignments
{
...
...
modules/Bio/EnsEMBL/IO/ColumnBasedParser.pm
View file @
6765ee11
...
...
@@ -312,7 +312,7 @@ sub validate_metadata {
## TODO - implement validation!
}
return
undef
;
return
;
}
=head2 validate_record
...
...
modules/Bio/EnsEMBL/IO/ListBasedParser.pm
View file @
6765ee11
...
...
@@ -57,9 +57,9 @@ sub open {
## This format has no metadata
sub
is_metadata
{
return
undef
;
}
sub
is_metadata
{
return
;
}
sub
read_metadata
{
return
undef
;
}
sub
read_metadata
{
return
;
}
=head2 read_record
...
...
modules/Bio/EnsEMBL/IO/Parser/BaseVCF4.pm
View file @
6765ee11
...
...
@@ -619,7 +619,7 @@ sub get_info_description {
sub
get_raw_formats
{
my
$self
=
shift
;
return
undef
if
(
!
$self
->
get_metadata_by_pragma
('
header
')
->
[
8
]
||
$self
->
get_metadata_by_pragma
('
header
')
->
[
8
]
ne
'
FORMAT
');
return
if
(
!
$self
->
get_metadata_by_pragma
('
header
')
->
[
8
]
||
$self
->
get_metadata_by_pragma
('
header
')
->
[
8
]
ne
'
FORMAT
');
return
$self
->
{'
record
'}[
8
];
}
...
...
@@ -667,14 +667,14 @@ sub get_metadata_description {
if
(
!
defined
(
$type
)
||
!
defined
(
$id
))
{
carp
("
You need to provide a meta type (e.g. 'INFO') and a meta entry ID (e.g. 'AA')
");
return
undef
;
return
;
}
my
$meta
=
$self
->
get_metadata_by_pragma
(
$type
);
foreach
my
$meta_entry
(
@$meta
)
{
return
$meta_entry
->
{'
Description
'}
if
(
$meta_entry
->
{'
ID
'}
eq
$id
);
}
return
undef
;
return
;
}
...
...
modules/Bio/EnsEMBL/IO/Parser/Pileup.pm
View file @
6765ee11
...
...
@@ -60,9 +60,9 @@ sub open {
## This format has no metadata
sub
is_metadata
{
return
undef
;
}
sub
is_metadata
{
return
;
}
sub
read_metadata
{
return
undef
;
}
sub
read_metadata
{
return
;
}
=head2 set_fields
...
...
modules/Bio/EnsEMBL/IO/Parser/VEP_input.pm
View file @
6765ee11
...
...
@@ -58,9 +58,9 @@ sub open {
## This format has no metadata
sub
is_metadata
{
return
undef
;
}
sub
is_metadata
{
return
;
}
sub
read_metadata
{
return
undef
;
}
sub
read_metadata
{
return
;
}
=head2 set_fields
...
...
modules/Bio/EnsEMBL/IO/Parser/VEP_output.pm
View file @
6765ee11
...
...
@@ -62,7 +62,7 @@ sub is_metadata {
sub
read_metadata
{
### No useful metadata, just column names
return
undef
;
return
;
}
=head2 set_fields
...
...
modules/Bio/EnsEMBL/IO/Parser/Wig.pm
View file @
6765ee11
...
...
@@ -274,7 +274,7 @@ sub get_score {
my
$self
=
shift
;
my
$val
=
$self
->
get_raw_score
();
if
(
$val
&&
$val
=~
/^\.$/
)
{
return
undef
;
return
;
}
else
{
return
$val
;
}
...
...
modules/Bio/EnsEMBL/IO/Translator.pm
View file @
6765ee11
...
...
@@ -168,7 +168,7 @@ sub get_field {
}
# If the field doesn't exist, return undef
return
undef
;
return
;
}
=head2 batch_fields
...
...
@@ -230,7 +230,7 @@ sub fetch_callback {
}
# If the field doesn't exist, return undef
return
undef
return
;
}
1
;
modules/Bio/EnsEMBL/IO/Translator/StructuralVariationFeature.pm
View file @
6765ee11
...
...
@@ -283,7 +283,7 @@ sub sv_cipos {
return
"
$info
=
$cipos
";
}
else
{
return
undef
;
return
;
}
}
...
...
@@ -300,7 +300,7 @@ sub sv_ciend {
return
"
$info
=
$ciend
";
}
else
{
return
undef
;
return
;
}
}
...
...
@@ -312,7 +312,7 @@ sub sv_imprecise {
if
((
$object
->
outer_start
&&
$object
->
inner_start
)
||
(
$object
->
inner_end
&&
$object
->
outer_end
))
{
return
$info
;
}
else
{
return
undef
;
return
;
}
}
...
...
modules/EnsEMBL/Web/File/Utils.pm
View file @
6765ee11
...
...
@@ -50,7 +50,7 @@ sub sanitise_path {
}
}
else
{
return
undef
;
return
;
}
}
...
...
@@ -127,7 +127,7 @@ sub get_compression {
return
'
gz
'
if
$file
=~
/\.gz$/
;
return
'
zip
'
if
$file
=~
/\.zip$/
;
return
'
bz
'
if
$file
=~
/\.bz2?$/
;
return
undef
;
return
;
}
}
...
...
modules/EnsEMBL/Web/File/Utils/FileSystem.pm
View file @
6765ee11
...
...
@@ -43,7 +43,7 @@ sub create_path {
my
@directories
=
make_path
(
$path
,
{
%$params
,
'
error
'
=>
\
my
$error
});
if
(
@$error
)
{
return
undef
if
$no_exception
;
return
if
$no_exception
;
throw
(
sprintf
qq(Could not create the given path '%s' due to following errors: \n%s)
,
$path
,
displayable_error
(
$error
));
}
...
...
@@ -62,7 +62,7 @@ sub remove_directory {
my
$file_count
=
remove_tree
(
$path
,
{
%$params
,
'
error
'
=>
\
my
$error
});
if
(
@$error
)
{
return
undef
if
$no_exception
;
return
if
$no_exception
;
throw
(
sprintf
qq(Could not remove the given directory '%s' due to following errors: \n%s)
,
$path
,
displayable_error
(
$error
));
}
...
...
@@ -111,14 +111,14 @@ sub copy_dir_contents {
my
$no_exception
=
delete
$params
->
{'
no_exception
'};
my
$contents
=
[]
;
my
%exclude
=
map
{
$_
=~
s/\/$//r
=>
1
}
@
{
$params
->
{'
exclude
'}
||
[]
};
my
$dir_contents
=
list_dir_contents
(
$source_dir
,
{'
no_exception
'
=>
$no_exception
})
or
return
undef
;
my
$dir_contents
=
list_dir_contents
(
$source_dir
,
{'
no_exception
'
=>
$no_exception
})
or
return
;
if
(
!-
d
$dest_dir
)
{
if
(
$params
->
{'
create_path
'})
{
push
@$contents
,
@
{
create_path
(
$dest_dir
)
};
}
else
{
throw
("
Destination directory
$dest_dir
does not exist.
")
unless
$no_exception
;
return
undef
;
return
;
}
}
...
...
@@ -188,7 +188,7 @@ sub list_dir_contents {
if
(
!
$dh
)
{
throw
("
An error occurred while reading the directory
$dir
: $!
")
unless
$params
->
{'
no_exception
'};
return
undef
;
return
;
}
while
(
my
$content
=
$dh
->
read
)
{
...
...
modules/EnsEMBL/Web/File/Utils/IO.pm
View file @
6765ee11
...
...
@@ -191,7 +191,7 @@ sub fetch_file {
else
{
if
(
$@
)
{
throw
(
sprintf
qq(Could not fetch contents of file '%s' due to following errors: \n%s)
,
$path
,
$@
)
unless
$args
->
{'
no_exception
'};
return
undef
;
return
;
}
else
{
return
$content
;
...
...
@@ -237,7 +237,7 @@ sub read_file {
else
{
if
(
$@
)
{
throw
(
sprintf
qq(Could not read file '%s' due to following errors: \n%s)
,
$path
,
$@
)
unless
$args
->
{'
no_exception
'};
return
undef
;
return
;
}
else
{
return
$content
;
...
...
@@ -285,7 +285,7 @@ sub read_lines {
else
{
if
(
$@
)
{
throw
(
sprintf
qq(Could not read lines from file '%s' due to following errors: \n%s)
,
$path
,
$@
)
unless
$args
->
{'
no_exception
'};
return
undef
;
return
;
}
else
{
return
$content
;
...
...
@@ -347,7 +347,7 @@ sub preview_file {
else
{
if
(
$@
)
{
throw
(
sprintf
qq(Could not fetch preview of file '%s' due to following errors: \n%s)
,
$path
,
$@
)
unless
$args
->
{'
no_exception
'};
return
undef
;
return
;
}
else
{
return
$lines
;
...
...
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