|
ensembl-hive
2.8.1
|
This object represents a stable ID history tree graph.
The graph is implemented as a collection of nodes (ArchiveStableId
objects) and links (StableIdEvent objects) which have positions
on an (x,y) grid. The x axis is used for releases, the y axis for
stable_ids. The idea is to create a plot similar to this (the numbers
shown on the nodes are the stable ID versions):
ENSG001 1-------------- 2--
\
ENSG003 1-----1
/
ENSG002 1-------2----------
38 39 40 41 42
The grid coordinates of the ArchiveStableId objects in this example
would be (note that coordinates are zero-based):
ENSG001.1 (0, 0)
ENSG001.2 (2, 0)
ENSG003.1 (release 41) (3, 1)
ENSG003.1 (release 42) (4, 1)
ENSG002.1 (0, 2)
ENSG002.2 (1, 2)
The tree will only contain those nodes which had a change in the stable
ID version. Therefore, in the above example, in release 39 ENSG001 was
present and had version 1 (but will not be drawn there, to unclutter the
output).
The grid positions will be calculated by the API and will try to
untangle the tree (i.e. try to avoid overlapping lines).
Definition at line 73 of file StableIdHistoryTree.pm.
| protected Bio::EnsEMBL::StableIdHistoryTree::_factorial | ( | ) |
Undocumented method
Code:
| protected Bio::EnsEMBL::StableIdHistoryTree::_index_of | ( | ) |
Undocumented method
Code:
| protected Bio::EnsEMBL::StableIdHistoryTree::_link_id | ( | ) |
Undocumented method
Code:
| protected Bio::EnsEMBL::StableIdHistoryTree::_move_nodes | ( | ) |
Undocumented method
Code:
| protected Bio::EnsEMBL::StableIdHistoryTree::_node_id | ( | ) |
Undocumented method
Code:
| protected Bio::EnsEMBL::StableIdHistoryTree::_sort_links | ( | ) |
Undocumented method
Code:
| protected Bio::EnsEMBL::StableIdHistoryTree::_sort_releases | ( | ) |
Undocumented method
Code:
| protected Bio::EnsEMBL::StableIdHistoryTree::_sort_stable_ids | ( | ) |
Undocumented method
Code:
| protected Bio::EnsEMBL::StableIdHistoryTree::_total_link_length | ( | ) |
Undocumented method
Code:
| public void Bio::EnsEMBL::StableIdHistoryTree::add_ArchiveStableIds | ( | ) |
Arg[1..n] : Bio::EnsEMBL::ArchiveStableId's @archive_ids The ArchiveStableIds to add to the the history tree Example :
Description : Adds ArchiveStableIds (nodes) to the history tree. No
calculation of grid coordinates is done at this point, you need
to initiate this manually with calculate_coords().
ArchiveStableIds are only added once for each release (to avoid
duplicates).
Return type : none
Exceptions : thrown on invalid or missing argument
Caller : Bio::EnsEMBL::DBSQL::ArchiveStableIdAdaptor::fetch_history_by_stable_id, general
Status : At Risk
: under development
Code:
| public void Bio::EnsEMBL::StableIdHistoryTree::add_ArchiveStableIds_for_events | ( | ) |
Example :
Description : Convenience method that adds all ArchiveStableIds for all
StableIdEvents attached to this object to the tree.
Return type : none
Exceptions : none
Caller : Bio::EnsEMBL::DBSQL::ArchiveStableIdAdaptor::fetch_history_by_stable_id, general
Status : At Risk
: under development
Code:
| public void Bio::EnsEMBL::StableIdHistoryTree::add_StableIdEvents | ( | ) |
Arg[1..n] : Bio::EnsEMBL::StableIdEvent's @events The StableIdEvents to add to the the history tree Example :
Description : Adds StableIdEvents (links) to the history tree. Note that
ArchiveStableIds attached to the StableIdEvent aren't added to
the tree automatically, you'll need to call
add_ArchiveStableIds_for_events later.
Return type : none
Exceptions : thrown on invalid or missing argument
Caller : Bio::EnsEMBL::DBSQL::ArchiveStableIdAdaptor::fetch_history_by_stable_id, general
Status : At Risk
: under development
Code:
| public void Bio::EnsEMBL::StableIdHistoryTree::calculate_coords | ( | ) |
Arg [1] : (optional) Float $time_limit
Optimise tree normally runs until it hits a minimised state
but this can take a very long time. Therefore you can
opt to bail out of the optimisation early. Specify the
time in seconds. Floating point values are supported should you
require sub-second limits
Example : Description : Pre-calculates the grid coordinates of all nodes in the tree.
Return type : none
Exceptions : none
Caller : ArchiveStableIdAdaptor::fetch_history_by_stable_id
Status : At Risk
: under development
Code:
| public void Bio::EnsEMBL::StableIdHistoryTree::consolidate_tree | ( | ) |
Example :
Description : Consolidate the history tree. This means removing nodes where
there wasn't a change and bridging gaps in the history. The end
result will be a sparse tree which only contains the necessary
information.
Return type : none
Exceptions : none
Caller : ArchiveStableIdAdaptor->fetch_history_tree_by_stable_id
Status : At Risk
: under development
Code:
| public Arrayref Bio::EnsEMBL::StableIdHistoryTree::coords_by_ArchiveStableId | ( | ) |
Arg[1] : Bio::EnsEMBL::ArchiveStableId $archive_id The ArchiveStableId to get tree grid coordinates for Example :
print $archive_id->stable_id, " coords: $x, $y\n"; Description : Returns the coordinates of an ArchiveStableId in the history tree grid. If the ArchiveStableId isn't found in this tree, an empty list is returned.
Coordinates are zero-based (i.e. the top leftmost element in
the grid has coordinates [0, 0], not [1, 1]). This is to
facilitate using them to create a matrix as a two-dimensional
array of arrays.
Return type : Arrayref (x coordinate, y coordinate)
Exceptions : thrown on wrong argument type
Caller : general
Status : At Risk
: under development
Code:
| public String Bio::EnsEMBL::StableIdHistoryTree::current_assembly | ( | ) |
Arg[1] : (optional) String $assembly - the assembly to set Example :
Description : Getter/setter for current assembly.
Return type : String
Exceptions : none
Caller : general
Status : At Risk
: under development
Code:
| public String Bio::EnsEMBL::StableIdHistoryTree::current_dbname | ( | ) |
Arg[1] : (optional) String $dbname - the dbname to set Example :
Description : Getter/setter for current dbname.
Return type : String
Exceptions : none
Caller : general
Status : At Risk
: under development
Code:
| public Int Bio::EnsEMBL::StableIdHistoryTree::current_release | ( | ) |
Arg[1] : (optional) Int $release - the release to set Example :
Description : Getter/setter for current release.
Return type : Int
Exceptions : none
Caller : general
Status : At Risk
: under development
Code:
| public void Bio::EnsEMBL::StableIdHistoryTree::flush_ArchiveStableIds | ( | ) |
Example :
Description : Remove all ArchiveStableIds from the tree.
Return type : none
Exceptions : none
Caller : general
Status : At Risk
: under development
Code:
| public void Bio::EnsEMBL::StableIdHistoryTree::flush_StableIdEvents | ( | ) |
Example :
Description : Removes all StableIdEvents from the tree.
Return type : none
Exceptions : none
Caller : general
Status : At Risk
: under development
Code:
| public Arrayref Bio::EnsEMBL::StableIdHistoryTree::get_all_ArchiveStableIds | ( | ) |
Example :
Description : Gets all ArchiveStableIds (nodes) in this tree. Return type : Arrayref of Bio::EnsEMBL::ArchiveStableId objects Exceptions : none Caller : general Status : At Risk : under development
Code:
| public Arrayref Bio::EnsEMBL::StableIdHistoryTree::get_all_current_ArchiveStableIds | ( | ) |
Example :
Description : Convenience method to get all current ArchiveStableIds in this
tree. Note that no lazy loading of "current" status is done at that
stage; as long as you retrieve your StableIdHistoryTree object
from ArchiveStableIdAdaptor, you'll get the right answer. In
other use cases, if you want to make sure you really get all
current stable IDs, loop over the result of
get_all_ArchiveStableIds() and call
ArchiveStableId->current_version() on all of them.
Return type : Arrayref of Bio::EnsEMBL::ArchiveStableId objects
Exceptions : none
Caller : general
Status : At Risk
: under development
Code:
| public Arrayref Bio::EnsEMBL::StableIdHistoryTree::get_all_StableIdEvents | ( | ) |
Example :
print "Old stable ID: ",
($event->get_attribute('old', 'stable_id') or 'none'), "\n";
print "New stable ID: ",
($event->get_attribute('new', 'stable_id') or 'none'), "\n";
print "Mapping score: ", $event->score, "\n";
}
Description : Gets all StableIdsEvents (links) in this tree.
Return type : Arrayref of Bio::EnsEMBL::StableIdEvent objects
Exceptions : none
Caller : general
Status : At Risk
: under development
Code:
| public Bio::EnsEMBL::StableIdEvent Bio::EnsEMBL::StableIdHistoryTree::get_latest_StableIdEvent | ( | ) |
Arg[1] : Bio::EnsEMBL::ArchiveStableId $arch_id - the stable ID to get the latest Event for Example :
Description : Returns the latest StableIdEvent found in the tree where a given stable ID is the new stable ID. If more than one is found (e.g. in a merge scenario in the latest mapping), preference is given to self-events. Return type : Bio::EnsEMBL::StableIdEvent Exceptions : thrown on missing or wrong argument Caller : Bio::EnsEMBL::DBSQL::ArchiveStableIdAdaptor::add_all_current_to_history, general Status : At Risk : under development
Code:
| public Arrayref Bio::EnsEMBL::StableIdHistoryTree::get_release_db_names | ( | ) |
Example :
Description : Returns a chronologically sorted list of unique release
db_names in this tree.
Return type : Arrayref of strings.
Exceptions : none
Caller : general
Status : At Risk
: under development
Code:
| public Arrayref Bio::EnsEMBL::StableIdHistoryTree::get_release_display_names | ( | ) |
Example :
Description : Returns a chronologically sorted list of unique release
display_names in this tree. This method can be used to determine the number of columns when
plotting the history tree.
Return type : Arrayref of strings.
Exceptions : none
Caller : general
Status : At Risk
: under development
Code:
| public Arrayref Bio::EnsEMBL::StableIdHistoryTree::get_unique_stable_ids | ( | ) |
Example :
Description : Returns a list of unique stable IDs in this tree. Version is not
taken into account here. This method can be used to determine
the number of rows when plotting the history with each stable ID
occupying one line. Sort algorithm will depend on what was chosen when the sorted
tree was generated. This ranges from a simple alphanumeric sort
to algorithms trying to untangle the history tree. If no
pre-sorted data is found, an alphanumerically sorted list will
be returned by default.
Return type : Arrayref of strings.
Exceptions : none
Caller : general
Status : At Risk
: under development
Code:
| public Boolean Bio::EnsEMBL::StableIdHistoryTree::is_incomplete | ( | ) |
Arg[1] : (optional) Boolean $incomplete Example :
Description : Getter/setter for incomplete flag. This is used by
ArchiveStableIdAdaptor to indicate that it finished building
the tree prematurely due to too many mappins in the db and can
be used by applications to print warning messages.
Return type : Boolean
Exceptions : none
Caller : general
Status : At Risk
: under development
Code:
| public Bio::EnsEMBL::StableIdHistoryTree Bio::EnsEMBL::StableIdHistoryTree::new | ( | ) |
Arg [CURRENT_DBNAME] : (optional) name of current db Arg [CURRENT_RELEASE] : (optional) current release number Arg [CURRENT_ASSEMBLY] : (optional) current assembly name Example :
Description : object constructor Return type : Bio::EnsEMBL::StableIdHistoryTree Exceptions : none Caller : general Status : At Risk : under development
Code:
| public void Bio::EnsEMBL::StableIdHistoryTree::optimise_tree | ( | ) |
Arg [1] : (optional) Float $time_limit
Optimise tree normally runs until it hits a minimised state
but this can take a very long time. Therefore you can
opt to bail out of the optimisation early. Specify the
time in seconds. Floating point values are supported should you
require sub-second limits
Example : Description : This method sorts the history tree so that the number of
overlapping branches is minimised (thus "untangling" the tree). It uses a clustering algorithm for this which iteratively moves
the nodes with the largest vertical distance next to each other
and looking for a mininum in total branch length. This might not
produce the overall optimum but usually converges on a local
optimum very quickly.
Return type : none
Exceptions : none
Caller : calculate_coords
Status : At Risk
: under development
Code:
| public void Bio::EnsEMBL::StableIdHistoryTree::remove_ArchiveStableId | ( | ) |
Arg[1] : Bio::EnsEMBL::ArchiveStableId $archive_id the ArchiveStableId to remove from the tree Example :
Description : Removes an ArchiveStableId from the tree. Return type : none Exceptions : thrown on missing or invalid argument Caller : Bio::EnsEMBL::DBSQL::ArchiveStableIdAdaptor::fetch_history_by_stable_id, general Status : At Risk : under development
Code:
| public void Bio::EnsEMBL::StableIdHistoryTree::remove_StableIdEvent | ( | ) |
Arg[1] : Bio::EnsEMBL::StableIdEvent $event the StableIdEvent to remove from the tree Example :
Description : Removes a StableIdEvent from the tree. Return type : none Exceptions : thrown on missing or invalid arguments Caller : Bio::EnsEMBL::DBSQL::ArchiveStableIdAdaptor::fetch_history_by_stable_id, general Status : At Risk : under development
Code:
| public void Bio::EnsEMBL::StableIdHistoryTree::reset_tree | ( | ) |
Example :
Description : Resets all pre-calculated tree grid data. Mostly used internally
by methods that modify the tree.
Return type : none
Exceptions : none
Caller : internal
Status : At Risk
: under development
Code: