docstr: Testing what happens when read and reference sequences are shorter.
docstr_tok: ["Testing","what","happens","when","read","and","reference","sequences","are","shorter","."]
code: def test_align_to_haplotype_stress_tests(
      self, alt_allele, ref_buffer_length, read_buffer_length
  ):
      """Testing what happens when read and reference sequences are shorter."""
      # Start with long prefix and suffix to enable cutting it down as necessary
      whole_prefix = "AGTGATCTAGTCCTTTTTGTTGTGCAAAAGGAAGTGCTAAAATCAGAATGAGAACCATGGTCACCTGACATAGAC"
      whole_suffix = "ATCCATGTTCAAGTACTAATTCTGGGCAAGACACTGTTCTAAGTGCTATGAATATATTACCTCATTTAATCATCT"
  
      ref_prefix = whole_prefix[-ref_buffer_length:]
      ref_suffix = whole_suffix[:ref_buffer_length]
  
      # Make two haplotypes.
      ref_allele = ""
      haplotypes = [ref_allele, alt_allele]
  
      # Simulate one read from the reference and one from the alt haplotype.
      read_prefix = ref_prefix[-read_buffer_length:]
      read_suffix = ref_suffix[:read_buffer_length]
  
      expected_cigars = [
          # Aligning to ref haplotype: Insertion.
          "{}M{}I{}M".format(
              len(read_prefix), len(alt_allele), len(read_suffix)
          ),
          # Aligning to alt haplotype: All matching.
          "{}M".format(
              len(read_prefix) + len(alt_allele) + len(read_suffix)
          ),
      ]
  
      reads = [
          test_utils.make_read(
              read_prefix + alt_allele + read_suffix, start=1
          )
      ]
      # Align to each haplotype in turn.
      for i in range(len(haplotypes)):
          aligned_reads = self.reads_realigner.align_to_haplotype(
              haplotypes[i],
              haplotypes,
              ref_prefix,
              ref_suffix,
              reads,
              "test",
              1,
          )
          self.assertEqual(len(reads), len(aligned_reads))
          self.assertEqual(
              cigar_utils.format_cigar_units(
                  aligned_reads[0].alignment.cigar
              ),
              expected_cigars[i],
          )
  
imports: import csv
  import itertools
  import os
  from absl import flags
  from absl.testing import absltest
  from absl.testing import flagsaver
  from absl.testing import parameterized
  from etils import epath
  import numpy
  from deepvariant import testdata
  from deepvariant.protos import realigner_pb2
  from deepvariant.realigner import realigner
  from deepvariant.realigner import utils
  from third_party.nucleus.io import fasta
  from third_party.nucleus.io import sam
  from third_party.nucleus.protos import reads_pb2
  from third_party.nucleus.testing import test_utils
  from third_party.nucleus.util import cigar
  from third_party.nucleus.util import ranges
label_desc: Use image node_id 9 for calling the RealignerTest obj's underlying member method code with example usage: obj.test_align_to_haplotype_stress_tests(alt_allele, ref_buffer_length, read_buffer_length) without return types