Skip to main content

cs2star

License PyPI Python Version CI codecov

A simple utility that wraps around csparc2star.py to convert particle positions from Cryosparc JOB directories into a RELION-ready directory. On top of what csparc2star.py already does, this script will traverse the Cryosparc job tree to find the relevant .cs files, automatically symlinks (or copies) the .mrc files (renaming them as appropriate to mrcs and updating the rlnMicrographName column to reflect the change). cs2star also separates micrograph information in a micrographs.star file, which is required in several relion jobs.

Installation

This package requires pyem, which is not available on pip under that name (there is a pyem on pip; that's a different package!). To install it manually [NOTE: some fixes necessary for this are not yet on the main repo, so we're installing from a fork]:

pip install git+https://github.com/brisvag/pyem.git

You can then install cs2star with pip:

pip install cs2star

Usage

cs2star cryosparc_job_dir [dest_dir]

A couple more options are available, check out the help page with -h.

Example

Assuming Cryosparc/J23 is a classification job:

cs2star Cryosparc/J23 -p

will create in the working directory:

  • a relion-ready particles.star
  • a relion-ready micrographs.star
  • a patches directory containing the particle images to be used by relion refinement You can now run relion and provide particles.star and micrographs.star as the inputs.

Tips

  • While you can use the --class option to select specific classes from a cryosparc job, the class indexes do not correspond the the class order in Cryosparc (which is simply based on particle number). A much easier way to select specific classes to convert to .star is to use the select 2D classes job in cryosparc, then provide this job as input to cs2star.
  • --swapxy defaults to True. This is because usually that's what you need; unfortunately, this may differ on a case by case basis, so make sure to check the data after conversion with you favourite viewer to ensure that particles are correctly centered.

Metadata

Release files for cs2star 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cs2star 0.7.0
File Size Uploaded Provenance
cs2star-0.7.0.tar.gz 21.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cs2star 0.7.0
File Interpreter ABI Platform
cs2star-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.3 kB

Release files / cs2star-0.7.0.tar.gz

Download URL cs2star-0.7.0.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c5cd1271eaf563e53403bf4645c99012a83d2cd13df6b6e4bc1766a0f3c0f57e
BLAKE2b-256 checksum
How to use checksums
2aed505e23e3a42bc6bc21c2f2cc2808e5c8289f1fb25f32bc14fcff90a04a0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / cs2star-0.7.0-py3-none-any.whl

Download URL cs2star-0.7.0-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
091fd6ca3f85f3f6f34ff21be47d459a015efd456d6b99d15208bbb289bc9a02
BLAKE2b-256 checksum
How to use checksums
2ed85625a8a14944361b751109e53b57cd77503c0d628cde6d663496d43b8d6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Security for cs2star 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page