Skip to main content

Scripts and Tools for Electron Microscopy Analysis.

Project description

STEMIA

Scripts and Tools for Electron Microscopy Image Analysis.

This is a simple personal collection of (sometimes...) useful scripts and tools for cryoem/cryoet.

Installation

pip install stemia

Tools

Everything is accessible through the main command line interface stemia. Try stemia -h.

stemia aretomo aln2xf

Usage: stemia aretomo aln2xf [OPTIONS] ALN_FILE

  Convert AreTomo `aln` file to imod `xf` format.

Options:
  -f, --overwrite  overwrite existing output
  --help           Show this message and exit.

stemia aretomo batch_warp

Usage: stemia aretomo batch_warp [OPTIONS] WARP_DIR

  Run aretomo in batch on data preprocessed in warp.

  Needs to be ran after imod stacks were generated. Requires ccderaser and
  AreTomo. Assumes the default Warp directory structure with generated imod
  stacks. Some warp xml files may be updated to disable too dark images.

Options:
  -m, --mdoc-dir PATH
  -o, --output-dir PATH           output directory for all the processing. If
                                  None, defined as warp_dir/aretomo
  -d, --dry-run                   only print some info, without running the
                                  commands.
  -v, --verbose                   print individual commands
  -j, --just TEXT                 quickly reconstruct just this tomogram with
                                  a simple setup. Useful for testing and to
                                  estimate sample thickness
  -t, --thickness INTEGER         unbinned thickness of the SAMPLE (ice or
                                  lamella); the reconstruction will be 20%
                                  thicker, but this will be used for alignment
  -b, --binning INTEGER           binning for aretomo reconstruction (relative
                                  to warp binning)
  -a, --tilt-axis FLOAT           starting tilt axis for AreTomo, if any
  -p, --patches INTEGER           number of patches for local alignment in
                                  aretomo (NxN)
  -f, --overwrite                 overwrite any previous existing run
  --train                         whether to train a new denosing model
  --topaz-patch-size INTEGER      patch size for denoising in topaz.
  --start-from [fix|align|reconstruct|stack_halves|reconstruct_halves|denoise]
                                  use outputs from a previous run, starting
                                  processing at this step
  --stop-at [fix|align|reconstruct|stack_halves|reconstruct_halves|denoise]
                                  terminate processing after this step
  --ccderaser TEXT                command for ccderaser
  --aretomo TEXT                  command for aretomo
  --help                          Show this message and exit.

stemia aretomo batch

Usage: stemia aretomo batch [OPTIONS]

  Run AreTomo on a full directory.

Options:
  --help  Show this message and exit.

stemia cryosparc csplot

Usage: stemia cryosparc csplot [OPTIONS] JOB_DIR

  Read cryosparc file(s) and plot interactively any column.

  An interactive ipython shell will be opened with data loaded into a pandas
  dataframe.

  CS_FILE:     a .cs file followed by any number of passthrough files

Options:
  --help  Show this message and exit.

stemia cryosparc generate_tilt_angles

Usage: stemia cryosparc generate_tilt_angles [OPTIONS] STAR_FILE TILT_ANGLE
                                             TILT_AXIS

  Generate angle priors for a tilted dataset.

  Read a Relion STAR_FILE with in-plane angles and generate priors for rot and
  tilt angles based on a TILT_ANGLE around a TILT_AXIS.

Options:
  -r, --radians           Provide angles in radians instead of degrees
  -o, --star-output FILE  where to put the updated version of the star file
                          [default: <STAR_FILE>_tilted.star]
  -f, --overwrite         overwrite output if exists
  --help                  Show this message and exit.

stemia image center_filament

Usage: stemia image center_filament [OPTIONS] INPUT [OUTPUT]

  Center an mrc image (stack) containing filament(s).

  Can update particles in a RELION .star file accordingly. If OUTPUT is not
  given, default to INPUT_centered.mrc

Options:
  -s, --update-star FILE        a RELION .star file to update with new
                                particle positions
  -o, --star-output FILE        where to put the updated version of the star
                                file. Only used if -s is passed [default:
                                STARFILE_centered.star]
  --update-by [class|particle]  whether to update particle positions by
                                classes or 1 by 1. Only used if -s is passed
                                [default: class]
  -f, --overwrite               overwrite output if exists
  -n, --n-filaments INTEGER     number of filaments on the image  [default: 2]
  -p, --percentile INTEGER      percentile for binarisation  [default: 85]
  --help                        Show this message and exit.

stemia image flip_z

Usage: stemia image flip_z [OPTIONS] STAR_PATH

  Flip the z axis for particles in a RELION star file.

  STAR_PATH: star file to flip along z

  Assumes all tomograms have the same shape.

Options:
  -o, --output FILE
  -m, --mrc_path FILE
  --star_pixel_size FLOAT
  --mrc_pixel_size FLOAT
  --z_shape INTEGER
  --help                   Show this message and exit.

stemia image rescale

Usage: stemia image rescale [OPTIONS] INPUT OUTPUT TARGET_PIXEL_SIZE

  Rescale an mrc image to the specified pixel size.

  TARGET_PIXEL_SIZE: target pixel size in Angstrom

Options:
  --input-pixel-size FLOAT  force input pizel size and ignore mrc header
  -f, --overwrite           overwrite output if exists
  --help                    Show this message and exit.

stemia warp fix_mdoc

Usage: stemia warp fix_mdoc [OPTIONS] DATA_DIR

  Fix mdoc files to point to the right data.

Options:
  --help  Show this message and exit.

stemia warp offset_angle

Usage: stemia warp offset_angle [OPTIONS] [WARP_DIR]

  Offset tilt angles in warp xml files.

Options:
  --help  Show this message and exit.

stemia warp parse_xml

Usage: stemia warp parse_xml [OPTIONS] XML_FILE

  Parse a warp xml file and print its content.

Options:
  --help  Show this message and exit.

stemia warp prepare_isonet

Usage: stemia warp prepare_isonet [OPTIONS] WARP_DIR ISO_STAR

  Update an isonet starfile with preprocessing data from warp.

Options:
  --help  Show this message and exit.

stemia warp summarize

Usage: stemia warp summarize [OPTIONS] [WARP_DIR]

  Summarize the state of a Warp project.

Options:
  --help  Show this message and exit.

stemia warp preprocess_serialem

Usage: stemia warp preprocess_serialem [OPTIONS] RAW_DATA_DIR

  Prepare and unpack data from sterialEM for Warp.

  You must be in a new directory for this to work; new files will be placed
  there with the same name as the original tifs.

  RAW_DATA_DIR: the directory containing the raw data

Options:
  --help  Show this message and exit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stemia-0.5.1.tar.gz (40.3 kB view hashes)

Uploaded Source

Built Distribution

stemia-0.5.1-py2.py3-none-any.whl (46.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page