-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INCUBATORS-17: use reconciliation attributes to get the speciation an…
…d duplication counts.
- Loading branch information
Showing
4 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
lib/IPlant/DB/TreeRec/ResultSet/ReconciliationAttribute.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package IPlant::DB::TreeRec::ResultSet::ReconciliationAttribute; | ||
|
||
use warnings; | ||
use strict; | ||
|
||
use IPlant::TreeRec::X; | ||
|
||
use base 'DBIx::Class::ResultSet'; | ||
|
||
########################################################################## | ||
# Usage : @values = $dbh->resultset('ReconciliationAttribute') | ||
# ->get_values( $reconciliation_id, $attribute_name ); | ||
# | ||
# Purpose : Retrieves the attribute values for all attributes of the | ||
# reconciliation with the given ID that have the given name. | ||
# | ||
# Returns : The list of values. | ||
# | ||
# Parameters : $reconciliation_id - the reconciliation identifier. | ||
# $attribute_name - the name of the attribute. | ||
# | ||
# Throws : No exceptions. | ||
sub get_values { | ||
my ( $self, $reconciliation_id, $attribute_name ) = @_; | ||
|
||
# Find the tree. | ||
my @results = $self->search( | ||
{ 'reconciliation_id' => $reconciliation_id, | ||
'cvterm.name' => $attribute_name, | ||
}, | ||
{ 'join' => 'cvterm' } | ||
); | ||
|
||
return map { $_->value() } @results; | ||
} | ||
|
||
1; | ||
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters