Specifying a temporary directory via command line

Is there support for assigning a temporary directory in CellProfiler?

I have a situation similar to this one: Unable to change temporary directory on cluster, where I have a PBS/Torque cluster and the /tmp/ directory on the nodes is very limited in space. When running a CellProfiler job, two files are written in this directory, a .h5 file that looks something like “CellProfilerImageCache4GQWlo.h5”, and an .hdf5 file that looks something like “Cpmeasurements1aoH7l.hdf5”

Running 2.2.0rc3 there seems to be support for a "-t " flag for the command line functionality, but running 2.4.0rc1 and this seems to no longer be supported according to this issue:

The LIMS documentation mentions both the use of the “-t” flag (which is now depricated), and the ability to assign the write path for the .hdf5 file

Using the latter method (“cellprofiler mytmpfile.hdf5 -c -r -p pipeline_file.cppipe --data-file=data_file.csv”) the .hdf5 file is written to the correct location but the .h5 file is sill being written in /tmp/

Specifying a /tmp/ file in the CellProfiler GUI does not transfer to the .cppipe file and therefore does not effect the headless run

Any help or work-arounds would be great.


CellProfiler respects your system’s temporary environment variable (e.g. TMPDIR on Linux), e.g.

$ export TMPDIR=/foo/bar $ cellprofiler ...

1 Like

As of this morning, -t has been added back to the master branch of CP; not sure exactly what branch or commit you were running but it should be back now for the foreseeable future.

This method seems to work in an inconsistent way. We’re using a PBS queue to simultaneously run many cellprofiler jobs. Most of the time the files go to the location specified by TMPDIR, but occasionally intermediate results will appear in /tmp/. Any thoughts on why this is happening?

This is with the cellprofiler version circia July.

@gregjohnso It sounds like a bug. Meanwhile, you should consider using a post-Aug 10 build and specifying a temporary directory with the -t flag.