The CLI import option
--bulk specifies a configuration file that
can be used to perform a batch of imports with the same or similar
options. The file is written in a simple YAML syntax and can be named
whatever you would like. It does not need to be placed in the folder
from which the OMERO commands are run.
A minimal YAML file might look like:
--- path: "my-files.txt"
my-files.txt is a list of files such as
fileA fileB directoryC
this is equivalent to:
$ omero import -k --transfer=ln_s fileA fileB directoryC
where the files
fileB and all the files of
directoryC will be imported.
path key specifies a file from which each individual line
will be processed as a separate import. In the simplest case, a single
file is placed per line as above. For more complex usages,
can point to a tab-separated value (TSV) or a comma-separate value (CSV)
file where each field will be interpreted based on
A fairly regular requirement in importing many files is that for
each file a similar but slightly different configuration is needed.
This can be accomplished with the
columns key. It specifies how
each of the separated fields of the
path file should be interpreted.
For example, a
bulk.yml file specifying:
--- path: "files.tsv" columns: - name - path
along with a
files.tsv of the form:
import-1 fileA import-2 fileB
would match the two calls:
$ omero import --name import-1 fileA $ omero import --name import-2 fileB
but in a single call. The same could be achieved with this CSV file:
Other options like
target can also be added as a separate field:
Dataset:name:training-set import-1 fileA Dataset:name:training-set import-2 fileB Dataset:name:test-set-001 import-3 fileC
columns in your
columns: - target - name - path
which will create the named datasets if they do not exist. See Import targets for more information on import targets and see below for more examples of options you can use.
include key specifies another bulk YAML file that should be
included in the current processing. For example, if there is a global
omero-imports.yml that all users should use,
--- checksum_algorithm: "File-Size-64" exclude: "clientpath" transfer: "ln_s"
then users can make use of this configuration by adding the following
line to their
dry-run key can either be set to
true in which case
no import will occur, and only the potential actions will be
shown, or additionally it can be set to a file path of the form
%s will be replaced by an number
and a file with the given name will be written out. Each of these
scripts can then be used independently.
Otherwise, all the regular options from the CLI are available for
checksum_algorithmfor faster processing of large files
continuefor processing all files even if one errors
excludefor skipping files that have already been imported
parallel_filesetfor concurrent imports
parallel_uploadfor concurrent uploads
targetfor placing imported images into specific containers
transferfor alternative methods of shipping files to the server
See Import images for more information.