name: samtools
namespace: genetic_demux
scope: "public"
description: Filter the BAM according to the instruction of scSplit via Samtools.
authors:
  - __merge__: /src/authors/xichen_wu.yaml
    roles: [ author ]
arguments:
  - name: "--bam"
    type: file
    required: true
    description: "Input bam file for filtering."
    example: input.bam
  - name: "--output"
    type: file
    direction: output
    description: "Samtools output directory."
    example: "samtools_out/"
resources:
  - type: bash_script
    path: script.sh
  - path: umi_tools.patch
test_resources:
  - type: bash_script
    path: test.sh
  - path: ../../../resources_test/demuxafy_test_data

engines:
- type: docker
  image: python:3.12
  setup:
  - type: docker
    copy: ["umi_tools.patch /opt/umi_tools.patch"]
  - type: apt
    packages: 
      - wget
      - gcc
      - make
      - libbz2-dev
      - zlib1g-dev
      - libncurses5-dev
      - libncursesw5-dev
      - liblzma-dev
      - samtools
  - type: docker
    run: git clone --branch v1.1.6 --single-branch https://github.com/CGATOxford/UMI-tools.git && git apply --directory=UMI-tools /opt/umi_tools.patch
  - type: python
    pip: ['./UMI-tools']

runners:
- type: executable
- type: nextflow
  directives:
    label: [ midmem, midcpu ]
