class_docstr: Encodes a list position frequency matrices for a given list of multiple sequence alignments
  
  The default character set is 25 amino acids. If you want to use a different character set, such as nucleotides, simply pass in
  a list of character strings in the featurizer constructor.
  
  The max_length parameter is the maximum length of the sequences to be featurized. If you want to featurize longer sequences, modify the
  max_length parameter in the featurizer constructor.
  
  The final row in the position frequency matrix is the unknown set, if there are any characters which are not included in the charset.
  
  Examples
  --------
  >>> from deepchem.feat.sequence_featurizers import PFMFeaturizer
  >>> from deepchem.data import NumpyDataset
  >>> msa = NumpyDataset(X=[['ABC','BCD'],['AAA','AAB']], ids=[['seq01','seq02'],['seq11','seq12']])
  >>> seqs = msa.X
  >>> featurizer = PFMFeaturizer()
  >>> pfm = featurizer.featurize(seqs)
  >>> pfm.shape
  (2, 26, 100)
docstr: Featurize a multisequence alignment into a position frequency matrix
  
  Use dc.utils.sequence_utils.hhblits or dc.utils.sequence_utils.hhsearch to create a multiple sequence alignment from a fasta file.
  
  Parameters
  ----------
  datapoint: np.ndarray
      MSA to featurize. A list of sequences which have been aligned and padded to the same length.
  
  Returns
  -------
  pfm: np.ndarray
      Position frequency matrix for the set of sequences with the rows corresponding to the unique characters and the columns corresponding to the position in the alignment.
docstr_tok: ["Featurize","a","multisequence","alignment","into","a","position","frequency","matrix","Use","dc.utils.sequence_utils.hhblits","or","dc.utils.sequence_utils.hhsearch","to","create","a","multiple","sequence","alignment","from","a","fasta","file",".","Parameters","--","--","--","--","--","datapoint",":","np.ndarray","MSA","to","featurize",".","A","list","of","sequences","which","have","been","aligned","and","padded","to","the","same","length",".","Returns","--","--","--","-","pfm",":","np.ndarray","Position","frequency","matrix","for","the","set","of","sequences","with","the","rows","corresponding","to","the","unique","characters","and","the","columns","corresponding","to","the","position","in","the","alignment","."]
code: def _featurize(self, datapoint):
      """Featurize a multisequence alignment into a position frequency matrix
  
      Use dc.utils.sequence_utils.hhblits or dc.utils.sequence_utils.hhsearch to create a multiple sequence alignment from a fasta file.
  
      Parameters
      ----------
      datapoint: np.ndarray
          MSA to featurize. A list of sequences which have been aligned and padded to the same length.
  
      Returns
      -------
      pfm: np.ndarray
          Position frequency matrix for the set of sequences with the rows corresponding to the unique characters and the columns corresponding to the position in the alignment.
  
      """
  
      seq_one_hot = self.ohe.featurize(datapoint)
  
      seq_one_hot_array = np.transpose(
          np.array(seq_one_hot), (0, 2, 1)
      )  # swap rows and columns to make rows the characters, columns the positions
  
      pfm = np.sum(seq_one_hot_array, axis=0)
  
      return pfm
  
file_path: deepchem/deepchem/feat/sequence_featurizers/position_frequency_matrix_featurizer.py
imports: import numpy
  from deepchem.feat.molecule_featurizers import OneHotFeaturizer
  from deepchem.feat.base_classes import Featurizer
  from typing import List, Optional
label_desc: Use image node_id 2 for calling the PFMFeaturizer obj's underlying member method code with example usage: obj._featurize(datapoint) and returns: pfm