class_docstr: Handles loading of FASTA files.
  
  FASTA files are commonly used to hold sequence data. This
  class provides convenience files to lead FASTA data and
  one-hot encode the genomic sequences for use in downstream
  learning tasks.
class_docstr_tok: ["Handles","loading","of","FASTA","files",".","FASTA","files","are","commonly","used","to","hold","sequence","data",".","This","class","provides","convenience","files","to","lead","FASTA","data","and","one-hot","encode","the","genomic","sequences","for","use","in","downstream","learning","tasks","."]
docstr: Initialize FASTALoader.
  
  Parameters
  ----------
  featurizer: Featurizer (default: None)
      The Featurizer to be used for the loaded FASTA data.
  
      If featurizer is None and legacy is True, the original featurization
      logic is used, creating a one hot encoding of all included FASTA strings
      of shape
      (number of FASTA sequences, number of channels + 1, sequence length, 1).
  
      If featurizer is None and legacy is False, the featurizer is initialized
      as a OneHotFeaturizer object with charset ("A", "C", "T", "G") and
      max_length = None.
  
  auto_add_annotations: bool (default False)
      Whether create_dataset will automatically add [CLS] and [SEP] annotations
      to the sequences it reads in order to assist tokenization.
      Keep False if your FASTA file already includes [CLS] and [SEP] annotations.
  
  legacy: bool (default True)
      Whether to use legacy logic for featurization. Legacy mode will create
      a one hot encoding of the FASTA content of shape
      (number of FASTA sequences, number of channels + 1, max length, 1).
  
      Legacy mode is only tested for ACTGN charsets, and will be deprecated.
docstr_tok: ["Initialize","FASTALoader",".","Parameters","--","--","--","--","--","featurizer",":","Featurizer","(","default",":","None",")","The","Featurizer","to","be","used","for","the","loaded","FASTA","data",".","If","featurizer","is","None","and","legacy","is","True",",","the","original","featurization","logic","is","used",",","creating","a","one","hot","encoding","of","all","included","FASTA","strings","of","shape","(","number","of","FASTA","sequences",",","number","of","channels","+","1",",","sequence","length",",","1",")",".","If","featurizer","is","None","and","legacy","is","False",",","the","featurizer","is","initialized","as","a","OneHotFeaturizer","object","with","charset","(","``","A","''",",","``","C","''",",","``","T","''",",","``","G","''",")","and","max_length","=","None",".","auto_add_annotations",":","bool","(","default","False",")","Whether","create_dataset","will","automatically","add","[","CLS","]","and","[","SEP","]","annotations","to","the","sequences","it","reads","in","order","to","assist","tokenization",".","Keep","False","if","your","FASTA","file","already","includes","[","CLS","]","and","[","SEP","]","annotations",".","legacy",":","bool","(","default","True",")","Whether","to","use","legacy","logic","for","featurization",".","Legacy","mode","will","create","a","one","hot","encoding","of","the","FASTA","content","of","shape","(","number","of","FASTA","sequences",",","number","of","channels","+","1",",","max","length",",","1",")",".","Legacy","mode","is","only","tested","for","ACTGN","charsets",",","and","will","be","deprecated","."]
code: def __init__(
      self,
      featurizer: Optional[Featurizer] = None,
      auto_add_annotations: bool = False,
      legacy: bool = True,
  ):
      """Initialize FASTALoader.
  
      Parameters
      ----------
      featurizer: Featurizer (default: None)
          The Featurizer to be used for the loaded FASTA data.
  
          If featurizer is None and legacy is True, the original featurization
          logic is used, creating a one hot encoding of all included FASTA strings
          of shape
          (number of FASTA sequences, number of channels + 1, sequence length, 1).
  
          If featurizer is None and legacy is False, the featurizer is initialized
          as a OneHotFeaturizer object with charset ("A", "C", "T", "G") and
          max_length = None.
  
      auto_add_annotations: bool (default False)
          Whether create_dataset will automatically add [CLS] and [SEP] annotations
          to the sequences it reads in order to assist tokenization.
          Keep False if your FASTA file already includes [CLS] and [SEP] annotations.
  
      legacy: bool (default True)
          Whether to use legacy logic for featurization. Legacy mode will create
          a one hot encoding of the FASTA content of shape
          (number of FASTA sequences, number of channels + 1, max length, 1).
  
          Legacy mode is only tested for ACTGN charsets, and will be deprecated.
      """
  
      # Process legacy toggle
      if legacy:
          warnings.warn(
              """
                      Legacy mode is deprecated and will be removed in
                      DeepChem 3.0. Disable legacy mode by passing legacy=False
                      during construction of FASTALoader object.
                      """,
              FutureWarning,
          )
          if featurizer is not None or auto_add_annotations:
              raise ValueError(
                  f"""
                            featurizer option must be None and
                            auto_add_annotations must be false when legacy mode
                            is enabled. You set featurizer to {featurizer} and
                            auto_add_annotations to {auto_add_annotations}.
                            """
              )
  
      # Set attributes
      self.legacy = legacy
      self.auto_add_annotations = auto_add_annotations
  
      self.user_specified_features = None
  
      # Handle special featurizer cases
      if isinstance(
          featurizer, UserDefinedFeaturizer
      ):  # User defined featurizer
          self.user_specified_features = featurizer.feature_fields
      elif featurizer is None:  # Default featurizer
          featurizer = OneHotFeaturizer(
              charset=["A", "C", "T", "G"], max_length=None
          )
  
      # Set self.featurizer
      self.featurizer = featurizer
  
imports: import os
  import tempfile
  import zipfile
  import time
  import logging
  import warnings
  from typing import List, Optional, Tuple, Any, Sequence, Union, Iterator
  import pandas
  import numpy
  from deepchem.utils.typing import OneOrMany
  from deepchem.utils.data_utils import load_image_files, load_csv_files, load_json_files, load_sdf_files, unzip_file
  from deepchem.feat import UserDefinedFeaturizer, Featurizer
  from deepchem.data import Dataset, DiskDataset, NumpyDataset, ImageDataset
  from deepchem.feat.molecule_featurizers import OneHotFeaturizer
  from deepchem.utils.genomics_utils import encode_bio_sequence
label_desc: Use image node_id 1 to create a new FASTALoader object from inherited base classes: DataLoader with example: obj = FASTALoader(featurizer, auto_add_annotations, legacy)