name: fq_subsample
description: fq subsample outputs a subset of records from single or paired FASTQ files.
keywords: [fastq, subsample, subset]
links:
  homepage: https://github.com/stjude-rust-labs/fq/blob/master/README.md
  documentation: https://github.com/stjude-rust-labs/fq/blob/master/README.md
  repository: https://github.com/stjude-rust-labs/fq
license: MIT

argument_groups: 
- name: "Input"
  arguments: 
  - name: "--input_1"
    type: file
    required: true
    description: First input fastq file to subsample. Accepts both raw and gzipped FASTQ inputs.
  - name: "--input_2"
    type: file
    description: Second input fastq files to subsample. Accepts both raw and gzipped FASTQ inputs.

- name: "Output"
  arguments: 
  - name: "--output_1"
    type: file
    direction: output
    description: Sampled read 1 fastq files. Output will be gzipped if ends in `.gz`.
  - name: "--output_2"
    type: file
    direction: output
    description: Sampled read 2 fastq files. Output will be gzipped if ends in `.gz`.

- name: "Options"
  arguments: 
  - name: "--probability"
    type: double
    description: The probability a record is kept, as a percentage (0.0, 1.0). Cannot be used with `record-count`
  - name: "--record_count"
    type: integer
    description: The exact number of records to keep. Cannot be used with `probability`
  - name: "--seed"
    type: integer
    description: Seed to use for the random number generator

resources:
  - type: bash_script
    path: script.sh

test_resources:
  - type: bash_script
    path: test.sh
  - path: test_data

engines:  
  - type: docker
    image: rust:1.81-slim
    setup:
      - type: docker
        run: |
          apt-get update && apt-get install -y git procps && \
          git clone --depth 1 --branch v0.12.0 https://github.com/stjude-rust-labs/fq.git && \
          cd fq && \
          cargo install --locked --path . && \
          mv target/release/fq /usr/local/bin/ && \
          cd / && rm -rf /fq

runners:
  - type: executable
  - type: nextflow
