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
76b7ff0a
Commit
76b7ff0a
authored
Jul 22, 2003
by
Arne Stabenau
Browse files
minor changes, formatting
parent
d154c61e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
35 deletions
+38
-35
modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm
+2
-2
modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm
+15
-14
modules/Bio/EnsEMBL/DBSQL/SequenceAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/SequenceAdaptor.pm
+2
-0
modules/Bio/EnsEMBL/Slice.pm
modules/Bio/EnsEMBL/Slice.pm
+15
-15
modules/t/canonicalDBAdaptor.t
modules/t/canonicalDBAdaptor.t
+4
-4
No files found.
modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm
View file @
76b7ff0a
...
...
@@ -129,7 +129,7 @@ sub register_region{
$self
->
throw
("
$assmapper
is not a Bio::EnsEMBL::AssemblyMapper
")
unless
$assmapper
->
isa
("
Bio::EnsEMBL::AssemblyMapper
");
my
$chr
=
$self
->
db
->
get_ChromosomeAdaptor
()
->
fetch_by_name
(
$chr_name
);
my
$chr
=
$self
->
db
->
get_ChromosomeAdaptor
()
->
fetch_by_
chr_
name
(
$chr_name
);
my
$chr_id
=
$chr
->
dbID
();
my
$max_assembly_contig
=
$self
->
db
()
->
get_MetaContainer
->
get_max_assembly_contig
();
...
...
@@ -142,7 +142,7 @@ sub register_region{
ass.chr_start,
ass.chr_end
from
assembly ass
,
assembly ass
where
ass.chromosome_id = $chr_id and
? <= ass.chr_end and
...
...
modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm
View file @
76b7ff0a
...
...
@@ -1124,7 +1124,8 @@ sub set_adaptor() {
Arg [1] : List of names of feature adaptors to get. If no adaptor names are given, all the defined adaptors are returned.
Example : $db->get_GenericFeature("SomeFeature", "SomeOtherFeature")
Description: Returns a hash containing the named feature adaptors (or all feature adaptors).
Returntype : Hash containing the named feature adaptors (or all feature adaptors).
Returntype : reference to a Hash containing the named
feature adaptors (or all feature adaptors).
Exceptions : If any of the the named generic feature adaptors do not exist.
Caller : external
...
...
@@ -1132,22 +1133,22 @@ sub set_adaptor() {
sub
get_GenericFeatureAdaptors
()
{
my
(
$self
,
@names
)
=
@_
;
my
(
$self
,
@names
)
=
@_
;
my
%adaptors
=
{}
;
my
%adaptors
=
()
;
if
(
!
@names
)
{
%adaptors
=
%
{
$self
->
{'
generic_feature_adaptors
'}};
}
else
{
foreach
my
$name
(
@names
)
{
if
(
!
exists
(
$self
->
{'
generic_feature_adaptors
'}
->
{
$name
}))
{
$self
->
throw
("
No generic feature adaptor has been defined for
$name
"
);
}
%
adaptors
->
{
$name
}
=
$self
->
{'
generic_feature_adaptors
'}
->
{
$name
};
}
}
if
(
!
@names
)
{
%adaptors
=
%
{
$self
->
{'
generic_feature_adaptors
'}};
}
else
{
foreach
my
$name
(
@names
)
{
if
(
!
exists
(
$self
->
{'
generic_feature_adaptors
'}
->
{
$name
}))
{
$self
->
throw
("
No generic feature adaptor has been defined for
$name
"
);
}
$
adaptors
{
$name
}
=
$self
->
{'
generic_feature_adaptors
'}
->
{
$name
};
}
}
return
%adaptors
;
return
\
%adaptors
;
}
...
...
modules/Bio/EnsEMBL/DBSQL/SequenceAdaptor.pm
View file @
76b7ff0a
...
...
@@ -70,6 +70,8 @@ sub fetch_by_RawContig_start_end_strand {
my
(
$self
,
$contig
,
$start
,
$end
,
$strand
,
$compressed
)
=
@_
;
my
$sth
;
$compressed
||=
0
;
if
(
$start
<
1
)
{
$self
->
throw
(
"
Wrong parameters
"
);
}
...
...
modules/Bio/EnsEMBL/Slice.pm
View file @
76b7ff0a
...
...
@@ -1496,25 +1496,25 @@ sub get_generic_features() {
my
(
$self
,
@names
)
=
@_
;
my
$db
=
$self
->
adaptor
()
->
db
();
my
$db
=
$self
->
adaptor
()
->
db
();
my
%features
=
{}
;
# this will hold the results
my
%features
=
()
;
# this will hold the results
# get the adaptors for each feature
my
%adaptors
=
$db
->
get_GenericFeatureAdaptors
(
@names
);
# get the adaptors for each feature
my
%adaptors
=
%
{
$db
->
get_GenericFeatureAdaptors
(
@names
)
}
;
foreach
my
$adaptor_name
(
keys
(
%adaptors
))
{
foreach
my
$adaptor_name
(
keys
(
%adaptors
))
{
my
$adaptor_obj
=
%adaptors
->
{
$adaptor_name
};
# get the features and add them to the hash
my
$features_ref
=
$adaptor_obj
->
fetch_all_by_Slice
(
$self
);
# add each feature to the hash to be returned
foreach
my
$feature
(
@$features_ref
)
{
%
features
->
{
$adaptor_name
}
=
$feature
;
}
}
return
%features
;
my
$adaptor_obj
=
%adaptors
->
{
$adaptor_name
};
# get the features and add them to the hash
my
$features_ref
=
$adaptor_obj
->
fetch_all_by_Slice
(
$self
);
# add each feature to the hash to be returned
foreach
my
$feature
(
@$features_ref
)
{
$
features
{
$adaptor_name
}
=
$feature
;
}
}
return
\
%features
;
}
...
...
modules/t/canonicalDBAdaptor.t
View file @
76b7ff0a
...
...
@@ -119,11 +119,11 @@ ok($db->add_GenericFeatureAdaptor("Simple", $sfa));
# Check get-ing the above
# by name ...
my
%generic_adaptors
=
$db
->
get_GenericFeatureAdaptors
("
Simple
",
"
Repeat
");
my
%generic_adaptors
=
%
{
$db
->
get_GenericFeatureAdaptors
("
Simple
",
"
Repeat
")
}
;
ok
(
%generic_adaptors
);
# no arg should return all
%generic_adaptors
=
$db
->
get_GenericFeatureAdaptors
();
%generic_adaptors
=
%
{
$db
->
get_GenericFeatureAdaptors
()
}
;
my
$size
=
keys
(
%generic_adaptors
);
ok
(
$size
==
2
);
...
...
@@ -135,5 +135,5 @@ ok($@);
my
$slice
=
$db
->
get_SliceAdaptor
()
->
fetch_by_chr_start_end
('
X
',
1
,
10000
);
ok
(
$slice
);
my
%features
=
$slice
->
get_generic_features
();
ok
(
%features
);
my
%features
=
%
{
$slice
->
get_generic_features
()
}
;
ok
(
!
%features
);
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