Commit 8ac32cc0 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

more effecient way compute no functions genes

parent cfecdeaa
......@@ -32,7 +32,10 @@ class GeneStatistics(Statistics):
def count_has_function(self, source=None):
if source is None:
filters = {'functions__isnull': False}
all_genes_count = self.get_queryset().count()
filters = {'functions__isnull': True}
no_functions_genes_count = self.get_queryset(filters=filters).count()
return all_genes_count - no_functions_genes_count
filters = {'functions__source': source}
return self.get_queryset(filters=filters).distinct().count()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment