Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the MemberProductionCounts DC #559

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions lib/Bio/EnsEMBL/DataCheck/Checks/MemberProductionCounts.pm
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,16 @@ sub tests {
WHERE collection = ?
/;

my $constraint = "tree_type = 'tree' AND ref_root_id IS NULL";
my $sqlCollections = qq/
SELECT DISTINCT clusterset_id
FROM gene_tree_root
WHERE $constraint
/;

my $collections = $helper->execute_simple( -SQL => $sqlCollections );
my $clusterset_query = q/
SELECT DISTINCT clusterset_id, species_set_id
FROM gene_tree_root
JOIN method_link_species_set USING(method_link_species_set_id)
WHERE tree_type = 'tree'
AND ref_root_id IS NULL;
/;

my %clusterset_to_ss_id = map { $_->{'clusterset_id'} => $_->{'species_set_id'} } @{$helper->execute(-SQL => $clusterset_query, -USE_HASHREFS => 1)};
my $collections = [keys %clusterset_to_ss_id];

my $sqlFamilies = q/
SELECT COUNT(*)
Expand All @@ -85,11 +87,12 @@ sub tests {
my $family_count = $helper->execute_single_result( -SQL => $sqlFamilies );

my $sqlPolyploids = q/
SELECT COUNT(*)
FROM genome_db
WHERE genome_component IS NOT NULL
/; # Assumes that the polyploid genomes are found in all the collections
my $polyploid_count = $helper->execute_single_result( -SQL => $sqlPolyploids );
SELECT COUNT(*)
FROM genome_db
JOIN species_set
USING(genome_db_id)
WHERE species_set_id = ? AND genome_component IS NOT NULL;
/;

my $sqlGeneTrees = qq/
SELECT COUNT(*)
Expand All @@ -113,7 +116,7 @@ sub tests {

my $genetree_count = $helper->execute_single_result( -SQL => $sqlGeneTrees, PARAMS => [$collection] );
my $cafetrees_count = $helper->execute_single_result( -SQL => $sqlCAFETrees, PARAMS => [$collection] );

my $polyploid_count = $helper->execute_single_result( -SQL => $sqlPolyploids, PARAMS => [$clusterset_to_ss_id{$collection}] );
my @counts = ($family_count, $genetree_count, $cafetrees_count, $genetree_count, $genetree_count, $polyploid_count);

#Test for families commented out for duration of compara production freeze, this may return in the future
Expand Down