Skip to content

Commit 957153a

Browse files
committed
updating a few things // switching branches
1 parent 27761fd commit 957153a

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

ingest/templates/ingest/metadata_questions.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ <h3>Step 2 of 3: What does your data look like?</h3>
4646
<input type="radio" id="ingest_method_5" name="ingest_method" value="ingest_5">
4747
</td>
4848
<td>
49-
<p>5. SWC (description TBD)</p>
49+
<p>5. Reconstructed neurons in standardized swc format. All reconstructions were generated from one specimen. There should be one line listed in the specimen tab. There should be one line listed in the dataset tab. No information should be listed in the image tab. File format specification: <a href="http://www.neuronland.org/NLMorphologyConverter/MorphologyFormats/SWC/Spec.html">http://www.neuronland.org/NLMorphologyConverter/MorphologyFormats/SWC/Spec.html</a>
50+
</p>
5051
</td>
5152
</tr>
5253
</table>

ingest/views.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ def check_swc_sheet(filename):
14341434
workbook=xlrd.open_workbook(filename)
14351435
sheetname = 'SWC'
14361436
swc_sheet = workbook.sheet_by_name(sheetname)
1437-
colheads=['tracingFile', 'sourceData', 'sourceDataSample', 'sourceDataSubmission', 'coordinates', 'coordinatesRegistration', 'brainRegion', 'brainRegionAtlas', 'brainRegionAtlasName', 'brainRegionAxonalProjection', 'brainRegionDendriticProjection', 'neuronType', 'segmentTags', 'proofreadingLevel', 'notes']
1437+
colheads=['tracingFile', 'sourceData', 'sourceDataSample', 'sourceDataSubmission', 'coordinates', 'coordinatesRegistration', 'brainRegion', 'brainRegionAtlas', 'brainRegionAtlasName', 'brainRegionAxonalProjection', 'brainRegionDendriticProjection', 'neuronType', 'segmentTags', 'proofreadingLevel', 'Notes']
14381438
cellcols=['A','B','C','D','E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O']
14391439
coordinatesRegistration = ['Yes', 'No']
14401440
cols=swc_sheet.row_values(3)
@@ -1643,12 +1643,12 @@ def save_swc_sheet(swcs, sheet, saved_datasets):
16431643

16441644
swc = SWC(tracingFile=tracingFile, sourceData=sourceData, sourceDataSample=sourceDataSample, sourceDataSubmission=sourceDataSubmission, coordinates=coordinates, coordinatesRegistration=coordinatesRegistration, brainRegion=brainRegion, brainRegionAtlas=brainRegionAtlas, brainRegionAtlasName=brainRegionAtlasName, brainRegionAxonalProjection=brainRegionAxonalProjection, brainRegionDendriticProjection=brainRegionDendriticProjection, neuronType=neuronType, segmentTags=segmentTags, proofreadingLevel=proofreadingLevel, notes=notes, data_set_id=data_set_id,sheet_id=sheet.id)
16451645
swc_no_uuid = swc.save()
1646-
print(swc_no_uuid.id)
1646+
print('swc id: ' + swc_no_uuid.id)
16471647

16481648

16491649
swc_uuid = Mne.num_to_mne(swc_no_uuid.id)
16501650

1651-
print(swc_uuid)
1651+
print('swc_uuid: '+ swc_uuid)
16521652

16531653
this_swc = SWC.objects.get(id=swc_no_uuid.id)
16541654
# this_swc(swc_uuid=swc_uuid)
@@ -2028,7 +2028,7 @@ def save_specimen_sheet_method_4(specimen_set, sheet):
20282028

20292029
def save_specimen_sheet_method_5(specimen_set, sheet):
20302030
# 1 datasets, 1 instruments, 0 images
2031-
# single specimen
2031+
# 1 specimen
20322032
try:
20332033
for s in specimen_set:
20342034
localid = s['LocalID']
@@ -2392,12 +2392,12 @@ def save_all_sheets_method_4(instruments, specimen_set, images, datasets, sheet,
23922392
saved = False
23932393

23942394
def save_all_sheets_method_5(instruments, specimen_set, datasets, sheet, contributors, funders, publications, swcs):
2395-
# if swc tab filled out we don't want images
2396-
# 1 dataset row should be filled out
2397-
# many SWC : 1 dataset
2395+
# if swc tab filled out we don't want images
2396+
# 1 dataset row should be filled out
2397+
# many SWC : 1 dataset
23982398
# 1 specimen
23992399
# 1 instrument
2400-
# 1 datasest
2400+
# 1 datasest
24012401

24022402
try:
24032403
specimen_object_method_5 = save_specimen_sheet_method_5(specimen_set, sheet)
@@ -2435,7 +2435,8 @@ def metadata_version_check(filename):
24352435
version1 = True
24362436
return version1
24372437

2438-
def check_all_sheets(filename):
2438+
def check_all_sheets(filename, ingest_method):
2439+
ingest_method = ingest_method
24392440
errormsg = check_contributors_sheet(filename)
24402441
if errormsg != '':
24412442
return errormsg
@@ -2454,12 +2455,14 @@ def check_all_sheets(filename):
24542455
errormsg = check_specimen_sheet(filename)
24552456
if errormsg != '':
24562457
return errormsg
2457-
errormsg = check_image_sheet(filename)
2458-
if errormsg != '':
2459-
return errormsg
2460-
errormsg = check_swc_sheet(filename)
2461-
if errormsg != '':
2462-
return errormsg
2458+
if ingest_method != 'ingest_5':
2459+
errormsg = check_image_sheet(filename)
2460+
if errormsg != '':
2461+
return errormsg
2462+
if ingest_method == 'ingest_5':
2463+
errormsg = check_swc_sheet(filename)
2464+
if errormsg != '':
2465+
return errormsg
24632466
return errormsg
24642467

24652468
@login_required
@@ -2493,7 +2496,7 @@ def descriptive_metadata_upload(request):
24932496
# datapath = '/home/shared_bil_dev/testetc/'
24942497

24952498
# for development locally
2496-
datapath = '/Users/luketuite/Desktop/bil_metadata_uploads'
2499+
datapath = '/Users/ecp/Desktop/bil_metadata_uploads'
24972500

24982501
spreadsheet_file = request.FILES['spreadsheet_file']
24992502

@@ -2514,7 +2517,7 @@ def descriptive_metadata_upload(request):
25142517

25152518
# using new metadata model
25162519
elif version1 == False:
2517-
errormsg = check_all_sheets(filename)
2520+
errormsg = check_all_sheets(filename, ingest_method)
25182521
if errormsg != '':
25192522
messages.error(request, errormsg)
25202523
return redirect('ingest:descriptive_metadata_upload')

0 commit comments

Comments
 (0)