Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ingest for VIDRL flat files #164

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions source-data/vidrl_flat_file_column_map.tsv

This file was deleted.

22 changes: 12 additions & 10 deletions tdb/elife_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,20 @@ def format_measurements(self, measurements, **kwargs):
self.format_subtype(meas)
self.format_assay_type(meas)
self.format_date(meas)
tmp = kwargs['fstem'].split('-')[0]
if len(tmp) > 8:
tmp = tmp[:(8-len(tmp))]
elif len(tmp) < 8:
meas['assay_date'] = "XXXX-XX-XX"
else:
if tmp[0:2] == '20':
meas['assay_date'] = "{}-{}-{}".format(tmp[0:4],tmp[4:6],tmp[6:8])
# Only overwrite the "assay_date" if it's not already available
if meas.get("assay_date", None) is None:
tmp = kwargs['fstem'].split('-')[0]
if len(tmp) > 8:
tmp = tmp[:(8-len(tmp))]
elif len(tmp) < 8:
meas['assay_date'] = "XXXX-XX-XX"
else:
if tmp[0:2] == '20':
meas['assay_date'] = "{}-{}-{}".format(tmp[0:4],tmp[4:6],tmp[6:8])
else:
meas['assay_date'] = "XXXX-XX-XX"
if 'assay_date' not in meas.keys() or meas['assay_date'] is None:
meas['assay_date'] = "XXXX-XX-XX"
if 'assay_date' not in meas.keys() or meas['assay_date'] is None:
meas['assay_date'] = "XXXX-XX-XX"
self.format_passage(meas, 'serum_passage', 'serum_passage_category')
self.format_passage(meas, 'virus_passage', 'virus_passage_category')
self.format_ref(meas)
Expand Down
Loading