This is an old revision of the document!


Convert Coordinates Thread

This Thread can be used to convert between different coordinate file formats: cow-style plt ↔ relion-style plt , cow-style plt↔ star . It can also split up a master star file containing coordinate information of multiple micrographs into separate plts or star. If a master star file is to be split is determined at runtime by going through a star file to be imported and checking if the key _rlnMicrographName is existing in the header. In that case, a new plt/star file and the given subdirectories are created whenever a new value for the _rlnMicrographName is found in the file. This only works if the the section “Do star(cow) to/from Star(relion) conversions” is disabled! Coordinate values when converting to a star file are depraved of the “.5” that the cow picker adds to it. When converting to a plt file, the “.5” is added to each coordinate value, as well as the 1.0 in the third column. This doesn't bother Relion if loading a file into there and unfortunately is needed in the cow for now. Also, due to problems with K2 handling , the pre-import and post-export value conversions necessary for transferring data stacks between relion and cow need to be handled with this thread by activating “Do star(cow) to/from Star(relion) conversions” and chosing the necessary options. Typical usage examples can be found in the corresponding section at the bottom of this document.

General options that are needed for all conversion operations

Switch x and y coordinates

If checked, will switch the coordinate values with one another

Output filetype

Either star or plt, if “Do star(cow) to/from Star(relion) conversions” is enabled, the output file will always be a star file

Input files

The files or the folder containing the files to be converted. If “Do star(cow) to/from Star(relion) conversions” is enabled, the input file needs to be a star file

Output Directory

The directory where the converted files are written to

Suffix to add to filename

A string that will be appended to the name of the input file to identify the output file, e.g. :

Input file name: fileOne.plt, chosen suffix: _converted → Output file name : fileOne_converted.plt

If left blank, nothing is added. Careful if output directory is where input files lie, this can lead to file corruption or errors!!!

Here, the value to be flipped plus the needed micrograph dimension can be chosen by the user. Important: The values are mirrored before the coordinates are switched.

Flip Coordinate

Choice is either first or second value. As in plt files no meta information is given, this value assignment to x and y cannot always be done without mistake, therefore the general notion is used. Internally this is treated as the order of values that are found → In a cow-style plt file, y is the first column and x is the second. To counteract the effects the mrcs being mirrored across the y-axis in the cow, the x value would have to be mirrored, so in this case, the second value. Relion always writes X first and then Y (with information about those values in the header), so here the two columns for X and Y are read and X is treated as first and Y as second value. Going from relion star to cow-style plt, the first value would have to be flipped.

Micrograph Dimension of flip Coordinate

The dimension of the origin micrograph in the chosen flip direction in pixels. For 4K micrographs, this is 4096, for K2 images it is 3838 in cow→ relion mode and 3710 for relion → cow mode for counting mode.

This section contains options for the case that no simple coordinate file is to be converted, but rather a big star file containing particle stacks that needs to be transferred between Relion and the cow. Coordinate Conversions can still be performed, the paths to the files can be fixed and euler angle + applied Y Shift conversions are also handled here. Note: If this mode is activated, the input files need to be .star and the output filetype will always be .star .

Star file usage direction

This is relevant mostly for Euler angle conversions for now as the direction of usage determines the formula to convert the given values from Relions ZYZ ↔ cow ZXZ . Furthermore, if from Cow To Relion is selected, all commas (that are unintentionally written by the StarIO) in non-filename header values (_rlnImageName, _rlnOriginalImageName and _rlnMicrographName) will be replaced by periods.

Absolute path to relion launch folder

This string, if given, is preprended to each value of _rlnImageName (or if only _rlnOriginalImageName if only that is available) and before the path part of the _rlnMicrographName string (e.g. 001@test/mg1.mrc , absolute path: /home/relion/ , converted: 001@/home/relion/test/mg1.mrc). This needs to be used to make relion written star files readable in the cow as the new relion writes paths relative to the relion launching path and not to the star file. To help the cow understand this, absolute paths to the given files are created through this option. One of the three described headerkeys needs to be in the input star file or the cow will moo in disapproval and will not finish the conversions.

