code: def run(samples, run_parallel, stage):
      
      to_process, extras, background = _batch_split_by_sv(samples, stage)
      processed = run_parallel("detect_sv", ([xs, background, stage]
                                             for xs in to_process.values()))
      finalized = (run_parallel("finalize_sv", [([xs[0] for xs in processed], processed[0][0]["config"])])
                   if len(processed) > 0 else [])
      return extras + finalized
docs: Run structural variation detection.
  
      The stage indicates which level of structural variant calling to run.
        - initial, callers that can be used in subsequent structural variation steps (cnvkit -> lumpy)
        - standard, regular batch calling
        - ensemble, post-calling, combine other callers or prioritize results