Skip to main content

A tool converting DYNAMO table files(.tbl) to RELION star files(.star)

Project description

tbl2star

A tool converting DYNAMO table files(.tbl) to RELION star files(.star)

Can be used together with Membrane_Associated_Picking by EuanPyle, which helps to pick membrane associated particles in cryo-ET.

Based on dynamotable, starfile, eulerangles by alisterburt.

Features

  • Convert one or more dynamo tables to one relion star file
  • Transfer all particle information including position, angle, related object and tomogram and so on
  • Strictly follow the relion format for coordinates importing in tomogram workflow
  • Recognize the personalized naming pattern of tomograms flexibly and precisely

Installation

You can install this package by:

pip install tbl2star

Usage

You can refer to the instructions via:

tbl2star --help

Preparation

The dictionary containing tilt series and dynamo tables must look like this:

.
├── tomograms
│   └──***[pattern]_[number1]***
│      └──***[pattern]_[number1]***.st
│      └──etc...
│   └──***[pattern]_[number2]***
│      └──***[pattern]_[number2]***.st
│      └──etc...
│   └──***[pattern]_[number3]***
│      └──***[pattern]_[number3]***.st
│      └──etc...
│   └──etc...
├── dynamotables
│   └──***.tbl
│   └──etc...

Pay attention to the following points:

  1. The file dictionary for storing tilt series is consistent with the rules of RELION software.
  2. Tomogram is distinguished by numbers in DYNAMO tables, so please ensure that the number1, number2, number3, etc. in this naming pattern are different.
  3. This tool will determine the number corresponding to each tomogram based on a specific pattern defined by you, and will look up the coordinates information for each tomogram in the DYNAMO tables based on this number. Therefore, please strictly follow the naming conventions mentioned above. *** represents any symbol, and you can input your customized pattern [pattern], so that the tool can read the subsequent number [number].
  4. You also need to place the .tbl file that stores all coordinates information in the same folder. After specifying the target directory, this tool will read all .tbl files in the directory, so please pay attention to the correspondence with tomograms, especially the numbers corresponding to the tomogram names.

Parameters

  • tiltseries_path: -ts. Path to dictionary containing tiltseries/tomograms in RELION pattern. For example, path/to/your/tomograms.
  • dynamotable_path: -tbl. Path to dictionary containing all of your dynamotables. Default is to use the current folder. All of these coordinates will be used, so please ensure that they correspond to the tomograms.
  • binning: -b. Binning in DYNAMO table. Default is 1.
  • pattern: -p. Pattern to recognize tomogram names. Default is TS/ts.You can input a string so that the first set of numbers after the string is recognized and used as a criterion to distinguish the tomogram. For instance, if your tomogram folder names are 'Rubisco_30_A_001_XX', 'Rubisco_30_A_002_XX'..., you can set the pattern to A so the program can recognize them as 1,2,...Note that strings and numbers must be separated by "_".
  • relionstarfile_name: -s. Name of relion star file. Default is "AllCoordinates.star". For example, you can input 'GCBcoordinates.star'. Do not forget the file suffix .star.
  • relionstarfile_path: -sp. Path of relion star file. Default is the current folder. For example, Path/to/your/save/dictionary.

Example

You can just simply using:

tbl2star
Please enter your path to dictionary containing tiltseries/tomograms: /Users/hzvictor/tomograms
Please enter your path to dictionary containing all dynamo tables. [.]: /Users/hzvictor
Binning in DYNAMO table [1]: 6
Pattern to recognize tomogram names: ts
Please enter the name of relion star file: Allcoordinates.star
Please enter the save path of relion star file: /Users/hzvictor/test
/Users/hzvictor/GCB_004_object_1.tbl has been read
/Users/hzvictor/GCB_003_object_2.tbl has been read
     rlnTomoName  rlnTomoParticleId  rlnTomoManifoldIndex  ...  rlnAnglePsi  rlnClassNumber  rlnRandomSubset
0     GCB_ts_003                  1                     2  ...     -135.000               1                1
1     GCB_ts_003                  2                     2  ...      153.435               1                1
2     GCB_ts_003                  3                     2  ...      135.000               1                2
3     GCB_ts_003                  4                     2  ...      141.340               1                2
4     GCB_ts_003                  5                     2  ...      -90.000               1                2
...          ...                ...                   ...  ...          ...             ...              ...
5826  GCB_ts_004              11658                     1  ...      168.690               1                1
5827  GCB_ts_004              11659                     1  ...       45.000               1                1
5828  GCB_ts_004              11660                     1  ...        0.000               1                1
5829  GCB_ts_004              11661                     1  ...      161.570               1                2
5830  GCB_ts_004              11662                     1  ...      -26.565               1                2

[11662 rows x 14 columns]
Saving relion .star file Allcoordinates.star to /Users/hzvictor/test/ ...

Or you can input:

tbl2star -ts /Users/hzvictor/tomograms -tbl /Users/hzvictor -b 6 -p ts -s Allcoordinates.star -sp /Users/hzvictor/test

License

The project is released under the BSD 3-Clause License

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

tbl2star-1.0.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

tbl2star-1.0.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file tbl2star-1.0.1.tar.gz.

File metadata

  • Download URL: tbl2star-1.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.9.16 Darwin/22.4.0

File hashes

Hashes for tbl2star-1.0.1.tar.gz
Algorithm Hash digest
SHA256 bf8bb2a2d9dc949bf777cb362460c348be943bd065a348ff580c9f3b3ab33856
MD5 30d29320cca4f3d34aa00f83b4c4b2dd
BLAKE2b-256 65e1584ace60969f738d43650f837f56894b8987fec3bdf3305050fde76652b3

See more details on using hashes here.

File details

Details for the file tbl2star-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: tbl2star-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.9.16 Darwin/22.4.0

File hashes

Hashes for tbl2star-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 99b2303f1dde1715b7470a4bbafe17a663b15d9b8a48c5d739bb357eee50e3a8
MD5 7058da4c719394334091606b0fbf3819
BLAKE2b-256 522de1b95f114d363223950d30840bce0da54f63c8a98a2b080eed7e1e4e3e52

See more details on using hashes here.

Supported by

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