├── .gitignore ├── .travis.yml ├── LICENSE.txt ├── README.md ├── dynamo2m ├── __init__.py ├── dynamo2warp.py ├── relion_star_downgrade.py ├── utils.py ├── version.py └── warp2dynamo.py ├── geom.png ├── requirements.txt ├── setup.py ├── test_data ├── dynamo2warp │ ├── example.doc │ └── example.tbl ├── relion_star_downgrade │ └── relion3.1.star └── warp2dynamo │ └── example.star └── tests ├── __init__.py ├── test_dynamo2warp.py └── test_warp2dynamo.py /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | venv 3 | setup.cfg 4 | build 5 | dist 6 | MANIFEST 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "3.6" 4 | - "3.7" 5 | - "3.8" 6 | 7 | install: 8 | - pip install -r requirements.txt 9 | - pip install pytest 10 | 11 | script: 12 | - pytest 13 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, Alister Burt 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dynamo2m 2 | [![PyPI pyversions](https://img.shields.io/pypi/pyversions/dynamo2m.svg)](https://pypi.python.org/pypi/dynamo2m/) 3 | [![PyPI version](https://badge.fury.io/py/dynamo2m.svg)](https://pypi.python.org/pypi/dynamo2m/) 4 | [![DOI](https://zenodo.org/badge/273026988.svg)](https://zenodo.org/badge/latestdoi/273026988) 5 | 6 | `dynamo2m` is a small set of tools providing a bidirectional interface between the subtomogram averaging software 7 | [Dynamo](https://wiki.dynamo.biozentrum.unibas.ch/w/index.php/Main_Page) 8 | and the 9 | [Warp-RELION-M](http://www.warpem.com/warp/?page_id=1614) pipeline. 10 | 11 | A description of the workflow for working between Warp, Dynamo and M can be found [here](https://wiki.dynamo.biozentrum.unibas.ch/w/index.php/Integration_with_Warp_and_M) 12 | 13 | 14 | ## Motivation 15 | Dynamo is a tomography specific software package with many useful tools for subtomogram averaging including... 16 | 17 | - Flexible [subtomogram averaging](https://wiki.dynamo.biozentrum.unibas.ch/w/index.php/Dcp_GUI) workflows 18 | - [Geometric modelling and visualisation tools](https://wiki.dynamo.biozentrum.unibas.ch/w/index.php/Model) for particle picking and tomogram annotation 19 | - [Automated tilt-series alignment](https://wiki.dynamo.biozentrum.unibas.ch/w/index.php/Walkthrough_on_command_line_based_tilt_series_alignment) 20 | - [Multireference based classification](https://wiki.dynamo.biozentrum.unibas.ch/w/index.php/Multireference_Analysis) 21 | - [PCA based classification and analysis tools](https://wiki.dynamo.biozentrum.unibas.ch/w/index.php/Walkthrough_on_PCA_through_the_command_line) 22 | - Interactive tools for [initial model generation](https://wiki.dynamo.biozentrum.unibas.ch/w/index.php/Starters_guide#Initial_model_generation) 23 | - Ways to [visualise](https://wiki.dynamo.biozentrum.unibas.ch/w/index.php/Walkthrough_for_lattices_on_vesicles#Merging_the_tables) subtomogram averaging results 24 | 25 | M is a software package which allows one to perform multi-particle refinements with the aim of correcting for various 26 | sample deformations which can occur during imaging, it currently holds the record for high resolution 27 | single particle analysis from frame-series and tilt-series data. 28 | 29 | The ability to easily combine these software packages, particularly for particle picking using a modelled supporting geometry, is the goal of the scripts provided in this package. 30 | 31 |

32 | Automatically detected fiducial markers 37 |

38 | 39 | ## Scripts 40 | - `dynamo2warp` for the conversion of Dynamo metadata to facilitate extraction of particles in Warp 41 | - `warp2dynamo` for the conversion of Warp STAR files into Dynamo compatible metadata 42 | - `relion_star_downgrade` to convert RELION 3.1 format STAR files into RELION 3.0 format STAR files for extraction in Warp 43 | 44 | 45 | ## Installation 46 | Installation is available directly from the [Python package index](https://pypi.org/project/dynamo2m/) 47 | ``` 48 | pip install dynamo2m 49 | ``` 50 | 51 | 52 | ## Usage 53 | Each of the scripts can be invoked directly from the command line and each has an interactive command line interface. 54 | 55 | For example 56 | ``` 57 | dynamo2warp 58 | ``` 59 | 60 | ``` 61 | Input Dynamo table file: example.tbl 62 | Input Dynamo table map file: example.doc 63 | Output STAR file: test.star 64 | Done! Converted 'example.tbl' to RELION/Warp/M compatible STAR file 'test_data.star' 65 | 66 | ``` 67 | 68 | Alternatively, options can be passed directly at the command line, this is detailed in the help provided with each script 69 | 70 | ``` 71 | dynamo2warp --help 72 | ``` 73 | 74 | ``` 75 | Usage: dynamo2warp [OPTIONS] 76 | 77 | Options: 78 | -i, --input_table_file PATH [required] 79 | -tm, --table_map_file PATH [required] 80 | -o, --output_star_file PATH [required] 81 | --help Show this message and exit. 82 | 83 | ``` 84 | -------------------------------------------------------------------------------- /dynamo2m/__init__.py: -------------------------------------------------------------------------------- 1 | from .dynamo2warp import dynamo2warp 2 | from .warp2dynamo import warp2dynamo 3 | from .relion_star_downgrade import relion_star_downgrade 4 | 5 | from .version import __version__ 6 | -------------------------------------------------------------------------------- /dynamo2m/dynamo2warp.py: -------------------------------------------------------------------------------- 1 | import click 2 | import dynamotable 3 | import starfile 4 | import pandas as pd 5 | from eulerangles import convert_eulers 6 | from .utils import sanitise_micrograph_name, sanitise_m_starfile_name 7 | 8 | 9 | def dynamo2warp(input_table_file, table_map_file, output_star_file): 10 | # Read table file into dataframe 11 | table = dynamotable.read(input_table_file, table_map_file) 12 | 13 | # Prep data for star file in dict 14 | data = {} 15 | 16 | # extract xyz into dict with relion style headings 17 | for axis in ('x', 'y', 'z'): 18 | heading = f'rlnCoordinate{axis.upper()}' 19 | shift_axis = f'd{axis}' 20 | data[heading] = table[axis] + table[shift_axis] 21 | 22 | # extract and convert eulerangles 23 | eulers_dynamo = table[['tdrot', 'tilt', 'narot']].to_numpy() 24 | eulers_warp = convert_eulers(eulers_dynamo, 25 | source_meta='dynamo', 26 | target_meta='warp') 27 | data['rlnAngleRot'] = eulers_warp[:, 0] 28 | data['rlnAngleTilt'] = eulers_warp[:, 1] 29 | data['rlnAnglePsi'] = eulers_warp[:, 2] 30 | 31 | # extract and sanitise micrograph names to ensure compatibility with M 32 | data['rlnMicrographName'] = table['tomo_file'].apply(sanitise_micrograph_name) 33 | 34 | # convert dict to dataframe 35 | df = pd.DataFrame.from_dict(data) 36 | 37 | # write out STAR file 38 | starfile.write(df, output_star_file, overwrite=True) 39 | 40 | # echo to console 41 | click.echo( 42 | f"Done! Converted '{input_table_file}' to RELION/Warp compatible STAR file '{output_star_file}'") 43 | 44 | return 45 | 46 | @click.command() 47 | @click.option('--input_table_file', '-i', 48 | prompt='Input Dynamo table file', 49 | type=click.Path(), 50 | required=True) 51 | @click.option('--table_map_file', '-tm', 52 | prompt='Input Dynamo table map file', 53 | type=click.Path(), 54 | required=True) 55 | @click.option('--output_star_file', '-o', 56 | prompt='Output STAR file', 57 | type=click.Path(), 58 | required=True) 59 | def cli(input_table_file, table_map_file, output_star_file): 60 | dynamo2warp(input_table_file, table_map_file, output_star_file) 61 | -------------------------------------------------------------------------------- /dynamo2m/relion_star_downgrade.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | import click 4 | import pandas as pd 5 | import starfile 6 | 7 | 8 | def relion_star_downgrade(star_file, output_star_file): 9 | """Downgrade RELION 3.1 STAR file to RELION 3.0 format for Warp 10 | """ 11 | star = starfile.read(star_file) 12 | 13 | # Merge optics info into particles dataframe 14 | data = star['particles'].merge(star['optics']) 15 | 16 | # Get necessary data from 3.1 style star file 17 | # (RELION 3.0 style expected by warp for particle extraction) 18 | xyz_headings = [f'rlnCoordinate{axis}' for axis in 'XYZ'] 19 | shift_headings = [f'rlnOrigin{axis}Angst' for axis in 'XYZ'] 20 | euler_headings = [f'rlnAngle{euler}' for euler in ('Rot', 'Tilt', 'Psi')] 21 | 22 | xyz = data[xyz_headings].to_numpy() 23 | shifts_ang = data[shift_headings].to_numpy() 24 | pixel_size = data['rlnImagePixelSize'].to_numpy().reshape((-1, 1)) 25 | eulers = data[euler_headings].to_numpy() 26 | data_out = {} 27 | data_out['rlnMicrographName'] = data['rlnMicrographName'] 28 | 29 | # Get shifts in pixels (RELION 3.0 style) 30 | shifts_px = shifts_ang / pixel_size 31 | 32 | # update XYZ positions 33 | xyz_shifted = xyz - shifts_px 34 | 35 | # Create output DataFrame 36 | df = pd.DataFrame.from_dict(data_out, orient='columns') 37 | for idx in range(3): 38 | df[xyz_headings[idx]] = xyz_shifted[:, idx] 39 | 40 | for idx in range(3): 41 | df[euler_headings[idx]] = eulers[:, idx] 42 | 43 | if output_star_file is None: 44 | 45 | # Derive output filename 46 | star_file = Path(star_file) 47 | stem = star_file.stem 48 | output_filename = star_file.parent / (str(stem) + '_rln3.0.star') 49 | 50 | else: 51 | 52 | output_filename = output_star_file 53 | 54 | # Write output 55 | starfile.write(df, output_filename, overwrite=True) 56 | click.echo(f'Done! Wrote RELION 3.0 format STAR file to {output_filename}') 57 | return 58 | 59 | 60 | @click.command() 61 | @click.option('--star_file', '-s', type=click.Path(exists=True), default=None, help='Input STAR file') 62 | @click.option('--output_star_file', '-o', type=click.Path(), default=None, help='Output STAR file') 63 | def cli(star_file, output_star_file): 64 | if star_file is None: 65 | star_file = click.prompt('Input STAR file', type=click.Path(exists=True)) 66 | 67 | if output_star_file is None: 68 | output_star_file = click.prompt('Output STAR file', type=click.Path()) 69 | 70 | relion_star_downgrade(star_file, output_star_file) 71 | 72 | -------------------------------------------------------------------------------- /dynamo2m/utils.py: -------------------------------------------------------------------------------- 1 | import re 2 | from pathlib import Path 3 | 4 | 5 | def sanitise_micrograph_name(micrograph_name: str) -> str: 6 | """ 7 | Replaces tomogram name from warp reconstructions with corresponding tomostar file if appropriate 8 | Ensures compatibility with M for subsequent STAR files 9 | :param micrograph_name: 10 | :return: 11 | """ 12 | return re.sub(r".mrc_\d+.\d+Apx.mrc", ".mrc.tomostar", micrograph_name) 13 | 14 | 15 | def sanitise_m_starfile_name(starfile_name: str) -> str: 16 | """ 17 | Makes sure STAR filename is properly formatted for import into M (requires _data.star) 18 | :param starfile_name: 19 | :return: 20 | """ 21 | if starfile_name.endswith('_data.star'): 22 | return starfile_name 23 | elif starfile_name.endswith('.star') and not starfile_name.endswith('_data.star'): 24 | return re.sub(r".star", "_data.star", starfile_name) 25 | else: 26 | return starfile_name + '_data.star' 27 | 28 | 29 | def sanitise_dynamo_table_filename(table_file_name: str) -> str: 30 | """ 31 | Make sure table file ends in .tbl 32 | :param table_file_name: 33 | :return: 34 | """ 35 | if not table_file_name.endswith('.tbl'): 36 | table_file_name += '.tbl' 37 | 38 | return table_file_name 39 | 40 | 41 | def reextract_table_filename(table_file_name: str) -> str: 42 | """ 43 | 44 | :param table_file_name: 45 | :return: 46 | """ 47 | return table_file_name.replace('.tbl', '.reextract.tbl') 48 | 49 | 50 | def extract_tomostar_from_image_name(filename: str) -> str: 51 | """ 52 | from a given filename, expected to be from the 'rlnImageName' column of a STAR file output by M 53 | extract the tomogram name 54 | :param filename: 55 | :return: 56 | """ 57 | p = Path(filename) 58 | tomo_name = p.parts[-2] 59 | tomostar = tomo_name + '.tomostar' 60 | return tomostar 61 | 62 | 63 | -------------------------------------------------------------------------------- /dynamo2m/version.py: -------------------------------------------------------------------------------- 1 | __version__ = '0.2.2' 2 | -------------------------------------------------------------------------------- /dynamo2m/warp2dynamo.py: -------------------------------------------------------------------------------- 1 | import click 2 | import numpy as np 3 | import pandas as pd 4 | import starfile 5 | import dynamotable 6 | from eulerangles import convert_eulers 7 | 8 | from .utils import sanitise_dynamo_table_filename, reextract_table_filename 9 | 10 | 11 | def warp2dynamo(warp_star_file, output_dynamo_table_file, extracted_box_size): 12 | """ 13 | Converts a Warp STAR file into a Dynamo table file. 14 | Outputs a few things 15 | 1) dynamo table and corresponding table map (.doc) 16 | 2) dynamo STAR file as data container (to avoid reextraction) 17 | 3) a separate table for reextraction as a dynamo data folder 18 | (STAR container didn't work in my hands for alignment projects) 19 | """ 20 | # Read STAR file 21 | relion_star = starfile.read(warp_star_file) 22 | 23 | # Initialise empty dict for dynamo 24 | dynamo_data = {} 25 | 26 | # Get XYZ positions and put into data 27 | for axis in ('x', 'y', 'z'): 28 | relion_heading = 'rlnCoordinate' + axis.upper() 29 | dynamo_data[axis] = relion_star[relion_heading] 30 | 31 | # Get euler angles and convert to dynamo convention (only if eulers present in STAR file) 32 | if 'rlnAngleRot' in relion_star.columns: 33 | eulers_relion = relion_star[['rlnAngleRot', 'rlnAngleTilt', 'rlnAnglePsi']].to_numpy() 34 | eulers_dynamo = convert_eulers(eulers_relion, 35 | source_meta='relion', 36 | target_meta='dynamo') 37 | 38 | dynamo_data['tdrot'] = eulers_dynamo[:, 0] 39 | dynamo_data['tilt'] = eulers_dynamo[:, 1] 40 | dynamo_data['narot'] = eulers_dynamo[:, 2] 41 | 42 | # Add tomogram info 43 | dynamo_data['tomo_file'] = relion_star['rlnMicrographName'] 44 | 45 | # Convert to DataFrame 46 | df = pd.DataFrame.from_dict(dynamo_data) 47 | 48 | # Write table file 49 | output_dynamo_table_file = sanitise_dynamo_table_filename(output_dynamo_table_file) 50 | click.echo( 51 | f"Writing out Dynamo table file '{output_dynamo_table_file}' and corresponding table map file with appropriate info...\n") 52 | dynamotable.write(df, output_dynamo_table_file) 53 | 54 | # Write out dynamo STAR file to avoid reextraction 55 | dynamo_star_name = output_dynamo_table_file + '.star' 56 | click.echo( 57 | f"Writing out Dynamo format STAR file '{dynamo_star_name}' to avoid reextraction...\n") 58 | 59 | tags = [x + 1 for x in range(df.shape[0])] 60 | particle_files = relion_star['rlnImageName'] 61 | dynamo_star = {'tag': tags, 62 | 'particleFile': particle_files} 63 | dynamo_star = pd.DataFrame.from_dict(dynamo_star) 64 | 65 | starfile.write(dynamo_star, dynamo_star_name) 66 | 67 | # Write out reextraction table and .doc file (STAR files with mrc volumes didn't work in dynamo 1.1.509 in my hands) 68 | # Get extraction table name 69 | reextraction_table_name = reextract_table_filename(output_dynamo_table_file) 70 | 71 | # Change xyz positions to match centers of extracted boxes 72 | for axis in ('x', 'y', 'z'): 73 | df[axis] = np.ones_like(df[axis]) * (extracted_box_size / 2) 74 | 75 | # Change tomo_file to point to individual particles and make tomo equal to tags 76 | df['tomo_file'] = relion_star['rlnImageName'] 77 | df['tomo'] = dynamo_star['tag'] 78 | 79 | # Write 80 | click.echo( 81 | f"Writing out table and table map to facilitate reextraction if dynamo STAR file doesn't work...") 82 | click.echo( 83 | f"General reextraction command: dtcrop -asBoxes 1") 84 | extraction_command = f"dtcrop {reextraction_table_name.replace('.tbl', '.doc')} {reextraction_table_name} {extracted_box_size} -asBoxes 1" 85 | 86 | reextraction_matlab = output_dynamo_table_file.replace('.tbl', 'reextraction_script.m') 87 | with open(reextraction_matlab, 'w') as f: 88 | f.write(f'{extraction_command}\n') 89 | dynamotable.write(df, reextraction_table_name) 90 | 91 | click.echo(f"\nDone! Converted Warp output '{warp_star_file}' into Dynamo input files") 92 | return 93 | 94 | 95 | @click.command() 96 | @click.option('--input_star_file', '-i', 'warp_star_file', 97 | prompt='Input Warp STAR file', 98 | type=click.Path(exists=True), 99 | required=True) 100 | @click.option('--output_table_file', '-o', 'dynamo_table_file', 101 | type=click.Path(exists=False), 102 | prompt='Output dynamo table file') 103 | @click.option('--extracted_box_size', '-bs', 'extracted_box_size', 104 | prompt='Extracted box size (px)', 105 | type=int, 106 | required=True) 107 | def cli(warp_star_file, dynamo_table_file, extracted_box_size): 108 | warp2dynamo(warp_star_file, dynamo_table_file, extracted_box_size) 109 | -------------------------------------------------------------------------------- /geom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alisterburt/dynamo2m/6308cb2c60097217e8bb478e826f5ed99a70fd8a/geom.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | starfile>=0.4.4 2 | dynamotable>=0.2 3 | click>=7.1.2 4 | eulerangles>=1.0.0 5 | pandas>=1.1.2 6 | numpy>=1.16.5 7 | dataclasses; python_version < '3.7' 8 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | from dynamo2m import __version__ 3 | setup( 4 | name='dynamo2m', 5 | version=__version__, 6 | packages=['dynamo2m'], 7 | url='https://github.com/alisterburt/dynamo2m', 8 | license='BSD', 9 | author='aburt', 10 | author_email='alisterburt@gmail.com', 11 | description='Interface the cryo-EM packages warp, dynamo and M', 12 | classifiers=[ 13 | 'License :: OSI Approved :: BSD License', 14 | 'Natural Language :: English', 15 | 'Operating System :: OS Independent', 16 | 'Programming Language :: Python', 17 | 'Programming Language :: Python :: 3.6', 18 | 'Programming Language :: Python :: 3.7', 19 | 'Programming Language :: Python :: 3.8', 20 | 'Programming Language :: Python :: 3.9', 21 | ], 22 | python_requires='>=3.6', 23 | install_requires=[ 24 | 'click', 25 | 'starfile', 26 | 'dynamotable', 27 | 'eulerangles' 28 | ], 29 | entry_points=''' 30 | [console_scripts] 31 | dynamo2warp=dynamo2m.dynamo2warp:cli 32 | warp2dynamo=dynamo2m.warp2dynamo:cli 33 | relion_star_downgrade=dynamo2m.relion_star_downgrade:cli 34 | ''', 35 | ) 36 | -------------------------------------------------------------------------------- /test_data/dynamo2warp/example.doc: -------------------------------------------------------------------------------- 1 | 1 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts01.mrc_15.00Apx.mrc 2 | 2 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts02.mrc_15.00Apx.mrc 3 | 3 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts03.mrc_15.00Apx.mrc 4 | 4 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts04.mrc_15.00Apx.mrc 5 | 6 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts06.mrc_15.00Apx.mrc 6 | 7 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts07.mrc_15.00Apx.mrc 7 | 10 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts10.mrc_15.00Apx.mrc 8 | 12 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts101.mrc_15.00Apx.mrc 9 | 13 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts102.mrc_15.00Apx.mrc 10 | 14 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts103.mrc_15.00Apx.mrc 11 | 15 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts104.mrc_15.00Apx.mrc 12 | 16 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts105.mrc_15.00Apx.mrc 13 | 17 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts106.mrc_15.00Apx.mrc 14 | 19 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts109.mrc_15.00Apx.mrc 15 | 20 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts11.mrc_15.00Apx.mrc 16 | 21 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts12.mrc_15.00Apx.mrc 17 | 23 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts14.mrc_15.00Apx.mrc 18 | 24 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts15.mrc_15.00Apx.mrc 19 | 28 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts19.mrc_15.00Apx.mrc 20 | 29 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts20.mrc_15.00Apx.mrc 21 | 35 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts26.mrc_15.00Apx.mrc 22 | 37 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts28.mrc_15.00Apx.mrc 23 | 38 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts29.mrc_15.00Apx.mrc 24 | 40 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts31.mrc_15.00Apx.mrc 25 | 41 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts32.mrc_15.00Apx.mrc 26 | 42 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts33.mrc_15.00Apx.mrc 27 | 46 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts37.mrc_15.00Apx.mrc 28 | 47 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts38.mrc_15.00Apx.mrc 29 | 48 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts39.mrc_15.00Apx.mrc 30 | 49 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts40.mrc_15.00Apx.mrc 31 | 50 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts41.mrc_15.00Apx.mrc 32 | 51 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts43.mrc_15.00Apx.mrc 33 | 53 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts45.mrc_15.00Apx.mrc 34 | 55 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts47.mrc_15.00Apx.mrc 35 | 56 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts48.mrc_15.00Apx.mrc 36 | 57 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts49.mrc_15.00Apx.mrc 37 | 61 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts53.mrc_15.00Apx.mrc 38 | 63 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts55.mrc_15.00Apx.mrc 39 | 65 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts57.mrc_15.00Apx.mrc 40 | 70 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts63.mrc_15.00Apx.mrc 41 | 72 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts65.mrc_15.00Apx.mrc 42 | 73 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts66.mrc_15.00Apx.mrc 43 | 75 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts68.mrc_15.00Apx.mrc 44 | 76 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts69.mrc_15.00Apx.mrc 45 | 77 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts70.mrc_15.00Apx.mrc 46 | 79 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts72.mrc_15.00Apx.mrc 47 | 85 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts78.mrc_15.00Apx.mrc 48 | 91 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts84.mrc_15.00Apx.mrc 49 | 94 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts87.mrc_15.00Apx.mrc 50 | 95 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts88.mrc_15.00Apx.mrc 51 | 97 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts90.mrc_15.00Apx.mrc 52 | 98 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts91.mrc_15.00Apx.mrc 53 | 105 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts98.mrc_15.00Apx.mrc 54 | 106 /media/aburt/Dibona/WM5984_180924_DCheR_minicells/frames/reconstruction/tomo_ts99.mrc_15.00Apx.mrc 55 | -------------------------------------------------------------------------------- /test_data/relion_star_downgrade/relion3.1.star: -------------------------------------------------------------------------------- 1 | 2 | # version 30001 3 | 4 | data_optics 5 | 6 | loop_ 7 | _rlnOpticsGroup #1 8 | _rlnOpticsGroupName #2 9 | _rlnSphericalAberration #3 10 | _rlnVoltage #4 11 | _rlnImagePixelSize #5 12 | _rlnImageSize #6 13 | _rlnImageDimensionality #7 14 | 1 opticsGroup1 2.700000 300.000000 5.000000 64 3 15 | 16 | 17 | # version 30001 18 | 19 | data_particles 20 | 21 | loop_ 22 | _rlnCoordinateX #1 23 | _rlnCoordinateY #2 24 | _rlnCoordinateZ #3 25 | _rlnAngleRot #4 26 | _rlnAngleTilt #5 27 | _rlnAnglePsi #6 28 | _rlnMicrographName #7 29 | _rlnCtfMaxResolution #8 30 | _rlnImageName #9 31 | _rlnCtfImage #10 32 | _rlnPixelSize #11 33 | _rlnOpticsGroup #12 34 | _rlnGroupNumber #13 35 | _rlnOriginXAngst #14 36 | _rlnOriginYAngst #15 37 | _rlnOriginZAngst #16 38 | _rlnClassNumber #17 39 | _rlnNormCorrection #18 40 | _rlnRandomSubset #19 41 | _rlnLogLikeliContribution #20 42 | _rlnMaxValueProbDistribution #21 43 | _rlnNrOfSignificantSamples #22 44 | 314.929000 918.864000 349.444000 -16.91486 175.815434 47.775756 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000000_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000000_ctf_5.00A.mrc 5.000000 1 1 3.947427 0.072427 0.072427 1 1.000000 2 7.375154e+05 0.013423 190 45 | 308.439000 928.751000 350.590000 -16.59358 174.992461 36.481591 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000001_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000001_ctf_5.00A.mrc 5.000000 1 1 0.447427 5.447427 1.947427 1 1.000000 2 7.365501e+05 0.013988 364 46 | 307.172000 907.383000 349.770000 -16.68826 175.266813 -71.13003 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000002_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000002_ctf_5.00A.mrc 5.000000 1 1 6.947427 1.197427 0.447427 1 1.000000 1 7.366978e+05 0.045408 38 47 | 321.682000 906.364000 349.807000 -16.38415 176.181197 -71.64329 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000003_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000003_ctf_5.00A.mrc 5.000000 1 1 4.697427 1.947427 0.447427 1 1.000000 1 7.379242e+05 0.049355 21 48 | 329.458000 918.575000 349.831000 16.560305 173.711705 139.696172 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000004_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000004_ctf_5.00A.mrc 5.000000 1 1 5.447427 3.947427 -0.67757 1 1.000000 1 7.378705e+05 0.013682 334 49 | 321.756000 930.422000 350.256000 24.650156 173.939461 143.854329 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000005_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000005_ctf_5.00A.mrc 5.000000 1 1 4.322427 1.197427 1.197427 1 1.000000 2 7.370974e+05 0.026475 165 50 | 295.238000 926.391000 352.338000 18.607212 171.743007 7.501021 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000006_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000006_ctf_5.00A.mrc 5.000000 1 1 0.072427 5.447427 1.947427 1 1.000000 2 7.375660e+05 0.010481 272 51 | 313.468000 894.735000 351.633000 -18.81991 171.216133 -73.41687 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000007_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000007_ctf_5.00A.mrc 5.000000 1 1 4.697427 4.322427 1.197427 1 1.000000 1 7.373567e+05 0.013232 114 52 | 328.262000 893.535000 351.759000 6.401719 168.832345 -108.60653 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000008_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000008_ctf_5.00A.mrc 5.000000 1 1 5.822427 1.947427 0.447427 1 1.000000 2 7.371557e+05 0.018468 60 53 | 335.771000 905.708000 351.533000 10.943307 170.277225 -164.96261 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000009_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000009_ctf_5.00A.mrc 5.000000 1 1 4.322427 3.572427 0.447427 1 1.000000 2 7.378378e+05 0.030254 42 54 | 314.398000 942.229000 351.759000 -23.27208 166.786197 91.239335 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000010_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000010_ctf_5.00A.mrc 5.000000 1 1 5.072427 6.197427 1.947427 1 1.000000 2 7.370959e+05 0.007631 158 55 | 305.609000 952.809000 354.871000 23.830673 160.855753 76.299389 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000011_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000011_ctf_5.00A.mrc 5.000000 1 1 4.322427 5.447427 1.947427 1 1.000000 2 7.376308e+05 0.004513 400 56 | 300.530000 939.666000 352.355000 6.622151 168.579837 57.272513 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000012_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000012_ctf_5.00A.mrc 5.000000 1 1 3.947427 5.072427 1.197427 1 1.000000 1 7.369545e+05 0.008367 129 57 | 286.780000 936.623000 354.553000 -18.01524 162.684201 30.491595 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000013_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000013_ctf_5.00A.mrc 5.000000 1 1 4.322427 5.072427 0.072427 1 1.000000 2 7.377907e+05 0.003356 633 58 | 319.665000 882.476000 354.543000 17.462800 165.267980 -96.81691 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000014_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000014_ctf_5.00A.mrc 5.000000 1 1 5.072427 6.197427 1.947427 1 1.000000 2 7.375270e+05 0.012611 156 59 | 342.290000 893.358000 354.432000 -24.81606 162.521558 -140.11138 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000015_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000015_ctf_5.00A.mrc 5.000000 1 1 5.822427 4.697427 1.197427 1 1.000000 2 7.376865e+05 0.008646 142 60 | 349.779000 905.396000 354.550000 13.713914 161.806050 -162.53833 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000016_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000016_ctf_5.00A.mrc 5.000000 1 1 4.322427 3.572427 0.447427 1 1.000000 2 7.378999e+05 0.014349 79 61 | 343.554000 918.422000 352.171000 -10.81621 166.810484 171.706925 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000017_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000017_ctf_5.00A.mrc 5.000000 1 1 5.072427 4.322427 -0.67757 1 1.000000 1 7.376941e+05 0.009622 227 62 | 336.434000 931.183000 351.749000 17.723480 167.476528 138.324333 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000018_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000018_ctf_5.00A.mrc 5.000000 1 1 5.072427 4.697427 -0.67757 1 1.000000 1 7.371407e+05 0.004059 641 63 | 328.743000 943.296000 353.070000 3.539904 165.568257 121.103628 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000019_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000019_ctf_5.00A.mrc 5.000000 1 1 6.197427 5.072427 1.947427 1 1.000000 1 7.369992e+05 0.014875 144 64 | 273.595000 932.746000 359.299000 -29.37369 154.380453 16.895910 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000020_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000020_ctf_5.00A.mrc 5.000000 1 1 3.572427 4.322427 0.447427 1 1.000000 1 7.379976e+05 0.003544 173 65 | 282.410000 922.537000 355.085000 18.781835 162.545468 6.130150 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000021_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000021_ctf_5.00A.mrc 5.000000 1 1 3.572427 4.322427 0.447427 1 1.000000 1 7.372114e+05 0.010751 90 66 | 333.753000 881.371000 355.561000 -8.41237 161.065721 -122.66054 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000022_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000022_ctf_5.00A.mrc 5.000000 1 1 4.697427 5.072427 1.947427 1 1.000000 2 7.370996e+05 0.010179 159 67 | 357.079000 917.714000 356.643000 -5.29352 157.699092 176.962822 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000023_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000023_ctf_5.00A.mrc 5.000000 1 1 4.697427 1.947427 0.447427 1 1.000000 2 7.374719e+05 0.013438 98 68 | 350.452000 930.779000 355.235000 -24.80890 160.253022 156.083183 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000024_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000024_ctf_5.00A.mrc 5.000000 1 1 5.822427 3.572427 0.072427 1 1.000000 1 7.380636e+05 0.005793 189 69 | 343.044000 943.328000 355.649000 17.301191 160.068461 136.292093 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000025_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000025_ctf_5.00A.mrc 5.000000 1 1 6.197427 3.572427 0.447427 1 1.000000 1 7.372351e+05 0.016568 175 70 | 334.515000 955.357000 357.488000 0.991178 157.140113 117.759674 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000026_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000026_ctf_5.00A.mrc 5.000000 1 1 5.072427 4.322427 1.947427 1 1.000000 1 7.373748e+05 0.009926 140 71 | 319.697000 954.518000 355.439000 -16.32469 160.370001 98.728122 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000027_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000027_ctf_5.00A.mrc 5.000000 1 1 3.572427 5.072427 1.197427 1 1.000000 2 7.377444e+05 0.016542 117 72 | 297.014000 962.529000 359.817000 15.675233 152.857234 67.233683 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000028_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000028_ctf_5.00A.mrc 5.000000 1 1 4.697427 3.947427 0.447427 1 1.000000 2 7.386406e+05 0.004403 394 73 | 291.642000 950.327000 355.791000 1.686691 159.280312 51.959675 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000029_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000029_ctf_5.00A.mrc 5.000000 1 1 4.697427 6.197427 -0.67757 1 1.000000 1 7.380864e+05 0.013936 406 74 | 278.339000 946.678000 359.749000 -13.62061 153.350654 35.101635 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000030_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000030_ctf_5.00A.mrc 5.000000 1 1 6.197427 5.447427 -0.67757 1 1.000000 1 7.379418e+05 0.003647 958 75 | 269.706000 918.657000 360.206000 16.445303 151.963316 0.437013 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000031_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000031_ctf_5.00A.mrc 5.000000 1 1 0.072427 4.322427 1.947427 1 1.000000 1 7.379661e+05 0.004685 195 76 | 278.385000 888.970000 364.725000 27.028765 150.381653 -46.57803 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000032_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000032_ctf_5.00A.mrc 5.000000 1 1 4.322427 0.447427 1.947427 1 1.000000 2 7.374749e+05 0.005323 438 77 | 288.392000 879.520000 365.584000 15.570563 149.389574 -62.14264 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000033_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000033_ctf_5.00A.mrc 5.000000 1 1 1.197427 1.197427 1.197427 1 1.000000 2 7.371676e+05 0.008931 521 78 | 310.712000 871.134000 356.660000 27.017128 157.254421 -84.74668 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000034_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000034_ctf_5.00A.mrc 5.000000 1 1 3.572427 4.322427 0.072427 1 1.000000 1 7.380399e+05 0.012799 146 79 | 325.420000 869.528000 358.826000 8.485629 158.327262 -105.18234 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000035_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000035_ctf_5.00A.mrc 5.000000 1 1 5.072427 4.322427 1.947427 1 1.000000 1 7.373832e+05 0.009032 399 80 | 347.637000 880.646000 359.523000 -20.05173 154.779927 -134.38646 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000036_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000036_ctf_5.00A.mrc 5.000000 1 1 5.072427 3.572427 1.197427 1 1.000000 1 7.373958e+05 0.009836 219 81 | 355.681000 892.744000 358.956000 24.055651 155.107010 -151.51845 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000037_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000037_ctf_5.00A.mrc 5.000000 1 1 4.697427 3.572427 0.447427 1 1.000000 2 7.384032e+05 0.010128 212 82 | 362.877000 905.142000 359.782000 9.431405 152.481567 -167.29262 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000038_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000038_ctf_5.00A.mrc 5.000000 1 1 4.322427 3.572427 0.447427 1 1.000000 1 7.377017e+05 0.006795 110 83 | 363.509000 930.281000 360.633000 -20.11563 151.821613 161.220557 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000039_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000039_ctf_5.00A.mrc 5.000000 1 1 5.072427 3.947427 1.197427 1 1.000000 2 7.372238e+05 0.006257 465 84 | 356.468000 942.817000 360.322000 26.219756 152.526790 146.284070 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000040_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000040_ctf_5.00A.mrc 5.000000 1 1 5.447427 3.572427 1.197427 1 1.000000 1 7.376616e+05 0.012669 238 85 | 325.552000 966.406000 360.771000 -12.65922 152.293159 102.602724 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000041_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000041_ctf_5.00A.mrc 5.000000 1 1 4.322427 4.697427 1.197427 1 1.000000 2 7.380468e+05 0.007043 442 86 | 311.165000 965.016000 359.645000 -27.29258 153.630590 86.331574 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000042_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000042_ctf_5.00A.mrc 5.000000 1 1 4.322427 4.322427 1.197427 1 1.000000 1 7.383645e+05 0.005288 215 87 | 289.293000 971.486000 367.250000 11.460543 143.471878 62.101490 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000043_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000043_ctf_5.00A.mrc 5.000000 1 1 8.572427 4.322427 0.447427 1 1.000000 1 7.382510e+05 0.006666 129 88 | 283.567000 959.555000 362.271000 0.621401 149.556069 50.933037 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000044_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000044_ctf_5.00A.mrc 5.000000 1 1 6.947427 4.322427 0.072427 1 1.000000 2 7.388110e+05 0.005038 178 89 | 270.366000 955.676000 366.942000 -11.36805 144.192814 37.888658 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000045_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000045_ctf_5.00A.mrc 5.000000 1 1 6.197427 4.322427 -0.67757 1 1.000000 1 7.385788e+05 0.007092 477 90 | 265.405000 942.493000 366.382000 -23.24542 147.013382 23.320236 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000046_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000046_ctf_5.00A.mrc 5.000000 1 1 5.447427 5.447427 1.947427 1 1.000000 1 7.380567e+05 0.009816 135 91 | 261.589000 928.367000 366.614000 23.984609 146.512651 8.144824 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000047_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000047_ctf_5.00A.mrc 5.000000 1 1 4.322427 5.072427 1.947427 1 1.000000 1 7.379522e+05 0.011634 302 92 | 259.226000 914.644000 367.813000 11.450983 144.576707 -7.21474 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000048_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000048_ctf_5.00A.mrc 5.000000 1 1 3.572427 5.447427 1.197427 1 1.000000 1 7.384710e+05 0.007049 388 93 | 269.433000 899.514000 366.322000 -17.87800 150.831594 -27.30284 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000049_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000049_ctf_5.00A.mrc 5.000000 1 1 6.197427 0.447427 1.947427 1 1.000000 1 7.373467e+05 0.012115 312 94 | 276.236000 876.807000 371.535000 22.028957 141.855245 -53.46913 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000050_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000050_ctf_5.00A.mrc 5.000000 1 1 4.322427 1.197427 1.197427 1 1.000000 2 7.366189e+05 0.009177 365 95 | 300.359000 871.407000 368.245000 6.734542 145.869623 -74.27800 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000051_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000051_ctf_5.00A.mrc 5.000000 1 1 5.072427 3.572427 1.197427 1 1.000000 2 7.380326e+05 0.007388 203 96 | 311.511000 864.316000 371.272000 -1.63904 141.977548 -86.00193 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000052_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000052_ctf_5.00A.mrc 5.000000 1 1 1.197427 4.322427 1.197427 1 1.000000 1 7.377424e+05 0.007605 379 97 | 330.568000 858.427000 365.628000 4.940213 147.467351 -104.92352 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000053_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000053_ctf_5.00A.mrc 5.000000 1 1 8.947427 0.447427 1.197427 1 1.000000 1 7.377724e+05 0.002186 434 98 | 339.461000 868.945000 361.609000 -5.01600 151.869876 -117.64538 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000054_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000054_ctf_5.00A.mrc 5.000000 1 1 6.947427 1.197427 0.447427 1 1.000000 1 7.374139e+05 0.013990 129 99 | 360.578000 880.537000 365.567000 -28.31005 147.250769 -143.20628 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000055_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000055_ctf_5.00A.mrc 5.000000 1 1 4.322427 1.197427 1.197427 1 1.000000 1 7.372368e+05 0.014679 323 100 | 375.197000 905.343000 368.510000 7.384669 142.821993 -169.22909 /ibshome/lgaifas/hiv-tutorial/frames/reconstruction/TS_01.mrc.tomostar 6.000000 ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000056_5.00A.mrc ../frames/subtomo/TS_01.mrc/TS_01.mrc_0000056_ctf_5.00A.mrc 5.000000 1 1 5.072427 4.322427 1.947427 1 1.000000 1 7.374919e+05 0.008780 543 101 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alisterburt/dynamo2m/6308cb2c60097217e8bb478e826f5ed99a70fd8a/tests/__init__.py -------------------------------------------------------------------------------- /tests/test_dynamo2warp.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | import pandas as pd 4 | from pandas.testing import assert_frame_equal 5 | 6 | import starfile 7 | 8 | from dynamo2m import dynamo2warp 9 | 10 | data_dir = Path(__file__).parent / '..' / 'test_data' / 'dynamo2warp' 11 | table_file = data_dir / 'example.tbl' 12 | doc_file = data_dir / 'example.doc' 13 | 14 | 15 | def test_dynamo2warp(tmp_path): 16 | output_file = tmp_path / 'dynamo2warp.star' 17 | dynamo2warp(input_table_file=table_file, table_map_file=doc_file, output_star_file=output_file) 18 | 19 | df = starfile.read(output_file) 20 | assert df.shape == (4934, 7) 21 | xyz_sample = { 22 | 'rlnCoordinateX': {1: 536.6156, 2: 524.35252, 3: 523.738, 4: 528.2961}, 23 | 'rlnCoordinateY': {1: 370.5493, 2: 362.3147, 3: 376.7746, 4: 369.7624}, 24 | 'rlnCoordinateZ': {1: 319.70611, 2: 321.8937, 3: 324.2958, 4: 323.2949} 25 | } 26 | 27 | euler_sample ={ 28 | 'rlnAngleRot': {1: -155.676, 2: 159.44, 3: 144.73, 4: 114.09}, 29 | 'rlnAngleTilt': {1: 8.4212, 2: 7.7828, 3: 5.4919, 4: 7.7122}, 30 | 'rlnAnglePsi': {1: -157.3, 2: -108.68, 3: -93.8, 4: -124.29} 31 | } 32 | 33 | assert_frame_equal(df[['rlnCoordinateX', 'rlnCoordinateY', 'rlnCoordinateZ']][1:5], 34 | pd.DataFrame.from_dict(xyz_sample)) 35 | 36 | assert_frame_equal(df[['rlnAngleRot', 'rlnAngleTilt', 'rlnAnglePsi']][1:5], 37 | pd.DataFrame.from_dict(euler_sample)) 38 | -------------------------------------------------------------------------------- /tests/test_warp2dynamo.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | import pandas as pd 4 | from pandas.testing import assert_frame_equal 5 | import dynamotable 6 | 7 | from dynamo2m import warp2dynamo 8 | 9 | data_dir = Path(__file__).parent / '..' / 'test_data' / 'warp2dynamo' 10 | star_file = data_dir / 'example.star' 11 | 12 | 13 | def test_warp2dynamo(tmp_path): 14 | output_file = str(tmp_path / 'warp2dynamo.tbl') 15 | warp2dynamo(warp_star_file=star_file, output_dynamo_table_file=output_file, extracted_box_size=128) 16 | df = dynamotable.read(output_file) 17 | assert df.shape == (1399, 42) 18 | 19 | euler_sample = { 20 | 'tdrot': {1: -175.26000000000005, 21 | 2: 159.70999999999995, 22 | 3: -172.37, 23 | 4: -159.26999999999995}, 24 | 'tilt': {1: 15.24499999999999, 25 | 2: 19.961000000000013, 26 | 3: 12.364999999999993, 27 | 4: 23.17700000000001}, 28 | 'narot': {1: 46.303999999999995, 29 | 2: 134.29999999999998, 30 | 3: 161.13, 31 | 4: 32.63100000000001}} 32 | 33 | xyz_sample = { 34 | 'x': {1: 1534.5, 35 | 2: 1558.5, 36 | 3: 1534.5, 37 | 4: 1522.5}, 38 | 'y': {1: 1105.5, 39 | 2: 1105.5, 40 | 3: 1105.5, 41 | 4: 1041.285}, 42 | 'z': {1: 972.344, 43 | 2: 972.285, 44 | 3: 975.284, 45 | 4: 958.5} 46 | } 47 | 48 | assert_frame_equal(df[['tdrot', 'tilt', 'narot']][1:5], pd.DataFrame.from_dict(euler_sample)) 49 | assert_frame_equal(df[['x', 'y', 'z']][1:5], pd.DataFrame.from_dict(xyz_sample)) 50 | --------------------------------------------------------------------------------