Code to generate images from dna sequence
M. Pérez-Enciso, C. Pons, A. Graell, A.J. Monforte, L.M. Zingaretti. Computer generation of fruit shapes from DNA sequence. Biorxiv. submitted
The generation of realistic plant and animal images from marker information could be a main contribution of artificial intelligence to genetics and breeding. Since morphological traits are highly variable and highly heritable, this must be possible. However, a suitable algorithm has not been proposed yet. This paper is a proof of concept demonstrating the feasibility of this proposal using ‘decoders’, a class of deep learning architecture. We apply it to Cucurbitaceae, the family harboring the largest variability in fruit shape in the plant kingdom, and to tomato. We generate Cucurbitaceae shapes assuming a hypothetical, but plausible, evolutive path along observed fruit shapes. In tomato, we analyze 129 crosses for which image and genotype data were available. In both instances, a simple decoder was able to recover expected shapes with large accuracy. For the tomato pedigree, we also show that the algorithm can be trained to generate offspring images from their parents’ shapes, fully bypassing genotype information.
- Generates 2D and 3D ellipses: https://github.com/miguelperezenciso/dna2image/blob/main/dna2img.ellipse.ipynb
- Generates cucurbit shapes: https://github.com/miguelperezenciso/dna2image/blob/main/dna2img.cucurbita.ipynb
- Generates tomato shapes: https://github.com/miguelperezenciso/dna2image/blob/main/dna2img.tomato.ipynb
- Generates 'offspring' ellipses from 'parents' ellipses: https://github.com/miguelperezenciso/dna2image/blob/main/img2img.ipynb
- Generates 'offspring' tomato shapes from 'parents' shapes: https://github.com/miguelperezenciso/dna2image/blob/main/img2img.ipynb
data: contains tomato contours, pedigree and genotype data
images: contains cucurbita images
Warning: The img2img code requires file TraditomImgset.pkl (~1Gb), which is available from dropbox link https://www.dropbox.com/s/hvmt1a2qursameq/TraditomImgset.pkl?dl=0
- https://docs.opencv.org/master/d6/d00/tutorial_py_root.html
- https://scikit-image.org/
- https://github.com/lauzingaretti/DeepAFS
- https://machinelearningmastery.com/
- https://machinelearningmastery.com/deep-learning-for-computer-vision/
- Geron A. 2019. https://www.oreilly.com/library/view/hands-on-machine-learning/9781492032632/
- Chollet F. 2017. https://www.manning.com/books/deep-learning-with-python , p122 ff for CNNs
- https://github.com/Horea94
- skimage: basic image processing (https://scikit-image.org/)
- opencv: advanced, classical library (https://pypi.org/project/opencv-python/, https://docs.opencv.org/4.x/d6/d00/tutorial_py_root.html)
- PIL: basic operations, saving, rotating: https://pillow.readthedocs.io/en/stable/handbook/index.html
- pymrt: as downloaded from the web to generate 3D images, DO NOT use the repository version available from pip.
- procrustes: https://github.com/theochem/procrustes