Suppose I have a sequence like "ADTGESW". Each character in this sequence can attain a number of possible values, let's say 10. I can then one-hot encode this sequence and obtain a matrix with shape 10 by the length of the sequence:
$$ \begin{matrix} position_0 & position_1 & \cdots & position_n \\ 0 & 1 & \cdots & 0 \\ 1 & 0 & \cdots & 0 \\ \vdots & \vdots & \vdots & \vdots \\ 0 & 0 & \cdots & 1 \end{matrix} $$
Ideally, this could be the input of a Convolutional Neural Network (CNN).
Suppose now I do not have enough data point to use a CNN, so that I have to rely on something simpler like a Random Forests (RF). Would it still be possible to use such an input (i.e., a matrix) with RF? One might say to just flatten the matrix, but then I would lose the locality properties that are instead preserved with CNNs. Moreover, I might have many similar matrices (for different properties of the sequence and thus with different shapes).