code: def _bam_to_outbase(bam_file, work_dir, data):
      
      batch = dd.get_batch(data) or dd.get_sample_name(data)
      out_base = os.path.splitext(os.path.basename(bam_file))[0].split(".")[0]
      base = os.path.join(work_dir, out_base)
      return "%s-%s" % (base, batch), base
docs: Convert an input BAM file into CNVkit expected output.
  
      Handles previous non-batch cases to avoid re-calculating,
      returning both new and old values: