Skip to content

DSGlab/Yeast-Array-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Code by D. Patrick Bastedo, 2018

The yeast colony analysis and generation of visualization files takes place in
two steps.

In Step I, the the mouse-aware GUI of Processing for Python is exploited to
allow for user-specified definition of grid points by recording mouse clicks at
the four corners that define a pseudo-rectangular grid. Default grid dimensions
(8 rows, 6 columns) can be manually adjusted by editing the values of variables
named 'n_rows', and 'n_cols', defined at lines 14 and 15 of the code 
('spot_picker.pyde'). The name of the input file to be processed 
('sample input.png' by default) is specified at line 9 and can/should likewise 
be edited prior to running the Processing "sketch" (i.e. script).

In Step II, the user calls a script entitled 'show_blues_array.py' from the
command line to generate two derivative data visualization files, both labeled
according to a user-specified grid layout ('PBL array layout.xlsx' by default).
One is a coloured grid representation of pixel-averaged yeast colony colours for
each spot in the array, omitting non-yeast (i.e. agar only) portions of the
plate. The second file can be used for annotating phylogenetic trees displayed
using iTOL (https://itol.embl.de/), and likewise results in a given label
range/text being coloured according to the corresponding pixel-averaged yeast
colony colours.

In both cases the font colour for text labels (specifying names of either array
positions or of tree leaves) is determined by the relative interaction strength
between bait and prey (white if deep blue/strong interaction, and black
otherwise).


Specific Instructions:

Step I

Ia) [One time only.] Download and install Processing (www.processing.org). Open
Processing and specify 'Processing for Python mode' by clicking the dropdown in
the upper right corner and selecting 'Add mode...'.

Ib) [One time only.] Download the folder 'spot_picker' and its contents. Add all
input image files to be processed (and array layouts, if necessary) to the
subfolder 'spot_picker/input'.

Ic) [Once for each input file.] Launch Processing, open the file
spot_picker.pyde and edit the input filename and/or the number of rows and
columns as necessary. Save spot_picker.pyde (if modified) and run the file by
clicking the arrow-shaped 'play' button at top left, or typing Ctrl-R (Windows)
or Command-R (Mac). A new window should appear displaying the specified input
image file.  If necessary, images that are too small/large to appropriately
fill/fit the display window can be rescaled by editing the 'scaling' variable
defined at line 27 and restarting the script.

Id) Use the mouse to click on the four corners that define the four corners of
the rectangular array grid (in any order). Coordinate pairs (x,y) corresponding
to each mouse click are displayed as a growing list in the Console portion of
the Processing window (bottom). Once four clicks have been registered, the
script will automatically interpolate the intermediate positions defined by
these corners and by the number of rows and columns. These positions are then
displayed on the screen as a grid of small rectangles overlaying the input
image, and a tab-delimited text file describing pixel-averaged RGB values (81
pixels; 9x9) for each position is written to a subdirectory named 'output'
(created automatically if necessary). Output files have the input filename
(minus the file extension) appended with ' - rgb spot values.txt'.

Ie) [optional] Repeat step Id to overwrite previous output file if placement of
grid rectangles is suboptimal due to inaccurate mouse clicks.


Step II

The Python (2.7) script 'show_blues_array.py' (included in the 'spot_picker' folder)
is run from the command line and allows batch-wise processing of a series of
output files generated by Step I (ending with ' - rgb spot values.txt') to
generate labeled array colour summaries and iTOL tree annotations in
subdirectories that are labeled 'coloured arrays' and 'iTOL files' (directories
will be automatically created if they do not previously exist). Grid and tree
labels are derived from a default input file ('spot_picker/input/PBL array layout.xlsx') but an alternative array layout can be added to the folder 'spot_picker/input/' and specified explicitly at runtime (see below).

Usage:

python show_blues_array.py

or

python show_blues_array.py alt_array_layout.xlsx


Dependencies:

matplotlib, numpy, pandas, xlrd

 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages