Skip to main content
. 2023 Jan 19;11(2):284. doi: 10.3390/biomedicines11020284
Algorithm 1 The algorithm for transformation of SMILES strings into SMILES matrices
Require: D ▹ SMILES dataset
    UØ ▹ Unique symbols
    m0 ▹ Maximal symbol length
    s"" ▹ Empty symbol
    for each SMILESD do
          for each sSMILES do
                if sU then
                       Us
                end if
                if dim(SMILES)>m then
                       mdim(SMILES)
                end if
          end for
    end for
    Tdim(U)×m ▹ One-hot matrix to be filled
    TØ ▹ Transformed dataset
    PØ ▹ MP values from dataset
    y0 ▹ Output value
    for each SMILESD do
          i0 ▹ For tracking vector columns
          for each sSMILES do
                PDP
                yDy
                if sU then
                     LetxbesuchthatUx=s
                     Tx,i=1
                     xdim(U)xxTx,i=0
                else
                     for each xin[1,dim(U)] do
                           Tx,i=0
                     end for
                end if
                ii+1
                T(P,T,y)
          end for
    end for