# Synthetic Data Generation for the Development of 2D Gel Electrophoresis Protein Spot Models
## 2 Materials and Methods
### Generation of Synthetic Protein Spot Images
#### 2.1.3 Generation of Protein Spot 2D Prototype (Primary Spot)  
This is the first step of the main workflow of synthetic protein spot image generation. This step produces the initial appearance of the spot. In Section 2.1.1 and Figure 2, it was discussed that the fast approach of constructing the 2D shape of the spot from vertical and horizontal sections of the spot by vector outer product might lead to situations where the 2D shape of the spot starts to lose smoothness and appear cornered. Effects such as these start to show when generating more extremely saturated spots (spots with larger plateaus on the top). To overcome this problem, the 2D shape of the spot is inferred from the generated vertical and horizontal sections of the spot by elliptic interpolation. The workflow of the prototype spot generation is as follows (Figure 4):  
_1. Random generation of protein spot edge 1D templates._ The first step is to randomly select the mathematical function and its parameters that define the intensity profile of the spot sections. A single function serves as a protein spot edge 1D template. To generate a rich variety of spot shapes, the section of the spot is made of two 1D templates, and these templates are generated independently. For creating the spot, two sections (vertical and horizontal) are required, so four samples of templates must be created. Six functions are selected for the spot edge template generation: Gaussian, simplified diffusion process, spline, fuzzy logic generalized membership bell-shaped, sigmoid, and raised cosine. Mathematical functions are described further in this section, and their plots are shown in Figure 6.  
_2. Spot template resampling._ To prepare templates for simple elliptic interpolation, the templates are resampled such that all templates have the same intensity values. Linear interpolation is used to solve the problem of finding \(x\) coordinates where the function acquires the required intensity values. The required intensity values are generated non-linearly dividing interval \([0,\ 1]\): the spacing of the samples at the ends of the interval is smaller than at the center to create a smoother template curve where the curvature is larger. _3. Arranging 1D templates in 2D space._ The generated templates obtain their position in 2D space. Now each template defines a shape of the eastern, northern, western, and southern sides of the spot. _4. Elliptic interpolation of 1D templates to create the full spot shape._ The arranged templates fill only parts of the spot at the cardinal axes (spot horizontal and vertical sections). This step performs the calculation of spot samples for the full area of the spot. Spot intensity values are acquired by elliptic interpolation of the template samples: an ellipse is fitted to the pair of samples that have the same value and belongs to the adjacent templates (the distances from the origin to the positions of the samples define the two axes of an ellipse); an ellipse is sampled at a range of angle values with a step of 1 deg; and \(x\) and \(y\) coordinates of the ellipse samples are collected to describe the shape of the spot. The elliptic interpolation is repeated for all template sample pairs in all quadrants. _5. Interpolation of data points to create the spot image._ At this point, the computed samples that form the spot are irregularly scattered in 3D space (if point intensity is seen as \(z\) coordinate). In order to produce the 2D image of the spot, we need to resample the point cloud to obtain data points on the regular grid in the XY-plane. This is achieved by  
Figure 5: Visualization of the generation of varying background templates. Four samples of backgrounds are presented. Each plot shows a randomly generated grid of points and a fitted polynomial surface of degree 5 in \(x\) and \(y\) directions. triangulation-based cubic interpolation for 2D cases. The final result is the image of the protein spot. Spot edge templates are needed to build vertical and horizontal sections of the protein spot.