aboutsummaryrefslogtreecommitdiff
path: root/gn3/db
diff options
context:
space:
mode:
authorBonfaceKilz2021-07-27 11:35:23 +0300
committerBonfaceKilz2021-07-29 08:49:46 +0300
commitf5d83ab0e6db9ed5fab2a97695fee698ed484f9a (patch)
tree313aaf575e1df559ef25098c8fd8b9ac73de635a /gn3/db
parent0b8f5fef2398385113d8e480050b8cb1ed404b4d (diff)
downloadgenenetwork3-f5d83ab0e6db9ed5fab2a97695fee698ed484f9a.tar.gz
db: traits: Remove publishdata column
Diffstat (limited to 'gn3/db')
-rw-r--r--gn3/db/traits.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/gn3/db/traits.py b/gn3/db/traits.py
index ec4fa5a..4baac67 100644
--- a/gn3/db/traits.py
+++ b/gn3/db/traits.py
@@ -18,10 +18,15 @@ def get_trait_csv_sample_data(conn: Any,
"PublishData.Id = PublishXRef.DataId AND "
"PublishXRef.Id = %s AND PublishXRef.PhenotypeId = %s "
"AND PublishData.StrainId = Strain.Id Order BY Strain.Name")
- csv_data = ["Strain Id, Publish Data Id,Strain Name,Value,SE,Count"]
+ csv_data = ["Strain Id,Strain Name,Value,SE,Count"]
+ publishdata_id = ""
with conn.cursor() as cursor:
cursor.execute(sql, (trait_name, phenotype_id,))
for record in cursor.fetchall():
- csv_data.append(",".join([str(val) if val else "x"
- for val in record]))
- return "\n".join(csv_data)
+ (strain_id, publishdata_id,
+ strain_name, value, error, count) = record
+ csv_data.append(
+ ",".join([str(val) if val else "x"
+ for val in (strain_id, strain_name,
+ value, error, count)]))
+ return f"# Publish Data Id: {publishdata_id}\n\n" + "\n".join(csv_data)