Bacteria Colonies
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.
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.
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.
Example:
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.
Precondition:
5 ≤ len(grid) ≤ 20
all(5 ≤ len(row) ≤ 20 for row in grid)
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.
Welcome to Pair Programming! Engage in real-time collaboration on coding projects by starting a session and sharing the provided unique URL with friends or colleagues. This feature is perfect for joint project development, debugging, or learning new skills together. Simply click 'Start Session' to begin your collaborative coding journey!
You are trying to join a pair programming session that has not started yet.
Please wait for the session creator to join.
It looks like the creator of the pair programming session closed the editor window.
It might happen accidentally, so that you can wait for reconnection.