docstr: Test conversion from a native file format to tfrecord.gz, then back.
docstr_tok: ["Test","conversion","from","a","native","file","format","to","tfrecord.gz",",","then","back","."]
code: def test_conversion_to_tfrecord_and_back(self, original_input_file):
      """Test conversion from a native file format to tfrecord.gz, then back."""
      input_path = test_utils.genomics_core_testdata(
          original_input_file
      )
      tfrecord_output_path = test_utils.test_tmpfile(
          original_input_file + ".tfrecord.gz"
      )
      native_output_path = test_utils.test_tmpfile(original_input_file)
  
      # Test conversion from native format to tfrecord.
      self._convert(input_path, tfrecord_output_path)
  
      # TODO: remove this when SAM writer is implemented.
      if native_output_path.endswith(".sam"):
          raise unittest.SkipTest("SAM writing not yet supported")
  
      # Test conversion from tfrecord format back to native format.  Ensure that
      # conversions where we would need a header, but don't have one from the
      # input, trigger an error message.
      if any(
          native_output_path.endswith(ext)
          for ext in FORMATS_REQUIRING_HEADER
      ):
          with self.assertRaisesRegexp(
              converter.ConversionError,
              "Input file does not have a header, which is needed to construct "
              "output file",
          ):
              self._convert(tfrecord_output_path, native_output_path)
  
      else:
          self._convert(tfrecord_output_path, native_output_path)
  
file_path: deepvariant/third_party/nucleus/io/converter_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import unittest
  from absl import logging
  from absl.testing import absltest
  from absl.testing import parameterized
  from third_party.nucleus.io import converter
  from third_party.nucleus.testing import test_utils
label_desc: Use image node_id 2 for calling the ConvertGenomicsFileTest obj's underlying member method code with example usage: obj.test_conversion_to_tfrecord_and_back(original_input_file) without return types