#!/usr/bin/env cwl-runner

cwlVersion: v1.2
class: CommandLineTool

label: "jgi_summarize_bam_contig_depths"

doc: |
    Summarize contig read depth from bam file for metabat2 binning.

requirements:
 - class: InlineJavascriptRequirement

inputs:
  # prefix_id:
  #   type: string
  #   doc: prefix of the filename outputs
  #   default: "sampleX"

  bamFile:
    type: File
    inputBinding:
      position: 2

baseCommand: [/unlock/infrastructure/binaries/metabat_2.12.1/jgi_summarize_bam_contig_depths]

arguments:
  - position: 1
    prefix: '--outputDepth'
    valueFrom:  $(inputs.bamFile.basename).metabat.depth.txt


outputs:
  depths:
    type: File
    outputBinding:
      glob: $(inputs.bamFile.basename).metabat.depth.txt