## Bsoft program

# bmg

### Usage: bmg [options] input.star/input.img [input.star/input.img]

Manipulates micrograph parameter files.
If the input files are images, a new parameter file will be created.

### Actions:

-reconstructions | Operate on reconstruction parameters rather than micrographs.
-getfield field1 | Get a single field from a parameter file.
-getmicrograph mg1 | Get a single micrograph from a parameter file.
-selected | Show selected particles.
-histogram 80,0.01 | Histogram of magnification values of selected particles.
-add | Add micrograph coordinates and particle origins.
-Euler | Convert orientations from views to Euler angles.
-View | Convert orientations from Euler angles to views.
-flip y | Reverse the particle coordinates in the micrographs along the given axis.
-oriflip y | Reverse the particle origins along the given axis.
-toview -2.5,5.5,9,45 | Transform particle orientations relative to this view.
-toeuler 45,30,10 | Transform particle orientations relative to these Euler angles.
-delete | Delete non-selected micrographs from the parameter file.

### Actions dealing with file references:

-check | Check if files can be found.
-filenames | Delete file names of files not found.

### Actions for generating parameters from images:

-extract part | Extract views from images: mg, frame, rec, part, fil.

### Actions modifiying images:

-write | Write particle views into images.
-bin 3 | Bin micrographs by given kernel size, new file names with a "_b" insert.
-changepixelsize 3.68 | Change the pixel size and all associated size parameters.

### Parameters:

-verbose 7 | Verbosity of output.
-numberperfield 3 | Number of micrographs per field-of-view (default 1).
-fieldID dbgd | Set the field ID (multiple micrographs will get numbered ID's).
-mgpath dir/subdir | Set the micrograph file paths.
-framepath dir/subdir | Set the micrograph frames file paths.
-pspath dir/subdir | Set the power spectrum file paths.
-partpath dir/subdir | Set the particle file paths.
-filpath dir/subdir | Set the filament file paths.
-samemgpart | Set the micrograph and particle file names to be the same.
-Scansampling 3.6 | Set the scan sampling or pixel size (um/pixel).
-Pixelsize 5.5 | Set the pixel size (angstrom/pixel).
-boxsize 55 | Set the particle box size (default from parameter file).
-mgorigin 1256,1256,1 | Set the micrograph origin (voxels).
-partorigin 215,215,1 | Set the particle origin (voxels).

### Actions setting microscope and CTF parameters:

-Magnification 38500 | Set the magnification.
-electrondose 35.5 | Set the electron dose (electrons/angstrom)
-Defocus 1.8,0.3,-34 | Set defocus average, deviation, and astigmatism angle (um, degrees).
-Astigmatism 0.3,-34 | Set defocus deviation and astigmatism angle (um, degrees).
-Cs 2.0 | Set the spherical aberration, Cs (mm).
-Volt 100 | Set the acceleration voltage (kV).
-Amplitude 0.07 | Set the amplitude contrast (fraction)
-alpha 0.15 | Set the illumination half-angle (milliradians).
-basetype 2 | Baseline type: (default 1)
| Type 1: Polynomial with 5 coefficients.
| Type 2: Double Gaussian with 5 coefficients.
| Type 3: EMAN style with 4 coefficients.
-baseline | 1,1.5,-2.6,12.9,30,118 Baseline type and 4 or 5 coefficients: (default 1,0,0,0,0)
-envtype 3 | Envelope type: (default 4)
| Type 1: Single gaussian (2 coefficients).
| Type 2: Single gaussian with constant (3 coefficients).
| Type 3: Double gaussian (4 coefficients).
| Type 4: Double gaussian with constant (5 coefficients).

### Input:

-input input.star | Input master parameter file to merge in data blocks from other input files.
-revert part.star,15 | Replace file names with those in this file,
| with a flag indicating: 1=mg, 2=ps, 4=rec, 8=part.
-replacectf ctf.star | Replace CTF parameters with those in this file.
-validate mg.xsd | Validate XML input file(s) with this schema.

### Output:

-output output.star | Output parameter file (required any time "-split" is used to indicate the type).
-split 3 | Split micrograph or reconstruction data blocks into individual files:
| Argument: 1-6: number of digits inserted before extension
| Argument: "id": micrograph ID's are used as file names (no -output required).
| Argument: "field": field ID's are used as file names (no -output required).
-dump file.txt | Dump all the particle origins and views.

Bsoft version 2.0.3-20180917 (64 bit)