code: def get_motif_scores(
      encoded_sequences: np.ndarray,
      motif_names: List[str],
      max_scores: Optional[int] = None,
      return_positions: bool = False,
      GC_fraction: float = 0.4,
  ) -> np.ndarray:
      """Computes pwm log odds.
  
      Parameters
      ----------
      encoded_sequences: np.ndarray
          A numpy array of shape `(N_sequences, N_letters, sequence_length, 1)`.
      motif_names: List[str]
          List of motif file names.
      max_scores: int, optional
          Get top `max_scores` scores.
      return_positions: bool, default False
          Whether to return postions or not.
      GC_fraction: float, default 0.4
          GC fraction in background sequence.
  
      Returns
      -------
      np.ndarray
          A numpy array of complete score. The shape is `(N_sequences, num_motifs, seq_length)` by default.
          If max_scores, the shape of score array is `(N_sequences, num_motifs*max_scores)`.
          If max_scores and return_positions, the shape of score array with max scores and their positions.
          is `(N_sequences, 2*num_motifs*max_scores)`.
  
      Notes
      -----
      This method requires simdna to be installed.
      """
      try:
          import simdna
          from simdna import synthetic
      except ModuleNotFoundError:
          raise ImportError(
              "This function requires simdna to be installed."
          )
  
      loaded_motifs = synthetic.LoadedEncodeMotifs(
          simdna.ENCODE_MOTIFS_PATH, pseudocountProb=0.001
      )
      num_samples, _, seq_length, _ = encoded_sequences.shape
      scores = np.ones((num_samples, len(motif_names), seq_length))
      for j, motif_name in enumerate(motif_names):
          pwm = loaded_motifs.getPwm(motif_name).getRows().T
          log_pwm = np.log(pwm)
          gc_pwm = (
              0.5
              * np.array(
                  [
                      [
                          1 - GC_fraction,
                          GC_fraction,
                          GC_fraction,
                          1 - GC_fraction,
                      ]
                  ]
                  * len(pwm[0])
              ).T
          )
          gc_log_pwm = np.log(gc_pwm)
          log_scores = get_pssm_scores(encoded_sequences, log_pwm)
          gc_log_scores = get_pssm_scores(encoded_sequences, gc_log_pwm)
          scores[:, j, :] = log_scores - gc_log_scores
      if max_scores is not None:
          sorted_scores = np.sort(scores)[:, :, ::-1][:, :, :max_scores]
          if return_positions:
              sorted_positions = scores.argsort()[:, :, ::-1][
                  :, :, :max_scores
              ]
              return np.concatenate(
                  (
                      sorted_scores.reshape(
                          (num_samples, len(motif_names) * max_scores)
                      ),
                      sorted_positions.reshape(
                          (num_samples, len(motif_names) * max_scores)
                      ),
                  ),
                  axis=1,
              )
          else:
              return sorted_scores.reshape(
                  (num_samples, len(motif_names) * max_scores)
              )
      else:
          return scores
  
file_path: deepchem/deepchem/metrics/genomic_metrics.py
imports: from typing import List, Optional
  import numpy
  from scipy.signal import correlate2d
  from deepchem.models import Model
  from deepchem.data import NumpyDataset
label_desc: Use image node_id 1 for calling a global function with example usage: get_motif_scores(encoded_sequences, motif_names, max_scores, return_positions, GC_fraction) and returns: scores, np, sorted_scores