From a96fc042e01ee1fdd40ba5676693c1f9734b9c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Koray=20K=C4=B1rl=C4=B1?= Date: Tue, 22 Nov 2016 17:35:59 -0500 Subject: [PATCH] FF-419 #comment changes for creating excel files --- wranglertools/fdnDCIC.py | 3 ++- wranglertools/get_field_info.py | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/wranglertools/fdnDCIC.py b/wranglertools/fdnDCIC.py index 6f509288..aaccc3bb 100644 --- a/wranglertools/fdnDCIC.py +++ b/wranglertools/fdnDCIC.py @@ -165,7 +165,8 @@ def filter_and_sort(list_names): useful = sorted(useful) return useful -move_frond = ['award', '*award', 'lab', '*lab', 'description', +move_frond = ['experiment_set', '*tec_rep_no', '*bio_rep_no', '*replicate_set', + 'award', '*award', 'lab', '*lab', 'description', 'title', '*title', 'name', '*name', 'aliases', '#Field Name:'] diff --git a/wranglertools/get_field_info.py b/wranglertools/get_field_info.py index e0c2d498..570254be 100755 --- a/wranglertools/get_field_info.py +++ b/wranglertools/get_field_info.py @@ -94,6 +94,13 @@ class FieldInfo(object): comm = attr.ib(default=u'') enum = attr.ib(default=u'') +# additional fields for experiment sheets to capture experiment_set related information +exp_set_addition = [FieldInfo('*replicate_set', 'Item:ExperimentSetReplicate', 'Grouping for replicate experiments'), + FieldInfo('*bio_rep_no', 'number', 'Biological replicate number'), + FieldInfo('*tec_rep_no', 'number', 'Technical replicate number'), + FieldInfo('experiment_set', 'Item:ExperimentSet', 'Grouping for non-replicate experiments') + ] + def get_field_type(field): field_type = field.get('type', '') @@ -176,6 +183,8 @@ def get_uploadable_fields(connection, types, include_description=False, include_description, include_comments, include_enums) + if name.startswith('Experiment') and not name.startswith('ExperimentSet'): + fields[name].extend(exp_set_addition) return fields @@ -203,6 +212,8 @@ def create_xls(all_fields, filename): add_info += str(field.comm) if field.enum: add_info += "Choices:" + str(field.enum) + if not field.comm and not field.enum: + add_info = "-" ws.write(3, col+1, add_info) wb.save(filename)