# Developmental scRNASeq Trajectories in Gene- and Cell-State Space--The Flatworm Example
## 2 Materials and Methods
### Single Cell SOM Portrayal  
For transcript-related analysis we applied the \"Single-Cell R Analysis Toolkit\" available as R-package \"scrat\" [22; 23; 27]. In brief, it works as follows: Transcript-level expression data were log-transformed and centralized into log-fold changes with respect to the ensemble average of each transcript, log FC (cell) = log expression (cell)--mean_log expression (all cells). Then, SOM neuronal network machine learning translates the high-dimensional expression data of N = 28,065 gene transcripts into K = 3600 metagene expression data per cell. Implementation of SOM and optimal parameter settings were addressed previously [27]. Each metagene represents a \"micro\"-cluster of co-expressed genes showing mutually similar expression profiles across the samples. Metagenes were arranged in a \(60\times 60\) two-dimensional grid coordinate system and colored according to their expression level in each sample thus generating an image of the transcriptome of each single cell. The resolution of \(60\times 60\) metagenes was chosen to optimally resolve expression modules as shown previously. Default coloring of metagenes (red to blue for maximum to minimum expression, respectively) scales with log-expression values [22; 36]. Mean portraits of the transcriptome of a cell type were calculated by averaging metagene expression values over all single cell portraits of the respective type. Metagenes of mutually correlated profiles cluster together forming \"spot-like\" red and blue areas of over- and under-expression in the portraits because of the self-organizing properties of the SOM. These \"spot\"-modules were detected using distance-metrics (D-map) clustering [37]. They extract groups of co-expressed genes showing high expression in specific cell types. However, the spots cover only part of the SOM and thus only part of the genes. For \"space-filling\" segmentation of the SOM we applied k-means clustering to all metagenes. This k-means clustering stratified the 3600 metagenes into 32 clusters where 11 of them can be assigned to the spots, 21 collect virtually low variant transcripts, and one cluster collects almost invariant genes (see below). The choice of the number of metagenes, clustering criteria, and methods for segmenting SOM were extensively studied and described previously [22; 27]. In short, a number of several thousand metagenes are large enough to resolve transcriptional landscapes in an unsupervised fashion in order to identify dozens of different states with sufficient resolution. Larger numbers of metagenes have virtually no effect on the results. The number of spots represents an intrinsic property of the data. It is obtained in an unsupervised way by searching for modules of co-expressed genes by applying different algorithms based on overexpression or D-map criteria. Typically their number is roughly comparable with the number of transcriptomic states as has been shown in previous applications [25; 36; 38]. It is expected to vary between ten and twenty in the flatworm example. For low-variant modules a number exceeding the number of spot modules by a factor of two is appropriate to segment the map with sufficient resolution. A number too small (e.g., five or less) will provide a too coarse resolution of the paths while higher numbers (e.g., more than thirty) do not change the results and, moreover, typically produce \"empty\" clusters without functional information. The spot-patterns obtained represents a characteristic fingerprint of each particular sample. This \"logFC\" scale is used as default color scale of the portraits (see also [22]). It enables to identify well-separated areas of overexpression (red color) as described above. In addition, we applied a so-called \"loglogFC\" scale for alternative coloring. It applies the signed logarithm of the absolute value of logFC, loglogFC = sign log(abs(logFC)), where \"sign\" equals the sign of logFC.