aboutsummaryrefslogtreecommitdiff
path: root/gn3/db/species.py
diff options
context:
space:
mode:
Diffstat (limited to 'gn3/db/species.py')
-rw-r--r--gn3/db/species.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/gn3/db/species.py b/gn3/db/species.py
index 91b78e2..0deae4e 100644
--- a/gn3/db/species.py
+++ b/gn3/db/species.py
@@ -6,6 +6,14 @@ from typing import Any, Optional, Tuple
from MySQLdb import escape_string
+def get_all_species(conn: Any) -> Optional[Tuple]:
+ """Return a list of all species"""
+ with conn.cursor() as cursor:
+ cursor.execute("SELECT Name, MenuName FROM Species "
+ "ORDER BY OrderId")
+ return cursor.fetchall()
+
+
def get_chromosome(name: str, is_species: bool, conn: Any) -> Optional[Tuple]:
"""Given either a group or a species Name, return all the species"""
_sql = ("SELECT Chr_Length.Name, Chr_Length.OrderId, "