diff options
author | BonfaceKilz | 2021-07-27 11:35:23 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-07-29 08:49:46 +0300 |
commit | f5d83ab0e6db9ed5fab2a97695fee698ed484f9a (patch) | |
tree | 313aaf575e1df559ef25098c8fd8b9ac73de635a /gn3/db/traits.py | |
parent | 0b8f5fef2398385113d8e480050b8cb1ed404b4d (diff) | |
download | genenetwork3-f5d83ab0e6db9ed5fab2a97695fee698ed484f9a.tar.gz |
db: traits: Remove publishdata column
Diffstat (limited to 'gn3/db/traits.py')
-rw-r--r-- | gn3/db/traits.py | 13 |
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) |