e2bdb - Examine and interact with a EMAN2DB directory
Usage in command lines:
e2bdb.py --cleanup --force --delete --all --long --short --filt --filtexclude --match --exclude --dump --check --nocache --makevstack="bdb:/Home/user/project#output" --appendvstack="bdb:output" --verbose --list="abc.txt" --restore="bdb:vstack"
Clean up the database cache so files can safely be moved or accessed on another computer via NFS, e.g.
- e2bdb.py --clean
Do not use the database cache for this operation - Cache was permanently disabled as of August 2013.
- Force an action that would normally fail due to failed checks.
Delete (or at least empty) the named database(s) e.g.
- e2bdb.py bdb:filename --delete
- List per-particle info
- Give details for each database
- Return each database name in 'bdb:database' format for use
Only include dictionary names containing the specified string e.g.
- e2bdb.py . --makevstack=bdb:vstack --filt=abc
Exclude dictionary names containing the specified string e.g.
- e2bdb.py . --makevstack=bdb:vstack --filtexclude=abc
Only include dictionaries matching the provided Python regular expression e.g.
- e2bdb.py . --makevstack=bdb:vstack --match=abc
- The name of a database containing a list of exclusion keys
List contents of an entire database, e.g.
- e2bdb.py -D refine_01#register
- Check for self-consistency and errors in the structure of specified databases
- Verbose level [0-9], higner number means higher level of verboseness
Make a 'virtual' image stack from one or more other stacks, e.g:
- e2bdb.py bdb:db1 bdb:db2 --makevstack=bdb:db3
will combine images in db1 and db2 into db3. Please note that any change in metadata of db1 or db2, there won't be changes in db3. However, if there are changes in the image data, it will appear at db3. In order to include all stack with a common root in the name (for example, db1, db2, db3) into one virtual stack called data, use:
- e2bdb.py . --makevstack=bdb:data --filt=db
Appends to/creates a 'virtual' BDB stack with its own metadata e.g.
- e2bdb.py bdb:db1 bdb:db2 --appendvstack=bdb:db3
Inputs an ASCII file with selected image to creates a new virtual BDB stack from an existed virtual stack, e.g.
- e2bdb.py bdb:#db1 bdb:#db2 --makevstack=bdb:.#db3 --list=abc.txt
Write changes in the derived virtual stack back to the original stack, e.g.
- e2bdb.py --restore=bdb:vstack
IN EMAN2, the usage of Berkeley DB file format has been increased since it is very convenient to manipulate the metadata separately from the image data, and it is faster that other formats, such as HDF. As it has this special structure, its files are stored in a folder named EMAN2DB, which cannot manually copy or remove files in it.
Note: It is important to emphasize that one cannot manually rename or edit the files in the EMAN2DB directory. Doing so can corrupt the entire database such that programs will no longer be able to access it properly. You can safely move the directory as a whole to a different location, but otherwise it should not be modified. The e2bdb program is using to interact with the EMAN2DB directory.
Virtual stack is a stack of metadata associated with the image data. When generate a virtual stack, unlike doing this same task with e2proc2d.py bdb:.#db1 bdb:.#db3; e2proc2d.py bdb:.#db2 bdb:.#db3, it will only generate the metadata stack. When generate a virtual stack, in the metadata, image location will be recored as data_path, original image ID will be recored as data_n, and the original stack will be recored as data_source.
By using the --list option, we are able to generate a virtual stack which contains metadata information of selected images. The virtual stack can be manipulate just as the original bdb files. Changes in virtual stack won't appear on the original stack. One can use the --restore option to write the change back to the original stack. It is very convenient to do so, and this functionality is expected to be very useful if one would like to use virtual stack for iteration.
Author / Maintainer
Steve Ludtke, Ran Lin
- category 1