sorttiltframes(1) General Commands Manual sorttiltframes(1) NAME sorttiltframes - Sort filenames by tilt angle in their names SYNOPSIS sorttiltframes [options] [filenames] DESCRIPTION sorttiltframes is a Python script that takes a set of filenames con- taining tilt angles in their names and sorts them so that they are either in numeric order or match the tilt angles in a specific tilt series. Typically these would be frame files from a direct detector camera, named in such a way that the tilt angles in their names prevent them from listing in order. The filenames can be either entered at the command line as non-option arguments or listed in a file to be read in. When matching the tilt angles of a tilt series, the angles to match can be either extracted from the extended header of the image file or listed in a file. Filenames that do not match any of those tilt angles will be excluded from the output. There must be at least one file for each angle of the tilt series. When there are multiple files at each angle, they will be listed in the output in the same order as they occurred in the input list. When not matching input angles, the tilt angles corresponding to the filenames can be output into a text file. There is also an option to output unsorted names and angles; if these are in the order of acquisi- tion, they could be entered into Alignframes along with dose infor- mation to get dose weighting, and Alignframes would produced an ordered output file. All filenames must include a decimal point in the tilt angle and one or two digits after the decimal point. This program does not expand wild card characters in the arguments because that would not work with filenames containing brackets. If you are running on Windows without Cygwin, where the command shell does not expand wild-cards either, then the only way to enter a large list of files at the command line is to prefix this command with "expandargs". OPTIONS Sorttiltframes uses the PIP package for input (see the manual page for pip). Options can be specified either as command line arguments (with the -) or one per line in a command file (without the -). Options can be abbreviated to unique letters; the currently valid abbreviations for short names are shown in parentheses. -input (-i) OR -InputFile File name Input file to analyze for tilt angle in the filename. Non- option arguments will also be used for input files, with those entries used after any names entered with this option. (Succes- sive entries accumulate) -listin (-l) OR -ListOfInputFiles File name File with list of filenames to sort. You can not enter some names with this option and other names with -input or as com- mand-line arguments; names must be entered one way or the other. -stack (-s) OR -TiltSeriesFile File name Tilt series stack file with tilt angles that can be extracted from the extended header. Filenames matching those angles will be put out in the same order as those angles. -angle (-a) OR -TiltAngleFile File name Text file with tilt angles, one per line. Filenames matching those angles will be put out in the same order as those angles. -outlist (-o) OR -OutputFileList File name Output file for list of sorted or unsorted filenames. This file can be used with the -list option to Alignframes. -tilt (-t) OR -OutputTiltAngleFile File name Output file for list of sorted or unsorted tilt angles extracted from the filenames. This file can be used with the -tilt option to Alignframes. This option can be used only if there are no tilt series angles to match. -reverse (-r) OR -ReverseOrder Reverse order from positive to negative. This option can be used only if there are no tilt series angles to match. -unsorted (-un) OR -UnsortedOutput Produce unsorted output lists. This option cannot be used with -reverse, -series, or -angle. -delim (-de) OR -Delimiters Text string Starting and ending delimiters of tilt angle in the filenames. Two characters must be entered, even if they are the same. The default is "[]" for tilt angles enclosed in brackets. Files from SerialEM would require either "__" or "_." -fixed (-f) OR -FixedImageDose Floating point Fixed dose for each image in electrons per square Angstrom. The -dose option must also be entered. -dose (-do) OR -DoseOutputFile File name Output file for dose information in the type 2 accepted by Alignframes and Mtffilter, namely the prior accumulated dose and image dose for each tilt series image. The -fixed option must also be entered. These options are appropriate only if input files are in the order of acquisition, but they work with both unsorted and sorted output. -help (-h) OR -usage Print help output. -StandardInput Read parameter entries from standard input EXAMPLES If the frame files for one tilt series such as "series4" are all present in the current directory and end in ".mrc", enter sorttiltframes -out series4.list series4*.mrc The frames can then be aligned and a tilt series file produced with: alignframes -list series4.list series4.mrc (plus whatever other Alignframes options are needed). The names can have brackets in them, but if you include any brackets in what you enter at the command line, you must precede each bracket by a backslash. If running on Windows without Cygwin, the above command will not work. Use: expandargs sorttiltframes -out series4.list series4*.mrc If the filenames are all listed in a file "series4_raw.list", enter: sorttiltframes -list series4_raw.list -out series4.list FILES If the output file already exists, a backup of the original is created with the ~ extension. AUTHOR David Mastronarde <mast at colorado dot edu> SEE ALSO alignframes IMOD 5.2.0 sorttiltframes(1)