Bacteria Colonies Bacteria Colonies
ES JA RU English

Biologists use bacteria to clone DNA for sequencing. These bacteria are then injected with the DNA that needs to be cloned and allowed to reproduce on a large plate. As these bacteria reproduce, they begin to form colonies. Only bacteria from healthy colonies will be used for sequencing. And here bioinformatics take the game and use technologies to automate these process.

Let's represent a plate snapshot as a pixel grid. You are given this grid as a binary matrix where 1 is bacteria cell and 0 is empty. Our goal is find the largest healthy bacteria colony which has grown uniformly. Bacteria can grow in four adjacent cells and bacteria colony is a set of bacterias that are connected. The healthy colonies look similar to the images represented below.

healthy healthy

Next, we can see that unhealthy colonies are marked with an orange color. Remember that a single cell is not a colony, so it cannot be counted as healthy colony.

example example

Your mission is to find the largest healthy colony and return the coordinates of the center cell. The top-left cell has coordinates (0, 0). If on the plate no a healthy colony, then return (0, 0) (or [0, 0]). If on the plate several largest colonies with the same size, then return any of them.

Input: A grid as a tuple of tuples with integers 1/0.

Output: The coordinates of the largest colony as a list or a tuple of two integers.


How it is used: This mission presents a mix of modeling, pattern recognition and data structure programing in addition to presenting some ideas for how to use it in bioinformatics. That is assuming of course that bioinformatics can be useful for classical biology.

5 ≤ len(grid) ≤ 20
all(5 ≤ len(row) ≤ 20 for row in grid)

Become Awesome

  • No Ads
  • No Limits
  • More Content
CheckiO Extensions

CheckiO Extensions allow you to use local files to solve missions. More info in a blog post.

In order to install CheckiO client you'll need installed Python (version at least 3.8)

Install CheckiO Client first:

pip3 install checkio_client

Configure your tool

checkio --domain=py config --key=

Sync solutions into your local folder

checkio sync

(in beta testing) Launch local server so your browser can use it and sync solution between local file end extension on the fly. (doesn't work for safari)

checkio serv -d

Alternatevly, you can install Chrome extension or FF addon

checkio install-plugin
checkio install-plugin --ff
checkio install-plugin --chromium

Read more here about other functionality that the checkio client provides. Feel free to submit an issue in case of any difficulties.

<< <
> >>
exec show

Whats Next?

Free accounts will see Best CheckiO solutions with some delay.
Best Solutions will be opened in
Become Awesome and Don't wait
The next stage is ""
Will be activated in
View More Solutions Random Review Solutions Go to the next mission