Skip to main content

Spotifier

This script to covert pre-processed plate images into figures.

Nothing fancy at the moment, no deep learning segmentation ;-) the script works using plates spotted according to provided template. Still, this helps to get this task done quicker!

! Download a set of templates for copper plates https://github.com/mmagnus/yeast-spotifier/releases/download/v1.0/templates-for-copper-plates.zip !

Table of Contents

Created by gh-md-toc

Options

usage: spotifier.py [-h] [-v] [-d] [--align] [-x X] [-y Y]
		    [--trim-rms TRIM_RMS] [--size SIZE] [-a]
		    map file [file ...]

install to work on psd files: psd-tools3

positional arguments:
  map                  map
  file                 pre-processed image(s)

optional arguments:
  -h, --help           show this help message and exit
  -v, --verbose        be verbose
  -d, --debug          be even more verbose
  --align              align dots
  -x X
  -y Y
  --trim-rms TRIM_RMS
  --size SIZE
  -a, --dont-annotate

Fig. -t, trim background to get nicely formatted dots.

Prepare image

Open the image:

Image -> Adjustments -> Black & white OR cmd+alt+shift+b

Inverse color (cmd+i)

Adjust Levels (cmd+l), select black backgroud with the black pippette and white for the white pippette.

Crop image and Edit -> Image Rotation -> Flip Canvas Horizontal.

Adjust the image to the template

Open template.psd and drag and drop plate photo

Lower opacity for the imported image, to around 30%, to see the template in the background.

Use Move tool and Free transform fit the image to the template.

Use Move tool and Free transform to move "Rectangle" to cover the plate.

Switch off the Backgroud layer, set Opacity to 100.

Save as a PSD (or jpeg) file, e.g., s02_30.jpeg.

Prepare mapping file

Open a text editor and prepare a file used to map dots into figure.

Run the program:

python spotifier.py testdata/02/s02_30.psd -t -m testdata/02/map.txt

The results should be like this:

and the file s02_30_spots.png should be created in the folder next to the input file (in this case testdata/s02/s02_30_spots.png)


TIP: If you want to introduce one extra, empty line, just add an empty line to a map file.

Customization

If you want to move single dots, use Preview and just move them around, save it (if you open a JPG, you will be asked if you want to convert the file to PNG, yeah, do it, remember only to change the file name in the command, 18_X.png).

and re-run:

python spotifier.py testdata/02/18_X.png -t -m testdata/02/map.txt

Use play with Opacity to see Backgound with the template to adjust positions of your dosts.

Mappings

Some ideas for your plates ;-):

5, 6, 7
8, 9, 10

12, 13, 14
15, 16, 17

20, 21, 22
23, 24, 25

28, 29, 30
31, 32, 33

36, 37, 38
39, 40, 41

44, 45, 46
47, 48, 49

1,2,3
4,5,6
7,8,9
10,11,12
13,14,15
16,17,18
19,20,21,
22,23,24,
25,26,27,
28,29,30,
31,32,33,
34,35,36,
37,38,39,
40,41,42,
46,47,48,
49,50,51,
52,53,54,
55,56,57,
58,59,60,

1, 2, 3
5, 6, 7
8, 9, 10
12, 13, 14
15, 16, 17
21, 22, 23
24, 25, 26
28, 29, 30
31, 32, 33
36, 37, 38
39, 40, 41
44, 45, 46
47, 48, 49
51, 52, 53
53, 54, 55
57, 58, 59

For reporters

For reporters, prepare each PSD file as described above. Run spotifier.py for each plate to check if everything is correct:

python spotifier.py testdata/repoters/2.txt testdata/repoters/1.psd

and then run this cmd to process each PSD files and combine all outputs into one figure.

python spotifier.py testdata/repoters/2.txt testdata/repoters/*.psd

Digitifier

Process a figure into numbers:

  python digitifier.py 8 6 testdata/digitfier/1_all.png
[  3.         238.12373299 434.86099169 -27.59790191  96.14306032
 289.4862576  391.415654   242.01505869]
          0
0  0.066164
1  0.574584
2  1.000000
3  0.000000
4  0.267572
5  0.685648
6  0.906056
7  0.582999
Output created testdata/digitfier/1_all_plot.png

Install

To download the tool and install it run (with this you will get all test files):

pip install -e git+http://github.com/mmagnus/yeast-spotifier.git#egg=yeast-spotifier

if you want to have only the code installed in your system, simply run:

pip install yeast-spotifier

Changelog

1.1.

  • --dont-align -> --align (align is worse right now hmm... so the default is --dont-align)
  • use -1 in mapping to put a white box, you can use to make spacers for your figures

Mapping: 1,-1,2

1.1 initial code

Metadata

Release files for yeast-spotifier 1.2.1

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

Built distribution (wheel)

Table of built distributions (wheels) for yeast-spotifier 1.2.1
File Interpreter ABI Platform
yeast_spotifier-1.2.1-py3-none-any.whl Python 3 none any Details

Release files / yeast_spotifier-1.2.1-py3-none-any.whl

Download URL yeast_spotifier-1.2.1-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8006096a71efa6736d9806033ef84e8801021822c647ca1c807ce2f92cb00c3b
BLAKE2b-256 checksum
How to use checksums
d7a1f21582060210e53ef366d55e032f674b4482ad1f4f8b35129a415950a2c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4

Security for yeast-spotifier 1.2.1

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.

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