Skip to content

Metadata_utilities_v31

Adrian Quintana edited this page Dec 11, 2017 · 1 revision

!xmipp_metadata_utilities (v3.1)

Usage

Perform several operations on metadata files. If the -o option is not used the original metadata will be modified. Also you can use the --print option just to print out the result metadata to screen. The combination of -i and -o without other operations can serve to extract data blocks inside a medata and write to an independent one.

See also Metadata_import_v3

Parameters

$: Input metadata file $: Output metadata file, if not provided result will overwrite input file $--set, -s &lt;set_operation&gt; &lt;md2_file&gt; &lt;labelimage> <label2=image2> where <set_operation> can be:

    • $ or``: Operations on the metadata structure where <operation> can be:
    • $ or``: File operations where <file_operation> can be:
    • $ or``: Query operations where <query_operation> can be:
    • $ or``: Fill a column values(should be of same type) where <fill_mode> can be:
    • $``: Just print medata to stdout, or if -o is specified written to disk. this option is useful for extrating data blocks inside a metadata. $--mode &lt;modeoverwrite> where <mode> can be:

Examples and notes

Concatenate two metadatas. If label is not provided, by default is 'image'

xmipp_metadata_utilities -i mD1.doc --set union mD2.doc  -o out.doc
Intersect two metadatas using label 'order_'
xmipp_metadata_utilities -i mD1.doc --set intersection mD2.doc order_ -o out.doc
Combine columns from two metadatas. Be sure of both have same number of rows and also there aren't common columns, in that case second metadata columns will be used
xmipp_metadata_utilities -i mD1.doc --set merge mD2.doc -o out.doc
Sort the elements in metadata (using default label 'image').
xmipp_metadata_utilities -i mD1.doc -s sort -o out.doc
You can also add columns and 'filling' its values with different options By example, to add the column 'shiftX' with uniform random value between 0 and 10
xmipp_metadata_utilities -i mD1.doc --fill shiftX rand_uniform 0 10 -o out.doc
Or for initialize metadata columns 'shiftX' and 'shiftY' with a constant value of 5
xmipp_metadata_utilities -i mD1.doc -l "shiftX shiftY" constant 5 -o out.doc
If you have columns that represent the filename of a metadata with other data (ex CTFParams) you cant 'expand' the column with the values in that metadta
xmipp_metadata_utilities -i mD1.doc --fill CTFParams expand -o outExpanded.doc
For check all options availables for 'filling' mode, use:
xmipp_metadata_utilities --help fill
write metadata as table in Sqlite3 database. (use xmipp_sqlite3 to visualize results)
xmipp_metadata_utilities -i [email protected] -o [email protected]
write metadata as xml file.
xmipp_metadata_utilities -i [email protected] -o [email protected]
Copy files in metadata to a location. The metadata will be also copied to new location
xmipp_metadata_utilities -i mD1.doc --file copy /home/pepe/newLocation
Delete files in metadata.
xmipp_metadata_utilities -i mD1.doc --file delete
Select elements in metadata that satisfy a given constrain.
xmipp_metadata_utilities -i mD1.doc --query select "angleRot > 10 AND anglePsi < 0.5" -o out.doc
You can also modify your data using SQLite syntax expression
xmipp_metadata_utilities  -i a.doc --operate modify_values "angleRot=2.*angleRot" -o b.doc
xmipp_metadata_utilities  -i a.doc --operate modify_values "angleRot=radians(angleRot)" -o b.doc
xmipp_metadata_utilities  -i a.doc --operate modify_values "angleRot=sin(radians(angleRot))" -o b.doc
xmipp_metadata_utilities  -i a.doc --operate modify_values "angleRot=sqrt(angleRot)" -o b.doc
xmipp_metadata_utilities  -i a.doc --operate modify_values "image=replace(image, 'xmp','spi')" -o b.doc
xmipp_metadata_utilities  -i a.doc --operate modify_values "image='new_prefix_dir/'||image" -o b.doc
Count number of images per CTF
xmipp_metadata_utilities -i mD1.doc -q count CTFModel -o out.doc
images asigned a ctfgroup
xmipp_metadata_utilities -i mD1.doc -q sum defocusGroup count -o out.doc
Print the metadata Size
xmipp_metadata_utilities -i mD1.doc --query size
Rename Column
xmipp_metadata_utilities -i mD1.doc --operate rename_column "weight wRobust"

User's comments

Clone this wiki locally