Skip to content

Commit

Permalink
FF-419 #comment changes for creating excel files
Browse files Browse the repository at this point in the history
  • Loading branch information
KorayKirli committed Nov 22, 2016
1 parent 4b3a598 commit a96fc04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wranglertools/fdnDCIC.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:']


Expand Down
11 changes: 11 additions & 0 deletions wranglertools/get_field_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit a96fc04

Please sign in to comment.