aboutsummaryrefslogtreecommitdiff
path: root/scripts/insert_data.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/insert_data.py')
-rw-r--r--scripts/insert_data.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/insert_data.py b/scripts/insert_data.py
index 7d3c1c6..23ae108 100644
--- a/scripts/insert_data.py
+++ b/scripts/insert_data.py
@@ -107,8 +107,12 @@ def check_strains(headings_strains, db_strains):
file=sys.stderr)
sys.exit(1)
+
def annotationinfo(
- dbconn: mdb.Connection, platformid: int, datasetid: int) -> dict:
+ dbconn: mdb.Connection,
+ platformid: int,
+ datasetid: int
+) -> dict[str, dict]:
"Get annotation information from the database."
# This is somewhat slow. Look into optimising the behaviour
def __organise_annotations__(accm, item):
@@ -277,8 +281,11 @@ def insert_se(# pylint: disable = [too-many-arguments]
return 1
se_values = (
- {"DataId": annotations[str(item["ProbeSetId"])]["DataId"], **item}
- for item in read_datavalues(filepath, headings, strains))
+ {"DataId": annotations[str(item["ProbeSetName"])]["DataId"], **item}
+ for item in (
+ row for psrows in
+ read_datavalues(filepath, headings, strains).values()
+ for row in psrows))
with dbconn.cursor(cursorclass=DictCursor) as cursor:
while True:
serrors = tuple(take(se_values, 1000))