code: def get_pssm_scores(encoded_sequences, pssm):
      """
      Convolves pssm and its reverse complement with encoded sequences
      and returns the maximum score at each position of each sequence.
  
      Parameters
      ----------
      encoded_sequences: 3darray
            (num_examples, 1, 4, seq_length) array
      pssm: 2darray
          (4, pssm_length) array
  
      Returns
      -------
      scores: 2darray
          (num_examples, seq_length) array
      """
      encoded_sequences = encoded_sequences.squeeze(axis=1)
      # initialize fwd and reverse scores to -infinity
      fwd_scores = np.full_like(encoded_sequences, -np.inf, float)
      rc_scores = np.full_like(encoded_sequences, -np.inf, float)
      # cross-correlate separately for each base,
      # for both the PSSM and its reverse complement
      for base_indx in range(encoded_sequences.shape[1]):
          base_pssm = pssm[base_indx][None]
          base_pssm_rc = base_pssm[:, ::-1]
          fwd_scores[:, base_indx, :] = correlate2d(
              encoded_sequences[:, base_indx, :], base_pssm, mode="same"
          )
          rc_scores[:, base_indx, :] = correlate2d(
              encoded_sequences[:, -(base_indx + 1), :],
              base_pssm_rc,
              mode="same",
          )
      # sum over the bases
      fwd_scores = fwd_scores.sum(axis=1)
      rc_scores = rc_scores.sum(axis=1)
      # take max of fwd and reverse scores at each position
      scores = np.maximum(fwd_scores, rc_scores)
      return scores
  
file_path: deepchem/contrib/dragonn/utils.py
imports: from __future__ import absolute_import, division, print_function
  import numpy
  import sys
  from sklearn.preprocessing import LabelEncoder, OneHotEncoder
  from scipy.signal import correlate2d
  from simdna.simulations import loaded_motifs
label_desc: Use image node_id 2 for calling a global function with example usage: get_pssm_scores(encoded_sequences, pssm) and returns: scores