code: def _piped_bamprep_region(data, region, out_file, tmp_dir):
      
      if _need_prep(data):
          prep_params = _get_prep_params(data)
          _piped_bamprep_region_gatk(data, region, prep_params, out_file, tmp_dir)
      else:
          raise ValueError("No realignment specified")
docs: Do work of preparing BAM input file on the selected region.