| 1 | =head1 LICENSE | ||
| 2 | |||
| 3 | See the NOTICE file distributed with this work for additional information | ||
| 4 | regarding copyright ownership. | ||
| 5 | |||
| 6 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | you may not use this file except in compliance with the License. | ||
| 8 | You may obtain a copy of the License at | ||
| 9 | |||
| 10 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | |||
| 12 | Unless required by applicable law or agreed to in writing, software | ||
| 13 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | See the License for the specific language governing permissions and | ||
| 16 | limitations under the License. | ||
| 17 | |||
| 18 | =cut | ||
| 19 | |||
| 20 | |||
| 21 | =head1 CONTACT | ||
| 22 | |||
| 23 | Please email comments or questions to the public Ensembl | ||
| 24 | developers list at <http://lists.ensembl.org/mailman/listinfo/dev>. | ||
| 25 | |||
| 26 | Questions may also be sent to the Ensembl help desk at | ||
| 27 | <http://www.ensembl.org/Help/Contact>. | ||
| 28 | |||
| 29 | =cut | ||
| 30 | |||
| 31 | =head1 NAME | ||
| 32 | |||
| 33 | Bio::EnsEMBL::IdMapping::TinyTranslation - lightweight translation object | ||
| 34 | |||
| 35 | =head1 SYNOPSIS | ||
| 36 | |||
| 37 | if ( my $tl = $tr->translation ) { | ||
| 38 | my $lightweight_tl = | ||
| 39 | Bio::EnsEMBL::IdMapping::TinyTranslation->new_fast( [ | ||
| 40 | $tl->dbID, $tl->stable_id, | ||
| 41 | $tl->version, $tl->created_date, | ||
| 42 | $tl->modified_date, $tr->dbID, | ||
| 43 | $tr->translate->seq, | ||
| 44 | ] ); | ||
| 45 | } | ||
| 46 | |||
| 47 | =head1 DESCRIPTION | ||
| 48 | |||
| 49 | This is a lightweight translation object for the stable Id mapping. See | ||
| 50 | the documentation in TinyFeature for general considerations about its | ||
| 51 | design. | ||
| 52 | |||
| 53 | =head1 METHODS | ||
| 54 | |||
| 55 | transcript_id | ||
| 56 | seq | ||
| 57 | |||
| 58 | =cut | ||
| 59 | |||
| 60 | package Bio::EnsEMBL::IdMapping::TinyTranslation; | ||
| 61 | $Bio::EnsEMBL::IdMapping::TinyTranslation::VERSION = '114.0.0'; | ||
| 62 | # internal data structure (array indices): | ||
| 63 | # | ||
| 64 | # 0-4 see TinyFeature | ||
| 65 | # 5 transcript_id | ||
| 66 | # 6 seq | ||
| 67 | |||
| 68 | |||
| 69 | use strict; | ||
| 70 | use warnings; | ||
| 71 | no warnings 'uninitialized'; | ||
| 72 | |||
| 73 | use Bio::EnsEMBL::IdMapping::TinyFeature; | ||
| 74 | our @ISA = qw(Bio::EnsEMBL::IdMapping::TinyFeature); | ||
| 75 | |||
| 76 | use Bio::EnsEMBL::Utils::Exception qw(throw warning); | ||
| 77 | |||
| 78 | |||
| 79 | =head2 transcript_id | ||
| 80 | |||
| 81 | Arg[1] : (optional) Int - the transcript internal Id ("dbID") | ||
| 82 | Description : Getter/setter for the transcript internal Id this translation is | ||
| 83 | attached to. | ||
| 84 | Return type : Int | ||
| 85 | Exceptions : none | ||
| 86 | Caller : general | ||
| 87 | Status : At Risk | ||
| 88 | : under development | ||
| 89 | |||
| 90 | =cut | ||
| 91 | |||
| 92 | sub transcript_id { | ||
| 93 | my $self = shift; | ||
| 94 | $self->[5] = shift if (@_); | ||
| 95 | return $self->[5]; | ||
| 96 | } | ||
| 97 | |||
| 98 | |||
| 99 | =head2 seq | ||
| 100 | |||
| 101 | Arg[1] : (optional) String - the translation's sequence | ||
| 102 | Description : Getter/setter for the translation's sequence. | ||
| 103 | Return type : String | ||
| 104 | Exceptions : none | ||
| 105 | Caller : general | ||
| 106 | Status : At Risk | ||
| 107 | : under development | ||
| 108 | |||
| 109 | =cut | ||
| 110 | |||
| 111 | sub seq { | ||
| 112 | my $self = shift; | ||
| 113 | $self->[6] = shift if (@_); | ||
| 114 | return $self->[6]; | ||
| 115 | } | ||
| 116 | |||
| 117 | |||
| 118 | |||
| 119 | 1; | ||
| 120 |