Convert Euler Angles

If selected, converts the euler Angles based on the formulas that were previously in the starIO.xml . For this to work, the keys _rlnAngleRot, _rlnAngleTilt and _rlnAnglePsi need to exist in the input star file.

Convert Y Shift

If selected, inverts the applied Y Shift. For this to work , _rlnOriginY needs to exist in the star file

Here, relevant settings that should be chosen for given parameters are summarized.

Cow-style plt written by the Windows Cow 2016.10.25v1 or local linux version with older timestamp but from around early November to relion plt / star

  • Switch x and y Coordinates: Yes
  • Output filetype, input files, output directory, suffix: User's choice
  • Mirror Coordinates and associated parameters: off
  • Do star(cow) to/from Star(relion) conversions: off

Cow-style plt written by the Cow 2016.11.30v1 (Windows, Linux Local, Server version) or Versions older than late November to relion plt / star

  • Switch x and y Coordinates: Yes
  • Output filetype, input files, output directory, suffix: User's choice
  • Mirror Coordinates: on
  • Flip Coordinate: First value
  • Micrograph Dimension of flip Coordinate: needs to be decided by user
  • Do star(cow) to/from Star(relion) conversions: off

Relion coordinate star file to Cow 2016.11.30v1 (Windows, Linux Local, Server version) or Versions older than late November to cow-style plt

  • Switch x and y Coordinates: Yes
  • Output filetype : plt
  • input files, output directory, suffix: User's choice
  • Mirror Coordinates : on
  • Flip Coordinate : Second value
  • Micrograph Dimension of flip Coordinate: needs to be decided by user
  • Do star(cow) to/from Star(relion) conversions : off

Relion coordinate star file to Windows Cow 2016.10.25v1 or local linux version with older timestamp but from around early November

  • Switch x and y Coordinates: Yes
  • Output filetype: plt
  • input files, output directory, suffix: User's choice
  • Mirror Coordinates and associated parameters: off
  • Do star(cow) to/from Star(relion) conversions: off

Relion master star file to Cow 2016.11.30v1 (Windows, Linux Local, Server version) or Versions older than late November

  • Switch x and y Coordinates: Yes
  • Output filetype: plt
  • input files, output directory, suffix: User's choice
  • Mirror Coordinates: on
  • Flip Coordinate: Second value
  • Micrograph Dimension of flip Coordinate: needs to be decided by user
  • Do star(cow) to/from Star(relion) conversions: off

Relion master star file to Windows Cow 2016.10.25v1 or local linux version with older timestamp but from around early November

  • Switch x and y Coordinates: Yes
  • Output filetype: plt
  • input files, output directory, suffix: User's choice
  • Mirror Coordinates and associated parameters: off
  • Do star(cow) to/from Star(relion) conversions: off

Relion star file to star file importable into Windows Cow 2016.10.25v1 or local linux version with older timestamp but from around early November

  • Switch x and y Coordinates: Yes
  • Output filetype: star
  • input files, output directory, suffix: User's choice, but input file needs to be star
  • Mirror Coordinates and associated parameters: off
  • Do star(cow) to/from Star(relion) conversions: on
  • Star file usage direction: from Relion to Cow
  • Absolute path to relion launch folder: needs to be decided by user
  • Convert Euler Angles(if they're available for dataset): on
  • Convert Y Shift (if available for dataset): on

Relion star file to star file importable into Cow 2016.11.30v1 (Windows, Linux Local, Server version) or Versions older than late November

  • Switch x and y Coordinates: Yes
  • Output filetype: star
  • input files, output directory, suffix: User's choice, but input file needs to be star
  • Mirror Coordinates: on
  • Flip Coordinate: Second value
  • Micrograph Dimension of flip Coordinate: needs to be decided by user
  • Do star(cow) to/from Star(relion) conversions: on
  • Star file usage direction: from Relion to Cow
  • Absolute path to relion launch folder: needs to be decided by user
  • Convert Euler Angles(if they're available for dataset): on
  • Convert Y Shift (if available for dataset): on