{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "samtools_view",
"description": "Views and converts SAM/BAM/CRAM files.",
"type": "object",
"definitions": {

    
    
    "inputs" : {
    "title": "Inputs",
    "type": "object",
    "description": "No description",
    "properties": {
    
        
                "input": {
                "type":
                "string",
                "description": "Type: `file`, required. Input SAM, BAM, or CRAM file",
                "help_text": "Type: `file`, required. Input SAM, BAM, or CRAM file."
            
            }
    

        ,
                "fai_reference": {
                "type":
                "string",
                "description": "Type: `file`. A tab-delimited FILE",
                "help_text": "Type: `file`. A tab-delimited FILE. Each line must contain the reference name in the first column\nand the length of the reference in the second column, with one line for each distinct\nreference. Any additional fields beyond the second column are ignored. This file also\ndefines the order of the reference sequences in sorting. If you run: `samtools faidx \u003cref.fa\u003e\u0027,\nthe resulting index file \u003cref.fa\u003e.fai can be used as this FILE.\n"
            
            }
    

        ,
                "reference": {
                "type":
                "string",
                "description": "Type: `file`. A FASTA format reference FILE, optionally compressed by bgzip and ideally indexed by samtools faidx",
                "help_text": "Type: `file`. A FASTA format reference FILE, optionally compressed by bgzip and ideally indexed by samtools faidx.\nIf an index is not present one will be generated for you, if the reference file is local.\nIf the reference file is not local, but is accessed instead via an https://, s3:// or other URL,\nthe index file will need to be supplied by the server alongside the reference. It is possible to\nhave the reference and index files in different locations by supplying both to this option separated\nby the string \"##idx##\", for example:\n--reference ftp://x.com/ref.fa##idx##ftp://y.com/index.fa.fai\nHowever, note that only the location of the reference will be stored in the output file header.\nIf this method is used to make CRAM files, the cram reader may not be able to find the index,\nand may not be able to decode the file unless it can get the references it needs using a different\nmethod.\n"
            
            }
    

        ,
                "target_file": {
                "type":
                "string",
                "description": "Type: `file`. Only output alignments overlapping the input BED FILE [null]",
                "help_text": "Type: `file`. Only output alignments overlapping the input BED FILE [null].\n"
            
            }
    

        ,
                "region_file": {
                "type":
                "string",
                "description": "Type: `file`. Use an index and multi-region iterator to only output alignments overlapping the input BED FILE",
                "help_text": "Type: `file`. Use an index and multi-region iterator to only output alignments overlapping the input BED FILE.\nEquivalent to --use_index --target_file FILE.\n"
            
            }
    

        ,
                "qname_file": {
                "type":
                "string",
                "description": "Type: `file`. Output only alignments with read names listed in FILE",
                "help_text": "Type: `file`. Output only alignments with read names listed in FILE. If FILE starts with ^ then the operation is\nnegated and only outputs alignment with read groups not listed in FILE. It is not permissible to mix\nboth the filter-in and filter-out style syntax in the same command.\n"
            
            }
    

        ,
                "read_group_file": {
                "type":
                "string",
                "description": "Type: `file`. Output alignments in read groups listed in FILE [null]",
                "help_text": "Type: `file`. Output alignments in read groups listed in FILE [null]. If FILE starts with ^ then the operation is\nnegated and only outputs alignment with read names not listed in FILE. It is not permissible to mix\nboth the filter-in and filter-out style syntax in the same command. Note that records with no RG tag\nwill also be output when using this option. This behaviour may change in a future release.\n"
            
            }
    

        ,
                "use_index": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Use the multi-region iterator on the union of a BED file and command-line region arguments",
                "help_text": "Type: `boolean_true`, default: `false`. Use the multi-region iterator on the union of a BED file and command-line region arguments.\nThis avoids re-reading the same regions of files so can sometimes be much faster. Note this also\nremoves duplicate sequences. Without this a sequence that overlaps multiple regions specified on\nthe command line will be reported multiple times. The usage of a BED file is optional and its path\nhas to be preceded by --target_file option.\n"
            ,
                "default": "False"
            }
    

}
},
    
    
    "outputs" : {
    "title": "Outputs",
    "type": "object",
    "description": "No description",
    "properties": {
    
        
                "output": {
                "type":
                "string",
                "description": "Type: `file`, required, default: `$id.$key.output.bam`, example: `output.bam`. Output to FILE instead of [stdout]",
                "help_text": "Type: `file`, required, default: `$id.$key.output.bam`, example: `output.bam`. Output to FILE instead of [stdout]."
            ,
                "default": "$id.$key.output.bam"
            }
    

        ,
                "bam": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Output in the BAM format",
                "help_text": "Type: `boolean_true`, default: `false`. Output in the BAM format."
            ,
                "default": "False"
            }
    

        ,
                "cram": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Output in the CRAM format (requires --reference)",
                "help_text": "Type: `boolean_true`, default: `false`. Output in the CRAM format (requires --reference).\n"
            ,
                "default": "False"
            }
    

        ,
                "fast": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Enable fast compression",
                "help_text": "Type: `boolean_true`, default: `false`. Enable fast compression. This also changes the default output format to BAM,\nbut this can be overridden by the explicit format options or using a filename\nwith a known suffix.\n"
            ,
                "default": "False"
            }
    

        ,
                "uncompressed": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Output uncompressed data",
                "help_text": "Type: `boolean_true`, default: `false`. Output uncompressed data. This also changes the default output format to BAM,\nbut this can be overridden by the explicit format options or using a filename\nwith a known suffix.\nThis option saves time spent on compression/decompression and is thus preferred\nwhen the output is piped to another samtools command.\n"
            ,
                "default": "False"
            }
    

        ,
                "with_header": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Include the header in the output",
                "help_text": "Type: `boolean_true`, default: `false`. Include the header in the output.\n"
            ,
                "default": "False"
            }
    

        ,
                "header_only": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Output the header only",
                "help_text": "Type: `boolean_true`, default: `false`. Output the header only.\n"
            ,
                "default": "False"
            }
    

        ,
                "no_header": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. When producing SAM format, output alignment records but not headers",
                "help_text": "Type: `boolean_true`, default: `false`. When producing SAM format, output alignment records but not headers.\nThis is the default; the option can be used to reset the effect of \n--with_header/--header_only.\n"
            ,
                "default": "False"
            }
    

        ,
                "count": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Instead of printing the alignments, only count them and print the total number",
                "help_text": "Type: `boolean_true`, default: `false`. Instead of printing the alignments, only count them and print the total number.\nAll filter options, such as --require_flags, --excl_flags, and --min_MQ, are taken\ninto account. The --unmap option is ignored in this mode.\n"
            ,
                "default": "False"
            }
    

        ,
                "output_unselected": {
                "type":
                "string",
                "description": "Type: `file`. Write alignments that are not selected by the various filter options to FILE",
                "help_text": "Type: `file`. Write alignments that are not selected by the various filter options to FILE.\nWhen this option is used, all alignments (or all alignments intersecting the regions\nspecified) are written to either the output file or this file, but never both.\n"
            
            }
    

        ,
                "unmap": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Set the UNMAP flag on alignments that are not selected by the filter options",
                "help_text": "Type: `boolean_true`, default: `false`. Set the UNMAP flag on alignments that are not selected by the filter options.\nThese alignments are then written to the normal output. This is not compatible\nwith --output_unselected.\n"
            ,
                "default": "False"
            }
    

        ,
                "read_group": {
                "type":
                "string",
                "description": "Type: `string`. Output alignments in read group STR [null]",
                "help_text": "Type: `string`. Output alignments in read group STR [null]. Note that records with no RG tag will also be output\nwhen using this option. This behaviour may change in a future release.\n"
            
            }
    

        ,
                "tag": {
                "type":
                "string",
                "description": "Type: `string`. Only output alignments with tag STR1 and associated value STR2, which can be a string or an integer\n[null]",
                "help_text": "Type: `string`. Only output alignments with tag STR1 and associated value STR2, which can be a string or an integer\n[null].\nThe value can be omitted, in which case only the tag is considered.\nNote that this option does not specify a tag type. For example, use --tag XX:42 to select alignments\nwith an XX:i:42 field, not --tag XX:i:42.\n"
            
            }
    

        ,
                "tag_file": {
                "type":
                "string",
                "description": "Type: `file`. Only output alignments with tag STR and associated values listed in FILE",
                "help_text": "Type: `file`. Only output alignments with tag STR and associated values listed in FILE.\n"
            
            }
    

        ,
                "min_MQ": {
                "type":
                "integer",
                "description": "Type: `integer`, default: `0`. Skip alignments with MAPQ smaller than INT",
                "help_text": "Type: `integer`, default: `0`. Skip alignments with MAPQ smaller than INT.\n"
            ,
                "default": "0"
            }
    

        ,
                "library": {
                "type":
                "string",
                "description": "Type: `string`. Only output alignments in library STR",
                "help_text": "Type: `string`. Only output alignments in library STR.\n"
            
            }
    

        ,
                "min_qlen": {
                "type":
                "integer",
                "description": "Type: `integer`, default: `0`. Only output alignments with number of CIGAR bases consuming query sequence \u003e= INT",
                "help_text": "Type: `integer`, default: `0`. Only output alignments with number of CIGAR bases consuming query sequence \u003e= INT.\n"
            ,
                "default": "0"
            }
    

        ,
                "expr": {
                "type":
                "string",
                "description": "Type: `string`. Only include alignments that match the filter expression STR",
                "help_text": "Type: `string`. Only include alignments that match the filter expression STR. The syntax for these expressions is\ndescribed in the main samtools.\n"
            
            }
    

        ,
                "require_flags": {
                "type":
                "string",
                "description": "Type: `string`. Only output alignments with all bits set in FLAG present in the FLAG field",
                "help_text": "Type: `string`. Only output alignments with all bits set in FLAG present in the FLAG field. FLAG can be specified\nin hex by beginning with `0x\u0027 (i.e. /^0x[0-9A-F]+/), in octal by beginning with `0\u0027 (i.e. /^0[0-7]+/),\nas a decimal number not beginning with \u00270\u0027 or as a comma-separated list of flag names.\n"
            
            }
    

        ,
                "excl_flags": {
                "type":
                "string",
                "description": "Type: `string`. Do not output alignments with any bits set in FLAG present in the FLAG field",
                "help_text": "Type: `string`. Do not output alignments with any bits set in FLAG present in the FLAG field. FLAG can be specified\nin hex by beginning with `0x\u0027 (i.e. /^0x[0-9A-F]+/), in octal by beginning with `0\u0027 (i.e. /^0[0-7]+/),\nas a decimal number not beginning with \u00270\u0027 or as a comma-separated list of flag names.\n"
            
            }
    

        ,
                "excl_all_flags": {
                "type":
                "integer",
                "description": "Type: `integer`. Do not output alignments with all bits set in INT present in the FLAG field",
                "help_text": "Type: `integer`. Do not output alignments with all bits set in INT present in the FLAG field. This is the opposite of\n--require_flags such that --require_flags 12 --exclude_all_flags 12 is the same as no filtering at all.\nFLAG can be specified in hex by beginning with `0x\u0027 (i.e. /^0x[0-9A-F]+/), in octal by beginning with `0\u0027\n(i.e. /^0[0-7]+/), as a decimal number not beginning with \u00270\u0027 or as a comma-separated list of flag names.\n"
            
            }
    

        ,
                "incl_flags": {
                "type":
                "string",
                "description": "Type: `string`. Only output alignments with any bit set in FLAG present in the FLAG field",
                "help_text": "Type: `string`. Only output alignments with any bit set in FLAG present in the FLAG field. FLAG can be specified in hex\nby beginning with `0x\u0027 (i.e. /^0x[0-9A-F]+/), in octal by beginning with `0\u0027 (i.e. /^0[0-7]+/), as a decimal\nnumber not beginning with \u00270\u0027 or as a comma-separated list of flag names.\n"
            
            }
    

        ,
                "remove_tag": {
                "type":
                "string",
                "description": "Type: `string`. Read tag(s) to exclude from output (repeatable) [null]",
                "help_text": "Type: `string`. Read tag(s) to exclude from output (repeatable) [null]. This can be a single tag or a comma separated list.\nAlternatively the option itself can be repeated multiple times.\nIf the list starts with a `^\u0027 then it is negated and treated as a request to remove all tags except those in STR.\nThe list may be empty, so --remove_tag ^ will remove all tags.\nNote that tags will only be removed from reads that pass filtering.\n"
            
            }
    

        ,
                "keep_tag": {
                "type":
                "string",
                "description": "Type: `string`. This keeps only tags listed in STR and is directly equivalent to --remove_tag ^STR",
                "help_text": "Type: `string`. This keeps only tags listed in STR and is directly equivalent to --remove_tag ^STR. Specifying an empty list\nwill remove all tags. If both --keep_tag and --remove_tag are specified then --keep_tag has precedence.\nNote that tags will only be removed from reads that pass filtering.\n"
            
            }
    

        ,
                "remove_B": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Collapse the backward CIGAR operation",
                "help_text": "Type: `boolean_true`, default: `false`. Collapse the backward CIGAR operation.\n"
            ,
                "default": "False"
            }
    

        ,
                "add_flags": {
                "type":
                "string",
                "description": "Type: `string`. Adds flag(s) to read",
                "help_text": "Type: `string`. Adds flag(s) to read. FLAG can be specified in hex by beginning with `0x\u0027 (i.e. /^0x[0-9A-F]+/), in octal\nby beginning with `0\u0027 (i.e. /^0[0-7]+/), as a decimal number not beginning with \u00270\u0027 or as a comma-separated\nlist of flag names.\n"
            
            }
    

        ,
                "remove_flags": {
                "type":
                "string",
                "description": "Type: `string`. Remove flag(s) from read",
                "help_text": "Type: `string`. Remove flag(s) from read. FLAG is specified in the same way as with the --add_flags option.\n"
            
            }
    

        ,
                "subsample": {
                "type":
                "number",
                "description": "Type: `double`. Output only a proportion of the input alignments, as specified by 0",
                "help_text": "Type: `double`. Output only a proportion of the input alignments, as specified by 0.0 \u003c= FLOAT \u003c= 1.0, which gives the fraction\nof templates/pairs to be kept. This subsampling acts in the same way on all of the alignment records in the same\ntemplate or read pair, so it never keeps a read but not its mate.\n"
            
            }
    

        ,
                "subsample_seed": {
                "type":
                "integer",
                "description": "Type: `integer`, default: `0`. Subsampling seed used to influence which subset of reads is kept",
                "help_text": "Type: `integer`, default: `0`. Subsampling seed used to influence which subset of reads is kept. When subsampling data that has previously\nbeen subsampled, be sure to use a different seed value from those used previously; otherwise more reads will\nbe retained than expected.\n"
            ,
                "default": "0"
            }
    

        ,
                "fetch_pairs": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Retrieve pairs even when the mate is outside of the requested region",
                "help_text": "Type: `boolean_true`, default: `false`. Retrieve pairs even when the mate is outside of the requested region. Enabling this option also turns on the\nmulti-region iterator (-M). A region to search must be specified, either on the command-line, or using the\n--target_file option. The input file must be an indexed regular file.\nThis option first scans the requested region, using the RNEXT and PNEXT fields of the records that have the\nPAIRED flag set and pass other filtering options to find where paired reads are located. These locations are\nused to build an expanded region list, and a set of QNAMEs to allow from the new regions. It will then make\na second pass, collecting all reads from the originally-specified region list together with reads from additional\nlocations that match the allowed set of QNAMEs. Any other filtering options used will be applied to all reads\nfound during this second pass.\nAs this option links reads using RNEXT and PNEXT, it is important that these fields are set accurately. Use\n\u0027samtools fixmate\u0027 to correct them if necessary.\nNote that this option does not work with the --count, --output-unselected or --unmap options.\n"
            ,
                "default": "False"
            }
    

        ,
                "customized_index": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Include customized index file as a part of arguments",
                "help_text": "Type: `boolean_true`, default: `false`. Include customized index file as a part of arguments. See EXAMPLES section for sample of usage.\n"
            ,
                "default": "False"
            }
    

        ,
                "sanitize": {
                "type":
                "string",
                "description": "Type: `string`. Perform some sanity checks on the state of SAM record fields, fixing up common mistakes made by aligners",
                "help_text": "Type: `string`. Perform some sanity checks on the state of SAM record fields, fixing up common mistakes made by aligners.\nThese include soft-clipping alignments when they extend beyond the end of the reference, marking records as\nunmapped when they have reference * or position 0, and ensuring unmapped alignments have no CIGAR or mapping\nquality for unmapped alignments and no MD, NM, CG or SM tags.\nFLAGs is a comma-separated list of keywords chosen from the following list.\n\nunmap: The UNMAPPED BAM flag. This is set for reads with position \u003c= 0, reference name \"*\" or reads starting\nbeyond the end of the reference. Note CIGAR \"*\" is permitted for mapped data so does not trigger this.\n\npos: Position and reference name fields. These may be cleared when a sequence is unmapped due to the\ncoordinates being beyond the end of the reference. Selecting this may change the sort order of the file,\nso it is not a part of the on compound argument.\nmqual: Mapping quality. This is set to zero for unmapped reads.\ncigar: Modifies CIGAR fields, either by adding soft-clips for reads that overlap the end of the reference or\n       by clearing it for unmapped reads.\naux: For unmapped data, some auxiliary fields are meaningless and will be removed. These include NM, MD, CG and SM.\noff: Perform no sanity fixing. This is the default\non: Sanitize data in a way that guarantees the same sort order. This is everything except for pos.\nall: All sanitizing options, including pos.\n"
            
            }
    

        ,
                "no_PG": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Do not add a @PG line to the header of the output file",
                "help_text": "Type: `boolean_true`, default: `false`. Do not add a @PG line to the header of the output file.\n"
            ,
                "default": "False"
            }
    

        ,
                "input_fmt_option": {
                "type":
                "string",
                "description": "Type: `string`. Specify a single input file format option in the form of OPTION or OPTION=VALUE",
                "help_text": "Type: `string`. Specify a single input file format option in the form of OPTION or OPTION=VALUE.\n"
            
            }
    

        ,
                "output_fmt": {
                "type":
                "string",
                "description": "Type: `string`. Specify output format (SAM, BAM, CRAM)",
                "help_text": "Type: `string`. Specify output format (SAM, BAM, CRAM).\n"
            
            }
    

        ,
                "output_fmt_option": {
                "type":
                "string",
                "description": "Type: `string`. Specify a single output file format option in the form of OPTION or OPTION=VALUE",
                "help_text": "Type: `string`. Specify a single output file format option in the form of OPTION or OPTION=VALUE.\n"
            
            }
    

        ,
                "write_index": {
                "type":
                "boolean",
                "description": "Type: `boolean_true`, default: `false`. Automatically index the output files",
                "help_text": "Type: `boolean_true`, default: `false`. Automatically index the output files.\n"
            ,
                "default": "False"
            }
    

}
},
    
    
    "nextflow input-output arguments" : {
    "title": "Nextflow input-output arguments",
    "type": "object",
    "description": "Input/output parameters for Nextflow itself. Please note that both publishDir and publish_dir are supported but at least one has to be configured.",
    "properties": {
    
        
                "publish_dir": {
                "type":
                "string",
                "description": "Type: `string`, required, example: `output/`. Path to an output directory",
                "help_text": "Type: `string`, required, example: `output/`. Path to an output directory."
            
            }
    

        ,
                "param_list": {
                "type":
                "string",
                "description": "Type: `string`, example: `my_params.yaml`. Allows inputting multiple parameter sets to initialise a Nextflow channel",
                "help_text": "Type: `string`, example: `my_params.yaml`. Allows inputting multiple parameter sets to initialise a Nextflow channel. A `param_list` can either be a list of maps, a csv file, a json file, a yaml file, or simply a yaml blob.\n\n* A list of maps (as-is) where the keys of each map corresponds to the arguments of the pipeline. Example: in a `nextflow.config` file: `param_list: [ [\u0027id\u0027: \u0027foo\u0027, \u0027input\u0027: \u0027foo.txt\u0027], [\u0027id\u0027: \u0027bar\u0027, \u0027input\u0027: \u0027bar.txt\u0027] ]`.\n* A csv file should have column names which correspond to the different arguments of this pipeline. Example: `--param_list data.csv` with columns `id,input`.\n* A json or a yaml file should be a list of maps, each of which has keys corresponding to the arguments of the pipeline. Example: `--param_list data.json` with contents `[ {\u0027id\u0027: \u0027foo\u0027, \u0027input\u0027: \u0027foo.txt\u0027}, {\u0027id\u0027: \u0027bar\u0027, \u0027input\u0027: \u0027bar.txt\u0027} ]`.\n* A yaml blob can also be passed directly as a string. Example: `--param_list \"[ {\u0027id\u0027: \u0027foo\u0027, \u0027input\u0027: \u0027foo.txt\u0027}, {\u0027id\u0027: \u0027bar\u0027, \u0027input\u0027: \u0027bar.txt\u0027} ]\"`.\n\nWhen passing a csv, json or yaml file, relative path names are relativized to the location of the parameter file. No relativation is performed when `param_list` is a list of maps (as-is) or a yaml blob.",
                "hidden": true
            
            }
    

}
}
},
"allOf": [

    {
    "$ref": "#/definitions/inputs"
    },

    {
    "$ref": "#/definitions/outputs"
    },

    {
    "$ref": "#/definitions/nextflow input-output arguments"
    }
]
}
