code: def _get_stats_files(data, out_dir=None):
      
      if not out_dir:
          out_dir = utils.safe_makedir(os.path.join(dd.get_work_dir(data),
                                                    "qc", dd.get_sample_name(data), "samtools"))
      stats_file = tz.get_in(["depth", "samtools", "stats"], data)
      idxstats_file = tz.get_in(["depth", "samtools", "idxstats"], data)
      if not stats_file:
          stats_file = os.path.join(out_dir, "%s.txt" % dd.get_sample_name(data))
      if not idxstats_file:
          idxstats_file = os.path.join(out_dir, "%s-idxstats.txt" % dd.get_sample_name(data))
      return stats_file, idxstats_file
docs: Retrieve stats files from pre-existing dictionary or filesystem.