LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2024] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
CONTACT
Please email comments or questions to the public Ensembl
developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.
Questions may also be sent to the Ensembl help desk at
<http://www.ensembl.org/Help/Contact>.
NAME
Bio::EnsEMBL::Utils::TranscriptSelector - Finds canonical transcripts
SYNOPSIS
my $selector = Bio::EnsEMBL::Utils::TranscriptSelector->new($ccds_dba);
my $canonical_transcript = $selector->select_canonical_transcript_for_Gene($gene);
DESCRIPTION
The decision process for choosing a canonical transcript of a given Gene is
an involved process. This package converts transcript attributes into
numeric values, sorts the values and returns the favourite transcript.
The canonical order of precedence is as follows:
longest translation of transcript present in CCDS that is reference sequence
longest translation of protein-coding transcript
longest translation of transcript marked nonsense-mediated-decay
longest translation of any other transcript (premature stop codon translations have an effective length of 0)
longest non-coding transcript
first stable ID in alphabetical order
The last condition is to give consistent behaviour when everything is else is equal.
It selects the "older" stable ID, thus preventing new IDs supplanting old ones that
remain correct.
new
Arg [1] : Optional - CCDS database adaptor - needed for species with CCDS only
Arg [2] : Optional - Boolean verbose flag. Turn on to fill your logs
Description: Constructor
Returntype : Bio::EnsEMBL::Utils::TranscriptSelector
select_canonical_transcript_for_Gene
Arg 1 : Bio::EnsEMBL::Gene
Example : $canonical_transcript = $selector->select_canonical_transcript_for_Gene
Description: Sorts the Transcripts of this Gene into order of suitability,
and returns the favourite Transcript.
Returntype : Bio::EnsEMBL::Transcript
Exceptions :
encode_transcript
Arg 1 : Transcript
Description: Converts a transcript into a list of encoded values for sorting
Priorities are defined immediately above
Unimportant biotypes and sources are classed as 'other'
Returntype : Listref of encoded attributes
sort_into_canonical_order
Arg 1 : 2D array reference of numerically encoded values
0 1 2 3 4 5 6
( [transcript dbID, translates, source , biotype, translation length, transcript length, stable ID],
...
)
Description: see Schwartzian transform for method in the following madness:
sort the 6-column array by the last 5 columns, then map the first elements
into a list of dbIDs, now in canonical order.
Returntype : Listref of ensembl dbIDs
Caller : select_canonical_transcript_for_Gene
check_Ens_trans_against_CCDS
Arg 1 : Transcript
Description: Attempts to find a matching transcript in CCDS by comparing Exon
composition. Returns true if one is found, or silently ends.
Returntype : Boolean
Caller : encode_transcript