name: samtools_view
description: filter/convert SAM/BAM/CRAM file
keywords:
  - view
  - bam
  - sam
  - cram
tools:
  - samtools:
      description: |
        SAMtools is a set of utilities for interacting with and post-processing
        short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li.
        These files are generated as output by short read aligners like BWA.
      homepage: http://www.htslib.org/
      documentation: http://www.htslib.org/doc/samtools.html
      doi: 10.1093/bioinformatics/btp352
      licence: ["MIT"]
      identifier: biotools:samtools
input:
  - - meta:
        type: map
        description: |
          Groovy Map containing sample information
          e.g. [ id:'test', single_end:false ]
    - input:
        type: file
        description: BAM/CRAM/SAM file
        pattern: "*.{bam,cram,sam}"
    - index:
        type: file
        description: BAM.BAI/BAM.CSI/CRAM.CRAI file (optional)
        pattern: "*.{.bai,.csi,.crai}"
  - - meta2:
        type: map
        description: |
          Groovy Map containing reference information
          e.g. [ id:'test' ]
    - fasta:
        type: file
        description: Reference file the CRAM was created with (optional)
        pattern: "*.{fasta,fa}"
  - - qname:
        type: file
        description: Optional file with read names to output only select alignments
        pattern: "*.{txt,list}"
output:
  - bam:
      - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - ${prefix}.bam:
          type: file
          description: optional filtered/converted BAM file
          pattern: "*.{bam}"
  - cram:
      - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - ${prefix}.cram:
          type: file
          description: optional filtered/converted CRAM file
          pattern: "*.{cram}"
  - sam:
      - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - ${prefix}.sam:
          type: file
          description: optional filtered/converted SAM file
          pattern: "*.{sam}"
  - bai:
      - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - ${prefix}.${file_type}.bai:
          type: file
          description: optional BAM file index
          pattern: "*.{bai}"
  - csi:
      - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - ${prefix}.${file_type}.csi:
          type: file
          description: optional tabix BAM file index
          pattern: "*.{csi}"
  - crai:
      - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - ${prefix}.${file_type}.crai:
          type: file
          description: optional CRAM file index
          pattern: "*.{crai}"
  - unselected:
      - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - ${prefix}.unselected.${file_type}:
          type: file
          description: optional file with unselected alignments
          pattern: "*.unselected.{bam,cram,sam}"
  - unselected_index:
      - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - ${prefix}.unselected.${file_type}.{bai,csi,crsi}:
          type: file
          description: index for the "unselected" file
          pattern: "*.unselected.{bai,csi,crai}"
  - versions:
      - versions.yml:
          type: file
          description: File containing software versions
          pattern: "versions.yml"
authors:
  - "@drpatelh"
  - "@joseespinosa"
  - "@FriederikeHanssen"
  - "@priyanka-surana"
maintainers:
  - "@drpatelh"
  - "@joseespinosa"
  - "@FriederikeHanssen"
  - "@priyanka-surana"
