name: "picard_markduplicates"
info:
  migration_info:
    git_repo: https://github.com/nf-core/rnaseq.git
    paths: [modules/nf-core/picard/markduplicates/main.nf, modules/nf-core/picard/markduplicates/meta.yml]
    last_sha: 55398de6ab7577acfe9b1180016a93d7af7eb859
description: | 
  Locate and tag duplicate reads in a BAM file

argument_groups: 
- name: "Input"
  arguments:
  - name: "--bam"
    type: file
    description: Input BAM file
  - name: "--fasta"
    type: file
    description: Reference genome FASTA file
  - name: "--fai"
    type: file
    description: Reference genome FASTA index
  - name: "--extra_picard_args"
    type: string
    description: Additional argument to be passed to Picard MarkDuplicates
    default: '--ASSUME_SORTED true --REMOVE_DUPLICATES false --VALIDATION_STRINGENCY LENIENT --TMP_DIR tmp'

- name: "Output"
  arguments:
  - name: "--output_bam"
    type: file
    direction: output
    description: BAM file with duplicate reads marked/removed
    default: $id.MarkDuplicates.bam
  - name: "--bai"
    type: file
    direction: output
    description: An optional BAM index file. If desired, --CREATE_INDEX must be passed as a flag
    default: $id.MarkDuplicates.bam.bai
    must_exist: false
  - name: "--metrics"
    type: file
    direction: output
    description: Duplicate metrics file generated by picard 
    default: $id.MarkDuplicates.metrics.txt 

resources: 
  - type: bash_script
    path: script.sh

test_resources:
  - type: bash_script
    path: test.sh
  - path: /testData/unit_test_resources/sarscov2/test.paired_end.sorted.bam
  - path: /testData/unit_test_resources/sarscov2/genome.fasta

engines: 
  - type: docker
    image: ubuntu:22.04
    setup: 
      - type: docker
        run: | 
          apt-get update && \
          apt-get install -y build-essential openjdk-17-jdk wget && \
          wget --no-check-certificate https://github.com/broadinstitute/picard/releases/download/3.1.1/picard.jar && \
          mv picard.jar /usr/local/bin 
        env: [ PICARD=/usr/local/bin/picard.jar ]
runners:
  - type: executable
  - type: nextflow