Skip to content

Commit 27c3b37

Browse files
Resolve conflicts for master (#81)
Related to merging master into dev
1 parent d4eb322 commit 27c3b37

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

drop-boxes/register-omero-metadata/backendinterface.py

-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,6 @@ def get_args():
407407
key_value = pair.split("::")
408408
key_value_data.append(key_value)
409409

410-
411410
add_annotations_to_image(conn, str(args.image_id), key_value_data)
412411

413412
print "0"

drop-boxes/register-omero-metadata/image_registration_process.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def __init__(self, transaction, env_name="omero_env_0", project_code="", sample_
2424
self._sample_code = sample_code
2525

2626
### set exec. env
27+
2728
self._conda_path = conda_home_path
2829
if not conda_path is None:
2930
self._conda_path = conda_path
@@ -47,6 +48,7 @@ def __init__(self, transaction, env_name="omero_env_0", project_code="", sample_
4748
self._init_cmd_list.append('export PATH=$PATH:' + self._conda_path + 'envs/' + env_name + '/bin')
4849

4950
# move to the dir where backendinterface.py lives for exec.
51+
5052
self._init_cmd_list.append('cd ' + self._etl_path)
5153

5254
def fetchOpenBisSampleCode(self):
@@ -63,6 +65,7 @@ def fetchOpenBisSampleCode(self):
6365

6466
def searchOpenBisSample(self, sample_code):
6567
# find specific sample
68+
6669
sc = SearchCriteria()
6770
sc.addMatchClause(SearchCriteria.MatchClause.createAttributeMatch(SearchCriteria.MatchClauseAttribute.CODE, sample_code))
6871
foundSamples = self._search_service.searchForSamples(sc)
@@ -100,7 +103,7 @@ def requestOmeroDatasetId(self, project_code=None, sample_code=None):
100103
return ds_id
101104

102105
def registerImageFileInOmero(self, file_path, dataset_id):
103-
106+
104107
cmd_list = list(self._init_cmd_list)
105108
cmd_list.append( "python backendinterface.py -f " + file_path + " -d " + str(dataset_id) )
106109

@@ -123,6 +126,7 @@ def triggerOMETiffConversion(self):
123126
pass
124127

125128
#ToDo Check if Metadata file is provided as defined
129+
126130
def extractMetadataFromTSV(self, tsv_file_path):
127131
tsvFileMap = {}
128132
try:
@@ -147,6 +151,7 @@ def registerOmeroKeyValuePairs(self, image_id, property_map):
147151
cmd_list = list(self._init_cmd_list)
148152

149153
# string format: key1::value1//key2::value2//key3::value3//...
154+
150155
key_value_str = ""
151156
for key in property_map.keys():
152157
key_value_str = key_value_str + str(key) + "::" + str(property_map[key]) + "//"
@@ -161,7 +166,6 @@ def registerOmeroKeyValuePairs(self, image_id, property_map):
161166
process = Popen( "/bin/bash", shell=False, universal_newlines=True, stdin=PIPE, stdout=PIPE, stderr=PIPE )
162167
out, err = process.communicate( commands )
163168

164-
165169
return 0
166170

167171

drop-boxes/register-omero-metadata/register-omero.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@
5555
# and delete the data!
5656
#####
5757

58-
5958
INCOMING_DATE_FORMAT = '%d.%m.%Y'
6059
OPENBIS_DATE_FORMAT = '%Y-%m-%d'
6160

6261
PROPPERTY_FILTER_LIST = ["IMAGE_FILE_NAME", "INSTRUMENT_USER", "IMAGING_DATE"]
6362

64-
6563
def mapDateString(date_string):
6664
return datetime.datetime.strptime(date_string, INCOMING_DATE_FORMAT).strftime(OPENBIS_DATE_FORMAT)
6765

@@ -245,6 +243,8 @@ def process(transaction):
245243

246244
# 1. Initialize the image registration process
247245
registrationProcess = irp.ImageRegistrationProcess(transaction)
246+
247+
print "started reg. process"
248248

249249
# 2. We want to get the openBIS sample code from the incoming data
250250
# This tells us to which biological sample the image data was aquired from.
@@ -253,13 +253,14 @@ def process(transaction):
253253
#find specific sample
254254
tissueSample = registrationProcess.searchOpenBisSample(sample_code)
255255
space = tissueSample.getSpace()
256-
256+
257257
# 3. We now request the associated omero dataset id for the openBIS sample code.
258258
# Each dataset in OMERO contains the associated openBIS biological sample id, which
259259
# happened during the experimental design registration with the projectwizard.
260260

261261
# Starts omero registration
262262
# returns -1 if fetching dataset-id operation failed
263+
263264
omero_dataset_id = registrationProcess.requestOmeroDatasetId(project_code=project_code, sample_code=sample_code)
264265

265266
print "omero dataset id:"
@@ -342,3 +343,4 @@ def process(transaction):
342343

343344
# 7. Last but not least we create the open science file format for images which is
344345
# OMERO-Tiff and store it in OMERO next to the proprierary vendor format.
346+

0 commit comments

Comments
 (0)