Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
8edd9fec
Commit
8edd9fec
authored
7 years ago
by
Tiago Grego
Browse files
Options
Downloads
Patches
Plain Diff
comments updated. Exception added to Biotype::object_type()
parent
8de35115
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!228
Biotype in Core schema
,
!228
Biotype in Core schema
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Bio/EnsEMBL/Biotype.pm
+12
-34
12 additions, 34 deletions
modules/Bio/EnsEMBL/Biotype.pm
modules/Bio/EnsEMBL/DBSQL/BiotypeAdaptor.pm
+10
-19
10 additions, 19 deletions
modules/Bio/EnsEMBL/DBSQL/BiotypeAdaptor.pm
with
22 additions
and
53 deletions
modules/Bio/EnsEMBL/Biotype.pm
+
12
−
34
View file @
8edd9fec
...
...
@@ -90,9 +90,6 @@ use base qw(Bio::EnsEMBL::Storable);
Description: Creates a new biotype object
Returntype : Bio::EnsEMBL::Biotype
Exceptions : none
Caller : general
Status : Stable
=cut
...
...
@@ -126,8 +123,6 @@ sub new {
Description: Getter/Setter for the name of this biotype.
Returntype : string
Exceptions : none
Caller : general
Status : Stable
=cut
...
...
@@ -146,6 +141,8 @@ sub name {
Arg [1] : (optional) string $biotype_group
Example : $biotype_group = $biotype->biotype_group();
Description: Getter/Setter for the biotype_group of this biotype.
Biotype groups are used internally at ensembl pipelines
and consist on few defined categories.
Returntype : string
Exceptions : none
Caller : general
...
...
@@ -167,14 +164,10 @@ sub biotype_group {
Arg [1] : (optional) string $so_acc
Example : $feat->so_acc();
Description: Getter/Setter for the so_acc of this biotype.
It must be a Sequence Ontology like accession (SO:\d*)
-1 is the reverse (negative) so_acc and 1 is the forward
(positive) so_acc. No other values are permitted.
Description: Getter/Setter for the Sequence Ontology accession of this biotype.
It must be a SO like accession.
Returntype : string
Exceptions : thrown if an invalid so_acc argument is passed
Caller : general
Status : Stable
=cut
...
...
@@ -197,10 +190,10 @@ sub so_acc {
Arg [1] : (optional) string $object_type
Example : $object_type = $biotype->object_type();
Description: Getter/Setter for the object_type of this biotype.
Biotypes can be assigned to either genes or transcripts,
object_type refers to which of them.
Returntype : string
Exceptions : none
Caller : general
Status : Stable
Exceptions : thrown if an invalid object_type argument is passed (not gene or transcript)
=cut
...
...
@@ -208,31 +201,16 @@ sub object_type {
my
(
$self
,
$value
)
=
@_
;
if
(
defined
(
$value
)
)
{
$value
=
lc
$value
;
throw
("
object_type must be gene or transcript. Got '
$value
'.
")
unless
(
$value
eq
'
gene
'
||
$value
eq
'
transcript
'
);
$self
->
{'
object_type
'}
=
$value
;
}
return
$self
->
{'
object_type
'};
}
=head2 as_hash
Example : $biotype_hash = $biotype->as_hash();
Description : Retrieves this Biotype as a hash.
Returns : hashref of descriptive strings
Status : Intended for internal use
=cut
sub
as_hash
{
my
(
$self
)
=
@_
;
return
{
name
=>
$self
->
name
,
biotype_group
=>
$self
->
biotype_group
,
so_acc
=>
$self
->
so_acc
,
object_type
=>
$self
->
object_type
,
};
}
use
overload
'
""
'
=>
\
&as_string
;
...
...
@@ -245,7 +223,7 @@ use overload '""' => \&as_string;
If Biotype object is called this is what is returned to maintain compatibility
with legacy biotype() methods in Gene and Transcript objects.
Returns : string for the biotype.
Status : Intended for internal use
=cut
sub
as_string
{
...
...
This diff is collapsed.
Click to expand it.
modules/Bio/EnsEMBL/DBSQL/BiotypeAdaptor.pm
+
10
−
19
View file @
8edd9fec
...
...
@@ -30,19 +30,20 @@ limitations under the License.
=head1 NAME
Bio::EnsEMBL::DBSQL::BiotypeAdaptor -
Encapsulates all generic access
to database meta information
Bio::EnsEMBL::DBSQL::BiotypeAdaptor -
An adaptor which performs database
interaction relating to the storage and retrieval of Biotypes
=head1 SYNOPSIS
my $meta_container = $db_adaptor->get_MetaContainer();
my @mapping_info =
@{ $meta_container->list_value_by_key('assembly.mapping') };
my $biotype = $db_adaptor->fetch_by_name_object_type('protein_coding', 'gene');
=head1 DESCRIPTION
An object that encapsulates access to db meta data
This adaptor provides a means to retrieve and store information related
to Biotypes. Primarily this involves the retrieval or storage of
Bio::EnsEMBL::Biotype objects from a database.
See Bio::EnsEMBL::Biotype for details of the Biotype class.
=head1 METHODS
...
...
@@ -66,8 +67,6 @@ use base qw(Bio::EnsEMBL::DBSQL::BaseAdaptor);
Returns the names, aliases of the tables to use for queries.
Returntype : list of listrefs of strings
Exceptions : none
Caller : internal
Status : Stable
=cut
...
...
@@ -85,8 +84,6 @@ sub _tables {
Returns a list of columns to use for queries.
Returntype : list of strings
Exceptions : none
Caller : internal
Status : Stable
=cut
...
...
@@ -102,10 +99,8 @@ sub _columns {
Example : none
Description: PROTECTED implementation of abstract superclass method.
responsible for the creation of ProteinFeatures
Returntype : listref of Bio::EnsEMBL::Biotype
Returntype : listref of Bio::EnsEMBL::Biotype
objects
Exceptions : none
Caller : internal
Status : At Risk
=cut
...
...
@@ -149,8 +144,6 @@ sub _objs_from_sth {
created with the provided name and object_type to be returned.
Returntype : Bio::EnsEMBL::Biotype
Exceptions : none
Caller : general
Status : Stable
=cut
...
...
@@ -179,10 +172,8 @@ sub fetch_by_name_object_type {
The object_type of the biotypes to retrieve (gene or transcript).
Example : $biotypes = $biotype_adaptor->fetch_all_by_object_type('gene');
Description: Retrieves an array reference of biotype objects from the database.
Returntype : listref of Bio::EnsEMBL::Biotype objects or
undef
Returntype : listref of Bio::EnsEMBL::Biotype objects or
empty list
Exceptions : none
Caller : general
Status : Stable
=cut
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment