semvec/pypi-packages huggingface dataset:
countparticles 1.3
Report the number of particles in each class from RELION
Requires Python: >=3.9.7
Keywords: cryo-EM particle class distribution visualization

# countparticles

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4139778.svg)](https://doi.org/10.5281/zenodo.4139778)

Report the number of particles in each class from a `run_data.star` file
produced by RELION.

A single-particle cryo-EM reconstruction comes from a set of particle images
corresponding to projections of identical particles in different orientations.
All datasets are heterogeneous, to various degrees, and data analysis involves
classification of particle images. Knowing how many particles contributed to
any given class is important to decide how to follow up after a classification
job. This command-line tool reports a count of particles in each class in a
`run_it???_data.star` file from a RELION Class2D or Class3D job. It can also
optionally produce a bar plot of these particle counts.

This tool was tested with star files produced by RELION-3.1.0. Earlier versions
of RELION are not supported.

## Acknowledgments

I would not have been able to put this tool together without the
[`starfile`](https://github.com/alisterburt/starfile) library.

## Installation

I recommend to install this tool in a dedicated conda environment. You can 
create one like so (replace `ENV_NAME` with the name you want to give to this
environment):

```
$ conda deactivate
$ conda create --name ENV_NAME python=3.9
$ conda activate ENV_NAME
```

Once the conda environment is active, you can install the tool with the
following command:

```
$ pip install countparticles
```

## Usage

```
$ countparticles --help
Usage: countparticles [OPTIONS] <run_data.star>

  Report the number of particles in each class from a run_data.star file
  produced by RELION.

Options:
  -p, --plot         Optional. Display a bar plot of the particle counts. This
                     is most helpful with only a few classes, e.g. for typical
                     Class3D results (but not for typical Class2D results with
                     many classes).

  -o, --output TEXT  Optional. File name to save the barplot (recommended file
                     formats: .png, .pdf, .svg or any format supported by
                     matplotlib). This option has no effect without the
                     -p/--plot option.

  -h, --help         Show this message and exit.
```
CV2-Threaded-Video-Capture 1.0.0
Reads a video into a buffer in an extra thread with some nice syntax.
Keywords: multi-threaded,video reader,CV2,CV

# CV2 Threaded Video Capture

Not much to say here, it enables you to read an entire video or a number of frames from a video in an extra thread with some nice syntax.

This project was initially part of my video synopsis project, wich is why the config dict() is required.

### Full video


    from VideoReader import VideoReader
    import os

    fileName = "out.mp4"
    dirName = os.path.join(os.path.dirname(__file__), "generate test footage")

    config = {}
    config["inputPath"] = os.path.join(dirName, fileName)
    config["videoBufferLength"] = 100

    with VideoReader(config) as reader:
        while not reader.videoEnded():
            framenumber, frame = reader.pop()
            print(framenumber)


### Selection of Frames


    from VideoReader import VideoReader
    import os

    fileName = "out.mp4"
    dirName = os.path.join(os.path.dirname(__file__), "generate test footage")

    config = {}
    config["inputPath"] = os.path.join(dirName, fileName)
    config["videoBufferLength"] = 100

    frameList = list(range(100, 500))

    with VideoReader(config, frameList) as reader:
        while not reader.videoEnded():
            framenumber, frame = reader.pop()
            print(framenumber)
Loli-wrapper 1.0.4
Simple wrapper for loli api.
Requires Python: >=3.7

<h1 align="center">Loli api wrapper</h1>

#### pip install loli.py



Sync Example
--------------

```Python
from loli import LoliSync


loli = LoliSync()

print(loli.get_point('sfw', 'hug'))
```

Async example
--------------

```Python
from loli import LoliAsync
import asyncio


loli = LoliAsync()

async def main():
    print(await loli.get_point('sfw', 'hug'))

if __name__ == "__main__":
    asyncio.run(main())
```