|
17 | 17 |
|
18 | 18 | DATA_ROOT = '/home/ubuntu/bucket' |
19 | 19 | LOCAL_OUTPUT = '/home/ubuntu/local_output' |
| 20 | +PLUGIN_DIR = '/home/ubuntu/CellProfiler-plugins' |
20 | 21 | QUEUE_URL = os.environ['SQS_QUEUE_URL'] |
21 | 22 | AWS_BUCKET = os.environ['AWS_BUCKET'] |
22 | 23 | LOG_GROUP_NAME= os.environ['LOG_GROUP_NAME'] |
|
26 | 27 | MIN_FILE_SIZE_BYTES = 1 |
27 | 28 | else: |
28 | 29 | MIN_FILE_SIZE_BYTES = int(os.environ['MIN_FILE_SIZE_BYTES']) |
| 30 | +if 'USE_PLUGINS' not in os.environ: |
| 31 | + USE_PLUGINS = 'False' |
| 32 | +else: |
| 33 | + USE_PLUGINS = os.environ['USE_PLUGINS'] |
29 | 34 |
|
30 | 35 | ################################# |
31 | 36 | # CLASS TO HANDLE THE SQS QUEUE |
@@ -129,7 +134,7 @@ def runCellProfiler(message): |
129 | 134 | remoteOut= os.path.join(message['output'],metadataID) |
130 | 135 | replaceValues = {'PL':message['pipeline'], 'OUT':localOut, 'FL':message['data_file'], |
131 | 136 | 'DATA': DATA_ROOT, 'Metadata': message['Metadata'], 'IN': message['input'], |
132 | | - 'MetadataID':metadataID } |
| 137 | + 'MetadataID':metadataID, 'PLUGINS':PLUGIN_DIR } |
133 | 138 | # See if this is a message you've already handled, if you've so chosen |
134 | 139 | if CHECK_IF_DONE_BOOL.upper() == 'TRUE': |
135 | 140 | try: |
@@ -159,9 +164,12 @@ def runCellProfiler(message): |
159 | 164 | cpDone = localOut + '/cp.is.done' |
160 | 165 | if message['pipeline'][-3:]!='.h5': |
161 | 166 | cmd = cmdstem + '-p %(DATA)s/%(PL)s -i %(DATA)s/%(IN)s -o %(OUT)s -d ' + cpDone |
162 | | - cmd += ' --data-file=%(DATA)s/%(FL)s -g %(Metadata)s' |
| 167 | + cmd += ' --data-file=%(DATA)s/%(FL)s ' |
| 168 | + cmd += '-g %(Metadata)s' |
163 | 169 | else: |
164 | 170 | cmd = cmdstem + '-p %(DATA)s/%(PL)s -i %(DATA)s/%(IN)s -o %(OUT)s -d ' + cpDone + ' --data-file=%(DATA)s/%(FL)s -g %(Metadata)s' |
| 171 | + if USE_PLUGINS == 'True': |
| 172 | + cmd += ' --plugins-directory=%(PLUGINS)s' |
165 | 173 | cmd = cmd % replaceValues |
166 | 174 | print('Running', cmd) |
167 | 175 | logger.info(cmd) |
|
0 commit comments