{
  "$namespaces": {
    "sbg": "https://sevenbridges.com"
  },
  "hints": [
    {
      "class": "sbg:AWSInstanceType",
      "value": "c4.8xlarge;ebs-gp2;1200"
    },
    {
      "class": "sbg:OpenStackInstanceHint",
      "value": "c4.8xlarge;storage;700"
    },
    {
      "class": "sbg:GoogleInstanceType",
      "value": "n1-standard-32;pd-ssd;4096"
    },
    {
      "class": "sbg:AlibabaCloudInstanceType",
      "value": "ecs.c5.8xlarge;cloud_ssd;700"
    }
  ],
  "sbg:toolAuthor": "Broad Institute",
  "sbg:projectName": "SBG Public Data",
  "sbg:canvas_x": -336,
  "sbg:license": "Open source BSD (3-clause) license",
  "outputs": [
    {
      "source": [
        "#SBG_Genome_Coverage.summary"
      ],
      "sbg:x": 2003.8105850806714,
      "label": "Genome coverage",
      "required": false,
      "id": "#Genome_coverage",
      "sbg:includeInPorts": true,
      "type": [
        "null",
        "File"
      ],
      "sbg:y": -610.9526609958269
    },
    {
      "source": [
        "#GATK_CollectAlignmentSummaryMetrics.summary_metrics"
      ],
      "sbg:x": 2090.3309490707547,
      "sbg:fileTypes": "TXT",
      "label": "Alignment Summary Metrics",
      "required": true,
      "id": "#alignment_summary_metrics",
      "sbg:includeInPorts": true,
      "type": [
        "File"
      ],
      "sbg:y": -441.4345946000855
    },
    {
      "source": [
        "#Sambamba_Merge.merged_bam"
      ],
      "sbg:x": 2008.333535273876,
      "sbg:fileTypes": "SAM, BAM",
      "label": "Aligned Reads",
      "required": false,
      "id": "#aligned_reads",
      "sbg:includeInPorts": true,
      "type": [
        "null",
        "File"
      ],
      "sbg:y": -281.6667085091287
    },
    {
      "source": [
        "#FastQC.report_html"
      ],
      "sbg:x": 835.0001554489189,
      "sbg:fileTypes": "HTML, B64HTML",
      "label": "FastQC Report",
      "required": false,
      "id": "#fastqc_report",
      "sbg:includeInPorts": true,
      "type": [
        "null",
        "File"
      ],
      "sbg:y": 318.33339677916854
    },
    {
      "source": [
        "#Tabix_Index.indexed_file"
      ],
      "sbg:x": 2670.666582902268,
      "sbg:fileTypes": "GFF.GZ, BED.GZ, SAM.GZ, VCF.GZ, PSLTBL.GZ",
      "label": "gVCF",
      "required": false,
      "id": "#gVCF",
      "sbg:includeInPorts": true,
      "type": [
        "null",
        "File"
      ],
      "sbg:y": 740.0000097751583
    },
    {
      "source": [
        "#GATK_MergeVcfs.output"
      ],
      "sbg:x": 2542.499372382931,
      "sbg:fileTypes": "VCF",
      "label": "Raw VCF",
      "required": false,
      "id": "#raw_vcf",
      "sbg:includeInPorts": true,
      "type": [
        "null",
        "File"
      ],
      "sbg:y": 437.9165056645801
    }
  ],
  "sbg:revisionsInfo": [
    {
      "sbg:revision": 0,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1501857801,
      "sbg:revisionNotes": "Fix Javascript in SBG Prepare Intervals for the formats arguments (CWL 1.0 support)"
    },
    {
      "sbg:revision": 1,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1501857802,
      "sbg:revisionNotes": "WF Description - added titles"
    },
    {
      "sbg:revision": 2,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1501857802,
      "sbg:revisionNotes": "description best practices link"
    },
    {
      "sbg:revision": 3,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1501857802,
      "sbg:revisionNotes": "Update GATK tools descriptions"
    },
    {
      "sbg:revision": 4,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1501857802,
      "sbg:revisionNotes": "Exposed parameters removed. Still GATK4 Beta2"
    },
    {
      "sbg:revision": 5,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1501857803,
      "sbg:revisionNotes": "Suggested files set to HG38"
    },
    {
      "sbg:revision": 6,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1501857803,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/123"
    },
    {
      "sbg:revision": 7,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1501928061,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/130"
    },
    {
      "sbg:revision": 8,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1505228154,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/131"
    },
    {
      "sbg:revision": 9,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1505228154,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/159"
    },
    {
      "sbg:revision": 10,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1505228154,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/160"
    },
    {
      "sbg:revision": 11,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1509554781,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/161"
    },
    {
      "sbg:revision": 12,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1509554782,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/163"
    },
    {
      "sbg:revision": 13,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1509554782,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/171"
    },
    {
      "sbg:revision": 14,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1509554782,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/172"
    },
    {
      "sbg:revision": 15,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1509554782,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/173"
    },
    {
      "sbg:revision": 16,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1509554782,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/175"
    },
    {
      "sbg:revision": 17,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1509554783,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/176"
    },
    {
      "sbg:revision": 18,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1509554783,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/178"
    },
    {
      "sbg:revision": 19,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1509554783,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/179"
    },
    {
      "sbg:revision": 20,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1509554784,
      "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/whole-genome-pipeline-bwa-gatk-4-0-with-metrics/182"
    },
    {
      "sbg:revision": 21,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1509554784,
      "sbg:revisionNotes": "Updated description after Doc team review."
    },
    {
      "sbg:revision": 22,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1509554784,
      "sbg:revisionNotes": "Updated description after Documentation team review."
    },
    {
      "sbg:revision": 23,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1515773872,
      "sbg:revisionNotes": "Import JSON from revision 187"
    },
    {
      "sbg:revision": 24,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1515773873,
      "sbg:revisionNotes": "Rev 197 from Dev"
    },
    {
      "sbg:revision": 25,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1515773873,
      "sbg:revisionNotes": "description rev 198"
    },
    {
      "sbg:revision": 26,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1515773873,
      "sbg:revisionNotes": "Disclaimer added for VQSR and GVCF mode."
    },
    {
      "sbg:revision": 27,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1515774748,
      "sbg:revisionNotes": "Description"
    },
    {
      "sbg:revision": 28,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1516983370,
      "sbg:revisionNotes": "Rev 206 from dev"
    },
    {
      "sbg:revision": 29,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1516983371,
      "sbg:revisionNotes": "Rev 212 from dev - output file names"
    },
    {
      "sbg:revision": 30,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1519745099,
      "sbg:revisionNotes": "Import rev 216 from dev project"
    },
    {
      "sbg:revision": 31,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1519745100,
      "sbg:revisionNotes": "Rev 217 from dev project"
    },
    {
      "sbg:revision": 32,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1519853426,
      "sbg:revisionNotes": "Rev 218 from dev project"
    },
    {
      "sbg:revision": 33,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1521478299,
      "sbg:revisionNotes": "Rev 220 from dev project"
    },
    {
      "sbg:revision": 34,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1521478301,
      "sbg:revisionNotes": "Rev 222 from Dev project"
    },
    {
      "sbg:revision": 35,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1521737845,
      "sbg:revisionNotes": "Rev 225 from Dev project"
    },
    {
      "sbg:revision": 36,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1528984095,
      "sbg:revisionNotes": "rev 226. openStack Hint"
    },
    {
      "sbg:revision": 37,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1529424304,
      "sbg:revisionNotes": "rev 227. OpenStack storage hint"
    },
    {
      "sbg:revision": 38,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1530629458,
      "sbg:revisionNotes": "All tools up to date. b64html removed."
    },
    {
      "sbg:revision": 39,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1531304668,
      "sbg:revisionNotes": "rev 230. alpine removed"
    },
    {
      "sbg:revision": 40,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1532538898,
      "sbg:revisionNotes": "BWA mem hg38 alt processing"
    },
    {
      "sbg:revision": 41,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1537979109,
      "sbg:revisionNotes": "use-soft-clipping set to True in BWA-MEM as proposed by CCDG;  documentaiton updated"
    },
    {
      "sbg:revision": 42,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1539602977,
      "sbg:revisionNotes": "Remove Duplicates on by default"
    },
    {
      "sbg:revision": 43,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1545145122,
      "sbg:revisionNotes": "Ali instance type"
    },
    {
      "sbg:revision": 44,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1548266652,
      "sbg:revisionNotes": "description and pair fastqs by metadata fix"
    },
    {
      "sbg:revision": 45,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1550069800,
      "sbg:revisionNotes": "All tools up to date. Bwa-mem uses biobambam2!"
    },
    {
      "sbg:revision": 46,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1550069804,
      "sbg:revisionNotes": ".bam.bai instead only .bai"
    },
    {
      "sbg:revision": 47,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1550069805,
      "sbg:revisionNotes": "latest docker for HC images.sbgenomics.com/vladimirk/gatk:4.1.0.0"
    },
    {
      "sbg:revision": 48,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1550069805,
      "sbg:revisionNotes": "from rev 46. HC to latest docker again!"
    },
    {
      "sbg:revision": 49,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1550069805,
      "sbg:revisionNotes": "same as rev 46"
    },
    {
      "sbg:revision": 50,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1550069806,
      "sbg:revisionNotes": "all GATK tools latest docker images images.sbgenomics.com/vladimirk/gatk:4.1.0.0"
    },
    {
      "sbg:revision": 51,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1550069806,
      "sbg:revisionNotes": "memory overhead per job for HC = 128 MB"
    },
    {
      "sbg:revision": 52,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1551456312,
      "sbg:revisionNotes": "1400GB HDD"
    },
    {
      "sbg:revision": 53,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1551456314,
      "sbg:revisionNotes": "HDD to 1200 GB, enough for 150x WGS to complete."
    },
    {
      "sbg:revision": 54,
      "sbg:modifiedBy": "admin",
      "sbg:modifiedOn": 1551696389,
      "sbg:revisionNotes": "revision in description 4.1.0.0"
    }
  ],
  "sbg:canvas_y": 284,
  "sbg:image_url": "https://igor.sbgenomics.com/ns/brood/images/admin/sbg-public-data/whole-genome-sequencing-bwa-gatk-4-0/54.png",
  "sbg:expand_workflow": false,
  "inputs": [
    {
      "sbg:x": 695.5725971025585,
      "sbg:fileTypes": "BED",
      "sbg:suggestedValue": {
        "path": "5978b7df507c1745908269bf",
        "name": "human_g1k_v37_decoy_breakpoints_86_intervals.bed",
        "class": "File"
      },
      "label": "Target BED",
      "id": "#intervals_file",
      "sbg:includeInPorts": true,
      "type": [
        "File"
      ],
      "sbg:y": 1188.4774212099737,
      "description": "Chromosomal intervals of this BED are used for parallelization (scattering)"
    },
    {
      "sbg:x": 700.9534852366695,
      "sbg:fileTypes": "VCF,BED,RECAL",
      "sbg:suggestedValue": {
        "path": "5772b6cd507c1752674486d8",
        "name": "dbsnp_137.b37.vcf",
        "class": "File"
      },
      "label": "dbsnp",
      "id": "#dbsnp",
      "sbg:includeInPorts": true,
      "type": [
        "File"
      ],
      "sbg:y": 981.1910669299391,
      "description": "Database with known variants from the population used with base quality score recalibration and annotation in variant calling"
    },
    {
      "sbg:x": 698.7731975359328,
      "sbg:fileTypes": "VCF,BED,RECAL",
      "sbg:suggestedValue": {
        "path": "5772b6c9507c1752674486d4",
        "name": "Mills_and_1000G_gold_standard.indels.b37.sites.vcf",
        "class": "File"
      },
      "label": "Mills",
      "id": "#mills",
      "sbg:includeInPorts": true,
      "type": [
        "File"
      ],
      "sbg:y": 818.333581897957,
      "description": "Database of know =n indels in population used with variant recalibration."
    },
    {
      "sbg:x": 61.23813509815136,
      "sbg:fileTypes": "FASTQ,FASTQ.GZ,FQ,FQ.GZ",
      "label": "Fastq",
      "id": "#fastq",
      "sbg:includeInPorts": true,
      "type": [
        {
          "name": "input_reads",
          "items": "File",
          "type": "array"
        }
      ],
      "sbg:y": 249.28001859792116,
      "description": "Illumina paired-end reads from the sequencer."
    },
    {
      "sbg:x": 195.0000333123748,
      "sbg:fileTypes": "TAR,FA,FASTA,FA.GZ,FASTA.GZ",
      "sbg:suggestedValue": {
        "path": "5772b6d9507c1752674486e7",
        "name": "human_g1k_v37_decoy.fasta.tar",
        "class": "File"
      },
      "label": "Reference or TAR with BWA reference indices",
      "id": "#reference",
      "sbg:includeInPorts": true,
      "type": [
        "File"
      ],
      "sbg:y": 49.994323438842635,
      "description": "Reference or TAR with BWA reference indices"
    },
    {
      "sbg:x": 698.3334630065539,
      "sbg:fileTypes": "VCF",
      "sbg:suggestedValue": {
        "path": "578cf947507c17681a3117ce",
        "name": "1000G_phase1.indels.b37.vcf",
        "class": "File"
      },
      "label": "Known indels 1000g bqsr",
      "id": "#known_indels_1000g_bqsr",
      "sbg:includeInPorts": true,
      "type": [
        "File"
      ],
      "sbg:y": 645.0002697706324,
      "description": "Known indels for BQSR"
    },
    {
      "type": [
        "null",
        "int"
      ],
      "label": "Threads",
      "sbg:category": "Execution",
      "sbg:toolDefaultValue": "8",
      "id": "#threads",
      "description": "Number of threads for BWA, Samblaster and Sambamba sort process."
    },
    {
      "sbg:suggestedValue": 2048,
      "label": "Memory Per Job",
      "sbg:category": "Execution",
      "id": "#memory_per_job",
      "type": [
        "null",
        "int"
      ],
      "description": "Amount of RAM memory to be used per job. Defaults to 2048MB for Single threaded jobs,and all of the available memory on the instance for multi-threaded jobs."
    }
  ],
  "steps": [
    {
      "sbg:x": 1735.619705611761,
      "inputs": [
        {
          "id": "#SBG_Genome_Coverage.trackopt"
        },
        {
          "id": "#SBG_Genome_Coverage.trackline"
        },
        {
          "id": "#SBG_Genome_Coverage.strand"
        },
        {
          "id": "#SBG_Genome_Coverage.split"
        },
        {
          "id": "#SBG_Genome_Coverage.scale"
        },
        {
          "id": "#SBG_Genome_Coverage.report_z"
        },
        {
          "id": "#SBG_Genome_Coverage.gzipped"
        },
        {
          "id": "#SBG_Genome_Coverage.format"
        },
        {
          "source": [
            "#SBG_FASTA_Indices.fasta_reference"
          ],
          "id": "#SBG_Genome_Coverage.fasta"
        },
        {
          "id": "#SBG_Genome_Coverage.coverage_interval"
        },
        {
          "source": [
            "#Sambamba_Merge.merged_bam"
          ],
          "id": "#SBG_Genome_Coverage.bam"
        }
      ],
      "outputs": [
        {
          "id": "#SBG_Genome_Coverage.summary"
        },
        {
          "id": "#SBG_Genome_Coverage.per_interval"
        },
        {
          "id": "#SBG_Genome_Coverage.bed_graph"
        }
      ],
      "run": {
        "y": -651.7597671115363,
        "x": 1735.619705611761,
        "sbg:createdBy": "bix-demo",
        "outputs": [
          {
            "id": "#summary",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#bam",
              "glob": "*.summary",
              "sbg:metadata": {
                "file_format": "TEXT"
              }
            },
            "type": [
              "null",
              "File"
            ],
            "description": "Summary file.",
            "label": "Summary"
          },
          {
            "id": "#per_interval",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#bam",
              "glob": {
                "script": "if ($job.inputs.gzipped)\n\t'*.per_interval.bed.gz'\nelse\n\t'*.per_interval.bed'",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:metadata": {
                "file_format": "BED"
              }
            },
            "type": [
              "null",
              "File"
            ],
            "label": "Per interval"
          },
          {
            "id": "#bed_graph",
            "outputBinding": {
              "glob": {
                "script": "if ($job.inputs.gzipped)\n\t'*.bedgraph.gz'\nelse\n\t'*.bedgraph'",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              }
            },
            "type": [
              "null",
              "File"
            ],
            "label": "Bed graph"
          }
        ],
        "sbg:revision": 5,
        "sbg:latestRevision": 5,
        "cwlVersion": "sbg:draft-2",
        "sbg:categories": [
          "Analysis"
        ],
        "sbg:createdOn": 1450911308,
        "baseCommand": [
          "python3.6",
          "sbg_genome_coverage.py"
        ],
        "successCodes": [],
        "sbg:validationErrors": [],
        "sbg:cmdPreview": "python3.6 sbg_genome_coverage.py -b bam.ext -f fasta.ext",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 4096
          },
          "inputs": {
            "split": true,
            "trackopt": "trackopt",
            "strand": "Forward+",
            "format": "BedGraph",
            "fasta": {
              "path": "fasta.ext",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "gzipped": true,
            "bam": {
              "path": "bam.ext",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "report_z": true,
            "coverage_interval": "Entire Interval",
            "trackline": true,
            "scale": 0
          }
        },
        "sbg:sbgMaintained": false,
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/filip_tubic/sbg_genome_coverage:2.0",
            "dockerImageId": ""
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          },
          {
            "class": "sbg:MemRequirement",
            "value": 4096
          }
        ],
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1450911308,
            "sbg:revisionNotes": null,
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1450911308,
            "sbg:revisionNotes": null,
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1476214514,
            "sbg:revisionNotes": "BEDTools newer version",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "filip_tubic",
            "sbg:modifiedOn": 1493296999,
            "sbg:revisionNotes": null,
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "milan_kovacevic",
            "sbg:modifiedOn": 1496740110,
            "sbg:revisionNotes": "Note in the description added",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1496853224,
            "sbg:revisionNotes": "added concat guard",
            "sbg:revision": 5
          }
        ],
        "sbg:license": "Apache License 2.0",
        "stdin": "",
        "sbg:toolAuthor": "Seven Bridges Genomics",
        "sbg:contributors": [
          "filip_tubic",
          "bogdang",
          "milan_kovacevic",
          "bix-demo",
          "vladimirk"
        ],
        "inputs": [
          {
            "type": [
              "null",
              "string"
            ],
            "label": "Additional track",
            "sbg:category": "OPTIONS",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--trackopt"
            },
            "required": false,
            "id": "#trackopt",
            "description": "Writes additional track line definition parameters in the first line."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "UCSC track line",
            "sbg:category": "OPTIONS",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": false,
              "prefix": "--trackline"
            },
            "required": false,
            "id": "#trackline",
            "description": "Adds a UCSC/Genome-Browser track line definition in the first line of the output."
          },
          {
            "type": [
              "null",
              {
                "name": "strand",
                "symbols": [
                  "Not Specified",
                  "Forward+",
                  "Reverse-"
                ],
                "type": "enum"
              }
            ],
            "label": "Strand",
            "sbg:category": "OPTIONS",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.strand == 'Not Specified') return 0\n  if ($job.inputs.strand == 'Forward+') return 1\n  if ($job.inputs.strand == 'Reverse-') return 2\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--strand"
            },
            "required": false,
            "id": "#strand",
            "description": "Calculate coverage of intervals from a specific strand."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Split",
            "sbg:category": "OPTIONS",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": false,
              "prefix": "--split"
            },
            "required": false,
            "id": "#split",
            "description": "Treat BAM entries as distinct BED intervals when computing coverage. Uses CIGAR 'N' and 'D' operations to infer the blocks for computing coverage."
          },
          {
            "type": [
              "null",
              "float"
            ],
            "label": "Scale",
            "sbg:category": "OPTIONS",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--scale"
            },
            "required": false,
            "id": "#scale",
            "description": "Scale the coverage by a constant factor. Requires BedGraph or Dept Per Base output."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Report Z",
            "sbg:category": "OPTIONS",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": false,
              "prefix": "--report_z"
            },
            "required": false,
            "id": "#report_z",
            "description": "If BedGraph or Depth Per Base output is selected, also report zero-depth positions."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "GZipped",
            "sbg:category": "OPTIONS",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": false,
              "prefix": "--gzipped"
            },
            "required": false,
            "id": "#gzipped",
            "description": "Compress output with gzip."
          },
          {
            "type": [
              "null",
              {
                "name": "format",
                "symbols": [
                  "Bed-Histogram",
                  "Bed-DepthPerBase",
                  "BedGraph"
                ],
                "type": "enum"
              }
            ],
            "label": "Format",
            "sbg:category": "OPTIONS",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.format == 'Bed-Histogram') return 0\n  if ($job.inputs.format == 'Bed-DepthPerBase') return 1\n  if ($job.inputs.format == 'BedGraph') return 2\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--format"
            },
            "required": false,
            "id": "#format",
            "description": "Output format."
          },
          {
            "sbg:fileTypes": "FASTA,FA",
            "label": "Fasta",
            "sbg:category": "INPUT FILES",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-f"
            },
            "required": true,
            "id": "#fasta",
            "type": [
              "File"
            ],
            "description": "Reference file."
          },
          {
            "type": [
              "null",
              {
                "name": "coverage_interval",
                "symbols": [
                  "Entire Interval",
                  "3' Positions Only",
                  "5' Positions Only"
                ],
                "type": "enum"
              }
            ],
            "label": "Coverage interval",
            "sbg:category": "OPTIONS",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.coverage_interval == 'Entire Interval') return 0\n  if ($job.inputs.coverage_interval == \"3' Positions Only\") return 3\n  if ($job.inputs.coverage_interval == \"5' Positions Only\") return 5\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--coverage_interval"
            },
            "required": false,
            "id": "#coverage_interval",
            "description": "Coverage calculation."
          },
          {
            "sbg:fileTypes": "BAM",
            "label": "Bam",
            "sbg:category": "INPUT FILES",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  return [].concat($job.inputs.bam)[0].path\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-b"
            },
            "required": true,
            "id": "#bam",
            "type": [
              "File"
            ],
            "description": "Input BAM file for coverage calculation."
          }
        ],
        "sbg:project": "bix-demo/sbgtools-demo",
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "appUrl": "/u/bix-demo/sbgtools-demo/apps/#bix-demo/sbgtools-demo/sbg-genome-coverage/5",
        "stdout": "",
        "id": "bix-demo/sbgtools-demo/sbg-genome-coverage/5",
        "description": "SBG Genome Coverage extends BEDTools Genome Coverage. The Genome Coverage calculates histograms, per-base reports and BedGraph summaries of feature coverage (aligned sequences for example) for a given genome. This extended version additionally extracts and creates a text file containing summary coverage stats.\n\nNote: This tool should be used for genome data only.",
        "arguments": [],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkit": "SBGTools",
        "sbg:image_url": null,
        "sbg:revisionNotes": "added concat guard",
        "label": "SBG Genome Coverage",
        "sbg:projectName": "SBGTools - Demo New",
        "temporaryFailCodes": [],
        "sbg:modifiedOn": 1496853224,
        "sbg:id": "admin/sbg-public-data/sbg-genome-coverage/5",
        "class": "CommandLineTool",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          },
          {
            "class": "CreateFileRequirement",
            "fileDef": [
              {
                "fileContent": "\"\"\"\nUsage:\n    sbg_genome_coverage.py --bam FILE --fasta FILE [options]\n\nOptions:\n    -h, --help                      Show this message.\n\n    -b, --bam FILE                  Input BAM file for coverage calculation.\n\n    -f, --fasta FILE                Reference file.\n\n    --format ENUM                   Output format. Available options: {0, 1, 2}\n                                    0: Bed-Histogram\n                                    1: Bed-DepthPerBase\n                                    2: BedGraph\n                                    [default: 0]\n\n    --report_z                      If BedGraph or Depth Per Base output is\n                                    selected, also report zero-depth positions.\n\n    --gzipped                       Compress output with gzip.\n\n    --split                         Treat BAM entries as distinct BED intervals\n                                    when computing coverage. Uses CIGAR 'N' and\n                                    'D' operations to infer the blocks for\n                                    computing coverage.\n\n    --strand ENUM                   Calculate coverage of intervals from a\n                                    specific strand.\n                                    Available options: {0, 1, 2}\n                                    0: Not Specified\n                                    1: Forward+\n                                    2: Reverse-\n                                    [default: 0]\n\n    --coverage_interval ENUM        Coverage calculation.\n                                    Available options:  \n                                    0: Entire Interval\n                                    3: 3' Positions Only\n                                    5: 5' Positions Only\n                                    [default: 0]\n\n    --scale FLOAT                   Scale the coverage by a constant factor.\n                                    Requires BedGraph or Dept Per Base output.\n                                    [default: 1.0]\n\n    --trackopt STR                  Writes additional track line definition\n                                    parameters in the first line.\n\n    --trackline                     Adds a UCSC/Genome-Browser track line\n                                    definition in the first line of the output.\n\n\"\"\"\n\nfrom docopt import docopt\nimport os\nimport pipes\nfrom pathlib import Path\nimport subprocess\nfrom enum import IntEnum\nfrom Compressor import PigzCompressor\n\nargs = docopt(__doc__, version='1.0')\n\nargs['--format'] = int(args['--format'])\nargs['--strand'] = int(args['--strand'])\nargs['--coverage_interval'] = int(args['--coverage_interval'])\nargs['--scale'] = float(args['--scale'])\n\n# BEDTOOLS_ROOT = ''\n\nBEDTOOLS_ROOT = '/opt/bedtools2/bin/'\n\nclass BEDTOOLS_FORMAT(IntEnum):\n    BedHistogram = 0\n    BedDepthPerBase = 1\n    BedGraph = 2\n\nclass BEDTOOLS_STRAND(IntEnum):\n    NotSpecified = 0\n    Forward = 1\n    Reverse = 2\n\nclass BEDTOOLS_COVERAGE_INTERVAL:\n    EntireInterval = 0\n    ThreePrimPositionsOnly = 3\n    FivePrimPositionsOnly = 5\n\ndef append_arg(arg_list, *args):\n    for arg in args:\n        if arg not in (None, ''):\n            arg_list.append(pipes.quote(arg))\n\ndef append_narg(arg_list, key, value):\n    if value in (None, '') or value is False:\n        return\n    if isinstance(value, bool):\n        append_arg(arg_list, key)\n    else:\n        append_arg(arg_list, key, str(value))\n\ndef get_output_file_name(bam, params):\n    just_name = lambda file_name: Path(file_name).name\n\n    if params['--format'] == BEDTOOLS_FORMAT.BedDepthPerBase:\n        return just_name(bam) + '.per_interval.bed'\n    elif params['--format'] == BEDTOOLS_FORMAT.BedHistogram:\n        return just_name(bam) + '.bed'\n    elif params['--format'] == BEDTOOLS_FORMAT.BedGraph:\n        return just_name(bam) + '.bedgraph'\n    else:\n        raise Exception('Unsupported --format value.')\n\ndef get_bedtools_cmd(bam, genome, parameters) -> list:\n    cmd_bedtools = [os.path.join(BEDTOOLS_ROOT, 'genomeCoverageBed'), '-ibam', bam, '-g', genome]\n\n    if parameters['--format'] == BEDTOOLS_FORMAT.BedDepthPerBase:\n        if parameters['--report_z'] is True:\n            append_arg(cmd_bedtools, '-d')\n        else:\n            append_arg(cmd_bedtools, '-dz')\n    elif parameters['--format'] == BEDTOOLS_FORMAT.BedGraph:\n        if parameters['--report_z'] is True:\n            append_arg(cmd_bedtools, '-bga')\n        else:\n            append_arg(cmd_bedtools, '-bg')\n\n    append_narg(cmd_bedtools, '-split', parameters['--split'])\n\n    if parameters['--coverage_interval'] == BEDTOOLS_COVERAGE_INTERVAL.FivePrimPositionsOnly:\n        append_arg(cmd_bedtools, '-5')\n    elif parameters['--coverage_interval'] == BEDTOOLS_COVERAGE_INTERVAL.ThreePrimPositionsOnly:\n        append_arg(cmd_bedtools, '-3')\n\n    if parameters['--format'] == BEDTOOLS_FORMAT.BedDepthPerBase or parameters['--format'] == BEDTOOLS_FORMAT.BedGraph:\n        append_narg(cmd_bedtools, '-scale', parameters['--scale'])\n\n    if parameters['--strand'] == BEDTOOLS_STRAND.Forward:\n        append_narg(cmd_bedtools, '-strand', '+')\n    elif parameters['--strand'] == BEDTOOLS_STRAND.Reverse:\n        append_narg(cmd_bedtools, '-strand', '-')\n\n    if parameters['--format'] == BEDTOOLS_FORMAT.BedGraph:\n        append_narg(cmd_bedtools, '-trackopts', parameters['--trackopt'])\n        append_narg(cmd_bedtools, '-trackline', parameters['--trackline'])\n\n    return cmd_bedtools\n\ndef handle_bed_histogram(bam, genome, parameters, gzip, ziper):\n    output_file = get_output_file_name(bam, parameters)\n    cmd_bedtools = get_bedtools_cmd(bam, genome, parameters)\n    cmd_summary = ['grep', '^genome']\n    cmd_intervals = ['grep', '-v', '^genome']\n    cmd_pigz = ['pigz', '--force', '--keep']\n\n    summary = open(Path(output_file).name + '.summary', 'wb')\n    per_interval_path = Path(output_file).name + '.per_interval.bed.gz' if gzip \\\n                        else Path(output_file).name + '.per_interval.bed'\n\n    per_interval = open(per_interval_path, 'wb')\n\n    bed_proc = subprocess.Popen(cmd_bedtools, stdout=subprocess.PIPE)\n    sum_proc = subprocess.Popen(cmd_summary,  stdin=subprocess.PIPE, stdout=summary)\n    inter_proc = subprocess.Popen(cmd_intervals, stdin=subprocess.PIPE, stdout=subprocess.PIPE if gzip else per_interval)\n    pigz_proc = None\n\n    if gzip:\n        pigz_proc = subprocess.Popen(cmd_pigz, stdin=inter_proc.stdout, stdout=per_interval)\n\n    try:\n        while True:\n            data = bed_proc.stdout.readline()\n            if not data:\n                sum_proc.stdin.close()\n                inter_proc.stdin.close()\n                break\n            sum_proc.stdin.write(data)\n            inter_proc.stdin.write(data)\n\n        bed_proc.wait()\n        inter_proc.wait()\n        sum_proc.wait()\n\n        if gzip and pigz_proc:\n            pigz_proc.wait()\n\n    except Exception as e:\n        print (str(e))\n        bed_proc.kill()\n        sum_proc.kill()\n        inter_proc.kill()\n    finally:\n        summary.close()\n        per_interval.close()\n\ndef handle_graph_or_depth(bam, genome, parameters, gzip, ziper):\n    output_file = get_output_file_name(bam, parameters)\n    cmd_bedtools = get_bedtools_cmd(bam, genome, parameters)\n\n    stdout = subprocess.PIPE if gzip else open(output_file, 'w')\n    process = subprocess.Popen(cmd_bedtools, stdout=stdout)\n    if gzip:\n        with open(output_file + '.gz', 'wb') as out:\n            ziper.compress(stdin=process.stdout, stdout=out, params={'threads': 2})\n    process.wait()\n\ndef main():\n    ziper = PigzCompressor()\n    if args['--format'] == BEDTOOLS_FORMAT.BedHistogram:\n        handle_bed_histogram(args['--bam'], args['--fasta'], args, args['--gzipped'], ziper)\n    elif args['--format'] == BEDTOOLS_FORMAT.BedDepthPerBase:\n        handle_graph_or_depth(args['--bam'], args['--fasta'], args, args['--gzipped'], ziper)\n    elif args['--format'] == BEDTOOLS_FORMAT.BedGraph:\n        handle_graph_or_depth(args['--bam'], args['--fasta'], args, args['--gzipped'], ziper)\nif __name__ == '__main__':\n    main()",
                "filename": "sbg_genome_coverage.py"
              }
            ]
          }
        ]
      },
      "id": "#SBG_Genome_Coverage",
      "sbg:y": -651.7597671115363
    },
    {
      "sbg:x": 648.3335068093467,
      "inputs": [
        {
          "source": [
            "#reference"
          ],
          "id": "#SBG_Untar_fasta.input_tar_with_reference"
        }
      ],
      "outputs": [
        {
          "id": "#SBG_Untar_fasta.output_fasta"
        }
      ],
      "run": {
        "y": -162.47767769539385,
        "x": 648.3335068093467,
        "sbg:createdBy": "bix-demo",
        "sbg:modifiedOn": 1500472520,
        "outputs": [
          {
            "id": "#output_fasta",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#input_tar_with_reference",
              "glob": "{*.fasta,*.fa,*.fa.gz,*.fasta.gz}"
            },
            "type": [
              "File"
            ],
            "description": "Unpacked fasta file from the input archive.",
            "label": "Unpacked fasta file"
          }
        ],
        "sbg:revision": 11,
        "sbg:latestRevision": 11,
        "sbg:homepage": "https://igor.sbgenomics.com/",
        "sbg:categories": [
          "Other"
        ],
        "class": "CommandLineTool",
        "sbg:createdOn": 1466002722,
        "successCodes": [],
        "sbg:validationErrors": [],
        "sbg:cmdPreview": "echo Passing input file",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 1000
          },
          "inputs": {
            "input_tar_with_reference": {
              "path": "input_file.fasta",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            }
          }
        },
        "sbg:sbgMaintained": false,
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/markop/sbg-decompressor:1.0",
            "dockerImageId": "58b79c627f95"
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          },
          {
            "class": "sbg:MemRequirement",
            "value": 1000
          }
        ],
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1466002722,
            "sbg:revisionNotes": null,
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1466003214,
            "sbg:revisionNotes": null,
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1466004710,
            "sbg:revisionNotes": null,
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1466004986,
            "sbg:revisionNotes": null,
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1466005081,
            "sbg:revisionNotes": null,
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1466005599,
            "sbg:revisionNotes": null,
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1466007588,
            "sbg:revisionNotes": null,
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1466077480,
            "sbg:revisionNotes": null,
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1500468272,
            "sbg:revisionNotes": "Description updated.",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1500468316,
            "sbg:revisionNotes": "description",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1500472209,
            "sbg:revisionNotes": "Important with bold",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1500472520,
            "sbg:revisionNotes": "description - bold important",
            "sbg:revision": 11
          }
        ],
        "sbg:license": "Apache License 2.0",
        "sbg:image_url": null,
        "stdin": "",
        "sbg:toolAuthor": "Vladimir Kovacevic, Seven Bridges Genomics",
        "sbg:contributors": [
          "bix-demo",
          "vladimirk"
        ],
        "inputs": [
          {
            "sbg:fileTypes": "TAR,FA,FASTA,FA.GZ,FASTA.GZ",
            "label": "Input archive file with fasta",
            "required": true,
            "id": "#input_tar_with_reference",
            "type": [
              "File"
            ],
            "description": "The input archive file to be unpacked.",
            "sbg:stageInput": "link"
          }
        ],
        "sbg:project": "bix-demo/sbgtools-demo",
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "arguments": [],
        "temporaryFailCodes": [],
        "id": "bix-demo/sbgtools-demo/sbg-untar-fasta/11",
        "description": "SBG Untar fasta is primarily used for extracting FASTA file from TAR with more different files. For example, extracting FASTA from BWA-MEM's index TAR.\n\n**Inputs**\n\nTAR (containing FASTA).\n\n**Outputs**\n\nFA/FASTA/FA.GZ/FASTA.GZ from TAR.\n\n\n\n**Important: TAR.GZ format is not supported. \nIf only decompress operation is required use SBG Decompressor tool.**",
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkit": "SBGTools",
        "sbg:toolkitVersion": "v1.0",
        "sbg:revisionNotes": "description - bold important",
        "label": "SBG Untar fasta",
        "sbg:projectName": "SBGTools - Demo New",
        "cwlVersion": "sbg:draft-2",
        "baseCommand": [
          {
            "script": "{\n  reference_file = $job.inputs.input_tar_with_reference.path.split('/')[$job.inputs.input_tar_with_reference.path.split('/').length-1]\n  ext = reference_file.split('.')[reference_file.split('.').length-1]\n  if(ext=='tar'){\n    return 'tar -xf ' + reference_file    \n  }\n  else{\n    return 'echo Passing input file '\n  }\n}",
            "class": "Expression",
            "engine": "#cwl-js-engine"
          }
        ],
        "sbg:id": "admin/sbg-public-data/sbg-untar-fasta/12",
        "stdout": "",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ]
      },
      "id": "#SBG_Untar_fasta",
      "sbg:y": -162.47767769539385
    },
    {
      "sbg:x": 1456.3334305021522,
      "inputs": [
        {
          "id": "#Sambamba_Merge.reserved_threads"
        },
        {
          "id": "#Sambamba_Merge.num_of_threads"
        },
        {
          "id": "#Sambamba_Merge.mem_mb"
        },
        {
          "id": "#Sambamba_Merge.compression_level"
        },
        {
          "source": [
            "#BWA_MEM_Bundle_0_7_17.aligned_reads"
          ],
          "id": "#Sambamba_Merge.bams"
        }
      ],
      "outputs": [
        {
          "id": "#Sambamba_Merge.merged_bam"
        }
      ],
      "run": {
        "y": -316.91665898097824,
        "temporaryFailCodes": [],
        "sbg:createdBy": "nevenam.sudo",
        "outputs": [
          {
            "sbg:fileTypes": "BAM",
            "label": "Merged bam",
            "id": "#merged_bam",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#bams",
              "glob": "*.bam",
              "secondaryFiles": [
                ".bai",
                "^.bai"
              ]
            },
            "type": [
              "null",
              "File"
            ],
            "description": "Merged bam."
          }
        ],
        "sbg:revision": 18,
        "x": 1456.3334305021522,
        "sbg:categories": [
          "SAM/BAM-Processing"
        ],
        "sbg:createdOn": 1458920412,
        "successCodes": [],
        "sbg:validationErrors": [],
        "sbg:cmdPreview": "/opt/sambamba_0.5.9/sambamba_v0.5.9 merge  -t 6  /path/to/uuu_bams.bam  /path/to/uyyy_bams.bam  testmeta__bams.merged.bam",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 2,
            "mem": 2
          },
          "inputs": {
            "bams": [
              {
                "path": "/path/to/uuu_bams.bam",
                "class": "File",
                "size": 0,
                "secondaryFiles": [],
                "metadata": {
                  "sample_id": "testmeta"
                }
              },
              {
                "path": "/path/to/uyyy_bams.bam",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              }
            ],
            "mem_mb": 2,
            "num_of_threads": 6,
            "reserved_threads": 2,
            "compression_level": null
          }
        },
        "description": "Sambamba Merge is used for merging several sorted BAM files into one. The sorting order of all the files must be the same, and it is maintained in the output file.",
        "sbg:sbgMaintained": false,
        "hints": [
          {
            "class": "sbg:CPURequirement",
            "value": {
              "script": "{\n  if ($job.inputs.reserved_threads) {\n    \n    return $job.inputs.reserved_threads\n    \n  } else if ($job.inputs.num_of_threads) {\n    \n    return $job.inputs.num_of_threads\n    \n  } else {\n    \n    return 1\n  }\n  \n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "script": "{\n  if ($job.inputs.mem_mb) {\n    \n    return $job.inputs.mem_mb\n    \n  } else {\n    \n    return 1024\n    \n  }\n  \n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/mladenlsbg/sambamba:0.5.9",
            "dockerImageId": ""
          }
        ],
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "nevenam.sudo",
            "sbg:modifiedOn": 1458920412,
            "sbg:revisionNotes": null,
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "nevenam.sudo",
            "sbg:modifiedOn": 1458920459,
            "sbg:revisionNotes": null,
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1462963630,
            "sbg:revisionNotes": null,
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1462963660,
            "sbg:revisionNotes": null,
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "ognjenm",
            "sbg:modifiedOn": 1468849940,
            "sbg:revisionNotes": null,
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "ognjenm",
            "sbg:modifiedOn": 1470679574,
            "sbg:revisionNotes": "Changed to common name",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "ognjenm",
            "sbg:modifiedOn": 1470752287,
            "sbg:revisionNotes": "Smart naming introduced",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "ognjenm",
            "sbg:modifiedOn": 1470753233,
            "sbg:revisionNotes": "Corrected single file case",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "ognjenm",
            "sbg:modifiedOn": 1470753950,
            "sbg:revisionNotes": "Changed glob",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "ognjenm",
            "sbg:modifiedOn": 1470756561,
            "sbg:revisionNotes": "Updated sample id tag",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "ognjenm",
            "sbg:modifiedOn": 1470757408,
            "sbg:revisionNotes": "Added inherit metadata",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1472994215,
            "sbg:revisionNotes": "Added support for receiving bams as list inside list.",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1473000652,
            "sbg:revisionNotes": "Glob returns *.bam",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1473071971,
            "sbg:revisionNotes": "Added support for input.bams received as list of one-element-lists.",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "ognjenm",
            "sbg:modifiedOn": 1473257751,
            "sbg:revisionNotes": "Added protection from null (10)",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1473424164,
            "sbg:revisionNotes": "Returned revision that accepts list of one-element lists.",
            "sbg:revision": 15
          },
          {
            "sbg:modifiedBy": "ognjenm",
            "sbg:modifiedOn": 1475064412,
            "sbg:revisionNotes": "Added resource parameters",
            "sbg:revision": 16
          },
          {
            "sbg:modifiedBy": "ognjenm",
            "sbg:modifiedOn": 1475064631,
            "sbg:revisionNotes": "Changed mem error",
            "sbg:revision": 17
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1476706820,
            "sbg:revisionNotes": "Added reserved number of threads.",
            "sbg:revision": 18
          }
        ],
        "sbg:license": "GNU General Public License v2.0 only",
        "sbg:image_url": null,
        "stdin": "",
        "sbg:toolAuthor": "Artem Tarasov",
        "sbg:contributors": [
          "nevenam",
          "ognjenm",
          "vladimirk",
          "nevenam.sudo"
        ],
        "inputs": [
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Number of threads reserved on the instance",
            "sbg:category": "Execution",
            "sbg:toolDefaultValue": "1",
            "id": "#reserved_threads",
            "description": "Number of threads reserved on the instance passed to the scheduler (number of jobs)."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#num_of_threads",
            "description": "Number of threads to use for compression/decompression.",
            "label": "Number of threads to use",
            "sbg:category": "Merge"
          },
          {
            "description": "Memory in MB.",
            "label": "Memory in MB",
            "sbg:category": "Execution",
            "type": [
              "null",
              "int"
            ],
            "id": "#mem_mb",
            "sbg:toolDefaultValue": "1024",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#compression_level",
            "description": "Level of compression for merged BAM file, number from 0 to 9.",
            "label": "Compression level",
            "sbg:category": "Merge"
          },
          {
            "sbg:fileTypes": "BAM",
            "label": "BAM files",
            "sbg:category": "Merge",
            "inputBinding": {
              "itemSeparator": null,
              "separate": true,
              "position": 5,
              "sbg:cmdInclude": true
            },
            "required": true,
            "id": "#bams",
            "type": [
              {
                "name": "bams",
                "items": "File",
                "type": "array"
              }
            ],
            "description": "Input BAM files."
          }
        ],
        "sbg:project": "bix-demo/sambamba-0-5-9-demo",
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "baseCommand": [
          {
            "script": "{\n  if ($job.inputs.bams instanceof Array) { // VK\n    if ($job.inputs.bams[0] instanceof Array) {\n      \n      // Support for input received as list of one-element-lists \n      in_var = []\n      for (i=0;i<$job.inputs.bams.length;i++) \n  \t\tin_var = in_var.concat($job.inputs.bams[i]);\n      \n    } else {\n      in_var = [].concat($job.inputs.bams)\n    }\n  \n  \n  } else {\n    in_var = [].concat($job.inputs.bams)\n  }\n  comm=''\n  if(in_var instanceof Array) // Always true\n  {\n    if(in_var.length==1)\n    {\n      comm+='cp '\n      \n    }\n  \telse if(in_var.length>1)\n  \t{\n    \n    \tcomm+='/opt/sambamba_0.5.9/sambamba_v0.5.9 merge '\n    \tif($job.inputs.num_of_threads)\n  \t\t{\n    \t\tcomm+=' -t '\n    \t\tcomm+=$job.inputs.num_of_threads\n  \t\t}\n  \t\tif($job.inputs.compression_level)\n  \t\t{\n   \t\t\tcomm+=' -l '\n    \t\tcomm+=$job.inputs.compression_level\n  \t\t}\n   \t\t\n    }\n  \n  \t\n\n  }\n  return comm\n}",
            "class": "Expression",
            "engine": "#cwl-js-engine"
          }
        ],
        "stdout": "",
        "sbg:latestRevision": 18,
        "id": "bix-demo/sambamba-0-5-9-demo/sambamba-merge-0-5-9/18",
        "sbg:links": [
          {
            "id": "http://lomereiter.github.io/sambamba/docs/sambamba-view.html",
            "label": "Homepage"
          },
          {
            "id": "https://github.com/lomereiter/sambamba",
            "label": "Source code"
          },
          {
            "id": "https://github.com/lomereiter/sambamba/wiki",
            "label": "Wiki"
          },
          {
            "id": "https://github.com/lomereiter/sambamba/releases/tag/v0.5.9",
            "label": "Download"
          },
          {
            "id": "http://lomereiter.github.io/sambamba/docs/sambamba-view.html",
            "label": "Publication"
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "script": "{\n  if ($job.inputs.bams instanceof Array) { // VK\n    if ($job.inputs.bams[0] instanceof Array) {\n      \n      // Support for input received as list of one-element-lists \n      in_var = []\n      for (i=0;i<$job.inputs.bams.length;i++) \n  \t\tin_var = in_var.concat($job.inputs.bams[i]);\n      \n    } else {\n      in_var = [].concat($job.inputs.bams)\n    }\n  \n  \n  } else {\n    in_var = [].concat($job.inputs.bams)\n  }\n  \n  comm=''\n  if(in_var.length==1)\n  {\n  \tcomm+='. '\n  \n  \tif(in_var[0].secondaryFiles!=undefined && in_var[0].secondaryFiles.length>0)\n  \t{\n    \t comm+='| cp '\n    \t comm+=in_var[0].secondaryFiles[0].path\n    \t comm+=' . '\n  \t}\n  }\n  return comm\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "position": 10
          },
          {
            "valueFrom": {
              "script": "{\n\n  function common_end(strs) {\n  \n  \t// Find minimum length of file name\n  \n  \tls = [];\n    whole = [];\n\tfor (i=0;i<strs.length;i++){\n  \t\tls = ls.concat(strs[i].path.split('/').pop().length);\n        whole = whole.concat(strs[i].path.length);\n  \t}\n \tl = Math.min.apply(Math,ls);\n  \n  \t// Loop from the end through characters and check if they are the same for all\n  \n \tind = 0;\n \tflag = 0;\n \tfor (i=1;i<=l;i++){\n    \tfor (j=1;j<strs.length;j++){\n      \t\tif (strs[0].path[whole[0]-i]!=strs[j].path[whole[j]-i]){\n        \tflag = 1;\n        \tbreak\n      \t\t}\n   \t\t}\n   \t \tif (flag == 1){\n   \t \t  \tbreak\n   \t    } else {\n      \t\tind = ind + 1;\n        }\n  \t }\n  \n  // Assign and return longest ending common substring\n  if (ind>0) {\n  \tcomstr = strs[0].path.slice(-ind);\n  } else {\n    comstr = 'different_extensions'\n  }\n  \n  return comstr\n  \n  }\n  \n  if ($job.inputs.bams instanceof Array) { // VK\n    if ($job.inputs.bams[0] instanceof Array) {\n      \n      // Support for input received as list of one-element-lists \n      in_var = []\n      for (i=0;i<$job.inputs.bams.length;i++) \n  \t\tin_var = in_var.concat($job.inputs.bams[i]);\n      \n    } else {\n      in_var = [].concat($job.inputs.bams)\n    }\n  \n  \n  } else {\n    in_var = [].concat($job.inputs.bams)\n  }\n  \n  prefix=''\n  \n  if(in_var.length==1) { \n    return '' // Input will be just passed to output\n  }else if (in_var[0].metadata){\n \t   if (\"sample_id\" in in_var[0].metadata){   \n  \t\t prefix = in_var[0].metadata[\"sample_id\"];      \n   \t    } else {\n   \t\t  prefix = 'sample_unknown';\n        }\n   \n  }else {\n    prefix = 'sample_unknown';   \n  }\n  \n  // Create joint name and add the merged suffix\n  joint_name = prefix + '_' + common_end(in_var);\n  name = joint_name.split('.').slice(0,-1).join('.') + '.merged.bam'\n  \n  \n  \n  return name\n  \n}\n\n\n",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "position": 5
          }
        ],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkit": "Sambamba",
        "sbg:toolkitVersion": "0.5.9",
        "sbg:revisionNotes": "Added reserved number of threads.",
        "label": "Sambamba Merge",
        "sbg:projectName": "Sambamba 0.5.9 - Demo",
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1476706820,
        "sbg:id": "admin/sbg-public-data/sambamba-merge-0-5-9/18",
        "class": "CommandLineTool",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ]
      },
      "id": "#Sambamba_Merge",
      "sbg:y": -316.91665898097824
    },
    {
      "sbg:x": 334.66669267018585,
      "inputs": [
        {
          "id": "#SBG_FASTQ_Quality_Adjuster.used_quality_scale"
        },
        {
          "id": "#SBG_FASTQ_Quality_Adjuster.total_memory"
        },
        {
          "source": [
            "#fastq"
          ],
          "id": "#SBG_FASTQ_Quality_Adjuster.fastq"
        }
      ],
      "outputs": [
        {
          "id": "#SBG_FASTQ_Quality_Adjuster.result"
        }
      ],
      "scatter": "#SBG_FASTQ_Quality_Adjuster.fastq",
      "run": {
        "y": 172.50462351142033,
        "x": 334.66669267018585,
        "sbg:createdBy": "vladimirk",
        "sbg:modifiedOn": 1511876318,
        "outputs": [
          {
            "sbg:fileTypes": "FASTQ",
            "label": "Result",
            "id": "#result",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#fastq",
              "glob": {
                "script": "{\n\n  qscale = \"to be detected\"\n  \n  if ($job.inputs.fastq.metadata)\n      if ($job.inputs.fastq.metadata[\"quality_scale\"])\n      qscale = $job.inputs.fastq.metadata[\"quality_scale\"]  \n  \n  if ($job.inputs.used_quality_scale)\n    if ($job.inputs.used_quality_scale != null) \n      qscale = $job.inputs.used_quality_scale\n  \n      \n  if (qscale == \"sanger\" || qscale == \"illumina18\" ) \n  {\n    return $job.inputs.fastq.path.replace(/^.*[\\\\\\/]/, '')\n  }\n  else\n  {\n\tfile = $job.inputs.fastq.path\n\tfile_split = file.split('.')\n\tbasename = file_split\n  \tif (basename.length > 1)\n    {\n      l_ext = basename.splice(basename.length-1)\n      if (l_ext == 'gz')\n      {\n        basename = basename.slice(0, basename.length-1)\n      }\n    }\n \tretval = basename.concat('std.fastq')\n\treturn retval.join('.').replace(/^.*[\\\\\\/]/, '') + \"*\"\n  }\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:metadata": {
                "Quality scale": "sanger"
              }
            },
            "type": [
              "null",
              "File"
            ],
            "description": "Resulting file in FASTQ format."
          }
        ],
        "sbg:revision": 15,
        "sbg:latestRevision": 15,
        "id": "bix-demo/sbgtools-demo/sbg-fastq-quality-adjuster/15",
        "sbg:categories": [
          "Converters",
          "FASTQ-Processing"
        ],
        "class": "CommandLineTool",
        "sbg:createdOn": 1470927070,
        "successCodes": [],
        "sbg:validationErrors": [],
        "sbg:cmdPreview": "python sbg_fastq_quality_scale_adjuster.py  --fastq /path/to/test.1.fastq",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 9216
          },
          "inputs": {
            "used_quality_scale": null,
            "total_memory": 9,
            "fastq": {
              "path": "/path/to/test.1.fastq",
              "class": "File",
              "size": 0,
              "secondaryFiles": [],
              "metadata": {
                "Quality scale": "sanger"
              }
            }
          }
        },
        "sbg:sbgMaintained": false,
        "hints": [
          {
            "class": "sbg:CPURequirement",
            "value": 1
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "script": "{\n  if($job.inputs.total_memory){\n    return $job.inputs.total_memory * 1024\n  } else {\n    return 1000\n  }\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/bogdang/sbg_quality_scale_adjuster:1.0",
            "dockerImageId": ""
          }
        ],
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1470927070,
            "sbg:revisionNotes": "Copy of bogdang/fastq-quality-converter/sbg-fastq-quality-adjuster/23",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1472559664,
            "sbg:revisionNotes": "Copy of bogdang/fastq-quality-converter/sbg-fastq-quality-adjuster/24",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1474546255,
            "sbg:revisionNotes": "Copy of bogdang/fastq-quality-converter/sbg-fastq-quality-adjuster/25",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1475084132,
            "sbg:revisionNotes": "'sanger': (33, 74) instead 'sanger': (33, 126)",
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1475231421,
            "sbg:revisionNotes": "sanger 33:92",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1475234050,
            "sbg:revisionNotes": "seqtk for converting from illumina13-15",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1478274820,
            "sbg:revisionNotes": "fix for seqtk conversion from .gz files",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1478277013,
            "sbg:revisionNotes": "Without seqtk",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1478300733,
            "sbg:revisionNotes": "fix seqtk for .gz files",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1481123041,
            "sbg:revisionNotes": "Support for files named filename.fq.fastq",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1481290093,
            "sbg:revisionNotes": "No conversion if sanger or illumina18 quality scale set in metadata",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1481448894,
            "sbg:revisionNotes": "fix",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1495706394,
            "sbg:revisionNotes": "Added detection mode and switched to python3",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1497438325,
            "sbg:revisionNotes": "Revert to rev 11",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1511876154,
            "sbg:revisionNotes": "Link instead of copy. Output string with detected quality scale.",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1511876318,
            "sbg:revisionNotes": "No change",
            "sbg:revision": 15
          }
        ],
        "sbg:license": "Apache License 2.0",
        "stdin": "",
        "sbg:toolAuthor": "Seven Bridges Genomics",
        "sbg:contributors": [
          "bogdang",
          "vladimirk"
        ],
        "inputs": [
          {
            "type": [
              "null",
              {
                "name": "used_quality_scale",
                "symbols": [
                  "sanger",
                  "illumina18",
                  "illumina13",
                  "illumina15",
                  "solexa"
                ],
                "type": "enum"
              }
            ],
            "id": "#used_quality_scale",
            "description": "Used quality scale of FASTQ reads.",
            "label": "Used quality scale",
            "sbg:category": "Input"
          },
          {
            "description": "Total memory in GB.",
            "label": "Total memory [GB]",
            "sbg:category": "Execution",
            "type": [
              "null",
              "int"
            ],
            "id": "#total_memory",
            "sbg:toolDefaultValue": "1",
            "sbg:stageInput": null
          },
          {
            "sbg:fileTypes": "FASTQ,FASTQ.GZ,FQ,FQ.GZ",
            "label": "Fastq file",
            "sbg:category": "Input",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  qscale = \"to be detected\"\n  \n  if ($job.inputs.fastq.metadata)\n      if ($job.inputs.fastq.metadata[\"quality_scale\"])\n      qscale = $job.inputs.fastq.metadata[\"quality_scale\"]  \n  \n  if ($job.inputs.used_quality_scale)\n    if ($job.inputs.used_quality_scale != null) \n      qscale = $job.inputs.used_quality_scale\n  \n      \n  if (qscale == \"sanger\" || qscale == \"illumina18\" )   {\n    return \"\"\n  }\n  else\n  {\n    return \"--fastq \" + $job.inputs.fastq.path\n  }\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 1
            },
            "required": true,
            "id": "#fastq",
            "type": [
              "File"
            ],
            "description": "Input FASTQ file.",
            "sbg:stageInput": "link"
          }
        ],
        "sbg:project": "bix-demo/sbgtools-demo",
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "arguments": [],
        "temporaryFailCodes": [],
        "sbg:publisher": "sbg",
        "description": "This app detects quality score format used in input FASTQ file. FASTQ quality score is then converted to standard Sanger quality score if conversion is required. It is basically a compact merged version of \"SBG Fastq Quality Detector\" and \"SBG Fastq Quality Converter\", created to speed up the execution of pipelines. Supported source formats are: Solexa, Illumina 1.3, Illumina 1.5 and Illumina 1.8.",
        "sbg:modifiedBy": "bogdang",
        "sbg:toolkit": "SBGTools",
        "sbg:image_url": null,
        "sbg:revisionNotes": "No change",
        "label": "SBG FASTQ Quality Adjuster",
        "sbg:projectName": "SBGTools - Demo New",
        "cwlVersion": "sbg:draft-2",
        "baseCommand": [
          {
            "script": "{\n  qscale = \"to be detected\"\n  \n  if ($job.inputs.fastq.metadata)\n      if ($job.inputs.fastq.metadata[\"quality_scale\"])\n      qscale = $job.inputs.fastq.metadata[\"quality_scale\"]  \n  \n  if ($job.inputs.used_quality_scale)\n    if ($job.inputs.used_quality_scale != null) \n      qscale = $job.inputs.used_quality_scale\n  \n  \n  if (qscale == \"sanger\" || qscale == \"illumina18\" ) \n  {// no conversion\n\treturn \"echo No conversion\"\n  }\n  else\n  {\n    return \"python sbg_fastq_quality_scale_adjuster.py\"\n  }\n}",
            "class": "Expression",
            "engine": "#cwl-js-engine"
          }
        ],
        "sbg:id": "admin/sbg-public-data/sbg-fastq-quality-adjuster/15",
        "stdout": "",
        "requirements": [
          {
            "class": "CreateFileRequirement",
            "fileDef": [
              {
                "fileContent": "\"\"\"\nUsage:\n    sbg_fastq_quality_scale_adjuster.py --fastq FILE\n\nOptions:\n    -h, --help          Show this message.\n\n    -f, --fastq FILE    Input FASTQ file.\n\n\"\"\"\n\nfrom docopt import docopt\nimport os\nimport gzip\nimport itertools as it\nimport shutil\nimport sys\nfrom math import log10\nfrom subprocess import Popen\n\n\n\nargs = docopt(__doc__, version='1.0')\n\ninput_file = args['--fastq'] \n\nbase_name = input_file[input_file.rfind('/')+1:input_file.rfind('.') if input_file.rfind('.') != -1 else None]\nr_ext = input_file[input_file.rfind('.')+1:] if input_file.rfind('.') else \"\"\nl_ext = base_name.split('.')[-1].lower()\nif l_ext == 'fastq' or l_ext == 'fq':\n    if not r_ext == 'fastq' and not r_ext == 'fq':\n        base_name = base_name[:base_name.rfind('.')]\noutput_file = base_name + '.std.fastq'\n\n\n\"\"\"input and output names defined above\"\"\"\n\nclass myGzipFile(gzip.GzipFile):\n    def __enter__(self, *args, **kwargs):\n        if self.fileobj is None:\n            raise ValueError(\"I/O operation on closed GzipFile object\")\n        return self\n\n    def __exit__(self, *args, **kwargs):\n        self.close()\n\n\ndef extremes(a, b):\n    if a is False:\n        return b, b\n    return min(a[0], b), max(a[1], b)\n\n\ndef walk_qualities(f, sample_size=1000):\n    for i in xrange(sample_size * 4):\n        try:\n            line = f.next()\n        except StopIteration:\n            return\n        if i % 4 == 3:\n            yield line.rstrip(\"\\n\\r\")\n\n\ndef sniff(path):\n    with open(path, 'rb') as f:\n        gz = f.read(2) == '\\x1f\\x8b'\n    opn = myGzipFile if gz else open\n    with opn(path) as f:\n        return get_scale(*map(ord, reduce(extremes, it.chain(*walk_qualities(f)), False)))\n\n\ndef get_scale(ord_min, ord_max):\n    options = {\n        'illumina13': (64, 105),\n        'illumina15': (66, 105),\n        'sanger': (33, 126),\n        'solexa': (59, 105),\n    }\n    fits = [(k, v) for k, v in options.iteritems() if v[0] <= ord_min and v[1] >= ord_max]\n    if not fits:\n        message = 'Quality scale for range (%s, %s) not found.' % (ord_min, ord_max)\n        raise Exception(message)\n        # Return narrowest range\n    return reduce(lambda a, b: a if a[1][1] - a[1][0] < b[1][1] - b[1][0] else b, fits)[0]\n\ndef qsolexa(x):\n    return chr(int(round(10 * log10(10.0**((ord(x)-64)/10.0)+1))) + 33)\n\n\ndef qillumina13(x):\n    return chr(ord(x) - 31)\n\n\ndef qillumina15(x):\n    return chr(ord(x) - 31) if ord(x)-64 > 2 else chr(33)\n\n\ndef qillumina18(x):\n    return x\n\n\n\"\"\"detect quality scale format\"\"\"\n\nmeta_qual = sniff(input_file)\n\n\n\"\"\"adjust quality scale if needed\"\"\"\n\nif meta_qual == 'illumina13':\n    proc = qillumina13\nelif meta_qual == 'illumina15':\n    proc = qillumina15\nelif meta_qual == 'solexa':\n    proc = qsolexa\nelse:\n    proc = None\n\nif proc == qsolexa: \n    with open(input_file, 'rb') as f:\n        gz = f.read(2) == '\\x1f\\x8b'\n    open_gz = myGzipFile if gz else open\n    with open(output_file, 'w') as out:\n        for i, line in enumerate(open_gz(input_file)):\n            if i % 4 == 3:\n                line = line.strip()\n                converted = ''.join(map(proc, line))\n                out.write(converted + '\\n')\n            else:\n                out.write(line)\n    contents = \"Original fastq quality scale format was \" + meta_qual + \", and is converted to illumina18.\\n\"\nelif proc is not None: #seqtk converter from illumina13-15\n    with open(input_file, 'rb') as f:\n        gz = f.read(2) == '\\x1f\\x8b'\n    f.close()\n    if gz:#gunzip file to temp.fastq\n        temp_file = 'temp.fastq'\n        \n        inF = gzip.GzipFile(input_file, 'rb')\n        outF = file(temp_file, 'wb')\n        \n        newline = ''\n        for lines in inF:\n            outF.write(newline + lines.rstrip('\\n'))\n            newline = '\\n'\n            \n        inF.close()\n        outF.close()\n\n    else:\n        temp_file = input_file\n\n    cmd = ['seqtk','seq','-Q64','-V',temp_file,'>',output_file]\n    with open(output_file, 'w') as out:\n        p = Popen(cmd, stdout = out)\n        p.communicate()\n    contents = \"Original fastq quality scale format was \" + meta_qual + \", and is converted to illumina18.\\n\"\nelse:\n    if input_file.rfind(\".gz\") == len(input_file) - 3:\n        output_file = output_file + \".gz\"\n    #shutil.copyfile(input_file, output_file)\n    #os.symlink(input_file, output_file)\n    os.rename(input_file, output_file)\n    contents = \"Original fastq quality scale format was illumina18. No conversion performed.\\n\"\n\nsys.stderr.write(contents) #Write conversion to error log",
                "filename": "sbg_fastq_quality_scale_adjuster.py"
              }
            ]
          },
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ]
      },
      "id": "#SBG_FASTQ_Quality_Adjuster",
      "sbg:y": 172.50462351142033
    },
    {
      "sbg:x": 2492.0826151321676,
      "inputs": [
        {
          "id": "#Tabix_Index.zero_based"
        },
        {
          "id": "#Tabix_Index.type_format",
          "default": "vcf.gz"
        },
        {
          "id": "#Tabix_Index.skip_lines"
        },
        {
          "id": "#Tabix_Index.sequence_name_col"
        },
        {
          "id": "#Tabix_Index.region_bed"
        },
        {
          "id": "#Tabix_Index.mem_mb"
        },
        {
          "id": "#Tabix_Index.list_chrs"
        },
        {
          "source": [
            "#Tabix_BGZIP.output_file"
          ],
          "id": "#Tabix_Index.input_file"
        },
        {
          "id": "#Tabix_Index.index_file"
        },
        {
          "id": "#Tabix_Index.end_chr"
        },
        {
          "id": "#Tabix_Index.dont_output_data_file"
        },
        {
          "id": "#Tabix_Index.comment_lines"
        },
        {
          "id": "#Tabix_Index.chr_start"
        }
      ],
      "outputs": [
        {
          "id": "#Tabix_Index.indexed_file"
        },
        {
          "id": "#Tabix_Index.index"
        }
      ],
      "run": {
        "y": 735.770708395794,
        "temporaryFailCodes": [],
        "sbg:createdBy": "bix-demo",
        "outputs": [
          {
            "sbg:fileTypes": "GFF.GZ, BED.GZ, SAM.GZ, VCF.GZ, PSLTBL.GZ",
            "label": "Tabix indexed file",
            "id": "#indexed_file",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#input_file",
              "glob": {
                "script": "{\n  if ($job.inputs.dont_output_data_file==true)\n    return ''\n  return $job.inputs.input_file.path.split('/').slice(-1)[0]\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "secondaryFiles": [
                ".tbi"
              ],
              "sbg:metadata": {
                "__inherit__": "input_file"
              }
            },
            "type": [
              "null",
              "File"
            ],
            "description": "Tabix indexed file."
          },
          {
            "sbg:fileTypes": "VCF.TBI",
            "label": "Tabix index",
            "id": "#index",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#input_file",
              "glob": "*.tbi"
            },
            "type": [
              "null",
              "File"
            ],
            "description": "Tabix index file."
          }
        ],
        "sbg:revision": 11,
        "x": 2492.0826151321676,
        "id": "bix-demo/tabix-0-2-6-demo/tabix-index-v0-2-6/11",
        "sbg:categories": [
          "Indexing"
        ],
        "sbg:createdOn": 1450911542,
        "baseCommand": [
          {
            "script": "{\n  if ($job.inputs.index_file==undefined)\n    return \"/opt/tabix-0.2.6/tabix \"\n  else\n    return \"echo \\\"Passing inputs to outputs.\\\" \"\n}",
            "class": "Expression",
            "engine": "#cwl-js-engine"
          }
        ],
        "successCodes": [],
        "sbg:validationErrors": [],
        "sbg:cmdPreview": "/opt/tabix-0.2.6/tabix    -f  vnbv.cvnb.cvbn.vcf",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 5000
          },
          "inputs": {
            "list_chrs": true,
            "region_bed": true,
            "input_file": {
              "path": "/sdf/asdf/asdf/asdf/vnbv.cvnb.cvbn.vcf"
            },
            "dont_output_data_file": false,
            "mem_mb": 5000
          }
        },
        "description": "Tabix indexes a TAB-delimited genome position file in.tab.bgz and creates an index file in.tab.bgz.tbi when region is absent from the command-line. The input data file must be position sorted and compressed by bgzip which has a gzip(1) like interface. After indexing, tabix is able to quickly retrieve data lines overlapping regions specified in the format \"chr:beginPos-endPos\". Fast data retrieval also works over network if URI is given as a file name and in this case the index file will be downloaded if it is not present locally.",
        "sbg:sbgMaintained": false,
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/nevenam/tabix:0.2.6",
            "dockerImageId": "78fc60e5f28a"
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "script": "{\n  if ($job.inputs.mem_mb)\n  {\n    return $job.inputs.mem_mb\n  }\n  else\n  {\n    return 2048\n  }\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          }
        ],
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1450911542,
            "sbg:revisionNotes": null,
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1450911544,
            "sbg:revisionNotes": null,
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "mladenlSBG",
            "sbg:modifiedOn": 1458576452,
            "sbg:revisionNotes": null,
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1467212209,
            "sbg:revisionNotes": null,
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1467381893,
            "sbg:revisionNotes": null,
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1467962665,
            "sbg:revisionNotes": null,
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1467964896,
            "sbg:revisionNotes": null,
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1469091516,
            "sbg:revisionNotes": null,
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1469091660,
            "sbg:revisionNotes": null,
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1469092179,
            "sbg:revisionNotes": null,
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1470066288,
            "sbg:revisionNotes": null,
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1489060552,
            "sbg:revisionNotes": "Changed output type for indexed_file to GFF.GZ, BED.GZ, SAM.GZ, VCF.GZ, PSLTBL.GZ",
            "sbg:revision": 11
          }
        ],
        "sbg:license": "MIT/Expat License",
        "sbg:image_url": null,
        "stdin": "",
        "sbg:toolAuthor": "Heng Li -  Broad Institue",
        "sbg:contributors": [
          "mladenlSBG",
          "nevenam",
          "bix-demo"
        ],
        "inputs": [
          {
            "label": "Specify if the position in the data file is 0 based",
            "sbg:category": "Configuration",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.index_file==undefined && $job.inputs.zero_based==true)\n    return \" -0 \"\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 7
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#zero_based",
            "description": "Specify if the position in the data file is 0 based."
          },
          {
            "id": "#type_format",
            "label": "Select input file format",
            "sbg:category": "File inputs",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.index_file==undefined && $job.inputs.type_format!=undefined && $job.inputs.type_format!='')\n  {\n    return ' -p ' + $job.inputs.type_format.substring(0, $job.inputs.type_format.length-3)\n  }\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 1
            },
            "sbg:toolDefaultValue": "gff.gz",
            "type": [
              {
                "name": "type_format",
                "symbols": [
                  "gff.gz",
                  "bed.gz",
                  "sam.gz",
                  "vcf.gz",
                  "psltab.gz"
                ],
                "type": "enum"
              }
            ],
            "description": "Select input file format."
          },
          {
            "id": "#skip_lines",
            "label": "Skip first N lines",
            "sbg:category": "Configuration",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.index_file==undefined && $job.inputs.skip_lines!=undefined)\n    return \" -S \" + $job.inputs.skip_lines\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 5
            },
            "sbg:toolDefaultValue": "0",
            "type": [
              "null",
              "int"
            ],
            "description": "Skip first N lines in the data file."
          },
          {
            "id": "#sequence_name_col",
            "label": "Column of the sequence name",
            "sbg:category": "Configuration",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.index_file==undefined && $job.inputs.sequence_name_col!=undefined)\n    return \" -s \" + $job.inputs.sequence_name_col\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 2
            },
            "sbg:toolDefaultValue": "1",
            "type": [
              "null",
              "int"
            ],
            "description": "Column of the sequence name."
          },
          {
            "label": "Region1 is a BED file",
            "sbg:category": "File inputs",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.index_file==undefined && $job.inputs.region_bed==true)\n    return \" -B \"\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 8
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#region_bed",
            "description": "Region1 is a BED file (entire file will be read)."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Reserve N MB of RAM",
            "sbg:category": "Execution",
            "sbg:toolDefaultValue": "2048",
            "id": "#mem_mb",
            "description": "Reserve N MB of RAM for tool execution."
          },
          {
            "label": "List chromosome names",
            "sbg:category": "Configuration",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.index_file==undefined && $job.inputs.list_chrs==true)\n    return \" -l \"\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 9
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#list_chrs",
            "description": "List chromosome names."
          },
          {
            "sbg:fileTypes": "GFF.GZ, BED.GZ, SAM.GZ, VCF.GZ, PSLTBL.GZ",
            "label": "Input file",
            "sbg:category": "File inputs",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.index_file==undefined)\n  \treturn $job.inputs.input_file.path.split('/').slice(-1)[0]\n}\n",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": false,
              "position": 99
            },
            "required": true,
            "id": "#input_file",
            "type": [
              "File"
            ],
            "description": "Input file for tabix indexing.",
            "sbg:stageInput": "link"
          },
          {
            "sbg:fileTypes": "TBI, CSI",
            "label": "Index file",
            "sbg:category": "File inputs",
            "required": false,
            "id": "#index_file",
            "type": [
              "null",
              "File"
            ],
            "description": "Index file.",
            "sbg:stageInput": "link"
          },
          {
            "id": "#end_chr",
            "label": "End position of the chromosome column",
            "sbg:category": "Configuration",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.index_file==undefined && $job.inputs.end_chr!=undefined)\n    return \" -e \" + $job.inputs.end_chr\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 4
            },
            "sbg:toolDefaultValue": "5",
            "type": [
              "null",
              "int"
            ],
            "description": "End position of the chromosome column. Can be identical to start chromosome column."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "id": "#dont_output_data_file",
            "description": "Don't output data file (only index file will be outputed).",
            "label": "Don't output data file",
            "sbg:category": "Output files"
          },
          {
            "id": "#comment_lines",
            "label": "Skip lines starting with character CHAR",
            "sbg:category": "Configuration",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.index_file==undefined && $job.inputs.comment_lines!=undefined)\n    return \" -c \" + $job.inputs.comment_lines\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 6
            },
            "sbg:toolDefaultValue": "#",
            "type": [
              "null",
              "string"
            ],
            "description": "Skip lines starting with character CHAR."
          },
          {
            "id": "#chr_start",
            "label": "Start position of the chromosome column",
            "sbg:category": "Configuration",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  if ($job.inputs.index_file==undefined && $job.inputs.chr_start!=undefined)\n    return \" -b \" + $job.inputs.chr_start\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 3
            },
            "sbg:toolDefaultValue": "4",
            "type": [
              "null",
              "int"
            ],
            "description": "Start position of the chromosome column."
          }
        ],
        "sbg:project": "bix-demo/tabix-0-2-6-demo",
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "arguments": [
          {
            "valueFrom": {
              "script": "{\n  if ($job.inputs.index_file==undefined)\n    return \" -f \"\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "prefix": ""
          }
        ],
        "stdout": "",
        "sbg:latestRevision": 11,
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "http://www.htslib.org/",
            "label": "Homepage"
          },
          {
            "id": "https://github.com/samtools/htslib/tree/master",
            "label": "Source Code"
          },
          {
            "id": "http://www.htslib.org/doc/#manual-pages",
            "label": "Wiki"
          },
          {
            "id": "http://sourceforge.net/projects/samtools/files/tabix/tabix-0.2.5.tar.bz2/download",
            "label": "Download"
          },
          {
            "id": "http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3042176/",
            "label": "Publication"
          }
        ],
        "sbg:modifiedBy": "nevenam",
        "sbg:toolkit": "Tabix",
        "sbg:toolkitVersion": "0.2.6",
        "sbg:revisionNotes": "Changed output type for indexed_file to GFF.GZ, BED.GZ, SAM.GZ, VCF.GZ, PSLTBL.GZ",
        "label": "Tabix Index",
        "sbg:projectName": "Tabix 0.2.6 - Demo New",
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1489060552,
        "sbg:id": "admin/sbg-public-data/tabix-index-v0-2-6/11",
        "class": "CommandLineTool",
        "requirements": [
          {
            "engineCommand": "cwl-engine.js",
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ]
      },
      "id": "#Tabix_Index",
      "sbg:y": 735.770708395794
    },
    {
      "sbg:x": 1761.5387078573099,
      "inputs": [
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.VERBOSITY"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.VALIDATION_STRINGENCY"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.USE_JDK_INFLATER"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.USE_JDK_DEFLATER"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.STOP_AFTER"
        },
        {
          "source": [
            "#SBG_FASTA_Indices.fasta_reference"
          ],
          "id": "#GATK_CollectAlignmentSummaryMetrics.REFERENCE_SEQUENCE"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.QUIET"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.METRIC_ACCUMULATION_LEVEL"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.MAX_RECORDS_IN_RAM"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.MAX_INSERT_SIZE"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.IS_BISULFITE_SEQUENCED"
        },
        {
          "source": [
            "#Sambamba_Merge.merged_bam"
          ],
          "id": "#GATK_CollectAlignmentSummaryMetrics.INPUT"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.GA4GH_CLIENT_SECRETS"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.EXPECTED_PAIR_ORIENTATIONS"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.CREATE_MD5_FILE"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.CREATE_INDEX"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.COMPRESSION_LEVEL"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.ASSUME_SORTED"
        },
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.ADAPTER_SEQUENCE"
        }
      ],
      "outputs": [
        {
          "id": "#GATK_CollectAlignmentSummaryMetrics.summary_metrics"
        }
      ],
      "run": {
        "x": 1761.5387078573099,
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/teodora_aleksic/gatk:4.0.2.0",
            "dockerImageId": "eab0e70b6629"
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "script": "{\n  if($job.inputs.memory_per_job){\n  \treturn $job.inputs.memory_per_job\n  }\n  \treturn 2048\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          }
        ],
        "sbg:latestRevision": 1,
        "sbg:cmdPreview": "/opt/gatk --java-options \"-Xmx2048M\" CollectAlignmentSummaryMetrics --INPUT /path/to/input.bam --OUTPUT input.summary_metrics.txt",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 2048
          },
          "inputs": {
            "verbosity": "INFO",
            "max_insert_size": null,
            "validation_stringency": null,
            "assume_sorted": true,
            "metric_accumulation_level": null,
            "input_bam": {
              "path": "/root/folder/example.bam"
            },
            "gcs_max_retries": 7,
            "adapter_sequence": null,
            "is_bisulfite_sequenced": 5.480351658898888,
            "quiet": true,
            "reference": {
              "path": "/root/directory/example.fasta"
            },
            "INPUT": {
              "path": "/path/to/input.bam",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "memory_per_job": 2048,
            "compression_level": null,
            "stop_after": null,
            "max_records_in_ram": null
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1517326998,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/Picard_CollectAlignmentSummaryMetrics/19",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1520946154,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/Picard_CollectAlignmentSummaryMetrics/20",
            "sbg:revision": 1
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "script": "{\n  if ($job.inputs.INPUT)\n  {\n    filename = [].concat($job.inputs.INPUT)[0].path\n    filebase = filename.split('.').slice(0, -1)\n\n    return filebase.concat(\"summary_metrics.txt\").join(\".\").replace(/^.*[\\\\\\/]/, '')\n  }\n}\n",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "prefix": "--OUTPUT",
            "position": 3
          }
        ],
        "sbg:project": "vladimirk/gatk-4-0-demo-1",
        "inputs": [
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--VERBOSITY",
              "position": 0
            },
            "description": "Control verbosity of logging.  Default value: INFO. Possible values: {ERROR, WARNING,\n                              INFO, DEBUG}.",
            "label": "Control verbosity of logging",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": null,
            "id": "#VERBOSITY",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "ERROR",
                  "WARNING",
                  "INFO",
                  "DEBUG"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "INFO"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--VALIDATION_STRINGENCY",
              "position": 0
            },
            "description": "Validation stringency for all SAM files read by this program.  Setting stringency to\n                              SILENT can improve performance when processing a BAM file in which variable-length data\n                              (read, qualities, tags) do not otherwise need to be decoded.  Default value: STRICT.\n                              Possible values: {STRICT, LENIENT, SILENT}.",
            "label": "Validation stringency for all SAM files read by this program",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": null,
            "id": "#VALIDATION_STRINGENCY",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "STRICT",
                  "LENIENT",
                  "SILENT"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "STRICT"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--USE_JDK_INFLATER",
              "position": 0
            },
            "description": "Use the JDK Inflater instead of the Intel Inflater for reading compressed input  Default\n                              value: false. Possible values: {true, false}.",
            "label": "Use the JDK Inflater instead of the Intel Inflater for reading compressed input  Default\n                              value: false",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "-use_jdk_inflater",
            "id": "#USE_JDK_INFLATER",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "true",
                  "false"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "false"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--USE_JDK_DEFLATER",
              "position": 0
            },
            "description": "Use the JDK Deflater instead of the Intel Deflater for writing compressed output  Default\n                              value: false. Possible values: {true, false}.",
            "label": "Use the JDK Deflater instead of the Intel Deflater for writing compressed output  Default\n                              value: false",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "-use_jdk_deflater",
            "id": "#USE_JDK_DEFLATER",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "true",
                  "false"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "false"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--STOP_AFTER",
              "position": 0
            },
            "description": "Stop after processing N reads, mainly for debugging.  Default value: 0.",
            "label": "Stop after processing N reads, mainly for debugging",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": null,
            "id": "#STOP_AFTER",
            "type": [
              "null",
              "int"
            ],
            "sbg:toolDefaultValue": "0"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--REFERENCE_SEQUENCE",
              "position": 0
            },
            "id": "#REFERENCE_SEQUENCE",
            "description": "Reference sequence file. Note that while this argument isn't required, without it only a\n                              small subset of the metrics will be calculated. Note also that if a reference sequence is\n                              provided, it must be accompanied by a sequence dictionary.  Default value: null.",
            "label": "Reference sequence file",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "-R",
            "required": false,
            "type": [
              "null",
              "File"
            ],
            "sbg:toolDefaultValue": "null"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--QUIET",
              "position": 0
            },
            "description": "Whether to suppress job-summary info on System.err.  Default value: false. Possible\n                              values: {true, false}.",
            "label": "Whether to suppress job-summary info on System",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": null,
            "id": "#QUIET",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "true",
                  "false"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "false"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--METRIC_ACCUMULATION_LEVEL",
              "position": 0
            },
            "description": "The level(s) at which to accumulate metrics.  This argument may be specified 0 or more\n                              times. Default value: [ALL_READS]. Possible values: {ALL_READS, SAMPLE, LIBRARY,\n                              READ_GROUP}.",
            "label": "The level(s) at which to accumulate metrics",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "-LEVEL",
            "id": "#METRIC_ACCUMULATION_LEVEL",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "ALL_READS",
                  "SAMPLE",
                  "LIBRARY",
                  "READ_GROUP"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "[ALL_READS]"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--MAX_RECORDS_IN_RAM",
              "position": 0
            },
            "description": "When writing files that need to be sorted, this will specify the number of records stored\n                              in RAM before spilling to disk. Increasing this number reduces the number of file handles\n                              needed to sort the file, and increases the amount of RAM needed.  Default value: 500000.",
            "label": "When writing files that need to be sorted, this will specify the number of records stored\n                              in RAM before spilling to disk",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": null,
            "id": "#MAX_RECORDS_IN_RAM",
            "type": [
              "null",
              "int"
            ],
            "sbg:toolDefaultValue": "500000"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--MAX_INSERT_SIZE",
              "position": 0
            },
            "description": "Paired-end reads above this insert size will be considered chimeric along with\n                              inter-chromosomal pairs.  Default value: 100000.",
            "label": "Paired-end reads above this insert size will be considered chimeric along with\n                              inter-chromosomal pairs",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": null,
            "id": "#MAX_INSERT_SIZE",
            "type": [
              "null",
              "int"
            ],
            "sbg:toolDefaultValue": "100000"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--IS_BISULFITE_SEQUENCED",
              "position": 0
            },
            "description": "Whether the SAM or BAM file consists of bisulfite sequenced reads.  Default value: false.\n                              Possible values: {true, false}.",
            "label": "Whether the SAM or BAM file consists of bisulfite sequenced reads",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "-BS",
            "id": "#IS_BISULFITE_SEQUENCED",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "true",
                  "false"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "false"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--INPUT",
              "position": 0
            },
            "id": "#INPUT",
            "description": "Input SAM or BAM file.  Required.",
            "label": "Input SAM or BAM file",
            "sbg:category": "Required Arguments",
            "sbg:altPrefix": "-I",
            "required": true,
            "type": [
              "File"
            ],
            "sbg:toolDefaultValue": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--GA4GH_CLIENT_SECRETS",
              "position": 0
            },
            "description": "Google Genomics API client_secrets.json file path.  Default value: client_secrets.json.",
            "label": "Google Genomics API client_secrets",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": null,
            "id": "#GA4GH_CLIENT_SECRETS",
            "type": [
              "null",
              "string"
            ],
            "sbg:toolDefaultValue": "client_secrets"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--EXPECTED_PAIR_ORIENTATIONS",
              "position": 0
            },
            "description": "Paired-end reads that do not have this expected orientation will be considered chimeric. \n                              This argument may be specified 0 or more times. Default value: [FR]. Possible values: {FR,\n                              RF, TANDEM}.",
            "label": "Paired-end reads that do not have this expected orientation will be considered chimeric",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": null,
            "id": "#EXPECTED_PAIR_ORIENTATIONS",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "FR",
                  "RF",
                  "TANDEM"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "[FR]"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--CREATE_MD5_FILE",
              "position": 0
            },
            "description": "Whether to create an MD5 digest for any BAM or FASTQ files created.    Default value:\n                              false. Possible values: {true, false}.",
            "label": "Whether to create an MD5 digest for any BAM or FASTQ files created",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": null,
            "id": "#CREATE_MD5_FILE",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "true",
                  "false"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "false"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--CREATE_INDEX",
              "position": 0
            },
            "description": "Whether to create a BAM index when writing a coordinate-sorted BAM file.  Default value:\n                              false. Possible values: {true, false}.",
            "label": "Whether to create a BAM index when writing a coordinate-sorted BAM file",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": null,
            "id": "#CREATE_INDEX",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "true",
                  "false"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "false"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--COMPRESSION_LEVEL",
              "position": 0
            },
            "description": "Compression level for all compressed files created (e.g. BAM and VCF).  Default value: 1.",
            "label": "Compression level for all compressed files created (e",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": null,
            "id": "#COMPRESSION_LEVEL",
            "type": [
              "null",
              "int"
            ],
            "sbg:toolDefaultValue": "1"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--ASSUME_SORTED",
              "position": 0
            },
            "description": "If true (default), then the sort order in the header file will be ignored.  Default value:\n                              true. Possible values: {true, false}.",
            "label": "If true (default), then the sort order in the header file will be ignored",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "-AS",
            "id": "#ASSUME_SORTED",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "true",
                  "false"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "true"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--ADAPTER_SEQUENCE",
              "position": 0
            },
            "description": "List of adapter sequences to use when processing the alignment metrics.  This argument may\n                              be specified 0 or more times. Default value:\n                              [AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT,\n                              AGATCGGAAGAGCTCGTATGCCGTCTTCTGCTTG,\n                              AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT,\n                              AGATCGGAAGAGCGGTTCAGCAGGAATGCCGAGACCGATCTCGTATGCCGTCTTCTGCTTG,\n                              AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT,\n                              AGATCGGAAGAGCACACGTCTGAACTCCAGTCACNNNNNNNNATCTCGTATGCCGTCTTCTGCTTG].",
            "label": "List of adapter sequences to use when processing the alignment metrics",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": null,
            "id": "#ADAPTER_SEQUENCE",
            "type": [
              "null",
              "string"
            ],
            "sbg:toolDefaultValue": "[AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT,\n                              AGATCGGAAGAGCTCGTATGCCGTCTTCTGCTTG,\n                              AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT,\n                              AGATCGGAAGAGCGGTTCAGCAGGAATGCCGAGACCGATCTCGTATGCCGTCTTCTGCTTG,\n                              AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT,\n                              AGATCGGAAGAGCACACGTCTGAACTCCAGTCACNNNNNNNNATCTCGTATGCCGTCTTCTGCTTG]"
          }
        ],
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "https://software.broadinstitute.org/gatk/",
            "label": "Homepage"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/documentation/tooldocs/current/",
            "label": "Documentation"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/download/",
            "label": "Download"
          }
        ],
        "sbg:modifiedBy": "teodora.aleksic",
        "sbg:toolkitVersion": "4.0.2.0",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "sbg:toolAuthor": "Broad Institute",
        "sbg:projectName": "GATK 4.0 - Demo",
        "baseCommand": [
          "/opt/gatk",
          "--java-options",
          {
            "script": "{\n  if($job.inputs.memory_per_job){\n  \treturn '\\\"-Xmx'.concat($job.inputs.memory_per_job, 'M') + '\\\"'\n  }\n  \treturn '\\\"-Xmx2048M\\\"'\n}",
            "class": "Expression",
            "engine": "#cwl-js-engine"
          },
          "CollectAlignmentSummaryMetrics"
        ],
        "stdin": "",
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "teodora.aleksic",
        "outputs": [
          {
            "sbg:fileTypes": "TXT",
            "label": "Summary metrics",
            "id": "#summary_metrics",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#INPUT",
              "glob": "*.summary_metrics.txt"
            },
            "type": [
              "File"
            ],
            "description": "File to which the output will be written."
          }
        ],
        "label": "GATK CollectAlignmentSummaryMetrics",
        "sbg:copyOf": "vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/Picard_CollectAlignmentSummaryMetrics/20",
        "sbg:createdOn": 1517326998,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": -441.51450943109455,
        "sbg:license": "Open source BSD (3-clause) license",
        "sbg:contributors": [
          "teodora.aleksic"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "temporaryFailCodes": [],
        "id": "vladimirk/gatk-4-0-demo-1/gatk-collectalignmentsummarymetrics/1",
        "description": "Produces from a SAM/BAM/CRAM file containing summary alignment metrics.\n\n###**Overview**  \n\nCollectAlignmentSummaryMetrics assesses the quality of alignment by analyzing a SAM or BAM file. It compares it with the reference file (FASTA) and provides alignment statistics, such as the number of input reads and the percent of reads that are mapped. It produces a file which contains summary alignment metrics from a SAM or BAM file.\n\nNote: This tool requires the exact same FASTA file as the one to which raw reads were aligned.\n\n###**Inputs**  \nA BAM or SAM file.\n\n###**Outputs**  \nAn alignment summary file. \n\n###**Usage example**\n\n    java -Xmx4g -jar gatk.jar \\  \n         CollectAlignmentSummaryMetrics \\  \n         --reference reference.fasta \\\n         --input input.bam \\\n         --output summary_metrics.txt\n\n###**Common issues**\n\n1) BAM file - Sort order should be coordinate based.\n2) Reference sequence file - Note that while this argument is not required, without it only a small subset of the metrics will be calculated. If reference sequence file is used, sequence index and dictionary are required. This tool requires the exact same FASTA file as the one to which raw reads were aligned.\n\n###**IMPORTANT NOTICE**  \n\nTools in GATK that require a fasta reference file also look for the reference file's corresponding *.fai* (fasta index) and *.dict* (fasta dictionary) files. The fasta index file allows random access to reference bases and the dictionary file is a dictionary of the contig names and sizes contained within the fasta reference. These two secondary files are essential for GATK to work properly. To append these two files to your fasta reference please use the '***SBG FASTA Indices***' tool within your GATK based workflow before using any of the GATK tools.",
        "sbg:toolkit": "GATK",
        "sbg:image_url": null,
        "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/Picard_CollectAlignmentSummaryMetrics/20",
        "sbg:revision": 1,
        "sbg:categories": [
          "GATK-4"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1520946154,
        "sbg:id": "admin/sbg-public-data/gatk-collectalignmentsummarymetrics/1",
        "stdout": ""
      },
      "id": "#GATK_CollectAlignmentSummaryMetrics",
      "sbg:y": -441.51450943109455
    },
    {
      "sbg:x": 944.1435756210566,
      "inputs": [
        {
          "id": "#SBG_Prepare_Intervals.split_mode",
          "default": "File per interval with alt contig in a single file"
        },
        {
          "id": "#SBG_Prepare_Intervals.format"
        },
        {
          "id": "#SBG_Prepare_Intervals.fai_file"
        },
        {
          "source": [
            "#intervals_file"
          ],
          "id": "#SBG_Prepare_Intervals.bed_file"
        }
      ],
      "outputs": [
        {
          "id": "#SBG_Prepare_Intervals.str_arr"
        },
        {
          "id": "#SBG_Prepare_Intervals.names"
        },
        {
          "id": "#SBG_Prepare_Intervals.intervals"
        }
      ],
      "run": {
        "y": 1242.3836307413155,
        "temporaryFailCodes": [],
        "sbg:createdBy": "vladimirk",
        "sbg:modifiedOn": 1530193387,
        "outputs": [
          {
            "id": "#str_arr",
            "outputBinding": {
              "outputEval": {
                "script": "{ rows = $self[0].contents\n  if (rows[rows.length -1] == '\\n'){\n    rows = rows.split(/\\r?\\n/).slice(0,-1);\n  }\n  else {\n    rows = rows.split(/\\r?\\n/);\n  }\n  out_list = []\n  for (i=0; i<rows.length; i++)\n  {\n    row = rows[i];\n    chromosome = row.split(\"\\t\")[0];\n    start = row.split(\"\\t\")[1];\n    end = row.split(\"\\t\")[2];\n    if(typeof start !== \"undefined\"){\n    \tinterval = chromosome.concat(\":\", start, \"-\", end);\n    }\n    else{\n    \tinterval = chromosome\n    }    \n    out_list.push(interval);\n  }\n  return out_list;\n  \t\n}\n",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "loadContents": true,
              "glob": {
                "script": "{ \n  if ($job.inputs.bed_file){\n    glob = $job.inputs.bed_file.path\n\tglob = glob.split('/').slice(-1)[0]\n  }\n  else if($job.inputs.fai_file){\n    glob = $job.inputs.fai_file.path\n\tglob = glob.split('/').slice(-1)[0].split('.').slice(0, -1).join('.') + '.bed'\n  }\n\n  return glob\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              }
            },
            "type": [
              "null",
              {
                "items": "string",
                "type": "array"
              }
            ],
            "description": "Outputs BED content as strings.",
            "label": "String output"
          },
          {
            "id": "#names",
            "outputBinding": {
              "outputEval": {
                "script": "{   \n content =  $self[0].contents.replace(/\\0/g, '')\n content = content.replace('[','')\n content = content.replace(']','')\n content = content.replace(/\\'/g, \"\")\n content = content.replace(/\\s/g, '')\n content_arr = content.split(\",\")\n\n return content_arr\n \n\n} ",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "loadContents": true,
              "glob": "Intervals/names.txt"
            },
            "type": [
              "null",
              "string"
            ],
            "description": "File containing the names of created files.",
            "label": "Output file names"
          },
          {
            "sbg:fileTypes": "BED",
            "label": "Intervals",
            "id": "#intervals",
            "outputBinding": {
              "glob": "Intervals/*.bed",
              "sbg:metadata": {
                "sbg_scatter": "true"
              }
            },
            "type": [
              "null",
              {
                "name": "intervals",
                "items": "File",
                "type": "array"
              }
            ],
            "description": "Array of BED files genereted as per selected Split Mode."
          }
        ],
        "sbg:revision": 15,
        "x": 944.1435756210566,
        "id": "bix-demo/sbgtools-demo/sbg-prepare-intervals/15",
        "sbg:categories": [
          "Converters"
        ],
        "sbg:createdOn": 1473083821,
        "successCodes": [],
        "sbg:validationErrors": [],
        "sbg:cmdPreview": "python sbg_prepare_intervals.py  --format \"chr start end\" --mode 2",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 1000
          },
          "inputs": {
            "split_mode": "File per chr with alt contig in a single file",
            "fai_file": {
              "path": "/path/to/fai_file.fasta.fai",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "format": "chr start end"
          }
        },
        "sbg:sbgMaintained": false,
        "hints": [
          {
            "class": "sbg:MemRequirement",
            "value": 1000
          },
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/bogdang/sbg_prepare_intervals:1.0",
            "dockerImageId": ""
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          }
        ],
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1473083821,
            "sbg:revisionNotes": "Copy of medjo/sbg-prepare-intervals/sbg-prepare-intervals/75",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1473084447,
            "sbg:revisionNotes": "Copy of medjo/sbg-prepare-intervals/sbg-prepare-intervals/76",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "medjo",
            "sbg:modifiedOn": 1473928444,
            "sbg:revisionNotes": null,
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "medjo",
            "sbg:modifiedOn": 1474970272,
            "sbg:revisionNotes": "split_mode set to required",
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1478525360,
            "sbg:revisionNotes": "Fixed Toolkit name.",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "medjo",
            "sbg:modifiedOn": 1491904483,
            "sbg:revisionNotes": "Description changed",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1491905063,
            "sbg:revisionNotes": "Common issues added",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500382475,
            "sbg:revisionNotes": "Change the Javascript for adding the format argument into the command line",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1503074487,
            "sbg:revisionNotes": "Removed lower() from mode_2",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "medjo",
            "sbg:modifiedOn": 1503398050,
            "sbg:revisionNotes": "String output added",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1504515792,
            "sbg:revisionNotes": "Glob fix for fai input",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1508491917,
            "sbg:revisionNotes": "Removed sbg:format for string output from json",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "medjo",
            "sbg:modifiedOn": 1512057641,
            "sbg:revisionNotes": "Bug fixed - if bed file is not ended with \\n tool will work as expected.",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "bogdang",
            "sbg:modifiedOn": 1528202923,
            "sbg:revisionNotes": "Ignore header lines",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "luka.topalovic",
            "sbg:modifiedOn": 1529595373,
            "sbg:revisionNotes": "Back to revision 12",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "medjo",
            "sbg:modifiedOn": 1530193387,
            "sbg:revisionNotes": "check for header",
            "sbg:revision": 15
          }
        ],
        "sbg:license": "Apache License 2.0",
        "sbg:image_url": null,
        "stdin": "",
        "sbg:toolAuthor": "Seven Bridges Genomics",
        "sbg:contributors": [
          "bix-demo",
          "vladimirk",
          "medjo",
          "nikola_jovanovic",
          "teodora.aleksic",
          "luka.topalovic",
          "bogdang"
        ],
        "inputs": [
          {
            "label": "Split mode",
            "sbg:category": "Input",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  mode = $job.inputs.split_mode\n  switch (mode) \n  {\n    case \"File per interval\": \n      return 1\n    case \"File per chr with alt contig in a single file\": \n      return 2\n    case \"Output original BED\": \n      return 3\n    case \"File per interval with alt contig in a single file\": \n      return 4  \n  }\n  return 3\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--mode",
              "position": 3
            },
            "type": [
              {
                "name": "split_mode",
                "symbols": [
                  "File per interval",
                  "File per chr with alt contig in a single file",
                  "Output original BED",
                  "File per interval with alt contig in a single file"
                ],
                "type": "enum"
              }
            ],
            "id": "#split_mode",
            "description": "Depending on selected Split Mode value, output files are generated in accordance with description below:  1. File per interval - The tool creates one interval file per line of the input BED(FAI) file. Each interval file contains a single line (one of the lines of BED(FAI) input file).  2. File per chr with alt contig in a single file - For each contig(chromosome) a single file is created containing all the intervals corresponding to it . All the intervals (lines) other than (chr1, chr2 ... chrY or 1, 2 ... Y) are saved as (\"others.bed\").  3. Output original BED - BED file is required for execution of this mode. If mode 3 is applied input is passed to the output.  4. File per interval with alt contig in a single file - For each chromosome a single file is created for each interval. All the intervals (lines) other than (chr1, chr2 ... chrY or 1, 2 ... Y) are saved as (\"others.bed\"). NOTE: Do not use option 1 (File per interval) with exome BED or a BED with a lot of GL contigs, as it will create a large number of files."
          },
          {
            "type": [
              "null",
              {
                "name": "format",
                "symbols": [
                  "chr start end",
                  "chr:start-end"
                ],
                "type": "enum"
              }
            ],
            "id": "#format",
            "description": "Format of the intervals in the generated files.",
            "label": "Interval format",
            "sbg:category": "Input"
          },
          {
            "sbg:fileTypes": "FAI",
            "label": "Input FAI file",
            "sbg:category": "File Input",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--fai",
              "position": 2
            },
            "required": false,
            "id": "#fai_file",
            "type": [
              "null",
              "File"
            ],
            "description": "FAI file is converted to BED format if BED file is not provided.",
            "sbg:stageInput": "link"
          },
          {
            "sbg:fileTypes": "BED",
            "label": "Input BED file",
            "sbg:category": "File Input",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--bed",
              "position": 1
            },
            "required": false,
            "id": "#bed_file",
            "type": [
              "null",
              "File"
            ],
            "description": "Input BED file containing intervals. Required for modes 3 and 4.",
            "sbg:stageInput": "link"
          }
        ],
        "sbg:project": "bix-demo/sbgtools-demo",
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "arguments": [
          {
            "valueFrom": {
              "script": "{\t\n  if ($job.inputs.format)\n  \treturn \"--format \" + \"\\\"\" + $job.inputs.format + \"\\\"\"\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true
          }
        ],
        "stdout": "",
        "sbg:latestRevision": 15,
        "sbg:publisher": "sbg",
        "description": "Depending on selected Split Mode value, output files are generated in accordance with description below:\n\n1. File per interval - The tool creates one interval file per line of the input BED(FAI) file.\nEach interval file contains a single line (one of the lines of BED(FAI) input file).\n\n2. File per chr with alt contig in a single file - For each contig(chromosome) a single file\nis created containing all the intervals corresponding to it .\nAll the intervals (lines) other than (chr1, chr2 ... chrY or 1, 2 ... Y) are saved as\n(\"others.bed\").\n\n3. Output original BED - BED file is required for execution of this mode. If mode 3 is applied input is passed to the output.\n\n4. File per interval with alt contig in a single file - For each chromosome a single file is created for each interval.\nAll the intervals (lines) other than (chr1, chr2 ... chrY or 1, 2 ... Y) are saved as\n(\"others.bed\").\n\n##### Common issues: \nDo not use option 1 (File per interval) with exome BED or a BED with a lot of GL contigs, as it will create a large number of files.",
        "sbg:modifiedBy": "medjo",
        "sbg:toolkit": "SBGTools",
        "sbg:toolkitVersion": "1.0",
        "sbg:revisionNotes": "check for header",
        "label": "SBG Prepare Intervals",
        "sbg:projectName": "SBGTools - Demo New",
        "cwlVersion": "sbg:draft-2",
        "baseCommand": [
          "python",
          "sbg_prepare_intervals.py"
        ],
        "sbg:id": "admin/sbg-public-data/sbg-prepare-intervals/96",
        "class": "CommandLineTool",
        "requirements": [
          {
            "class": "CreateFileRequirement",
            "fileDef": [
              {
                "fileContent": "\"\"\"\nUsage:\n    sbg_prepare_intervals.py [options] [--fastq FILE --bed FILE --mode INT --format STR --others STR]\n\nDescription:\n    Purpose of this tool is to split BED file into files based on the selected mode.\n    If bed file is not provided fai(fasta index) file is converted to bed.\n\nOptions:\n\n    -h, --help            Show this message.\n\n    -v, -V, --version     Tool version.\n\n    -b, -B, --bed FILE    Path to input bed file.\n\n    --fai FILE            Path to input fai file.\n\n    --format STR          Output file format.\n\n    --mode INT            Select input mode.\n\n\"\"\"\n\n\nimport os\nimport sys\nimport glob\nimport shutil\nfrom docopt import docopt\n\ndefault_extension = '.bed'  # for output files\n\n\ndef create_file(contents, contig_name, extension=default_extension):\n    \"\"\"function for creating a file for all intervals in a contig\"\"\"\n\n    new_file = open(\"Intervals/\" + contig_name + extension, \"w\")\n    new_file.write(contents)\n    new_file.close()\n\n\ndef add_to_file(line, name, extension=default_extension):\n    \"\"\"function for adding a line to a file\"\"\"\n\n    new_file = open(\"Intervals/\" + name + extension, \"a\")\n    if lformat == formats[1]:\n        sep = line.split(\"\\t\")\n        line = sep[0] + \":\" + sep[1] + \"-\" + sep[2]\n    new_file.write(line)\n    new_file.close()\n\n\ndef fai2bed(fai):\n    \"\"\"function to create a bed file from fai file\"\"\"\n\n    region_thr = 10000000  # threshold used to determine starting point accounting for telomeres in chromosomes\n    basename = fai[0:fai.rfind(\".\")]\n    with open(fai, \"r\") as ins:\n        new_array = []\n        for line in ins:\n            len_reg = int(line.split()[1])\n            cutoff = 0 if (\n            len_reg < region_thr) else 0  # sd\\\\telomeres or start with 1\n            new_line = line.split()[0] + '\\t' + str(cutoff) + '\\t' + str(\n                len_reg + cutoff)\n            new_array.append(new_line)\n    new_file = open(basename + \".bed\", \"w\")\n    new_file.write(\"\\n\".join(new_array))\n    return basename + \".bed\"\n\n\ndef chr_intervals(no_of_chrms=23):\n    \"\"\"returns all possible designations for chromosome intervals\"\"\"\n\n    chrms = []\n    for i in range(1, no_of_chrms):\n        chrms.append(\"chr\" + str(i))\n        chrms.append(str(i))\n    chrms.extend([\"x\", \"y\", \"chrx\", \"chry\"])\n    return chrms\n\n\ndef mode_1(orig_file):\n    \"\"\"mode 1: every line is a new file\"\"\"\n\n    with open(orig_file, \"r\") as ins:\n        prev = \"\"\n        counter = 0\n        names = []\n        for line in ins:\n            if is_header(line):\n                continue\n            if line.split()[0] == prev:\n                counter += 1\n            else:\n                counter = 0\n            suffix = \"\" if (counter == 0) else \"_\" + str(counter)\n            create_file(line, line.split()[0] + suffix)\n            names.append(line.split()[0] + suffix)\n            prev = line.split()[0]\n\n        create_file(str(names), \"names\", extension=\".txt\")\n\n\ndef mode_2(orig_file, others_name):\n    \"\"\"mode 2: separate file is created for each chromosome, and one file is created for other intervals\"\"\"\n\n    chrms = chr_intervals()\n    names = []\n\n    with open(orig_file, 'r') as ins:\n        for line in ins:\n            if is_header(line):\n                continue\n            name = line.split()[0]\n            if name.lower() in chrms:\n                name = name\n            else:\n                name = others_name\n            try:\n                add_to_file(line, name)\n                if not name in names:\n                    names.append(name)\n            except:\n                raise Exception(\n                    \"Couldn't create or write in the file in mode 2\")\n\n        create_file(str(names), \"names\", extension=\".txt\")\n\n\ndef mode_3(orig_file, extension=default_extension):\n    \"\"\"mode 3: input file is staged to output\"\"\"\n\n    orig_name = orig_file.split(\"/\")[len(orig_file.split(\"/\")) - 1]\n    output_file = r\"./Intervals/\" + orig_name[\n                                    0:orig_name.rfind('.')] + extension\n\n    shutil.copyfile(orig_file, output_file)\n\n    names = [orig_name[0:orig_name.rfind('.')]]\n    create_file(str(names), \"names\", extension=\".txt\")\n\n\ndef mode_4(orig_file, others_name):\n    \"\"\"mode 4: every interval in chromosomes is in a separate file. Other intervals are in a single file\"\"\"\n\n    chrms = chr_intervals()\n    names = []\n\n    with open(orig_file, \"r\") as ins:\n        counter = {}\n        for line in ins:\n            if line.startswith('@'):\n                continue\n            name = line.split()[0].lower()\n            if name in chrms:\n                if name in counter:\n                    counter[name] += 1\n                else:\n                    counter[name] = 0\n                suffix = \"\" if (counter[name] == 0) else \"_\" + str(counter[name])\n                create_file(line, name + suffix)\n                names.append(name + suffix)\n                prev = name\n            else:\n                name = others_name\n                if not name in names:\n                    names.append(name)\n                try:\n                    add_to_file(line, name)\n                except:\n                    raise Exception(\n                        \"Couldn't create or write in the file in mode 4\")\n\n    create_file(str(names), \"names\", extension=\".txt\")\n\n\ndef prepare_intervals():\n    # reading input files and split mode from command line\n    args = docopt(__doc__, version='1.0')\n\n    bed_file = args['--bed']\n    fai_file = args['--fai']\n    split_mode = int(args['--mode'])\n\n    # define file name for non-chromosomal contigs\n    others_name = 'others'\n\n    global formats, lformat\n    formats = [\"chr start end\", \"chr:start-end\"]\n    lformat = args['--format']\n    if lformat == None:\n        lformat = formats[0]\n    if not lformat in formats:\n        raise Exception('Unsuported interval format')\n\n    if not os.path.exists(r\"./Intervals\"):\n        os.mkdir(r\"./Intervals\")\n    else:\n        files = glob.glob(r\"./Intervals/*\")\n        for f in files:\n            os.remove(f)\n\n    # create variable input_file taking bed_file as priority\n    if bed_file:\n        input_file = bed_file\n    elif fai_file:\n        input_file = fai2bed(fai_file)\n    else:\n        raise Exception('No input files are provided')\n\n    # calling adequate split mode function\n    if split_mode == 1:\n        mode_1(input_file)\n    elif split_mode == 2:\n        mode_2(input_file, others_name)\n    elif split_mode == 3:\n        if bed_file:\n            mode_3(input_file)\n        else:\n            raise Exception('Bed file is required for mode 3')\n    elif split_mode == 4:\n        mode_4(input_file, others_name)\n    else:\n        raise Exception('Split mode value is not set')\n\n\ndef is_header(line):\n    x = line.split('\\t')\n    try:\n        int(x[1])\n        int(x[2])\n        header = False\n    except:\n        sys.stderr.write('Line is skipped: {}'.format(line))\n        header = True\n    return header\n\n\nif __name__ == '__main__':\n    prepare_intervals()",
                "filename": "sbg_prepare_intervals.py"
              }
            ]
          },
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ]
      },
      "id": "#SBG_Prepare_Intervals",
      "sbg:y": 1242.3836307413155
    },
    {
      "sbg:x": 470.0001054869792,
      "inputs": [
        {
          "id": "#FastQC.threads"
        },
        {
          "id": "#FastQC.quiet"
        },
        {
          "id": "#FastQC.nogroup"
        },
        {
          "id": "#FastQC.nano"
        },
        {
          "id": "#FastQC.memory_per_job"
        },
        {
          "id": "#FastQC.limits_file"
        },
        {
          "id": "#FastQC.kmers"
        },
        {
          "source": [
            "#fastq"
          ],
          "id": "#FastQC.input_fastq"
        },
        {
          "id": "#FastQC.format"
        },
        {
          "id": "#FastQC.cpus_per_job"
        },
        {
          "id": "#FastQC.contaminants_file"
        },
        {
          "id": "#FastQC.casava"
        },
        {
          "id": "#FastQC.adapters_file"
        }
      ],
      "outputs": [
        {
          "id": "#FastQC.report_zip"
        },
        {
          "id": "#FastQC.report_html"
        }
      ],
      "run": {
        "y": 318.33339677916854,
        "temporaryFailCodes": [],
        "sbg:createdBy": "bix-demo",
        "outputs": [
          {
            "sbg:fileTypes": "ZIP",
            "label": "Report zip",
            "id": "#report_zip",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#input_fastq",
              "glob": "*_fastqc.zip",
              "sbg:metadata": {
                "__inherit__": "input_fastq"
              }
            },
            "type": [
              "null",
              {
                "name": "report_zip",
                "items": "File",
                "type": "array"
              }
            ],
            "description": "Zip archive of the report."
          },
          {
            "sbg:fileTypes": "HTML",
            "label": "Report HTMLs",
            "id": "#report_html",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#input_fastq",
              "glob": "*.html"
            },
            "type": [
              "null",
              {
                "items": "File",
                "type": "array"
              }
            ],
            "description": "FastQC reports in HTML format."
          }
        ],
        "sbg:revision": 11,
        "x": 470.0001054869792,
        "id": "bix-demo/fastqc-0-11-4-demo/fastqc-0-11-4/11",
        "sbg:categories": [
          "FASTQ-Processing",
          "Quality-Control",
          "Quantification"
        ],
        "sbg:createdOn": 1450911593,
        "successCodes": [],
        "sbg:validationErrors": [],
        "sbg:cmdPreview": "fastqc  --noextract --outdir .  /path/to/input_fastq-1.fastq  /path/to/input_fastq-2.fastq",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 2,
            "mem": 1624
          },
          "inputs": {
            "quiet": true,
            "memory_per_job": null,
            "format": null,
            "cpus_per_job": null,
            "threads": null,
            "input_fastq": [
              {
                "path": "/path/to/input_fastq-1.fastq",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              },
              {
                "path": "/path/to/input_fastq-2.fastq",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              }
            ]
          }
        },
        "description": "FastQC reads a set of sequence files and produces a quality control (QC) report from each one. These reports consist of a number of different modules, each of which will help identify a different type of potential problem in your data. \n\nSince it's necessary to convert the tool report in order to show them on Seven Bridges platform, it's recommended to use [FastQC Analysis workflow instead](https://igor.sbgenomics.com/public/apps#admin/sbg-public-data/fastqc-analysis/). \n\nFastQC is a tool which takes a FASTQ file and runs a series of tests on it to generate a comprehensive QC report.  This report will tell you if there is anything unusual about your sequence.  Each test is flagged as a pass, warning, or fail depending on how far it departs from what you would expect from a normal large dataset with no significant biases.  It is important to stress that warnings or even failures do not necessarily mean that there is a problem with your data, only that it is unusual.  It is possible that the biological nature of your sample means that you would expect this particular bias in your results.",
        "sbg:sbgMaintained": false,
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/mladenlsbg/fastqc:0.11.4",
            "dockerImageId": "759c4c8fbafd"
          },
          {
            "class": "sbg:CPURequirement",
            "value": {
              "script": "{\n  // if cpus_per_job is set, it takes precedence\n  if ($job.inputs.cpus_per_job) {\n    return $job.inputs.cpus_per_job \n  }\n  // if threads parameter is set, the number of CPUs is set based on that parametere\n  else if ($job.inputs.threads) {\n    return $job.inputs.threads\n  }\n  // else the number of CPUs is determined by the number of input files, up to 7 -- default\n  else return Math.min([].concat($job.inputs.input_fastq).length,7)\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "script": "{\n  // if memory_per_job is set, it takes precedence\n  if ($job.inputs.memory_per_job){\n    return $job.inputs.memory_per_job\n  }\n  // if threads parameter is set, memory req is set based on the number of threads\n  else if ($job.inputs.threads){\n    return 1024 + 300*$job.inputs.threads\n  }\n  // else the memory req is determined by the number of input files, up to 7 -- default\n  else return (1024 + 300*Math.min([].concat($job.inputs.input_fastq).length,7))\n}\n\n",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          }
        ],
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1450911593,
            "sbg:revisionNotes": null,
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1450911593,
            "sbg:revisionNotes": null,
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1450911594,
            "sbg:revisionNotes": null,
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "mladenlSBG",
            "sbg:modifiedOn": 1459870965,
            "sbg:revisionNotes": null,
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "mladenlSBG",
            "sbg:modifiedOn": 1465990120,
            "sbg:revisionNotes": null,
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "mladenlSBG",
            "sbg:modifiedOn": 1476188095,
            "sbg:revisionNotes": "Input categories added.",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "mladenlSBG",
            "sbg:modifiedOn": 1476270496,
            "sbg:revisionNotes": "FASTQ input changed from single file to array. Added better thread handling. \n\nIMPORTANT NOTICE: If updating this tool in existing workflow, it's necessary to REMOVE SCATTER (uncheck it) from input_fastq or it might break the pipeline.",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "mladenlSBG",
            "sbg:modifiedOn": 1476354537,
            "sbg:revisionNotes": "FASTQ input changed from single file to array. Added better thread handling.\n\nIMPORTANT NOTICE: If updating this tool in existing workflow, it's necessary to REMOVE SCATTER (uncheck it) from input_fastq or it might break the pipeline.",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "mladenlSBG",
            "sbg:modifiedOn": 1488882730,
            "sbg:revisionNotes": "IMPORTANT NOTICE: If updating this tool in existing workflow, it's necessary to REMOVE SCATTER (uncheck it) from input_fastq or it might break the pipeline.\"\n\nAdded automatised handling of BAM and SAM files. Also, added security measures for better automated threading handling.",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1488980183,
            "sbg:revisionNotes": "Changed the file types of limits, adapters and contaminants files to be TXT, they have to be in format name[tab]sequence. Format should be similar to the one in the Configuration folder provided with FastQC, txt files.\n\n\"IMPORTANT NOTICE: If updating this tool in existing workflow, it's necessary to REMOVE SCATTER (uncheck it) from input_fastq or it might break the pipeline.\"",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1493223877,
            "sbg:revisionNotes": "* Fixed the JS expression for the CPU and Memory allocation\n* Added cpus_per_job and memory_per_job parameters\n* Removed default version for format, so the tool can handle combinations of file formats",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1529400574,
            "sbg:revisionNotes": "HTML output added.",
            "sbg:revision": 11
          }
        ],
        "sbg:license": "GNU General Public License v3.0 only",
        "sbg:image_url": null,
        "stdin": "",
        "sbg:toolAuthor": "Babraham Institute",
        "sbg:contributors": [
          "bix-demo",
          "mladenlSBG",
          "nikola_jovanovic"
        ],
        "inputs": [
          {
            "inputBinding": {
              "valueFrom": {
                "script": "{\n//if \"threads\" is not specified\n//number of threads is determined based on number of inputs\n  if (! $job.inputs.threads){\n    $job.inputs.threads = [].concat($job.inputs.input_fastq).length\n  }\n  return Math.min($job.inputs.threads,7)\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--threads"
            },
            "description": "Specifies the number of files which can be processed simultaneously.  Each thread will be allocated 250MB of memory so you shouldn't run more threads than your available memory will cope with, and not more than 6 threads on a 32 bit machine.",
            "label": "Threads",
            "sbg:category": "Options",
            "sbg:altPrefix": "-t",
            "id": "#threads",
            "type": [
              "null",
              "int"
            ],
            "sbg:toolDefaultValue": "1"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--quiet"
            },
            "label": "Quiet",
            "sbg:category": "Options",
            "sbg:altPrefix": "-q",
            "id": "#quiet",
            "type": [
              "null",
              "boolean"
            ],
            "description": "Supress all progress messages on stdout and only report errors."
          },
          {
            "label": "Nogroup",
            "sbg:category": "Options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": false,
              "prefix": "--nogroup"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#nogroup",
            "description": "Disable grouping of bases for reads >50bp. All reports will show data for every base in the read.  WARNING: Using this option will cause fastqc to crash and burn if you use it on really long reads, and your plots may end up a ridiculous size. You have been warned."
          },
          {
            "label": "Nano",
            "sbg:category": "Options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": false,
              "prefix": "--nano"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#nano",
            "description": "Files come from naopore sequences and are in fast5 format. In this mode you can pass in directories to process and the program will take in all fast5 files within those directories and produce a single output file from the sequences found in all files."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Amount of memory allocated per job execution.",
            "sbg:category": "Execution parameters",
            "sbg:toolDefaultValue": "Determined by the number of input files",
            "id": "#memory_per_job",
            "description": "Amount of memory allocated per execution of FastQC job."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--limits"
            },
            "sbg:fileTypes": "TXT",
            "label": "Limits",
            "sbg:category": "File inputs",
            "sbg:altPrefix": "-l",
            "required": false,
            "id": "#limits_file",
            "type": [
              "null",
              "File"
            ],
            "description": "Specifies a non-default file which contains a set of criteria which will be used to determine the warn/error limits for the various modules.  This file can also be used to selectively remove some modules from the output all together.  The format needs to mirror the default limits.txt file found in the Configuration folder."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--kmers"
            },
            "description": "Specifies the length of Kmer to look for in the Kmer content module. Specified Kmer length must be between 2 and 10. Default length is 7 if not specified.",
            "label": "Kmers",
            "sbg:category": "Options",
            "sbg:altPrefix": "-f",
            "id": "#kmers",
            "type": [
              "null",
              "int"
            ],
            "sbg:toolDefaultValue": "7"
          },
          {
            "sbg:fileTypes": "FASTQ, FQ, FASTQ.GZ, FQ.GZ, BAM, SAM",
            "label": "Input file",
            "sbg:category": "File inputs",
            "inputBinding": {
              "itemSeparator": null,
              "separate": true,
              "position": 100,
              "sbg:cmdInclude": true
            },
            "required": true,
            "id": "#input_fastq",
            "type": [
              {
                "name": "input_fastq",
                "items": "File",
                "type": "array"
              }
            ],
            "description": "Input file."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--format"
            },
            "description": "Bypasses the normal sequence file format detection and forces the program to use the specified format.  Valid formats are BAM, SAM, BAM_mapped, SAM_mapped and FASTQ.",
            "label": "Format",
            "sbg:category": "Options",
            "sbg:altPrefix": "-f",
            "id": "#format",
            "type": [
              "null",
              {
                "name": "format",
                "symbols": [
                  "bam",
                  "sam",
                  "bam_mapped",
                  "sam_mapped",
                  "fastq"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "FASTQ"
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Number of CPUs.",
            "sbg:category": "Execution parameters",
            "sbg:toolDefaultValue": "Determined by the number of input files",
            "id": "#cpus_per_job",
            "description": "Number of CPUs to be allocated per execution of FastQC."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--contaminants"
            },
            "sbg:fileTypes": "TXT",
            "label": "Contaminants",
            "sbg:category": "File inputs",
            "sbg:altPrefix": "-c",
            "required": false,
            "id": "#contaminants_file",
            "type": [
              "null",
              "File"
            ],
            "description": "Specifies a non-default file which contains the list of contaminants to screen overrepresented sequences against. The file must contain sets of named contaminants in the form name[tab]sequence.  Lines prefixed with a hash will be ignored."
          },
          {
            "label": "Casava",
            "sbg:category": "Options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": false,
              "prefix": "--casava"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#casava",
            "description": "Files come from raw casava output. Files in the same sample group (differing only by the group number) will be analysed as a set rather than individually. Sequences with the filter flag set in the header will be excluded from the analysis. Files must have the same names given to them by casava (including being gzipped and ending with .gz) otherwise they won't be grouped together correctly."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--adapters"
            },
            "sbg:fileTypes": "TXT",
            "label": "Adapters",
            "sbg:category": "File inputs",
            "sbg:altPrefix": "-a",
            "required": false,
            "id": "#adapters_file",
            "type": [
              "null",
              "File"
            ],
            "description": "Specifies a non-default file which contains the list of adapter sequences which will be explicity searched against the library. The file must contain sets of named adapters in the form name[tab]sequence.  Lines prefixed with a hash will be ignored."
          }
        ],
        "sbg:project": "bix-demo/fastqc-0-11-4-demo",
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "baseCommand": [
          "fastqc"
        ],
        "stdout": "",
        "sbg:latestRevision": 11,
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "http://www.bioinformatics.babraham.ac.uk/projects/fastqc/",
            "label": "Homepage"
          },
          {
            "id": "http://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.4_source.zip",
            "label": "Source Code"
          },
          {
            "id": "https://wiki.hpcc.msu.edu/display/Bioinfo/FastQC+Tutorial",
            "label": "Wiki"
          },
          {
            "id": "http://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.4.zip",
            "label": "Download"
          },
          {
            "id": "http://www.bioinformatics.babraham.ac.uk/projects/fastqc",
            "label": "Publication"
          }
        ],
        "arguments": [
          {
            "valueFrom": "--noextract",
            "separate": true,
            "prefix": ""
          },
          {
            "valueFrom": ".",
            "separate": true,
            "prefix": "--outdir"
          }
        ],
        "sbg:modifiedBy": "nikola_jovanovic",
        "sbg:toolkit": "FastQC",
        "sbg:toolkitVersion": "0.11.4",
        "sbg:revisionNotes": "HTML output added.",
        "label": "FastQC",
        "sbg:projectName": "FastQC 0.11.4 - Demo",
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1529400574,
        "sbg:id": "h-6684e9db/h-e170092a/h-e102ea64/0",
        "class": "CommandLineTool",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ]
      },
      "id": "#FastQC",
      "sbg:y": 318.33339677916854
    },
    {
      "sbg:x": 646.6667170789518,
      "inputs": [
        {
          "id": "#BWA_INDEX_1.total_memory"
        },
        {
          "source": [
            "#reference"
          ],
          "id": "#BWA_INDEX_1.reference"
        },
        {
          "id": "#BWA_INDEX_1.prefix_of_the_index_to_be_output"
        },
        {
          "id": "#BWA_INDEX_1.do_not_add_alt_contig_to_reference"
        },
        {
          "id": "#BWA_INDEX_1.bwt_construction"
        },
        {
          "id": "#BWA_INDEX_1.block_size"
        },
        {
          "id": "#BWA_INDEX_1.add_64_to_fasta_name"
        }
      ],
      "outputs": [
        {
          "id": "#BWA_INDEX_1.indexed_reference"
        }
      ],
      "run": {
        "x": 646.6667170789518,
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/vladimirk/bwa:0.7.17",
            "dockerImageId": "2f813371e803"
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "script": "{\n  reference_file = $job.inputs.reference.path.split('/')[$job.inputs.reference.path.split('/').length-1]\n  ext = reference_file.split('.')[reference_file.split('.').length-1]\n  \n  GB_1 = 1024*1024*1024\n  reads_size = $job.inputs.reference.size\n\n  if(!reads_size) { reads_size = GB_1 }\n  \n  if($job.inputs.total_memory){\n    return $job.inputs.total_memory * 1024\n  } else if (ext=='tar'){\n    return 128\n  }\n    {\n    return (parseInt(1.5 * reads_size / (1024*1024)))\n  }\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          }
        ],
        "sbg:latestRevision": 3,
        "sbg:cmdPreview": "cp /opt/hs38DH.fa.alt reference38.fasta.alt ; bwa index reference38.fasta            ; tar -cf reference38.fasta.tar reference38.fasta *.amb *.ann *.bwt *.pac *.sa *.alt ;",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 1536
          },
          "inputs": {
            "add_64_to_fasta_name": false,
            "bwt_construction": null,
            "block_size": null,
            "total_memory": null,
            "reference": {
              "path": "/path/to/the/reference38.fasta",
              "class": "File",
              "size": 0,
              "secondaryFiles": [
                {
                  "path": ".amb"
                },
                {
                  "path": ".ann"
                },
                {
                  "path": ".bwt"
                },
                {
                  "path": ".pac"
                },
                {
                  "path": ".sa"
                }
              ]
            },
            "prefix_of_the_index_to_be_output": "prefix",
            "do_not_add_alt_contig_to_reference": false
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1531828242,
            "sbg:revisionNotes": "Copy of vladimirk/bwa-mem-bundle-0-7-13-demo/bwa-index/18",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1531839752,
            "sbg:revisionNotes": "add alt to TAR",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1531840345,
            "sbg:revisionNotes": "*.alt correction",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1531844984,
            "sbg:revisionNotes": "docs",
            "sbg:revision": 3
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "script": "{\n  reference_file = $job.inputs.reference.path.split('/')[$job.inputs.reference.path.split('/').length-1]\n  ext = reference_file.split('.')[reference_file.split('.').length-1]\n  if(ext=='tar' || !$job.inputs.bwt_construction){\n    return ''\n  } else {\n    return '-a ' + $job.inputs.bwt_construction\n  }\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true
          },
          {
            "valueFrom": {
              "script": "{\n  reference_file = $job.inputs.reference.path.split('/')[$job.inputs.reference.path.split('/').length-1]\n  ext = reference_file.split('.')[reference_file.split('.').length-1]\n  if(ext=='tar' || !$job.inputs.prefix){\n    return ''\n  } else {\n    return '-p ' + $job.inputs.prefix\n  }\n}\n",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true
          },
          {
            "valueFrom": {
              "script": "{\n  reference_file = $job.inputs.reference.path.split('/')[$job.inputs.reference.path.split('/').length-1]\n  ext = reference_file.split('.')[reference_file.split('.').length-1]\n  if(ext=='tar' || !$job.inputs.block_size){\n    return ''\n  } else {\n    return '-b ' + $job.inputs.block_size\n  }\n}\n\n",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true
          },
          {
            "valueFrom": {
              "script": "{\n  reference_file = $job.inputs.reference.path.split('/')[$job.inputs.reference.path.split('/').length-1]\n  ext = reference_file.split('.')[reference_file.split('.').length-1]\n  if(ext=='tar' || !$job.inputs.add_64_to_fasta_name){\n    return ''\n  } else {\n    return '-6 '\n  }\n}\n",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true
          },
          {
            "valueFrom": {
              "script": "{\n  reference_file = $job.inputs.reference.path.split('/')[$job.inputs.reference.path.split('/').length-1]\n  ext = reference_file.split('.')[reference_file.split('.').length-1]\n  if(ext=='tar'){\n    return ''\n  }\n  else{\n    extensions = ' *.amb' + ' *.ann' + ' *.bwt' + ' *.pac' + ' *.sa'\n    if(!$job.inputs.do_not_add_alt_contig_to_reference){\n      if (reference_file.search('38') >= 0){\n        extensions = extensions + ' *.alt ; '\n      }\n    }\n    tar_cmd = 'tar -cf ' + reference_file + '.tar ' + reference_file + extensions\n    return ' ; ' + tar_cmd\n  }\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true
          }
        ],
        "sbg:project": "vladimirk/bwa-mem-bundle-0-7-17-demo",
        "inputs": [
          {
            "id": "#total_memory",
            "label": "Total memory [Gb]",
            "sbg:category": "Configuration",
            "required": false,
            "type": [
              "null",
              "int"
            ],
            "description": "Total memory [GB] to be reserved for the tool (Default value is 1.5 x size_of_the_reference)."
          },
          {
            "sbg:fileTypes": "FASTA,FA,FA.GZ,FASTA.GZ,TAR",
            "label": "Reference",
            "sbg:category": "File input",
            "required": true,
            "id": "#reference",
            "type": [
              "File"
            ],
            "description": "Input reference fasta of TAR file with reference and indices.",
            "sbg:stageInput": "link"
          },
          {
            "id": "#prefix_of_the_index_to_be_output",
            "label": "Prefix of the index to be output",
            "sbg:category": "Configuration",
            "required": false,
            "type": [
              "null",
              "string"
            ],
            "description": "Prefix of the index [same as fasta name]."
          },
          {
            "description": "Do not add alt contigs file to TAR bundle.",
            "label": "Do not add alt contigs file to TAR bundle",
            "required": false,
            "type": [
              "null",
              "boolean"
            ],
            "id": "#do_not_add_alt_contig_to_reference",
            "sbg:toolDefaultValue": "False",
            "sbg:stageInput": null
          },
          {
            "id": "#bwt_construction",
            "description": "Algorithm for constructing BWT index. Available options are:s\tIS linear-time algorithm for constructing suffix array. It requires 5.37N memory where N is the size of the database. IS is moderately fast, but does not work with database larger than 2GB. IS is the default algorithm due to its simplicity. The current codes for IS algorithm are reimplemented by Yuta Mori. bwtsw\tAlgorithm implemented in BWT-SW. This method works with the whole human genome. Warning: `-a bwtsw' does not work for short genomes, while `-a is' and `-a div' do not work not for long genomes.",
            "label": "Bwt construction",
            "sbg:category": "Configuration",
            "required": false,
            "type": [
              "null",
              {
                "name": "bwt_construction",
                "symbols": [
                  "bwtsw",
                  "is",
                  "div"
                ],
                "type": "enum"
              }
            ],
            "sbg:toolDefaultValue": "auto"
          },
          {
            "id": "#block_size",
            "description": "Block size for the bwtsw algorithm (effective with -a bwtsw).",
            "label": "Block size",
            "sbg:category": "Configuration",
            "required": false,
            "type": [
              "null",
              "int"
            ],
            "sbg:toolDefaultValue": "10000000"
          },
          {
            "id": "#add_64_to_fasta_name",
            "label": "Output index files renamed by adding 64",
            "sbg:category": "Configuration",
            "required": false,
            "type": [
              "null",
              "boolean"
            ],
            "description": "Index files named as <in.fasta>64 instead of <in.fasta>.*."
          }
        ],
        "appUrl": "/u/vladimirk/bwa-mem-bundle-0-7-17-demo/apps/#vladimirk/bwa-mem-bundle-0-7-17-demo/bwa-index/3",
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "http://bio-bwa.sourceforge.net/",
            "label": "Homepage"
          },
          {
            "id": "https://github.com/lh3/bwa",
            "label": "Source code"
          },
          {
            "id": "http://bio-bwa.sourceforge.net/bwa.shtml",
            "label": "Wiki"
          },
          {
            "id": "http://sourceforge.net/projects/bio-bwa/",
            "label": "Download"
          },
          {
            "id": "http://www.ncbi.nlm.nih.gov/pubmed/19451168",
            "label": "Publication"
          }
        ],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkitVersion": "0.7.17",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "sbg:toolAuthor": "Heng Li",
        "sbg:projectName": "BWA MEM Bundle 0.7.17 - Demo",
        "baseCommand": [
          {
            "script": "{\n  reference_file = $job.inputs.reference.path.split('/')[$job.inputs.reference.path.split('/').length-1]\n  ext = reference_file.split('.')[reference_file.split('.').length-1]\n  if(ext=='tar'){\n    return 'echo Index files passed without any processing!'\n  }\n  else{\n    \n    cp_alt_cmd = ''\n\n    if(!$job.inputs.do_not_add_alt_contig_to_reference){\n      if (reference_file.search('38') >= 0){\n        cp_alt_cmd = 'cp /opt/hs38DH.fa.alt ' + reference_file + '.alt ; '\n      }\n    }\n    \n    index_cmd = 'bwa index '+ reference_file + ' '\n    \n    return cp_alt_cmd + index_cmd\n  }\n}",
            "class": "Expression",
            "engine": "#cwl-js-engine"
          }
        ],
        "stdin": "",
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "vladimirk",
        "outputs": [
          {
            "sbg:fileTypes": "TAR",
            "label": "TARed fasta with its BWA indices",
            "id": "#indexed_reference",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#reference",
              "glob": {
                "script": "{\n  reference_file = $job.inputs.reference.path.split('/')[$job.inputs.reference.path.split('/').length-1]\n  ext = reference_file.split('.')[reference_file.split('.').length-1]\n  if(ext=='tar'){\n    return reference_file\n  }\n  else{\n    return reference_file + '.tar'\n  }\n}\n",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:metadata": {
                "reference": {
                  "script": "{\n  path = [].concat($job.inputs.reference)[0].path.split('/')\n  last = path.pop()\n  return last\n}",
                  "class": "Expression",
                  "engine": "#cwl-js-engine"
                }
              }
            },
            "type": [
              "null",
              "File"
            ],
            "description": "TARed fasta with its BWA indices."
          }
        ],
        "label": "BWA INDEX 0.7.17",
        "sbg:createdOn": 1531828242,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": 24.88164147595475,
        "sbg:license": "GNU Affero General Public License v3.0, MIT License",
        "sbg:contributors": [
          "vladimirk"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "temporaryFailCodes": [],
        "id": "vladimirk/bwa-mem-bundle-0-7-17-demo/bwa-index/3",
        "description": "BWA INDEX constructs the FM-index (Full-text index in Minute space) for the reference genome.\nGenerated index files will be used with BWA MEM, BWA ALN, BWA SAMPE and BWA SAMSE tools.\n\nIf input reference file has TAR extension it is assumed that BWA indices came together with it. BWA INDEX will only pass that TAR to the output. If input is not TAR, the creation of BWA indices and its packing in TAR file (together with the reference) will be performed.\n\nTAR also contains alt reference from bwa.kit suggested by the author of the tool.",
        "sbg:toolkit": "BWA",
        "sbg:image_url": null,
        "sbg:revisionNotes": "docs",
        "sbg:revision": 3,
        "sbg:categories": [
          "Indexing",
          "FASTA-Processing"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1531844984,
        "sbg:id": "h-6396b527/h-254804c6/h-26e32fcf/0",
        "stdout": ""
      },
      "id": "#BWA_INDEX_1",
      "sbg:y": 24.88164147595475
    },
    {
      "sbg:x": 648.000050389326,
      "inputs": [
        {
          "source": [
            "#SBG_FASTQ_Quality_Adjuster.result"
          ],
          "id": "#SBG_Pair_FASTQs_by_Metadata.fastq_list"
        }
      ],
      "outputs": [
        {
          "id": "#SBG_Pair_FASTQs_by_Metadata.tuple_list"
        }
      ],
      "run": {
        "sbg:sbgMaintained": false,
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "bix-demo",
        "sbg:revisionNotes": "Fix for outputEval evaluation failed. Changed map getting to map[a] instead of map.a",
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/nikola_jovanovic/alpine:1",
            "dockerImageId": "d41a0837ab81"
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          },
          {
            "class": "sbg:MemRequirement",
            "value": 1024
          }
        ],
        "sbg:toolAuthor": "",
        "sbg:latestRevision": 14,
        "sbg:publisher": "sbg",
        "sbg:categories": [
          "Converters",
          "Other"
        ],
        "sbg:createdOn": 1450911289,
        "successCodes": [],
        "sbg:validationErrors": [],
        "sbg:cmdPreview": "echo 'Pairing FASTQs!'",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 1024
          },
          "inputs": {
            "fastq_list": [
              {
                "path": "/asda/dsa/sda/sda/fasta1.fastq",
                "class": "File",
                "size": 0,
                "secondaryFiles": [],
                "metadata": {
                  "sample_id": "a",
                  "paired_end": "1"
                }
              },
              {
                "path": "/asda/dsa/sda/sda/fasta2.fastq",
                "secondaryFiles": [],
                "metadata": {
                  "sample_id": "a",
                  "paired_end": "2"
                }
              },
              {
                "path": "/asda/dsa/sda/sda/fasta3.fastq",
                "secondaryFiles": [],
                "metadata": {
                  "sample_id": "b",
                  "paired_end": ""
                }
              }
            ]
          }
        },
        "sbg:license": "Apache License 2.0",
        "outputs": [
          {
            "sbg:fileTypes": "FASTQ,FQ,FASTQ.GZ,FQ.GZ",
            "label": "List of grouped FASTQ files",
            "type": [
              "null",
              {
                "items": "File",
                "type": "array"
              }
            ],
            "outputBinding": {
              "outputEval": {
                "class": "Expression",
                "script": "{\n    function get_meta_map(m, file, meta) {\n        if (meta in file.metadata) {\n            return m[file.metadata[meta]]\n        } else {\n            return m['Undefined']\n        }\n    }\n\n    function create_new_map(map, file, meta) {\n        if (meta in file.metadata) {\n            map[file.metadata[meta]] = {}\n            return map[file.metadata[meta]]\n        } else {\n            map['Undefined'] = {}\n            return map['Undefined']\n        }\n    }\n\n    arr = [].concat($job.inputs.fastq_list)\n    map = {}\n\n    for (i in arr) {\n\n        sm_map = get_meta_map(map, arr[i], 'sample_id')\n        if (!sm_map) sm_map = create_new_map(map, arr[i], 'sample_id')\n\n        lb_map = get_meta_map(sm_map, arr[i], 'library_id')\n        if (!lb_map) lb_map = create_new_map(sm_map, arr[i], 'library_id')\n\n        pu_map = get_meta_map(lb_map, arr[i], 'platform_unit_id')\n        if (!pu_map) pu_map = create_new_map(lb_map, arr[i], 'platform_unit_id')\n\n        if ('file_segment_number' in arr[i].metadata) {\n            if (pu_map[arr[i].metadata['file_segment_number']]) {\n                a = pu_map[arr[i].metadata['file_segment_number']]\n                ar = [].concat(a)\n                ar = ar.concat(arr[i])\n                pu_map[arr[i].metadata['file_segment_number']] = ar\n            } else {\n              pu_map[arr[i].metadata['file_segment_number']] = [].concat(arr[i])\n            }\n        } else {\n            if (pu_map['Undefined']) {\n                a = pu_map['Undefined']\n                ar = [].concat(a)\n                ar = ar.concat(arr[i])\n                pu_map['Undefined'] = ar\n            } else {\n                pu_map['Undefined'] = [].concat(arr[i])\n            }\n        }\n    }\n    tuple_list = []\n    for (sm in map)\n        for (lb in map[sm])\n            for (pu in map[sm][lb]) {\n                for (fsm in map[sm][lb][pu]) {\n                    list = map[sm][lb][pu][fsm]\n                    tuple_list.push(list)\n                }\n            }\n    return tuple_list\n}\n",
                "engine": "#cwl-js-engine"
              }
            },
            "id": "#tuple_list",
            "description": "List of grouped FASTQ files by metadata fields."
          }
        ],
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1450911289,
            "sbg:revisionNotes": null,
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1450911290,
            "sbg:revisionNotes": null,
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1450911290,
            "sbg:revisionNotes": null,
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1463403276,
            "sbg:revisionNotes": null,
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "markop",
            "sbg:modifiedOn": 1469015151,
            "sbg:revisionNotes": "Link fastq_list",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1472059795,
            "sbg:revisionNotes": "Added support for single file.",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1489510320,
            "sbg:revisionNotes": null,
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1489665046,
            "sbg:revisionNotes": null,
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1498052477,
            "sbg:revisionNotes": "Fixed a typo.",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1504713791,
            "sbg:revisionNotes": "Fix - error message will appear if files are grouped but have no metadata.",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1505480936,
            "sbg:revisionNotes": "Changed order of pairings (pe1,pe2).",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1508759852,
            "sbg:revisionNotes": "Changed to JavaScript",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1530873664,
            "sbg:revisionNotes": "Changed docker image to images.sbgenomics.com.",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1538404498,
            "sbg:revisionNotes": "JS fix for cwl 1.0",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1547648917,
            "sbg:revisionNotes": "Fix for outputEval evaluation failed. Changed map getting to map[a] instead of map.a",
            "sbg:revision": 14
          }
        ],
        "x": 648.000050389326,
        "arguments": [],
        "sbg:contributors": [
          "bix-demo",
          "markop",
          "nikola_jovanovic",
          "vladimirk"
        ],
        "sbg:project": "bix-demo/sbgtools-demo",
        "inputs": [
          {
            "sbg:fileTypes": "FASTQ, FQ, FASTQ.GZ, FQ.GZ",
            "label": "List of FASTQ files",
            "required": true,
            "type": [
              {
                "items": "File",
                "type": "array"
              }
            ],
            "id": "#fastq_list",
            "description": "List of the FASTQ files with properly set metadata fileds.",
            "sbg:stageInput": "link"
          }
        ],
        "sbg:revision": 14,
        "sbg:content_hash": "aef49e72a7e4f23956e043c94a8a2279dfe32824fde935a0e69f66c608e52ba31",
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": "",
        "temporaryFailCodes": [],
        "id": "bix-demo/sbgtools-demo/sbg-pair-fastqs-by-metadata/14",
        "description": "Tool accepts list of FASTQ files groups them into separate lists. This grouping is done using metadata values and their hierarchy (Sample ID > Library ID > Platform unit ID > File segment number) which should create unique combinations for each pair of FASTQ files. Important metadata fields are Sample ID, Library ID, Platform unit ID and File segment number. Not all of these four metadata fields are required, but the present set has to be sufficient to create unique combinations for each pair of FASTQ files. Files with no paired end metadata are grouped in the same way as the ones with paired end metadata, generally they should be alone in a separate list. Files with no metadata set will be grouped together. \n\nIf there are more than two files in a group, this might create errors further down most pipelines and the user should check if the metadata fields for those files are set properly.",
        "sbg:modifiedBy": "nikola_jovanovic",
        "sbg:toolkit": "SBGTools",
        "sbg:image_url": null,
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "label": "SBG Pair FASTQs by Metadata",
        "sbg:projectName": "SBGTools - Demo New",
        "cwlVersion": "sbg:draft-2",
        "baseCommand": [
          "echo",
          "'Pairing",
          "FASTQs!'"
        ],
        "sbg:id": "admin/sbg-public-data/sbg-pair-fastqs-by-metadata/16",
        "sbg:modifiedOn": 1547648917,
        "class": "CommandLineTool",
        "y": 176.50462021241339,
        "stdin": ""
      },
      "id": "#SBG_Pair_FASTQs_by_Metadata",
      "sbg:y": 176.50462021241339
    },
    {
      "sbg:x": 985.4770126664764,
      "inputs": [
        {
          "source": [
            "#SBG_Untar_fasta.output_fasta"
          ],
          "id": "#SBG_FASTA_Indices.reference"
        },
        {
          "id": "#SBG_FASTA_Indices.memory_per_job"
        }
      ],
      "outputs": [
        {
          "id": "#SBG_FASTA_Indices.fasta_reference"
        },
        {
          "id": "#SBG_FASTA_Indices.fasta_index"
        },
        {
          "id": "#SBG_FASTA_Indices.fasta_dict"
        }
      ],
      "run": {
        "sbg:sbgMaintained": false,
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "bix-demo",
        "sbg:revisionNotes": "Reverted.",
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/nikola_jovanovic/samtoolspicard:1.0",
            "dockerImageId": "b177f5bd06db"
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "script": "{\n  if($job.inputs.memory_per_job)return $job.inputs.memory_per_job + 500\n  else return 2548\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          }
        ],
        "label": "SBG FASTA Indices",
        "sbg:latestRevision": 14,
        "id": "bix-demo/sbgtools-demo/sbg-fasta-indices/14",
        "sbg:categories": [
          "Indexing"
        ],
        "sbg:createdOn": 1450911283,
        "successCodes": [],
        "sbg:validationErrors": [],
        "sbg:cmdPreview": "samtools faidx  /path/to/reference.fa.gz && java -Xmx10M -jar /opt/picard.jar CreateSequenceDictionary R=/path/to/reference.fa.gz O=reference.dict",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 510
          },
          "inputs": {
            "reference": {
              "path": "/path/to/reference.fa.gz",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "memory_per_job": 10
          }
        },
        "sbg:license": "Apache License 2.0",
        "outputs": [
          {
            "type": [
              "null",
              "File"
            ],
            "sbg:fileTypes": "FASTA",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#reference",
              "glob": {
                "script": "{\n  return $job.inputs.reference.path.split('/').pop()\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "secondaryFiles": [
                ".fai",
                "^.dict",
                "^^.dict"
              ]
            },
            "id": "#fasta_reference",
            "label": "Reference"
          },
          {
            "type": [
              "null",
              "File"
            ],
            "sbg:fileTypes": "FAI",
            "outputBinding": {
              "glob": "*.fai",
              "sbg:metadata": {}
            },
            "id": "#fasta_index",
            "label": "FASTA Index"
          },
          {
            "type": [
              "null",
              "File"
            ],
            "sbg:fileTypes": "DICT",
            "outputBinding": {
              "glob": "*.dict",
              "sbg:metadata": {}
            },
            "id": "#fasta_dict",
            "label": "FASTA Dictionary"
          }
        ],
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1450911283,
            "sbg:revisionNotes": null,
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1450911283,
            "sbg:revisionNotes": null,
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1458655251,
            "sbg:revisionNotes": null,
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "bix-demo",
            "sbg:modifiedOn": 1458655509,
            "sbg:revisionNotes": null,
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "markop",
            "sbg:modifiedOn": 1458658019,
            "sbg:revisionNotes": null,
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "markop",
            "sbg:modifiedOn": 1458669249,
            "sbg:revisionNotes": null,
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1504530329,
            "sbg:revisionNotes": "Removed python script. Changed docker to just samtools and picard. Wrapped both faidx and CreateSequenceDictionary and exposed memory parameter for java execution.",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1506419953,
            "sbg:revisionNotes": "Changed join to join('.').",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1519907048,
            "sbg:revisionNotes": "Added support for FA.GZ, FASTA.GZ",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1519909639,
            "sbg:revisionNotes": "Added secondary .dict support for fasta.gz",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1528989492,
            "sbg:revisionNotes": "returned to rev 8",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1528990550,
            "sbg:revisionNotes": "rev 7",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1528991971,
            "sbg:revisionNotes": "rev 9: Added secondary .dict support",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1539180036,
            "sbg:revisionNotes": "Updated version for samtools (1.9) and picard (2.18.14)",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1539181752,
            "sbg:revisionNotes": "Reverted.",
            "sbg:revision": 14
          }
        ],
        "x": 985.4770126664764,
        "arguments": [
          {
            "valueFrom": {
              "script": "{\n  memory = '2048'\n  if ($job.inputs.memory_per_job){\n    memory = $job.inputs.memory_per_job\n  }\n  filename = $job.inputs.reference.path.split('/').pop()\n  basename = filename.split('.')\n  if (filename.endsWith('.gz')){\n    basename.pop()\n  }\n  basename.pop()\n  name = basename.join('.')\n  return 'java -Xmx' + memory + 'M -jar /opt/picard.jar CreateSequenceDictionary R=' + $job.inputs.reference.path + ' O=' + name + '.dict'\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "prefix": "&&",
            "position": 1
          }
        ],
        "sbg:contributors": [
          "vladimirk",
          "markop",
          "bix-demo",
          "nikola_jovanovic"
        ],
        "sbg:project": "bix-demo/sbgtools-demo",
        "inputs": [
          {
            "sbg:fileTypes": "FASTA,FA,FA.GZ,FASTA.GZ",
            "label": "FASTA file",
            "sbg:category": "Input files",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 0
            },
            "id": "#reference",
            "required": true,
            "type": [
              "File"
            ],
            "description": "FASTA file to be indexed",
            "sbg:stageInput": "link"
          },
          {
            "id": "#memory_per_job",
            "label": "Memory per job",
            "sbg:category": "Execution",
            "sbg:toolDefaultValue": "2048",
            "type": [
              "null",
              "int"
            ],
            "description": "Memory in megabytes required for each execution of the tool."
          }
        ],
        "sbg:revision": 14,
        "sbg:content_hash": null,
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": "",
        "temporaryFailCodes": [],
        "sbg:publisher": "sbg",
        "description": "Tool allows creating FASTA dictionary and index simultaneously which is necessary for running GATK tools. This version of tool for indexing uses SAMtools faidx command (toolkit version 1.9), while for the FASTA dictionary is used Picard CreateFastaDictionary (toolkit version 2.18.14)",
        "sbg:modifiedBy": "nikola_jovanovic",
        "sbg:toolkit": "SBGTools",
        "sbg:image_url": null,
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "sbg:toolAuthor": "Sanja Mijalkovic, Seven Bridges Genomics, <sanja.mijalkovic@sbgenomics.com>",
        "sbg:projectName": "SBGTools - Demo New",
        "cwlVersion": "sbg:draft-2",
        "baseCommand": [
          "samtools",
          "faidx"
        ],
        "sbg:id": "admin/sbg-public-data/sbg-fasta-indices/21",
        "sbg:modifiedOn": 1539181752,
        "class": "CommandLineTool",
        "y": -162.33342109786471,
        "stdin": ""
      },
      "id": "#SBG_FASTA_Indices",
      "sbg:y": -162.33342109786471
    },
    {
      "sbg:x": 2324.332869345963,
      "inputs": [
        {
          "id": "#Tabix_BGZIP.suffix_append"
        },
        {
          "source": [
            "#GATK_MergeVcfs_1.output"
          ],
          "id": "#Tabix_BGZIP.input_file"
        },
        {
          "id": "#Tabix_BGZIP.decompress"
        }
      ],
      "outputs": [
        {
          "id": "#Tabix_BGZIP.output_file"
        }
      ],
      "run": {
        "x": 2324.332869345963,
        "hints": [
          {
            "class": "sbg:CPURequirement",
            "value": 1
          },
          {
            "class": "sbg:MemRequirement",
            "value": 1000
          },
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/nevenam/tabixbgzip:0.2.6",
            "dockerImageId": ""
          }
        ],
        "sbg:latestRevision": 11,
        "sbg:cmdPreview": "/opt/samtools-1.3/tabix-0.2.6/bgzip  -c -f /path/to/input_vcf_file.vcf  > input_vcf_file.vcf.gz",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 1000
          },
          "inputs": {
            "suffix_append": false,
            "input_file": {
              "path": "/path/to/input_vcf_file.vcf",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "decompress": false
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "nevenam.sudo",
            "sbg:modifiedOn": 1458920859,
            "sbg:revisionNotes": null,
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "nevenam.sudo",
            "sbg:modifiedOn": 1458920968,
            "sbg:revisionNotes": null,
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "nevenam.sudo",
            "sbg:modifiedOn": 1462790441,
            "sbg:revisionNotes": null,
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1469092031,
            "sbg:revisionNotes": null,
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1470066112,
            "sbg:revisionNotes": null,
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1489579092,
            "sbg:revisionNotes": null,
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1489579236,
            "sbg:revisionNotes": "input_file can be an array of one file (javascript); decompress==undefined is threated as false value; .tab is added as additional extension for compression (.tab.vcf.gz, corrected)",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1500286251,
            "sbg:revisionNotes": "output file format updated",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1500984378,
            "sbg:revisionNotes": "added -c to gzip command",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1500998041,
            "sbg:revisionNotes": "changed | to ;",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "Makragic",
            "sbg:modifiedOn": 1511273331,
            "sbg:revisionNotes": "Output file now inherits metadata.",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "nevenam",
            "sbg:modifiedOn": 1536916600,
            "sbg:revisionNotes": null,
            "sbg:revision": 11
          }
        ],
        "arguments": [],
        "sbg:project": "bix-demo/tabix-0-2-6-demo",
        "inputs": [
          {
            "label": "Suffix append",
            "sbg:category": "Input Configuration",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#suffix_append",
            "description": "Suffix append (if set to True, '.tab' is added as an additional suffix to the output file name). If not set or set to False, it is not added.",
            "sbg:stageInput": null
          },
          {
            "sbg:fileTypes": "VCF,VCF.GZ,GFF,GFF.GZ,BED,BED.GZ,SAM,SAM.GZ,PSLTAB,PSLTAB.GZ",
            "label": "Input file",
            "sbg:category": "File inputs",
            "type": [
              "File"
            ],
            "required": true,
            "id": "#input_file",
            "description": "Input file to be compressed/decompressed."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Decompress input file",
            "sbg:category": "Configuration",
            "sbg:toolDefaultValue": "false",
            "id": "#decompress",
            "description": "Decompress input file."
          }
        ],
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "http://www.htslib.org/",
            "label": "Homepage"
          },
          {
            "id": "https://github.com/samtools/htslib/tree/master",
            "label": "Source Code"
          },
          {
            "id": "http://www.htslib.org/doc/#manual-pages",
            "label": "Wiki"
          },
          {
            "id": "http://sourceforge.net/projects/samtools/files/tabix/tabix-0.2.5.tar.bz2/download",
            "label": "Download"
          },
          {
            "id": "http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3042176/",
            "label": "Publication"
          },
          {
            "id": "http://www.htslib.org/doc/#manual-pages",
            "label": "Documentation"
          }
        ],
        "sbg:modifiedBy": "nevenam",
        "sbg:toolkitVersion": "0.2.6",
        "stdin": "",
        "sbg:toolAuthor": "Heng Li -  Broad Institue",
        "sbg:projectName": "Tabix 0.2.6 - Demo New",
        "baseCommand": [
          {
            "script": "{\n  com=''\n  filename=''\n  if($job.inputs.input_file instanceof Array)\n    filename=$job.inputs.input_file[0].path\n  else\n    filename=$job.inputs.input_file.path\n    \n  paths=filename.split('/')\n  names=filename.split('/')[paths.length-1].split('.')\n  \n  name=filename\n  if((filename.charAt(filename.length-3)+filename.charAt(filename.length-2)+filename.charAt(filename.length-1))\n     =='.gz' && ($job.inputs.decompress==false || $job.inputs.decompress==undefined))\n  {\n    com+='gzip -d -c '\n    com+=filename\n    com+='>'\n    com+=filename.split('/')[paths.length-1].substring(0, (filename.split('/')[paths.length-1].length)-3)\n    com+=' ; '\n    name=filename.split('/')[paths.length-1].substring(0, (filename.split('/')[paths.length-1].length)-3)\n  }\n  com+='/opt/samtools-1.3/tabix-0.2.6/bgzip '\n  com+=' -c -f '\n  if($job.inputs.decompress==true)\n  {\n    com+='-d '\n  }\n  com+=name\n  return com\n}",
            "class": "Expression",
            "engine": "#cwl-js-engine"
          }
        ],
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "nevenam.sudo",
        "outputs": [
          {
            "sbg:fileTypes": "VCF.GZ,VCF,BED.GZ,BED,GFF.GZ,GFF,SAM.GZ,SAM,PSLTAB.GZ,PSLTAB",
            "label": "Compressed or decompressed file",
            "type": [
              "null",
              "File"
            ],
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#input_file",
              "glob": {
                "script": "{\n  filename=''\n  if($job.inputs.input_file instanceof Array)\n    filename=$job.inputs.input_file[0].path\n  else\n    filename=$job.inputs.input_file.path\n  \n  paths=filename.split('/')\n  names=filename.split('/')[paths.length-1].split('.')\n  \n  nn=''\n  if($job.inputs.decompress)\n  {\n    lind=names.length-1\n  }\n  else if((filename.charAt(filename.length-3)+filename.charAt(filename.length-2)+filename.charAt(filename.length-1))\n     =='.gz' && ($job.inputs.decompress==false || $job.inputs.decompress==undefined))\n    \n  {\n    lind=names.length-1\n  }\n  else\n  {\n    lind=names.length\n  }\n  for(i=0; i<lind; i++)\n  {\n    if(i!=0)\n      nn+='.'\n    nn+=names[i]\n    if((filename.charAt(filename.length-3)+filename.charAt(filename.length-2)+filename.charAt(filename.length-1))\n     =='.gz' && ($job.inputs.decompress==false || $job.inputs.decompress==undefined) && i==0)\n      nn+='.tab'\n    else if (($job.inputs.decompress==false || $job.inputs.decompress==undefined) && i==0 && $job.inputs.suffix_append == true)\n      nn+='.tab'\n  }\n  \n  if($job.inputs.decompress)\n  {\n    return nn\n  }\n  else\n  {\n    return nn+'.gz'\n  }\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              }
            },
            "id": "#output_file",
            "description": "Compressed or decompressed file."
          }
        ],
        "label": "Tabix BGZIP",
        "sbg:createdOn": 1458920859,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": 725.4372737296035,
        "sbg:license": "MIT/Expat License",
        "sbg:contributors": [
          "Makragic",
          "nevenam",
          "nevenam.sudo"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": {
          "script": "{\n  filename=''\n  if($job.inputs.input_file instanceof Array)\n    filename=$job.inputs.input_file[0].path\n  else\n    filename=$job.inputs.input_file.path\n    \n  paths=filename.split('/')\n  names=filename.split('/')[paths.length-1].split('.')\n  \n  nn=''\n  if($job.inputs.decompress)\n  {\n    lind=names.length-1\n  }\n  else if((filename.charAt(filename.length-3)+filename.charAt(filename.length-2)+filename.charAt(filename.length-1))\n     =='.gz' && ($job.inputs.decompress==false || $job.inputs.decompress==undefined))\n    \n  {\n    lind=names.length-1\n  }\n  else\n  {\n    lind=names.length\n  }\n  for(i=0; i<lind; i++)\n  {\n    if(i!=0)\n      nn+='.'\n    nn+=names[i]\n    if((filename.charAt(filename.length-3)+filename.charAt(filename.length-2)+filename.charAt(filename.length-1))\n     =='.gz' && ($job.inputs.decompress==false || $job.inputs.decompress==undefined) && i==0)\n      nn+='.tab'\n    else if (($job.inputs.decompress==false || $job.inputs.decompress==undefined) && i==0 && $job.inputs.suffix_append == true)\n      nn+='.tab'\n  }\n  \n  if($job.inputs.decompress)\n  {\n    return nn\n  }\n  else\n  {\n    return nn+'.gz'\n  }\n}",
          "class": "Expression",
          "engine": "#cwl-js-engine"
        },
        "id": "bix-demo/tabix-0-2-6-demo/tabix-bgzip-v0-2-6/11",
        "description": "Tabix BGZIP is used for compressing/decompressing (BAM, VCF, BED, ...) any file (can handle only single file on input; list of files should be handled with scatter method) in BGZF and from BGZF format.",
        "sbg:content_hash": null,
        "sbg:toolkit": "Tabix",
        "sbg:image_url": null,
        "sbg:revisionNotes": null,
        "sbg:revision": 11,
        "sbg:categories": [
          "Other"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1536916600,
        "sbg:id": "admin/sbg-public-data/tabix-bgzip-v0-2-6/11",
        "temporaryFailCodes": []
      },
      "id": "#Tabix_BGZIP",
      "sbg:y": 725.4372737296035
    },
    {
      "sbg:x": 996.6666859918168,
      "inputs": [
        {
          "id": "#BWA_MEM_Bundle_0_7_17.wgs_hg38_mode_threads",
          "default": 25
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.verbose_level"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.use_soft_clipping",
          "default": true
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.unpaired_read_penalty"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.total_memory"
        },
        {
          "source": [
            "#threads"
          ],
          "id": "#BWA_MEM_Bundle_0_7_17.threads",
          "default": 36
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.split_alignment_primary"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.speficy_distribution_parameters"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.sort_memory",
          "default": 5
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.smart_pairing_in_input_fastq"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.skip_seeds"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.skip_pairing"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.skip_mate_rescue"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.select_seeds"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.seed_occurrence_for_the_3rd_round"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.score_for_a_sequence_match"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.rg_sample_id"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.rg_platform_unit_id"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.rg_platform"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.rg_median_fragment_length"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.rg_library_id"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.rg_id"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.rg_data_submitting_center"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.reserved_threads",
          "default": 20
        },
        {
          "source": [
            "#BWA_INDEX_1.indexed_reference"
          ],
          "id": "#BWA_MEM_Bundle_0_7_17.reference_index_tar"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.read_type"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.read_group_header"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.output_name"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.output_in_xa"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.output_header"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.output_format",
          "default": "Coordinate Sorted BAM"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.output_alignments"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.num_input_bases_in_each_batch"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.mismatch_penalty"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.minimum_seed_length"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.minimum_output_score"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.mate_rescue_rounds"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.mark_shorter"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.mapQ_of_suplementary"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.insert_string_to_header"
        },
        {
          "source": [
            "#SBG_Pair_FASTQs_by_Metadata.tuple_list"
          ],
          "id": "#BWA_MEM_Bundle_0_7_17.input_reads"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.ignore_alt_file"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.gap_open_penalties"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.gap_extension_penalties"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.filter_out_secondary_alignments"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.dropoff"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.drop_chains_fraction"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.discard_exact_matches"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.discard_chain_length"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.deduplication",
          "default": "RemoveDuplicates"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.clipping_penalty"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.band_width"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.append_comment"
        }
      ],
      "outputs": [
        {
          "id": "#BWA_MEM_Bundle_0_7_17.dups_metrics"
        },
        {
          "id": "#BWA_MEM_Bundle_0_7_17.aligned_reads"
        }
      ],
      "scatter": "#BWA_MEM_Bundle_0_7_17.input_reads",
      "run": {
        "x": 996.6666859918168,
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/vladimirk/bwa_biobambam2:0.7.17",
            "dockerImageId": ""
          },
          {
            "class": "sbg:CPURequirement",
            "value": {
              "script": "{  \n  // Calculate suggested number of CPUs depending of the input reads size\n  if ($job.inputs.input_reads.constructor == Array){\n    if ($job.inputs.input_reads[1]){\n      reads_size = $job.inputs.input_reads[0].size + $job.inputs.input_reads[1].size\n    } else{\n      reads_size = $job.inputs.input_reads[0].size\n    }\n  }\n  else{\n    reads_size = $job.inputs.input_reads.size\n  }\n  if(!reads_size) { reads_size = 0 }\n\n\n  GB_1 = 1024*1024*1024\n  if(reads_size < GB_1){ suggested_cpus = 1 }\n  else if(reads_size < 10 * GB_1){ suggested_cpus = 8 }\n  else { suggested_cpus = 31 }\n  \n  if($job.inputs.reserved_threads){ return $job.inputs.reserved_threads }\n  else if($job.inputs.threads){ return $job.inputs.threads } \n  else if($job.inputs.sambamba_threads) { return $job.inputs.sambamba_threads }\n  else{    return suggested_cpus  }\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "script": "{  \n\n  // Calculate suggested number of CPUs depending of the input reads size\n  if ($job.inputs.input_reads.constructor == Array){\n    if ($job.inputs.input_reads[1]){\n      reads_size = $job.inputs.input_reads[0].size + $job.inputs.input_reads[1].size\n    } else{\n      reads_size = $job.inputs.input_reads[0].size\n    }\n  }\n  else{\n    reads_size = $job.inputs.input_reads.size\n  }\n  if(!reads_size) { reads_size = 0 }\n \n  GB_1 = 1024*1024*1024\n  if(reads_size < GB_1){ suggested_memory = 4 }\n  else if(reads_size < 10 * GB_1){ suggested_memory = 15 }\n  else { suggested_memory = 58 }\n  \n  if($job.inputs.total_memory){  \t\n    return  $job.inputs.total_memory* 1024  \n  } \n  else if($job.inputs.sort_memory){\n    return  $job.inputs.sort_memory* 1024\n  }\n  else{  \t\n    return suggested_memory * 1024  \n  }\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          }
        ],
        "sbg:latestRevision": 31,
        "sbg:cmdPreview": "/bin/bash -c \" export REF_CACHE=${PWD} ;  tar -tvf reference.HG38.fasta.gz.tar 1>&2; tar -xf reference.HG38.fasta.gz.tar ;  bwa mem  -R '@RG\\tID:1\\tPL:Illumina\\tSM:dnk_sample' -t 10  reference.HG38.fasta.gz  /path/to/LP6005524-DNA_C01_lane_7.sorted.converted.filtered.pe_2.gz /path/to/LP6005524-DNA_C01_lane_7.sorted.converted.filtered.pe_1.gz  | bamsormadup threads=8 level=1 tmplevel=-1 inputformat=sam outputformat=cram SO=coordinate reference=reference.HG38.fasta.gz indexfilename=LP6005524-DNA_C01_lane_7.sorted.converted.filtered.cram.crai M=LP6005524-DNA_C01_lane_7.sorted.converted.filtered.sormadup_metrics.log > LP6005524-DNA_C01_lane_7.sorted.converted.filtered.cram  ;declare -i pipe_statuses=(\\${PIPESTATUS[*]});len=\\${#pipe_statuses[@]};declare -i tot=0;echo \\${pipe_statuses[*]};for (( i=0; i<\\${len}; i++ ));do if [ \\${pipe_statuses[\\$i]} -ne 0 ];then tot=\\${pipe_statuses[\\$i]}; fi;done;if [ \\$tot -ne 0 ]; then >&2 echo Error in piping. Pipe statuses: \\${pipe_statuses[*]};fi; if [ \\$tot -ne 0 ]; then false;fi\"",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 4096
          },
          "inputs": {
            "band_width": null,
            "output_format": "CRAM",
            "wgs_hg38_mode_threads": 10,
            "sort_memory": null,
            "num_input_bases_in_each_batch": null,
            "skip_seeds": null,
            "rg_median_fragment_length": "",
            "deduplication": "RemoveDuplicates",
            "reference_index_tar": {
              "path": "/path/to/reference.HG38.fasta.gz.tar",
              "class": "File",
              "size": 0,
              "secondaryFiles": [
                {
                  "path": ".amb"
                },
                {
                  "path": ".ann"
                },
                {
                  "path": ".bwt"
                },
                {
                  "path": ".pac"
                },
                {
                  "path": ".sa"
                }
              ]
            },
            "output_name": "",
            "read_group_header": "",
            "threads": null,
            "reserved_threads": null,
            "total_memory": null,
            "rg_sample_id": "",
            "rg_library_id": "",
            "rg_platform_unit_id": "",
            "filter_out_secondary_alignments": false,
            "mapQ_of_suplementary": false,
            "rg_platform": null,
            "rg_id": "",
            "rg_data_submitting_center": "",
            "split_alignment_primary": false,
            "input_reads": [
              {
                "path": "/path/to/LP6005524-DNA_C01_lane_7.sorted.converted.filtered.pe_1.gz",
                "class": "File",
                "size": 30000000000,
                "secondaryFiles": [],
                "metadata": {
                  "platform": "HiSeq X Ten",
                  "sample_id": "dnk_sample",
                  "paired_end": "2"
                }
              },
              {
                "path": "/path/to/LP6005524-DNA_C01_lane_7.sorted.converted.filtered.pe_2.gz"
              }
            ],
            "mark_shorter": false
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1530796841,
            "sbg:revisionNotes": "Copy of vladimirk/bwa-mem-bundle-0-7-13-demo/bwa-mem-bundle-0-7-13/46",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1530798840,
            "sbg:revisionNotes": "init",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1530804573,
            "sbg:revisionNotes": "added biobambam2 sort",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1530804812,
            "sbg:revisionNotes": "dedup added",
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1530805386,
            "sbg:revisionNotes": "boolean inputs fixed",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1530806442,
            "sbg:revisionNotes": "output written with >",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1531825239,
            "sbg:revisionNotes": "sambamba and samblaster",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1531832638,
            "sbg:revisionNotes": "samblaster path corrected",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1531834946,
            "sbg:revisionNotes": "Added ALT Contig reference",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1531844922,
            "sbg:revisionNotes": "docs",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1531845530,
            "sbg:revisionNotes": "num_bases_reproducibility",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1532099074,
            "sbg:revisionNotes": "Do_not_use_alt_38 parameter removed due to redundancy",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1535109085,
            "sbg:revisionNotes": "Added new @RG options.",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535572773,
            "sbg:revisionNotes": "added bamsormadup",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535573623,
            "sbg:revisionNotes": "add 'inputformat=sam'",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535574191,
            "sbg:revisionNotes": "add 'cram output support and capture reference'",
            "sbg:revision": 15
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535574401,
            "sbg:revisionNotes": "capture output with + ' > ' + name + extension",
            "sbg:revision": 16
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535574812,
            "sbg:revisionNotes": "capturing cram output and dups metrics file",
            "sbg:revision": 17
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535575033,
            "sbg:revisionNotes": "add cram selection as an output format",
            "sbg:revision": 18
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535575693,
            "sbg:revisionNotes": "fix output_format options",
            "sbg:revision": 19
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535577792,
            "sbg:revisionNotes": "lower case outputformat=cram",
            "sbg:revision": 20
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535579002,
            "sbg:revisionNotes": "fix typo",
            "sbg:revision": 21
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535581267,
            "sbg:revisionNotes": "tar -tv",
            "sbg:revision": 22
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535590853,
            "sbg:revisionNotes": "see tar contents",
            "sbg:revision": 23
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535592012,
            "sbg:revisionNotes": "1>&2",
            "sbg:revision": 24
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535595110,
            "sbg:revisionNotes": "typo",
            "sbg:revision": 25
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535654957,
            "sbg:revisionNotes": "add export REF_CACHE=$CWD",
            "sbg:revision": 26
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535656111,
            "sbg:revisionNotes": "export REF_CACHE=$CWD ;",
            "sbg:revision": 27
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535656657,
            "sbg:revisionNotes": "REF_CACHE=$PWD",
            "sbg:revision": 28
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1535656778,
            "sbg:revisionNotes": "set REF_CACHE",
            "sbg:revision": 29
          },
          {
            "sbg:modifiedBy": "ogan",
            "sbg:modifiedOn": 1536762661,
            "sbg:revisionNotes": "link to reference_tarball",
            "sbg:revision": 30
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1549024607,
            "sbg:revisionNotes": ".bam.bai instead only .bai",
            "sbg:revision": 31
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "script": "{\n  ///////////////////////////////////////////\n ///  BIOBAMBAM BAMSORMADUP   //////////////////////\n///////////////////////////////////////////\n  \nfunction common_substring(a,b) {\n  var i = 0;\n  while(a[i] === b[i] && i < a.length)\n  {\n    i = i + 1;\n  }\n\n  return a.slice(0, i);\n}\n\n   // Set output file name\n  if($job.inputs.input_reads[0] instanceof Array){\n    input_1 = $job.inputs.input_reads[0][0] // scatter mode\n    input_2 = $job.inputs.input_reads[0][1]\n  } else if($job.inputs.input_reads instanceof Array){\n    input_1 = $job.inputs.input_reads[0]\n    input_2 = $job.inputs.input_reads[1]\n  }else {\n    input_1 = [].concat($job.inputs.input_reads)[0]\n    input_2 = input_1\n  }\n  full_name = input_1.path.split('/')[input_1.path.split('/').length-1] \n  \n  if($job.inputs.output_name){name = $job.inputs.output_name }\n  else if ($job.inputs.input_reads.length == 1){\n    name = full_name\n    if(name.slice(-3, name.length) === '.gz' || name.slice(-3, name.length) === '.GZ')\n      name = name.slice(0, -3)   \n    if(name.slice(-3, name.length) === '.fq' || name.slice(-3, name.length) === '.FQ')\n      name = name.slice(0, -3)\n    if(name.slice(-6, name.length) === '.fastq' || name.slice(-6, name.length) === '.FASTQ')\n      name = name.slice(0, -6)\n       \n  }else{\n    full_name2 = input_2.path.split('/')[input_2.path.split('/').length-1] \n    name = common_substring(full_name, full_name2)\n    \n    if(name.slice(-1, name.length) === '_' || name.slice(-1, name.length) === '.')\n      name = name.slice(0, -1)\n    if(name.slice(-2, name.length) === 'p_' || name.slice(-1, name.length) === 'p.')\n      name = name.slice(0, -2)\n    if(name.slice(-2, name.length) === 'P_' || name.slice(-1, name.length) === 'P.')\n      name = name.slice(0, -2)\n    if(name.slice(-3, name.length) === '_p_' || name.slice(-3, name.length) === '.p.')\n      name = name.slice(0, -3)\n    if(name.slice(-3, name.length) === '_pe' || name.slice(-3, name.length) === '.pe')\n      name = name.slice(0, -3)\n  }\n\n  //////////////////////////\n  // Set sort memory size\n  \n  reads_size = 0 // Not used because of situations when size does not exist!\n  GB_1 = 1024*1024*1024\n  if(reads_size < GB_1){ \n    suggested_memory = 4\n    suggested_cpus = 1\n  }\n  else if(reads_size < 10 * GB_1){ \n    suggested_memory = 15\n    suggested_cpus = 8\n  }\n  else { \n    suggested_memory = 58 \n    suggested_cpus = 31\n  }\n  \n  \n  if(!$job.inputs.total_memory){ total_memory = suggested_memory }\n  else{ total_memory = $job.inputs.total_memory }\n\n  // TODO:Rough estimation, should be fine-tuned!\n  if(total_memory > 16){ sorter_memory = parseInt(total_memory / 3) }\n  else{ sorter_memory = 5 }\n          \n  if ($job.inputs.sort_memory){\n    sorter_memory_string = $job.inputs.sort_memory +'GiB'\n  }\n  else sorter_memory_string = sorter_memory + 'GiB' \n  \n  // Read number of threads if defined\n  if ($job.inputs.sambamba_threads){\n    threads = $job.inputs.sambamba_threads\n  }\n  else if ($job.inputs.threads){\n    threads = $job.inputs.threads\n  }\n  else if ($job.inputs.wgs_hg38_mode_threads){\n    MAX_THREADS = 36\n    ref_name_arr = $job.inputs.reference_index_tar.path.split('/')\n    ref_name = ref_name_arr[ref_name_arr.length - 1]\n    if (ref_name.search('38') >= 0){threads = $job.inputs.wgs_hg38_mode_threads}\n    else {threads = MAX_THREADS}\n  }\n  else { threads = 8 }\n  \n  \n  \n  if ($job.inputs.deduplication == \"MarkDuplicates\"){\n    dedup = ' markduplicates=1'\n  }\n  else if ($job.inputs.deduplication == \"RemoveDuplicates\"){\n    dedup = ' rmdup=1'\n  }\n  else{\n   dedup = '' \n  }\n  \n  sort_path = 'bamsormadup'\n  indexfilename = ' '\n  // Coordinate Sorted BAM is default\n  if ($job.inputs.output_format == 'CRAM'){\n    out_format = ' outputformat=cram SO=coordinate'\n    ref_name_arr = $job.inputs.reference_index_tar.path.split('/')\n    ref_name = ref_name_arr[ref_name_arr.length - 1].split('.tar')[0]\n    out_format += ' reference=' + ref_name\n    indexfilename = ' indexfilename=' + name + '.cram.crai'\n    extension = '.cram'    \n  }else if($job.inputs.output_format == 'SAM'){\n    out_format = ' outputformat=sam SO=coordinate'\n    extension = '.sam'    \n  }else if ($job.inputs.output_format == 'Queryname Sorted BAM'){\n    out_format = ' outputformat=bam SO=queryname'\n    extension = '.bam'\n  }else if ($job.inputs.output_format == 'Queryname Sorted SAM'){\n    out_format = ' outputformat=sam SO=queryname'\n    extension = '.sam'    \n  }else {\n    out_format = ' outputformat=bam SO=coordinate'\n    indexfilename = ' indexfilename=' + name + '.bam.bai'\n    extension = '.bam'\n  }\n    cmd = \" | \" + sort_path + \" threads=8 level=1 tmplevel=-1 inputformat=sam\" \n    cmd += out_format\n    cmd += indexfilename\n    // capture metrics file\n    cmd += \" M=\" + name + \".sormadup_metrics.log\"\n    return cmd + ' > ' + name + extension\n\n}\n  \n",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": false,
            "position": 112
          },
          {
            "valueFrom": {
              "script": "{\n  \n  if($job.inputs.read_group_header){\n  \treturn '-R ' + $job.inputs.read_group_header\n  }\n    \n  function add_param(key, val){\n    if(!val){\n      return\n\t}\n    param_list.push(key + ':' + val)\n  }\n\n  param_list = []\n\n  // Set output file name\n  if($job.inputs.input_reads[0] instanceof Array){\n    input_1 = $job.inputs.input_reads[0][0] // scatter mode\n  } else if($job.inputs.input_reads instanceof Array){\n    input_1 = $job.inputs.input_reads[0]\n  }else {\n    input_1 = [].concat($job.inputs.input_reads)[0]\n  }\n  \n  //Read metadata for input reads\n  read_metadata = input_1.metadata\n  if(!read_metadata) read_metadata = []\n\n  if($job.inputs.rg_id){\n    add_param('ID', $job.inputs.rg_id)\n  }\n  else {\n    add_param('ID', '1')\n  } \n   \n  \n  if($job.inputs.rg_data_submitting_center){\n  \tadd_param('CN', $job.inputs.rg_data_submitting_center)\n  }\n  else if('data_submitting_center' in  read_metadata){\n  \tadd_param('CN', read_metadata.data_submitting_center)\n  }\n  \n  if($job.inputs.rg_library_id){\n  \tadd_param('LB', $job.inputs.rg_library_id)\n  }\n  else if('library_id' in read_metadata){\n  \tadd_param('LB', read_metadata.library_id)\n  }\n  \n  if($job.inputs.rg_median_fragment_length){\n  \tadd_param('PI', $job.inputs.rg_median_fragment_length)\n  }\n\n  \n  if($job.inputs.rg_platform){\n  \tadd_param('PL', $job.inputs.rg_platform)\n  }\n  else if('platform' in read_metadata){\n    if(read_metadata.platform == 'HiSeq X Ten'){\n      rg_platform = 'Illumina'\n    }\n    else{\n      rg_platform = read_metadata.platform\n    }\n  \tadd_param('PL', rg_platform)\n  }\n  \n  if($job.inputs.rg_platform_unit_id){\n  \tadd_param('PU', $job.inputs.rg_platform_unit_id)\n  }\n  else if('platform_unit_id' in read_metadata){\n  \tadd_param('PU', read_metadata.platform_unit_id)\n  }\n  \n  if($job.inputs.rg_sample_id){\n  \tadd_param('SM', $job.inputs.rg_sample_id)\n  }\n  else if('sample_id' in  read_metadata){\n  \tadd_param('SM', read_metadata.sample_id)\n  }\n    \n  return \"-R '@RG\\\\t\" + param_list.join('\\\\t') + \"'\"\n  \n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "position": 1
          },
          {
            "valueFrom": {
              "script": "{\n  /////// Set input reads in the correct order depending of the paired end from metadata\n    \n     // Set output file name\n  if($job.inputs.input_reads[0] instanceof Array){\n    input_reads = $job.inputs.input_reads[0] // scatter mode\n  } else {\n    input_reads = $job.inputs.input_reads = [].concat($job.inputs.input_reads)\n  }\n  \n  \n  //Read metadata for input reads\n  read_metadata = input_reads[0].metadata\n  if(!read_metadata) read_metadata = []\n  \n  order = 0 // Consider this as normal order given at input: pe1 pe2\n  \n  // Check if paired end 1 corresponds to the first given read\n  if(read_metadata == []){ order = 0 }\n  else if('paired_end' in  read_metadata){ \n    pe1 = read_metadata.paired_end\n    if(pe1 != 1) order = 1 // change order\n  }\n\n  // Return reads in the correct order\n  if (input_reads.length == 1){\n    return input_reads[0].path // Only one read present\n  }\n  else if (input_reads.length == 2){\n    if (order == 0) return input_reads[0].path + ' ' + input_reads[1].path\n    else return input_reads[1].path + ' ' + input_reads[0].path\n  }\n\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "position": 101
          },
          {
            "valueFrom": {
              "script": "{\n  MAX_THREADS = 36\n  suggested_threads = 8\n  \n  if($job.inputs.threads){ threads = $job.inputs.threads  }\n  else if ($job.inputs.wgs_hg38_mode_threads){\n    ref_name_arr = $job.inputs.reference_index_tar.path.split('/')\n    ref_name = ref_name_arr[ref_name_arr.length - 1]\n    if (ref_name.search('38') >= 0){threads = $job.inputs.wgs_hg38_mode_threads}\n    else {threads = MAX_THREADS}\n  }\n  else{ threads = suggested_threads  }\n    \n  return threads\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "prefix": "-t",
            "position": 2
          },
          {
            "valueFrom": {
              "script": "{\n  name = ''\n  metadata = [].concat($job.inputs.reference_index_tar)[0].metadata\n  \n  if (metadata && metadata.reference_genome) {\n \tname = metadata.reference_genome\n  }\n  else {\n\treference_file = $job.inputs.reference_index_tar.path.split('/')[$job.inputs.reference_index_tar.path.split('/').length-1]\n  \tname = reference_file.slice(0, -4) // cut .tar extension \n  }\n    \n  return name \t\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "position": 10
          },
          {
            "valueFrom": {
              "script": "{\n  cmd = \";declare -i pipe_statuses=(\\\\${PIPESTATUS[*]});len=\\\\${#pipe_statuses[@]};declare -i tot=0;echo \\\\${pipe_statuses[*]};for (( i=0; i<\\\\${len}; i++ ));do if [ \\\\${pipe_statuses[\\\\$i]} -ne 0 ];then tot=\\\\${pipe_statuses[\\\\$i]}; fi;done;if [ \\\\$tot -ne 0 ]; then >&2 echo Error in piping. Pipe statuses: \\\\${pipe_statuses[*]};fi; if [ \\\\$tot -ne 0 ]; then false;fi\\\"\"\n  return cmd\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "position": 10000
          }
        ],
        "sbg:project": "vladimirk/bwa-mem-bundle-0-7-17-demo",
        "inputs": [
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Optimize threads for HG38",
            "sbg:category": "Execution",
            "sbg:toolDefaultValue": "False",
            "id": "#wgs_hg38_mode_threads",
            "description": "Lower the number of threads if HG38 reference genome is used.",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              {
                "name": "verbose_level",
                "symbols": [
                  "1",
                  "2",
                  "3",
                  "4"
                ],
                "type": "enum"
              }
            ],
            "label": "Verbose level",
            "sbg:category": "BWA Input/output options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-v"
            },
            "sbg:toolDefaultValue": "3",
            "id": "#verbose_level",
            "description": "Verbose level: 1=error, 2=warning, 3=message, 4+=debugging."
          },
          {
            "label": "Use soft clipping",
            "sbg:category": "BWA Input/output options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-Y"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_soft_clipping",
            "description": "Use soft clipping for supplementary alignments."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Unpaired read penalty",
            "sbg:category": "BWA Scoring options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-U"
            },
            "sbg:toolDefaultValue": "17",
            "id": "#unpaired_read_penalty",
            "description": "Penalty for an unpaired read pair."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Total memory",
            "sbg:category": "Execution",
            "sbg:toolDefaultValue": "15",
            "id": "#total_memory",
            "description": "Total memory to be used by the tool in GB. It's sum of BWA, Sambamba Sort and Samblaster. For fastq files of total size less than 10GB, we suggest using the default setting of 15GB, for larger files we suggest using 58GB of memory (and 32CPU cores).",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Threads",
            "sbg:category": "Execution",
            "sbg:toolDefaultValue": "8",
            "id": "#threads",
            "description": "Number of threads for BWA, Samblaster and Sambamba sort process."
          },
          {
            "label": "Split alignment smallest coordinate as primary",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  return ''\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-5"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#split_alignment_primary",
            "description": "for split alignment, take the alignment with the smallest coordinate as primary.",
            "sbg:stageInput": null
          },
          {
            "label": "Specify distribution parameters",
            "sbg:category": "BWA Input/output options",
            "inputBinding": {
              "itemSeparator": null,
              "separate": false,
              "prefix": "-I",
              "sbg:cmdInclude": true
            },
            "type": [
              "null",
              {
                "name": "speficy_distribution_parameters",
                "items": "float",
                "type": "array"
              }
            ],
            "id": "#speficy_distribution_parameters",
            "description": "Specify the mean, standard deviation (10% of the mean if absent), max (4 sigma from the mean if absent) and min of the insert size distribution.FR orientation only. This array can have maximum four values, where first two should be specified as FLOAT and last two as INT."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#sort_memory",
            "label": "Memory for BAM sorting",
            "description": "Amount of RAM [Gb] to give to the sorting algorithm (if not provided will be set to one third of the total memory).",
            "sbg:category": "Execution"
          },
          {
            "label": "Smart pairing in input FASTQ file",
            "sbg:category": "BWA Input/output options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-p"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#smart_pairing_in_input_fastq",
            "description": "Smart pairing in input FASTQ file (ignoring in2.fq)."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Skip seeds with more than INT occurrences",
            "sbg:category": "BWA Algorithm options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-c"
            },
            "sbg:toolDefaultValue": "500",
            "id": "#skip_seeds",
            "description": "Skip seeds with more than INT occurrences."
          },
          {
            "label": "Skip pairing",
            "sbg:category": "BWA Algorithm options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-P"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#skip_pairing",
            "description": "Skip pairing; mate rescue performed unless -S also in use."
          },
          {
            "label": "Skip mate rescue",
            "sbg:category": "BWA Algorithm options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-S"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#skip_mate_rescue",
            "description": "Skip mate rescue."
          },
          {
            "type": [
              "null",
              "float"
            ],
            "label": "Select seeds",
            "sbg:category": "BWA Algorithm options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-r"
            },
            "sbg:toolDefaultValue": "1.5",
            "id": "#select_seeds",
            "description": "Look for internal seeds inside a seed longer than {-k} * FLOAT."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Seed occurrence for the 3rd round",
            "sbg:category": "BWA Algorithm options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-y"
            },
            "sbg:toolDefaultValue": "20",
            "id": "#seed_occurrence_for_the_3rd_round",
            "description": "Seed occurrence for the 3rd round seeding."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Score for a sequence match",
            "sbg:category": "BWA Scoring options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-A"
            },
            "sbg:toolDefaultValue": "1",
            "id": "#score_for_a_sequence_match",
            "description": "Score for a sequence match, which scales options -TdBOELU unless overridden."
          },
          {
            "type": [
              "null",
              "string"
            ],
            "label": "Sample ID",
            "sbg:category": "BWA Read Group Options",
            "sbg:toolDefaultValue": "Inferred from metadata",
            "id": "#rg_sample_id",
            "description": "Specify the sample ID for RG line - A human readable identifier for a sample or specimen, which could contain some metadata information. A sample or specimen is material taken from a biological entity for testing, diagnosis, propagation, treatment, or research purposes, including but not limited to tissues, body fluids, cells, organs, embryos, body excretory products, etc."
          },
          {
            "type": [
              "null",
              "string"
            ],
            "label": "Platform unit ID",
            "sbg:category": "BWA Read Group Options",
            "sbg:toolDefaultValue": "Inferred from metadata",
            "id": "#rg_platform_unit_id",
            "description": "Specify the platform unit (lane/slide) for RG line - An identifier for lanes (Illumina), or for slides (SOLiD) in the case that a library was split and ran over multiple lanes on the flow cell or slides."
          },
          {
            "type": [
              "null",
              {
                "name": "rg_platform",
                "symbols": [
                  "454",
                  "Helicos",
                  "Illumina",
                  "Solid",
                  "IonTorrent"
                ],
                "type": "enum"
              }
            ],
            "label": "Platform",
            "sbg:category": "BWA Read Group Options",
            "sbg:toolDefaultValue": "Inferred from metadata",
            "id": "#rg_platform",
            "description": "Specify the version of the technology that was used for sequencing, which will be placed in RG line."
          },
          {
            "type": [
              "null",
              "string"
            ],
            "id": "#rg_median_fragment_length",
            "label": "Median fragment length",
            "description": "Specify the median fragment length for RG line.",
            "sbg:category": "BWA Read Group Options"
          },
          {
            "type": [
              "null",
              "string"
            ],
            "label": "Library ID",
            "sbg:category": "BWA Read Group Options",
            "sbg:toolDefaultValue": "Inferred from metadata",
            "id": "#rg_library_id",
            "description": "Specify the identifier for the sequencing library preparation, which will be placed in RG line."
          },
          {
            "type": [
              "null",
              "string"
            ],
            "label": "Read group ID",
            "sbg:category": "Configuration",
            "sbg:toolDefaultValue": "1",
            "id": "#rg_id",
            "description": "Read group ID"
          },
          {
            "type": [
              "null",
              "string"
            ],
            "id": "#rg_data_submitting_center",
            "label": "Data submitting center",
            "description": "Specify the data submitting center for RG line.",
            "sbg:category": "BWA Read Group Options"
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Reserved number of threads on the instance",
            "sbg:category": "Configuration",
            "sbg:toolDefaultValue": "1",
            "id": "#reserved_threads",
            "description": "Reserved number of threads on the instance used by scheduler.",
            "sbg:stageInput": null
          },
          {
            "sbg:fileTypes": "TAR",
            "label": "Reference Index TAR",
            "sbg:category": "Input files",
            "type": [
              "File"
            ],
            "required": true,
            "id": "#reference_index_tar",
            "description": "Reference fasta file with BWA index files packed in TAR.",
            "sbg:stageInput": "link"
          },
          {
            "label": "Sequencing technology-specific settings",
            "sbg:category": "BWA Scoring options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-x"
            },
            "type": [
              "null",
              {
                "name": "read_type",
                "symbols": [
                  "pacbio",
                  "ont2d",
                  "intractg"
                ],
                "type": "enum"
              }
            ],
            "id": "#read_type",
            "description": "Sequencing technology-specific settings; Setting -x changes multiple parameters unless overriden. pacbio: -k17 -W40 -r10 -A1 -B1 -O1 -E1 -L0  (PacBio reads to ref). ont2d: -k14 -W20 -r10 -A1 -B1 -O1 -E1 -L0  (Oxford Nanopore 2D-reads to ref). intractg: -B9 -O16 -L5  (intra-species contigs to ref)."
          },
          {
            "type": [
              "null",
              "string"
            ],
            "label": "Read group header",
            "sbg:category": "BWA Read Group Options",
            "sbg:toolDefaultValue": "Constructed from per-attribute parameters or inferred from metadata.",
            "id": "#read_group_header",
            "description": "Read group header line such as '@RG\\tID:foo\\tSM:bar'.  This value takes precedence over per-attribute parameters."
          },
          {
            "type": [
              "null",
              "string"
            ],
            "id": "#output_name",
            "label": "Output SAM/BAM file name",
            "description": "Name of the output BAM file.",
            "sbg:category": "Configuration"
          },
          {
            "type": [
              "null",
              {
                "items": "int",
                "type": "array"
              }
            ],
            "label": "Output in XA",
            "sbg:category": "BWA Input/output options",
            "inputBinding": {
              "itemSeparator": ",",
              "separate": false,
              "prefix": "-h",
              "sbg:cmdInclude": true
            },
            "sbg:toolDefaultValue": "[5, 200]",
            "id": "#output_in_xa",
            "description": "If there are <INT hits with score >80% of the max score, output all in XA. This array should have no more than two values."
          },
          {
            "label": "Output header",
            "sbg:category": "BWA Input/output options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-V"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#output_header",
            "description": "Output the reference FASTA header in the XR tag."
          },
          {
            "type": [
              "null",
              {
                "name": "output_format",
                "symbols": [
                  "SAM",
                  "BAM",
                  "CRAM",
                  "Queryname Sorted BAM",
                  "Queryname Sorted SAM"
                ],
                "type": "enum"
              }
            ],
            "label": "Output format",
            "sbg:category": "Execution",
            "sbg:toolDefaultValue": "Coordinate Sorted BAM",
            "id": "#output_format",
            "description": "Cordinate sort is default output."
          },
          {
            "label": "Output alignments",
            "sbg:category": "BWA Input/output options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-a"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#output_alignments",
            "description": "Output all alignments for SE or unpaired PE."
          },
          {
            "label": "process INT input bases in each batch (for reproducibility)",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-K"
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#num_input_bases_in_each_batch",
            "description": "process INT input bases in each batch regardless of nThreads (for reproducibility)",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Mismatch penalty",
            "sbg:category": "BWA Scoring options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-B"
            },
            "sbg:toolDefaultValue": "4",
            "id": "#mismatch_penalty",
            "description": "Penalty for a mismatch."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Minimum seed length",
            "sbg:category": "BWA Algorithm options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-k"
            },
            "sbg:toolDefaultValue": "19",
            "id": "#minimum_seed_length",
            "description": "Minimum seed length for BWA MEM."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Minimum alignment score for a read to be output in SAM/BAM",
            "sbg:category": "BWA Input/output options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-T"
            },
            "sbg:toolDefaultValue": "30",
            "id": "#minimum_output_score",
            "description": "Minimum alignment score for a read to be output in SAM/BAM."
          },
          {
            "type": [
              "null",
              "string"
            ],
            "label": "Mate rescue rounds",
            "sbg:category": "BWA Algorithm options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-m"
            },
            "sbg:toolDefaultValue": "50",
            "id": "#mate_rescue_rounds",
            "description": "Perform at most INT rounds of mate rescues for each read."
          },
          {
            "label": "Mark shorter",
            "sbg:category": "BWA Input/output options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-M"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#mark_shorter",
            "description": "Mark shorter split hits as secondary."
          },
          {
            "label": "Don't modify mapQ of supplementary alignments",
            "inputBinding": {
              "valueFrom": {
                "script": "{\n  return ''\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-q"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#mapQ_of_suplementary",
            "description": "Don't modify mapQ of supplementary alignments",
            "sbg:stageInput": null
          },
          {
            "label": "Insert string to output SAM or BAM header",
            "sbg:category": "BWA Input/output options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-H"
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#insert_string_to_header",
            "description": "Insert STR to header if it starts with @; or insert lines in FILE."
          },
          {
            "sbg:fileTypes": "FASTQ, FASTQ.GZ, FQ, FQ.GZ",
            "label": "Input reads",
            "sbg:category": "Input files",
            "type": [
              {
                "items": "File",
                "type": "array"
              }
            ],
            "required": true,
            "id": "#input_reads",
            "description": "Input sequence reads.",
            "sbg:stageInput": "link"
          },
          {
            "label": "Ignore ALT file",
            "sbg:category": "BWA Input/output options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-j"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#ignore_alt_file",
            "description": "Treat ALT contigs as part of the primary assembly (i.e. ignore <idxbase>.alt file)."
          },
          {
            "type": [
              "null",
              {
                "items": "int",
                "type": "array"
              }
            ],
            "label": "Gap open penalties",
            "sbg:category": "BWA Scoring options",
            "inputBinding": {
              "itemSeparator": ",",
              "separate": false,
              "prefix": "-O",
              "sbg:cmdInclude": true
            },
            "sbg:toolDefaultValue": "[6,6]",
            "id": "#gap_open_penalties",
            "description": "Gap open penalties for deletions and insertions. This array can't have more than two values."
          },
          {
            "type": [
              "null",
              {
                "items": "int",
                "type": "array"
              }
            ],
            "label": "Gap extension",
            "sbg:category": "BWA Scoring options",
            "inputBinding": {
              "itemSeparator": ",",
              "separate": false,
              "prefix": "-E",
              "sbg:cmdInclude": true
            },
            "sbg:toolDefaultValue": "[1,1]",
            "id": "#gap_extension_penalties",
            "description": "Gap extension penalty; a gap of size k cost '{-O} + {-E}*k'. This array can't have more than two values."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Filter out secondary alignments",
            "sbg:category": "Execution",
            "sbg:toolDefaultValue": "False",
            "id": "#filter_out_secondary_alignments",
            "description": "Filter out secondary alignments. Sambamba view tool will be used to perform this internally.",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Dropoff",
            "sbg:category": "BWA Algorithm options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-d"
            },
            "sbg:toolDefaultValue": "100",
            "id": "#dropoff",
            "description": "Off-diagonal X-dropoff."
          },
          {
            "type": [
              "null",
              "float"
            ],
            "label": "Drop chains fraction",
            "sbg:category": "BWA Algorithm options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-D"
            },
            "sbg:toolDefaultValue": "0.50",
            "id": "#drop_chains_fraction",
            "description": "Drop chains shorter than FLOAT fraction of the longest overlapping chain."
          },
          {
            "label": "Discard exact matches",
            "sbg:category": "BWA Algorithm options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-e"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#discard_exact_matches",
            "description": "Discard full-length exact matches."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Discard chain length",
            "sbg:category": "BWA Algorithm options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-W"
            },
            "sbg:toolDefaultValue": "0",
            "id": "#discard_chain_length",
            "description": "Discard a chain if seeded bases shorter than INT."
          },
          {
            "type": [
              "null",
              {
                "name": "deduplication",
                "symbols": [
                  "None",
                  "MarkDuplicates",
                  "RemoveDuplicates"
                ],
                "type": "enum"
              }
            ],
            "label": "PCR duplicate detection",
            "sbg:category": "Samblaster parameters",
            "sbg:toolDefaultValue": "MarkDuplicates",
            "id": "#deduplication",
            "description": "Use Samblaster for finding duplicates on sequence reads."
          },
          {
            "type": [
              "null",
              {
                "items": "int",
                "type": "array"
              }
            ],
            "label": "Clipping penalty",
            "sbg:category": "BWA Scoring options",
            "inputBinding": {
              "itemSeparator": ",",
              "separate": false,
              "prefix": "-L",
              "sbg:cmdInclude": true
            },
            "sbg:toolDefaultValue": "[5,5]",
            "id": "#clipping_penalty",
            "description": "Penalty for 5'- and 3'-end clipping."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Band width",
            "sbg:category": "BWA Algorithm options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-w"
            },
            "sbg:toolDefaultValue": "100",
            "id": "#band_width",
            "description": "Band width for banded alignment."
          },
          {
            "label": "Append comment",
            "sbg:category": "BWA Input/output options",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "-C"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#append_comment",
            "description": "Append FASTA/FASTQ comment to SAM output."
          }
        ],
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "http://bio-bwa.sourceforge.net/",
            "label": "Homepage"
          },
          {
            "id": "https://github.com/lh3/bwa",
            "label": "Source code"
          },
          {
            "id": "http://bio-bwa.sourceforge.net/bwa.shtml",
            "label": "Wiki"
          },
          {
            "id": "http://sourceforge.net/projects/bio-bwa/",
            "label": "Download"
          },
          {
            "id": "http://arxiv.org/abs/1303.3997",
            "label": "Publication"
          },
          {
            "id": "http://www.ncbi.nlm.nih.gov/pubmed/19451168",
            "label": "Publication BWA Algorithm"
          }
        ],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkitVersion": "0.7.13",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "sbg:toolAuthor": "Heng Li",
        "sbg:projectName": "BWA MEM Bundle 0.7.17 - Demo",
        "baseCommand": [
          {
            "script": "{\n  cmd = \"/bin/bash -c \\\"\"\n  return cmd + \" export REF_CACHE=${PWD} ; \"\n}",
            "class": "Expression",
            "engine": "#cwl-js-engine"
          },
          {
            "script": "{\n  reference_file = $job.inputs.reference_index_tar.path.split('/')[$job.inputs.reference_index_tar.path.split('/').length-1]\n  return 'tar -tvf ' +  reference_file + ' 1>&2; tar -xf ' + reference_file + ' ; '\n  \n}",
            "class": "Expression",
            "engine": "#cwl-js-engine"
          },
          "bwa",
          "mem"
        ],
        "stdin": "",
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "vladimirk",
        "outputs": [
          {
            "sbg:fileTypes": "LOG",
            "label": "Sormadup metrics",
            "type": [
              "null",
              "File"
            ],
            "outputBinding": {
              "glob": "*.sormadup_metrics.log"
            },
            "id": "#dups_metrics",
            "description": "Metrics file for biobambam mark duplicates"
          },
          {
            "sbg:fileTypes": "SAM, BAM, CRAM",
            "label": "Aligned SAM/BAM",
            "type": [
              "null",
              "File"
            ],
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#input_reads",
              "glob": "{*.sam,*.bam,*.cram}",
              "secondaryFiles": [
                ".bai",
                "^.bai",
                ".crai",
                "^.crai"
              ],
              "sbg:metadata": {
                "reference_genome": {
                  "script": "{\n  reference_file = $job.inputs.reference_index_tar.path.split('/')[$job.inputs.reference_index_tar.path.split('/').length-1]\n  name = reference_file.slice(0, -4) // cut .tar extension \n  \n  name_list = name.split('.')\n  ext = name_list[name_list.length-1]\n\n  if (ext == 'gz' || ext == 'GZ'){\n    a = name_list.pop() // strip fasta.gz\n    a = name_list.pop()\n  } else\n    a = name_list.pop() //strip only fasta/fa\n  \n  return name_list.join('.')\n  \n}",
                  "class": "Expression",
                  "engine": "#cwl-js-engine"
                }
              }
            },
            "id": "#aligned_reads",
            "description": "Aligned reads."
          }
        ],
        "sbg:revision": 31,
        "sbg:createdOn": 1530796841,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": 59.88164301243012,
        "sbg:license": "BWA: GNU Affero General Public License v3.0, MIT License. Sambamba: GNU GENERAL PUBLIC LICENSE. Samblaster: The MIT License (MIT)",
        "sbg:contributors": [
          "vladimirk",
          "nikola_jovanovic",
          "ogan"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": "",
        "id": "vladimirk/bwa-mem-bundle-0-7-17-demo/bwa-mem-bundle-0-7-17/31",
        "description": "**BWA MEM** is an algorithm designed for aligning sequence reads onto a large reference genome. BWA MEM is implemented as a component of BWA. The algorithm can automatically choose between performing end-to-end and local alignments. BWA MEM is capable of outputting multiple alignments, and finding chimeric reads. It can be applied to a wide range of read lengths, from 70 bp to several megabases. \n\nIn order to obtain possibilities for additional fast processing of aligned reads, two tools are embedded together into the same package with BWA MEM (0.7.13): Samblaster. (0.1.22) and Sambamba (v0.6.0). \nIf deduplication of alignments is needed, it can be done by setting the parameter 'Duplication'. **Samblaster** will be used internally to perform this action.\nBesides the standard BWA MEM SAM output file, BWA MEM package has been extended to support two additional output options: a BAM file obtained by piping through **Sambamba view** while filtering out the secondary alignments, as well as a Coordinate Sorted BAM option that additionally pipes the output through **Sambamba sort**, along with an accompanying .bai file produced by **Sambamba sort** as side effect. Sorted BAM is the default output of BWA MEM. Parameters responsible for these additional features are 'Filter out secondary alignments' and 'Output format'. Passing data from BWA MEM to Samblaster and Sambamba tools has been done through the pipes which saves processing times of two read and write of aligned reads into the hard drive. \n\nFor input reads fastq files of total size less than 10 GB we suggest using the default setting for parameter 'total memory' of 15GB, for larger files we suggest using 58 GB of memory and 32 CPU cores.\n\n**Important:**\nIn order to work BWA MEM Bundle requires fasta reference file accompanied with **bwa fasta indices** in TAR file.\nThere is the **known issue** with samblaster. It does not support processing when number of sequences in fasta is larger than 32768. If this is the case do not use deduplication option because the output BAM will be corrupted.\n\nHuman reference genome version 38 comes with ALT contigs, a collection of diverged alleles present in some humans but not the others. Making effective use of these contigs will help to reduce mapping artifacts, however, to facilitate mapping these ALT contigs to the primary assembly, GRC decided to add to each contig long flanking sequences almost identical to the primary assembly. As a result, a naive mapping against GRCh38+ALT will lead to many mapQ-zero mappings in these flanking regions. Please use post-processing steps to fix these alignments or implement [steps](https://sourceforge.net/p/bio-bwa/mailman/message/32845712/) described by the author of BWA toolkit.",
        "sbg:content_hash": "a10b6a701fb02268c2eb962a12d541bdad9da25895b0dabda8100548afacd0774",
        "sbg:toolkit": "BWA",
        "sbg:image_url": null,
        "sbg:revisionNotes": ".bam.bai instead only .bai",
        "label": "BWA MEM Bundle 0.7.17",
        "sbg:categories": [
          "Alignment",
          "FASTQ-Processing"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1549024607,
        "sbg:id": "h-398a03fa/h-0b5a66c7/h-430e0c1a/0",
        "temporaryFailCodes": []
      },
      "id": "#BWA_MEM_Bundle_0_7_17",
      "sbg:y": 59.88164301243012
    },
    {
      "sbg:x": 1754.0992744373552,
      "inputs": [
        {
          "id": "#GATK_HaplotypeCaller.wgs_hg38_mode_memory",
          "default": 4096
        },
        {
          "id": "#GATK_HaplotypeCaller.verbosity"
        },
        {
          "id": "#GATK_HaplotypeCaller.use_new_qual_calculator"
        },
        {
          "id": "#GATK_HaplotypeCaller.use_jdk_inflater"
        },
        {
          "id": "#GATK_HaplotypeCaller.use_jdk_deflater"
        },
        {
          "id": "#GATK_HaplotypeCaller.use_filtered_reads_for_annotations"
        },
        {
          "id": "#GATK_HaplotypeCaller.use_alleles_trigger"
        },
        {
          "id": "#GATK_HaplotypeCaller.standard_min_confidence_threshold_for_calling"
        },
        {
          "id": "#GATK_HaplotypeCaller.smith_waterman"
        },
        {
          "id": "#GATK_HaplotypeCaller.seconds_between_progress_updates"
        },
        {
          "id": "#GATK_HaplotypeCaller.sample_ploidy"
        },
        {
          "id": "#GATK_HaplotypeCaller.sample_name"
        },
        {
          "id": "#GATK_HaplotypeCaller.sample"
        },
        {
          "source": [
            "#SBG_FASTA_Indices.fasta_reference"
          ],
          "id": "#GATK_HaplotypeCaller.reference"
        },
        {
          "id": "#GATK_HaplotypeCaller.recover_dangling_heads"
        },
        {
          "source": [
            "#GATK_ApplyBQSR.output"
          ],
          "id": "#GATK_HaplotypeCaller.reads"
        },
        {
          "id": "#GATK_HaplotypeCaller.read_validation_stringency"
        },
        {
          "id": "#GATK_HaplotypeCaller.read_name"
        },
        {
          "id": "#GATK_HaplotypeCaller.read_index"
        },
        {
          "id": "#GATK_HaplotypeCaller.read_group_black_list"
        },
        {
          "id": "#GATK_HaplotypeCaller.read_filter"
        },
        {
          "id": "#GATK_HaplotypeCaller.quiet"
        },
        {
          "id": "#GATK_HaplotypeCaller.platform_filter_name"
        },
        {
          "id": "#GATK_HaplotypeCaller.phred_scaled_global_read_mismapping_rate"
        },
        {
          "id": "#GATK_HaplotypeCaller.pcr_indel_model"
        },
        {
          "id": "#GATK_HaplotypeCaller.pair_hmm_gap_continuation_penalty"
        },
        {
          "id": "#GATK_HaplotypeCaller.output_mode"
        },
        {
          "id": "#GATK_HaplotypeCaller.num_pruning_samples"
        },
        {
          "id": "#GATK_HaplotypeCaller.native_pair_hmm_use_double_precision"
        },
        {
          "id": "#GATK_HaplotypeCaller.native_pair_hmm_threads"
        },
        {
          "id": "#GATK_HaplotypeCaller.minimum_mapping_quality"
        },
        {
          "id": "#GATK_HaplotypeCaller.min_read_length"
        },
        {
          "id": "#GATK_HaplotypeCaller.min_pruning"
        },
        {
          "id": "#GATK_HaplotypeCaller.min_dangling_branch_length"
        },
        {
          "id": "#GATK_HaplotypeCaller.min_base_quality_score"
        },
        {
          "id": "#GATK_HaplotypeCaller.min_assembly_region_size"
        },
        {
          "source": [
            "#memory_per_job"
          ],
          "id": "#GATK_HaplotypeCaller.memory_per_job",
          "default": 2048
        },
        {
          "id": "#GATK_HaplotypeCaller.memory_overhead_per_job",
          "default": 128
        },
        {
          "id": "#GATK_HaplotypeCaller.maximum_mapping_quality"
        },
        {
          "id": "#GATK_HaplotypeCaller.max_reads_per_alignment_start"
        },
        {
          "id": "#GATK_HaplotypeCaller.max_read_length"
        },
        {
          "id": "#GATK_HaplotypeCaller.max_prob_propagation_distance"
        },
        {
          "id": "#GATK_HaplotypeCaller.max_num_haplotypes_in_population"
        },
        {
          "id": "#GATK_HaplotypeCaller.max_genotype_count"
        },
        {
          "id": "#GATK_HaplotypeCaller.max_fragment_length"
        },
        {
          "id": "#GATK_HaplotypeCaller.max_assembly_region_size"
        },
        {
          "id": "#GATK_HaplotypeCaller.max_alternate_alleles"
        },
        {
          "id": "#GATK_HaplotypeCaller.library"
        },
        {
          "id": "#GATK_HaplotypeCaller.lenient"
        },
        {
          "id": "#GATK_HaplotypeCaller.kmer_size"
        },
        {
          "id": "#GATK_HaplotypeCaller.keep_reverse"
        },
        {
          "id": "#GATK_HaplotypeCaller.keep_read_group"
        },
        {
          "id": "#GATK_HaplotypeCaller.intervals_string"
        },
        {
          "source": [
            "#SBG_Prepare_Intervals.intervals"
          ],
          "id": "#GATK_HaplotypeCaller.intervals_file"
        },
        {
          "id": "#GATK_HaplotypeCaller.interval_set_rule",
          "default": "UNION"
        },
        {
          "id": "#GATK_HaplotypeCaller.interval_padding"
        },
        {
          "id": "#GATK_HaplotypeCaller.interval_merging_rule"
        },
        {
          "id": "#GATK_HaplotypeCaller.interval_exclusion_padding"
        },
        {
          "id": "#GATK_HaplotypeCaller.input_prior"
        },
        {
          "id": "#GATK_HaplotypeCaller.indel_size_to_eliminate_in_ref_model"
        },
        {
          "id": "#GATK_HaplotypeCaller.indel_heterozygosity"
        },
        {
          "id": "#GATK_HaplotypeCaller.include_interval_name_in_output_name"
        },
        {
          "id": "#GATK_HaplotypeCaller.heterozygosity_stdev"
        },
        {
          "id": "#GATK_HaplotypeCaller.heterozygosity"
        },
        {
          "id": "#GATK_HaplotypeCaller.gvcf_gq_bands"
        },
        {
          "id": "#GATK_HaplotypeCaller.graph_output"
        },
        {
          "id": "#GATK_HaplotypeCaller.genotyping_mode",
          "default": "DISCOVERY"
        },
        {
          "id": "#GATK_HaplotypeCaller.filter_too_short"
        },
        {
          "id": "#GATK_HaplotypeCaller.exclude_intervals_string"
        },
        {
          "id": "#GATK_HaplotypeCaller.exclude_intervals_file"
        },
        {
          "id": "#GATK_HaplotypeCaller.emit_ref_confidence",
          "default": "GVCF"
        },
        {
          "id": "#GATK_HaplotypeCaller.dont_use_soft_clipped_bases"
        },
        {
          "id": "#GATK_HaplotypeCaller.dont_trim_active_regions"
        },
        {
          "id": "#GATK_HaplotypeCaller.dont_require_soft_clips_both_ends"
        },
        {
          "id": "#GATK_HaplotypeCaller.dont_increase_kmer_sizes_for_cycles"
        },
        {
          "id": "#GATK_HaplotypeCaller.do_not_run_physical_phasing"
        },
        {
          "id": "#GATK_HaplotypeCaller.disable_tool_default_read_filters"
        },
        {
          "id": "#GATK_HaplotypeCaller.disable_tool_default_annotations"
        },
        {
          "id": "#GATK_HaplotypeCaller.disable_sequence_dictionary_validation"
        },
        {
          "id": "#GATK_HaplotypeCaller.disable_read_filter"
        },
        {
          "id": "#GATK_HaplotypeCaller.disable_optimizations"
        },
        {
          "id": "#GATK_HaplotypeCaller.disable_bam_index_caching"
        },
        {
          "id": "#GATK_HaplotypeCaller.debug"
        },
        {
          "id": "#GATK_HaplotypeCaller.dbsnp_gz"
        },
        {
          "source": [
            "#GATK_IndexFeatureFile.output_with_index"
          ],
          "id": "#GATK_HaplotypeCaller.db_snp"
        },
        {
          "id": "#GATK_HaplotypeCaller.create_output_variant_md5"
        },
        {
          "id": "#GATK_HaplotypeCaller.create_output_variant_index"
        },
        {
          "id": "#GATK_HaplotypeCaller.create_output_bam_md5"
        },
        {
          "id": "#GATK_HaplotypeCaller.create_output_bam_index"
        },
        {
          "id": "#GATK_HaplotypeCaller.cpus_per_job"
        },
        {
          "id": "#GATK_HaplotypeCaller.contamination_fraction_to_filter"
        },
        {
          "id": "#GATK_HaplotypeCaller.contamination_fraction_per_sample_file"
        },
        {
          "id": "#GATK_HaplotypeCaller.consensus"
        },
        {
          "id": "#GATK_HaplotypeCaller.comp"
        },
        {
          "id": "#GATK_HaplotypeCaller.cloud_prefetch_buffer"
        },
        {
          "id": "#GATK_HaplotypeCaller.cloud_index_prefetch_buffer"
        },
        {
          "id": "#GATK_HaplotypeCaller.black_listed_lanes"
        },
        {
          "id": "#GATK_HaplotypeCaller.base_quality_score_threshold"
        },
        {
          "id": "#GATK_HaplotypeCaller.bam_writer_type"
        },
        {
          "id": "#GATK_HaplotypeCaller.bam_output"
        },
        {
          "id": "#GATK_HaplotypeCaller.assembly_region_padding"
        },
        {
          "id": "#GATK_HaplotypeCaller.annotations_to_exclude"
        },
        {
          "id": "#GATK_HaplotypeCaller.annotation_group"
        },
        {
          "id": "#GATK_HaplotypeCaller.annotation"
        },
        {
          "id": "#GATK_HaplotypeCaller.annotate_nda"
        },
        {
          "id": "#GATK_HaplotypeCaller.ambig_filter_frac"
        },
        {
          "id": "#GATK_HaplotypeCaller.ambig_filter_bases"
        },
        {
          "id": "#GATK_HaplotypeCaller.allow_non_unique_kmers_in_ref"
        },
        {
          "id": "#GATK_HaplotypeCaller.alleles"
        },
        {
          "id": "#GATK_HaplotypeCaller.all_site_p_ls"
        },
        {
          "id": "#GATK_HaplotypeCaller.add_output_sam_program_record"
        },
        {
          "id": "#GATK_HaplotypeCaller.activity_profile_out"
        },
        {
          "id": "#GATK_HaplotypeCaller.active_probability_threshold"
        }
      ],
      "outputs": [
        {
          "id": "#GATK_HaplotypeCaller.output_vcf"
        },
        {
          "id": "#GATK_HaplotypeCaller.output_bam"
        }
      ],
      "scatter": "#GATK_HaplotypeCaller.reads",
      "run": {
        "x": 1754.0992744373552,
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "dockerImageId": "3c3b8e0ed4e5"
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "class": "Expression",
              "script": "{\n  memory = 0\n  \n  if($job.inputs.memory_per_job){\n  \t memory = $job.inputs.memory_per_job\n  }\n  else{\n    if($job.inputs.wgs_hg38_mode_memory){\n      \treference_name = $job.inputs.reference.path.replace(/^.*[\\\\\\/]/, '')\n      \n       \tif(reference_name.indexOf('38') >-1){\n      \t\tmemory = $job.inputs.wgs_hg38_mode_memory\n    \t}\n        else{\n       \t\tmemory = 2048 \n        }\n    }\n  \telse{\n       memory = 2048\n  \t}\n  }\n       \n  if($job.inputs.memory_overhead_per_job){\n\treturn memory + $job.inputs.memory_overhead_per_job  \n  }\n  else{\n  \treturn memory\n  }\n}",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          }
        ],
        "sbg:latestRevision": 32,
        "sbg:cmdPreview": "/gatk/gatk --java-options \"-Xmx2048M\" HaplotypeCaller --input /path/to/input.bam --reference /path/to/reference.fa --output input.g.vcf",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 2048
          },
          "inputs": {
            "out_mode": null,
            "bqsr": {
              "path": "/path/to/bqsr.ext",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "contamination_fraction": null,
            "activity_profile_out": "",
            "pcr_indel_model": null,
            "consensus": false,
            "ambigFilterBases": null,
            "emit_ref_confidence": "GVCF",
            "bamout": false,
            "dbsnp_gz": {
              "path": "/path/to/dbsnp_gz.ext",
              "class": "File",
              "size": 0,
              "secondaryFiles": [
                {
                  "path": ".tbi"
                }
              ]
            },
            "reference": {
              "path": "/path/to/reference.fa",
              "class": "File",
              "size": 0,
              "secondaryFiles": [
                {
                  "path": ".fai"
                },
                {
                  "path": "^.dict"
                }
              ]
            },
            "memory_per_job": null,
            "cpus_per_job": null,
            "no_soft_clipped": false,
            "disableToolDefaultReadFilters": false,
            "db_snp": {
              "path": "/path/to/db_snp.vcf",
              "class": "File",
              "size": 0,
              "secondaryFiles": [
                {
                  "path": ".idx"
                }
              ]
            },
            "memory_overhead_per_job": null,
            "annotation_group": "",
            "min_length": null,
            "gq_threshold": [
              null
            ],
            "doNotRunPhysicalPhasing": false,
            "disable_opt": false,
            "annotate_all_sites_PLs": false,
            "allow_non_unique_kmers": false,
            "output_raw_activity": "",
            "min_base_q_scores": null,
            "dontUseSoftClippedBases": false,
            "max_active_region_size": null,
            "allowNonUniqueKmersInRef": false,
            "useNewAFCalculator": false,
            "exclude_intervals_string": "",
            "use_allele_trigger": false,
            "use_jdk_deflater": false,
            "max_reads_active_reg": null,
            "force_active": false,
            "consensus_mode": false,
            "exclude_ann": [
              ""
            ],
            "keepReverse": false,
            "no_cmdline_in_header": false,
            "createOutputBamIndex": false,
            "min_pruning_threshold": "",
            "debug": false,
            "sample_name": "",
            "readShardPadding": null,
            "indel_size": null,
            "active_reg_ext": "",
            "heterozygosityStandardDeviation": null,
            "dont_increase_kmers": false,
            "gap_penalty": null,
            "dontIncreaseKmerSizesForCycles": false,
            "maxReadsInMemoryPerSample": null,
            "native_pair_hmm_use_double_precision": false,
            "interval_merging_rule": null,
            "no_active_region_trim": false,
            "useDoublePrecision": false,
            "use_jdk_inflater": false,
            "QUIET": false,
            "lenient": false,
            "allSitePLs": false,
            "disable_tool_default_annotations": true,
            "readShardSize": null,
            "createOutputBamMD5": false,
            "write_to_bam": null,
            "bam_out": "",
            "useFilteredReadsForAnnotations": false,
            "wgs_hg38_mode_memory": null,
            "mismapping_rate": null,
            "addOutputSAMProgramRecord": false,
            "recoverDanglingHeads": false,
            "smith_waterman": null,
            "reads": [
              {
                "path": "/path/to/input.bam",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              }
            ],
            "max_haplotypes": null,
            "secondsBetweenProgressUpdates": null,
            "disableBamIndexCaching": false,
            "dontTrimActiveRegions": false,
            "kmer_size": null,
            "createOutputVariantIndex": false,
            "disable_phasing": false,
            "active_reg_output_file_name": "",
            "disableOptimizations": false,
            "bamOutput": false,
            "max_genotype_count": null,
            "band_pass": "",
            "graph_file": "",
            "intervals_file": [
              {
                "path": "/path/to/1.bed",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              }
            ],
            "genotyping_mode": null,
            "annotation_groups": [
              ""
            ],
            "annotateNDA": false,
            "maxTotalReadsInMemory": null,
            "emitDroppedReads": false,
            "emitRefConfidence": null,
            "prob_threshold": null,
            "use_filtered_reads": false,
            "min_reads_per_algn": null,
            "intervals_string": "",
            "createOutputVariantMD5": false,
            "useAllelesTrigger": false,
            "min_graph_pruning": "",
            "disableSequenceDictionaryValidation": false,
            "dontRequireSoftClipsBothEnds": false,
            "include_interval_name_in_output_name": false
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500296570,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/24",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500640351,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/25",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500887426,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/26",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1502111506,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/27",
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1502190447,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/28",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1502718044,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/29",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1503405184,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/33",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504105725,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/34",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504190940,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/35",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504264072,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/38",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504264485,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/39",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504264657,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/40",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504273058,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/41",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504275166,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/42",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504789607,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/45",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1505823077,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/46",
            "sbg:revision": 15
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1507566130,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/49",
            "sbg:revision": 16
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1507625689,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/50",
            "sbg:revision": 17
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511522877,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/51",
            "sbg:revision": 18
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1513786609,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/52",
            "sbg:revision": 19
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515587922,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/64",
            "sbg:revision": 20
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515590582,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/66",
            "sbg:revision": 21
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515599053,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/70",
            "sbg:revision": 22
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516365803,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/71",
            "sbg:revision": 23
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516373194,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/72",
            "sbg:revision": 24
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516899315,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/73",
            "sbg:revision": 25
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516960383,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/74",
            "sbg:revision": 26
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516968545,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/75",
            "sbg:revision": 27
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1519225983,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/76",
            "sbg:revision": 28
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1519900717,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/77",
            "sbg:revision": 29
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1520946125,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/78",
            "sbg:revision": 30
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1538570808,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_HaplotypeCaller/79",
            "sbg:revision": 31
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1549028728,
            "sbg:revisionNotes": "Latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "sbg:revision": 32
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "class": "Expression",
              "script": "{\t\n  interval_name = ''\n  \n  if ($job.inputs.include_interval_name_in_output_name){\n    if($job.inputs.intervals_file){\n      interval_path = [].concat($job.inputs.intervals_file)[0].path\n      interval_name = interval_path.split('/')[interval_path.split('/').length - 1].split('.')\n      interval_name.pop()\n      interval_name = '_' + interval_name.join('')\n    }\n  }\n  \n  read_name = [].concat($job.inputs.reads)[0].path.replace(/^.*[\\\\\\/]/, '').split('.')\n  \n  if (read_name[read_name.length - 2] == 'recalibrated')\n  \tread_namebase = read_name.slice(0, read_name.length - 2).join('.')\n  else\n    read_namebase = read_name.slice(0, read_name.length - 1).join('.')\n   \n  if($job.inputs.emit_ref_confidence == 'GVCF')\n  \treturn read_namebase + interval_name + '.g.vcf'\n  else\n  \treturn read_namebase + interval_name +  '.vcf'\n}",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "prefix": "--output"
          },
          {
            "valueFrom": {
              "class": "Expression",
              "script": "{\n  reads = [].concat($job.inputs.reads)\n  \n  if ($job.inputs.bam_output) {\n    \n    return '--bam-output ' + reads[0].path.split('/').pop().split('.').slice(0,-1).join('.') + '.reassembled.bam'\n    \n  } else {\n    \n    return ''\n    \n  }\n  \n}",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "position": 100
          }
        ],
        "sbg:project": "vladimirk/gatk-4-0-demo-1",
        "inputs": [
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#wgs_hg38_mode_memory",
            "description": "Set recommended value for memory if reference v38 is used",
            "label": "Wgs Hg38 Mode Memory",
            "sbg:category": "Optional Arguments"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--verbosity",
              "position": 0
            },
            "label": "Verbosity",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#verbosity",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "ERROR",
                  "WARNING",
                  "INFO",
                  "DEBUG"
                ],
                "type": "enum"
              }
            ],
            "description": "Control verbosity of logging. Default value: INFO. Possible values: {ERROR, WARNING, INFO, DEBUG}."
          },
          {
            "label": "Use New Qual Calculator",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-new-qual-calculator",
              "position": 0
            },
            "id": "#use_new_qual_calculator",
            "type": [
              "null",
              "boolean"
            ],
            "description": "If provided, we will use the new qual model. Default value: false. Possible values: {true, false}."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-inflater",
              "position": 0
            },
            "label": "Use Jdk Inflater",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_jdk_inflater",
            "description": "Whether to use the JdkInflater (as opposed to IntelInflater) Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-deflater",
              "position": 0
            },
            "label": "Use Jdk Deflater",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_jdk_deflater",
            "description": "Whether to use the JdkDeflater (as opposed to IntelDeflater) Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-filtered-reads-for-annotations",
              "position": 0
            },
            "label": "Use Filtered Reads For Annotations",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_filtered_reads_for_annotations",
            "description": "Use the contamination-filtered read maps for the purposes of annotating variants Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-alleles-trigger",
              "position": 0
            },
            "label": "Use Alleles Trigger",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_alleles_trigger",
            "description": "Use additional trigger on variants found in an external alleles file Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--standard-min-confidence-threshold-for-calling",
              "position": 0
            },
            "label": "Standard Min Confidence Threshold For Calling",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#standard_min_confidence_threshold_for_calling",
            "type": [
              "null",
              "float"
            ],
            "description": "The minimum phred-scaled confidence threshold at which variants should be called Default value: 10.0."
          },
          {
            "label": "Smith-Waterman",
            "sbg:category": "Advanced Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--smith-waterman"
            },
            "type": [
              "null",
              {
                "name": "smith_waterman",
                "symbols": [
                  "FASTEST_AVAILABLE",
                  "AVX_ENABLED",
                  "JAVA"
                ],
                "type": "enum"
              }
            ],
            "id": "#smith_waterman",
            "description": "Which Smith-Waterman implementation to use, generally FASTEST_AVAILABLE is the right choice  Default value: JAVA.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--seconds-between-progress-updates",
              "position": 0
            },
            "label": "Seconds Between Progress Updates",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#seconds_between_progress_updates",
            "type": [
              "null",
              "float"
            ],
            "description": "Output traversal statistics every time this many seconds elapse Default value: 10.0."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--sample-ploidy",
              "position": 0
            },
            "label": "Sample Ploidy",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#sample_ploidy",
            "type": [
              "null",
              "int"
            ],
            "description": "Ploidy (number of chromosomes) per sample. For pooled data, set to (Number of samples in each pool * Sample Ploidy). Default value: 2."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--sample-name",
              "position": 0
            },
            "label": "Sample Name",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#sample_name",
            "type": [
              "null",
              "string"
            ],
            "description": "Name of single sample to use from a multi-sample bam Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--sample",
              "position": 0
            },
            "label": "Sample",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#sample",
            "type": [
              "null",
              "string"
            ],
            "description": "The name of the sample(s) to keep, filtering out all others This argument must be specified at least once. Required."
          },
          {
            "inputBinding": {
              "secondaryFiles": [
                ".fai",
                "^.dict"
              ],
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--reference",
              "position": 0
            },
            "label": "Reference",
            "sbg:category": "Required Arguments",
            "sbg:altPrefix": "",
            "id": "#reference",
            "required": true,
            "type": [
              "File"
            ],
            "description": "Reference sequence file Required."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--recover-dangling-heads",
              "position": 0
            },
            "label": "Recover Dangling Heads",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#recover_dangling_heads",
            "description": "This argument is deprecated since version 3.3 Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "position": 0,
              "sbg:cmdInclude": true,
              "itemSeparator": null,
              "separate": true,
              "prefix": "--input",
              "secondaryFiles": [
                ".bai"
              ]
            },
            "sbg:fileTypes": "BAM",
            "label": "Reads",
            "sbg:category": "Required Arguments",
            "sbg:altPrefix": "",
            "type": [
              {
                "items": "File",
                "type": "array"
              }
            ],
            "required": true,
            "id": "#reads",
            "description": "BAM/SAM/CRAM file containing reads This argument must be specified at least once. Required."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-validation-stringency",
              "position": 0
            },
            "label": "Read Validation Stringency",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#read_validation_stringency",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "STRICT",
                  "LENIENT",
                  "SILENT"
                ],
                "type": "enum"
              }
            ],
            "description": "Validation stringency for all SAM/BAM/CRAM/SRA files read by this program. The default stringency value SILENT can improve performance when processing a BAM file in which variable-length data (read, qualities, tags) do not otherwise need to be decoded. Default value: SILENT. Possible values: {STRICT, LENIENT, SILENT}."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-name",
              "position": 0
            },
            "label": "Read Name",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#read_name",
            "type": [
              "null",
              "string"
            ],
            "description": "Keep only reads with this read name Required."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-index",
              "position": 0
            },
            "label": "Read Index",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#read_index",
            "type": [
              "null",
              "string"
            ],
            "description": "Indices to use for the read inputs. If specified, an index must be provided for every read input and in the same order as the read inputs. If this argument is not specified, the path to the index for each input will be inferred automatically. This argument may be specified 0 or more times. Default value: null."
          },
          {
            "label": "Read Group Black List",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-group-black-list",
              "position": 0
            },
            "id": "#read_group_black_list",
            "type": [
              "null",
              "string"
            ],
            "description": "This argument must be specified at least once. Required."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-filter",
              "position": 0
            },
            "label": "Read Filter",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#read_filter",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "AlignmentAgreesWithHeaderReadFilter",
                  "AllowAllReadsReadFilter",
                  "AmbiguousBaseReadFilter",
                  "CigarContainsNoNOperator",
                  "FirstOfPairReadFilter",
                  "FragmentLengthReadFilter",
                  "GoodCigarReadFilter",
                  "HasReadGroupReadFilter",
                  "LibraryReadFilter",
                  "MappedReadFilter",
                  "MappingQualityAvailableReadFilter",
                  "MappingQualityNotZeroReadFilter",
                  "MappingQualityReadFilter",
                  "MatchingBasesAndQualsReadFilter",
                  "MateDifferentStrandReadFilter",
                  "MateOnSameContigOrNoMappedMateReadFilter",
                  "MetricsReadFilter",
                  "NonZeroFragmentLengthReadFilter",
                  "NonZeroReferenceLengthAlignmentReadFilter",
                  "NotDuplicateReadFilter",
                  "NotOpticalDuplicateReadFilter",
                  "NotSecondaryAlignmentReadFilter",
                  "NotSupplementaryAlignmentReadFilter",
                  "OverclippedReadFilter",
                  "PairedReadFilter",
                  "PassesVendorQualityCheckReadFilter",
                  "PlatformReadFilter",
                  "PlatformUnitReadFilter",
                  "PrimaryLineReadFilter",
                  "ProperlyPairedReadFilter",
                  "ReadGroupBlackListReadFilter",
                  "ReadGroupReadFilter",
                  "ReadLengthEqualsCigarLengthReadFilter",
                  "ReadLengthReadFilter",
                  "ReadNameReadFilter",
                  "ReadStrandFilter",
                  "SampleReadFilter",
                  "SecondOfPairReadFilter",
                  "SeqIsStoredReadFilter",
                  "ValidAlignmentEndReadFilter",
                  "ValidAlignmentStartReadFilter",
                  "WellformedReadFilter"
                ],
                "type": "enum"
              }
            ],
            "description": "Read filters to be applied before analysis This argument may be specified 0 or more times. Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--quiet",
              "position": 0
            },
            "label": "Quiet",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#quiet",
            "description": "Whether to suppress job-summary info on System.err. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "label": "Platform Filter Name",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--platform-filter-name",
              "position": 0
            },
            "id": "#platform_filter_name",
            "type": [
              "null",
              "string"
            ],
            "description": "Platform attribute (PL) to match. This argument must be specified at least once."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--phred-scaled-global-read-mismapping-rate",
              "position": 0
            },
            "label": "Phred Scaled Global Read Mismapping Rate",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#phred_scaled_global_read_mismapping_rate",
            "type": [
              "null",
              "int"
            ],
            "description": "The global assumed mismapping rate for reads Default value: 45."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--pcr-indel-model",
              "position": 0
            },
            "label": "Pcr Indel Model",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#pcr_indel_model",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "NONE",
                  "HOSTILE",
                  "AGGRESSIVE",
                  "CONSERVATIVE"
                ],
                "type": "enum"
              }
            ],
            "description": "The PCR indel model to use Default value: CONSERVATIVE. Possible values: {NONE, HOSTILE, AGGRESSIVE, CONSERVATIVE}."
          },
          {
            "label": "Pair HMM Gap Continuation Penalty",
            "sbg:category": "Advanced Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--pair-hmm-gap-continuation-penalty",
              "position": 0
            },
            "id": "#pair_hmm_gap_continuation_penalty",
            "type": [
              "null",
              "int"
            ],
            "description": "Flat gap continuation penalty for use in the Pair HMM Default value: 10."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--output-mode",
              "position": 0
            },
            "label": "Output Mode",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#output_mode",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "EMIT_VARIANTS_ONLY",
                  "EMIT_ALL_CONFIDENT_SITES",
                  "EMIT_ALL_SITES"
                ],
                "type": "enum"
              }
            ],
            "description": "Specifies which type of calls we should output Default value: EMIT_VARIANTS_ONLY. Possible values: {EMIT_VARIANTS_ONLY, EMIT_ALL_CONFIDENT_SITES, EMIT_ALL_SITES}."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--num-pruning-samples",
              "position": 0
            },
            "label": "Num Pruning Samples",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#num_pruning_samples",
            "type": [
              "null",
              "int"
            ],
            "description": "Number of samples that must pass the minPruning threshold Default value: 1."
          },
          {
            "label": "Native Pair Hmm Use Double Precision",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--native-pair-hmm-use-double-precision"
            },
            "id": "#native_pair_hmm_use_double_precision",
            "type": [
              "null",
              "boolean"
            ],
            "description": "Use double precision in the native pairHmm. This is slower but matches the java implementation better. Default value: false."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--native-pair-hmm-threads",
              "position": 0
            },
            "label": "Native Pair Hmm Threads",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#native_pair_hmm_threads",
            "type": [
              "null",
              "int"
            ],
            "description": "How many threads should a native pairHMM implementation use Default value: 1."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--minimum-mapping-quality",
              "position": 0
            },
            "label": "Minimum Mapping Quality",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#minimum_mapping_quality",
            "type": [
              "null",
              "int"
            ],
            "description": "Minimum mapping quality to keep (inclusive) Default value: 20."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--min-read-length",
              "position": 0
            },
            "label": "Min Read Length",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#min_read_length",
            "type": [
              "null",
              "int"
            ],
            "description": "Keep only reads with length at least equal to the specified value Default value: 1."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--min-pruning",
              "position": 0
            },
            "label": "Min Pruning",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#min_pruning",
            "type": [
              "null",
              "int"
            ],
            "description": "Minimum support to not prune paths in the graph Default value: 2."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--min-dangling-branch-length",
              "position": 0
            },
            "label": "Min Dangling Branch Length",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#min_dangling_branch_length",
            "type": [
              "null",
              "int"
            ],
            "description": "Minimum length of a dangling branch to attempt recovery Default value: 4."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--min-base-quality-score",
              "position": 0
            },
            "label": "Min Base Quality Score",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#min_base_quality_score",
            "type": [
              "null",
              "int"
            ],
            "description": "Minimum base quality required to consider a base for calling Default value: 10."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--min-assembly-region-size",
              "position": 0
            },
            "label": "Min Assembly Region Size",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#min_assembly_region_size",
            "type": [
              "null",
              "int"
            ],
            "description": "Minimum size of an assembly region Default value: 50."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#memory_per_job",
            "description": "Amount of RAM memory to be used per job. Defaults to 2048MB for Single threaded jobs,and all of the available memory on the instance for multi-threaded jobs.",
            "label": "Memory Per Job",
            "sbg:category": "Execution"
          },
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#memory_overhead_per_job",
            "description": "Memory overhead per job. By default this parameter value is set to '0' (zero megabytes). This parameter value is added to the Memory per job parameter value. This results in the allocation of the sum total (Memory per job and Memory overhead per job) amount of memory per job. By default the memory per job parameter value is set to 2048 megabytes, unless specified otherwise.",
            "label": "Memory Overhead Per Job",
            "sbg:category": "Execution"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--maximum-mapping-quality",
              "position": 0
            },
            "label": "Maximum Mapping Quality",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#maximum_mapping_quality",
            "type": [
              "null",
              "int"
            ],
            "description": "Maximum mapping quality to keep (inclusive) Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-reads-per-alignment-start",
              "position": 0
            },
            "label": "Max Reads Per Alignment Start",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#max_reads_per_alignment_start",
            "type": [
              "null",
              "int"
            ],
            "description": "Maximum number of reads to retain per alignment start position. Reads above this threshold will be downsampled. Set to 0 to disable. Default value: 50."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-read-length",
              "position": 0
            },
            "label": "Max Read Length",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#max_read_length",
            "type": [
              "null",
              "int"
            ],
            "description": "Keep only reads with length at most equal to the specified value Required."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-prob-propagation-distance",
              "position": 0
            },
            "label": "Max Prob Propagation Distance",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#max_prob_propagation_distance",
            "type": [
              "null",
              "int"
            ],
            "description": "Upper limit on how many bases away probability mass can be moved around when calculating the boundaries between active and inactive assembly regions Default value: 50."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-num-haplotypes-in-population",
              "position": 0
            },
            "label": "Max Num Haplotypes In Population",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#max_num_haplotypes_in_population",
            "type": [
              "null",
              "int"
            ],
            "description": "Maximum number of haplotypes to consider for your population Default value: 128."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-genotype-count",
              "position": 0
            },
            "label": "Max Genotype Count",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#max_genotype_count",
            "type": [
              "null",
              "int"
            ],
            "description": "Maximum number of genotypes to consider at any site Default value: 1024."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-fragment-length",
              "position": 0
            },
            "label": "Max Fragment Length",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#max_fragment_length",
            "type": [
              "null",
              "int"
            ],
            "description": "Keep only read pairs with fragment length at most equal to the given value Default value: 1000000."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-assembly-region-size",
              "position": 0
            },
            "label": "Max Assembly Region Size",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#max_assembly_region_size",
            "type": [
              "null",
              "int"
            ],
            "description": "Maximum size of an assembly region Default value: 300."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-alternate-alleles",
              "position": 0
            },
            "label": "Max Alternate Alleles",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#max_alternate_alleles",
            "type": [
              "null",
              "int"
            ],
            "description": "Maximum number of alternate alleles to genotype Default value: 6."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--library",
              "position": 0
            },
            "label": "Library",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#library",
            "type": [
              "null",
              "string"
            ],
            "description": "The name of the library to keep Required."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--lenient",
              "position": 0
            },
            "label": "Lenient",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#lenient",
            "description": "Lenient processing of VCF files Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--kmer-size",
              "position": 0
            },
            "label": "Kmer Size",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#kmer_size",
            "type": [
              "null",
              "int"
            ],
            "description": "Kmer size to use in the read threading assembler This argument may be specified 0 or more times. Default value: [10, 25]."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--keep-reverse",
              "position": 0
            },
            "label": "Keep Reverse",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#keep_reverse",
            "description": "Keep only reads on the reverse strand Required. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--keep-read-group",
              "position": 0
            },
            "label": "Keep Read Group",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#keep_read_group",
            "type": [
              "null",
              "string"
            ],
            "description": "The name of the read group to keep Required."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--intervals"
            },
            "label": "Intervals String",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "string"
            ],
            "id": "#intervals_string",
            "description": "One or more genomic intervals over which to operate This argument may be specified 0 or more times. Default value: null.",
            "sbg:stageInput": null
          },
          {
            "sbg:fileTypes": "TXT, BED",
            "label": "Intervals File",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "valueFrom": {
                "class": "Expression",
                "script": "{\n  if($job.inputs.intervals_file){\n    if($job.inputs.intervals_file instanceof Array){\n      if($job.inputs.intervals_file.length > 1){\n        if([].concat($job.inputs.reads)[0].metadata)\n          if([].concat($job.inputs.reads)[0].metadata.intervals_file)\n            return '--intervals ' + [].concat($job.inputs.reads)[0].metadata.intervals_file\n      } else return '--intervals ' + [].concat($job.inputs.intervals_file)[0].path\n    } else return '--intervals ' + [].concat($job.inputs.intervals_file)[0].path\n  } else\n    return ''\n}",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": false,
              "itemSeparator": " "
            },
            "type": [
              "null",
              {
                "items": "File",
                "type": "array"
              }
            ],
            "required": false,
            "id": "#intervals_file",
            "description": "One or more genomic intervals over which to operate This argument may be specified 0 or more times. Default value: null.",
            "sbg:stageInput": "link"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-set-rule",
              "position": 0
            },
            "label": "Interval Set Rule",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#interval_set_rule",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "UNION",
                  "INTERSECTION"
                ],
                "type": "enum"
              }
            ],
            "description": "Set merging approach to use for combining interval inputs Default value: UNION. Possible values: {UNION, INTERSECTION}."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-padding",
              "position": 0
            },
            "label": "Interval Padding",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#interval_padding",
            "type": [
              "null",
              "int"
            ],
            "description": "Amount of padding (in bp) to add to each interval you are including. Default value: 0."
          },
          {
            "label": "Interval Merging Rule",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-merging-rule"
            },
            "type": [
              "null",
              {
                "name": "interval_merging_rule",
                "symbols": [
                  "ALL",
                  "OVERLAPPING_ONLY"
                ],
                "type": "enum"
              }
            ],
            "id": "#interval_merging_rule",
            "description": "Interval merging rule for abutting intervals. Default value: ALL.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-exclusion-padding",
              "position": 0
            },
            "label": "Interval Exclusion Padding",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#interval_exclusion_padding",
            "type": [
              "null",
              "int"
            ],
            "description": "Amount of padding (in bp) to add to each interval you are excluding. Default value: 0."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--input-prior",
              "position": 0
            },
            "label": "Input Prior",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#input_prior",
            "type": [
              "null",
              "float"
            ],
            "description": "Input prior for calls This argument may be specified 0 or more times. Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--indel-size-to-eliminate-in-ref-model",
              "position": 0
            },
            "label": "Indel Size To Eliminate In Ref Model",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#indel_size_to_eliminate_in_ref_model",
            "type": [
              "null",
              "int"
            ],
            "description": "The size of an indel to check for in the reference model Default value: 10."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--indel-heterozygosity",
              "position": 0
            },
            "label": "Indel Heterozygosity",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#indel_heterozygosity",
            "type": [
              "null",
              "float"
            ],
            "description": "Heterozygosity for indel calling. See the GATKDocs for heterozygosity for full details on the meaning of this population genetics concept Default value: 1.25E-4."
          },
          {
            "label": "Include Interval Name In Output Name",
            "sbg:toolDefaultValue": "FALSE",
            "id": "#include_interval_name_in_output_name",
            "type": [
              "null",
              "boolean"
            ],
            "description": "Include interval name in output name.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--heterozygosity-stdev",
              "position": 0
            },
            "label": "Heterozygosity Stdev",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#heterozygosity_stdev",
            "type": [
              "null",
              "float"
            ],
            "description": "Standard deviation of eterozygosity for SNP and indel calling. Default value: 0.01."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--heterozygosity",
              "position": 0
            },
            "label": "Heterozygosity",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#heterozygosity",
            "type": [
              "null",
              "float"
            ],
            "description": "Heterozygosity value used to compute prior likelihoods for any locus. See the GATKDocs for full details on the meaning of this population genetics concept Default value: 0.001."
          },
          {
            "label": "Gvcf GQ Bands",
            "sbg:category": "Advanced Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--gvcf-gq-bands",
              "position": 0
            },
            "id": "#gvcf_gq_bands",
            "type": [
              "null",
              "int"
            ],
            "description": "GQ thresholds for reference confidence bands This argument may be specified 0 or more times. Default value: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 70, 80, 90, 99]."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--graph-output",
              "position": 0
            },
            "label": "Graph Output",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#graph_output",
            "type": [
              "null",
              "string"
            ],
            "description": "Write debug assembly graph information to this file Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--genotyping-mode",
              "position": 0
            },
            "label": "Genotyping Mode",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#genotyping_mode",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "DISCOVERY",
                  "GENOTYPE_GIVEN_ALLELES"
                ],
                "type": "enum"
              }
            ],
            "description": "Specifies how to determine the alternate alleles to use for genotyping Default value: DISCOVERY. Possible values: {DISCOVERY, GENOTYPE_GIVEN_ALLELES}."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--filter-too-short",
              "position": 0
            },
            "label": "Filter Too Short",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#filter_too_short",
            "type": [
              "null",
              "int"
            ],
            "description": "Value for which reads with less than this number of aligned bases is considered too short Default value: 30."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--exclude-intervals"
            },
            "label": "Exclude Intervals String",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "string"
            ],
            "id": "#exclude_intervals_string",
            "description": "One or more genomic intervals to exclude from processing This argument may be specified 0 or more times. Default value: null.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--exclude-intervals"
            },
            "sbg:fileTypes": "TXT, BED",
            "label": "Exclude Intervals File",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "File"
            ],
            "required": false,
            "id": "#exclude_intervals_file",
            "description": "One or more genomic intervals to exclude from processing This argument may be specified 0 or more times. Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--emit-ref-confidence",
              "position": 0
            },
            "label": "Emit Ref Confidence",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#emit_ref_confidence",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "NONE",
                  "BP_RESOLUTION",
                  "GVCF"
                ],
                "type": "enum"
              }
            ],
            "description": "Mode for emitting reference confidence scores Default value: NONE. Possible values: {NONE, BP_RESOLUTION, GVCF}."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--dont-use-soft-clipped-bases",
              "position": 0
            },
            "label": "Dont Use Soft Clipped Bases",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#dont_use_soft_clipped_bases",
            "description": "Do not analyze soft clipped bases in the reads Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--dont-trim-active-regions",
              "position": 0
            },
            "label": "Dont Trim Active Regions",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#dont_trim_active_regions",
            "description": "If specified, we will not trim down the active region from the full region (active + extension) to just the active interval for genotyping Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--dont-require-soft-clips-both-ends",
              "position": 0
            },
            "label": "Dont Require Soft Clips Both Ends",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#dont_require_soft_clips_both_ends",
            "description": "Allow a read to be filtered out based on having only 1 soft-clipped block. By default, both ends must have a soft-clipped block, setting this flag requires only 1 soft-clipped block. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--dont-increase-kmer-sizes-for-cycles",
              "position": 0
            },
            "label": "Dont Increase Kmer Sizes For Cycles",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#dont_increase_kmer_sizes_for_cycles",
            "description": "Disable iterating over kmer sizes when graph cycles are detected Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--do-not-run-physical-phasing",
              "position": 0
            },
            "label": "Do Not Run Physical Phasing",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#do_not_run_physical_phasing",
            "description": "Disable physical phasing Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-tool-default-read-filters",
              "position": 0
            },
            "label": "Disable Tool Default Read Filters",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#disable_tool_default_read_filters",
            "description": "Disable all tool default read filters Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "label": "Disable Tool Default Annotations",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-tool-default-annotations"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#disable_tool_default_annotations",
            "description": "Disable all tool default annotations.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-sequence-dictionary-validation",
              "position": 0
            },
            "label": "Disable Sequence Dictionary Validation",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#disable_sequence_dictionary_validation",
            "description": "If specified, do not check the sequence dictionaries from our inputs for compatibility. Use at your own risk! Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-read-filter",
              "position": 0
            },
            "label": "Disable Read Filter",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#disable_read_filter",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "GoodCigarReadFilter",
                  "MappedReadFilter",
                  "MappingQualityAvailableReadFilter",
                  "MappingQualityReadFilter",
                  "NonZeroReferenceLengthAlignmentReadFilter",
                  "NotDuplicateReadFilter",
                  "NotSecondaryAlignmentReadFilter",
                  "PassesVendorQualityCheckReadFilter",
                  "WellformedReadFilter"
                ],
                "type": "enum"
              }
            ],
            "description": "Read filters to be disabled before analysis This argument may be specified 0 or more times. Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-optimizations",
              "position": 0
            },
            "label": "Disable Optimizations",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#disable_optimizations",
            "description": "Don't skip calculations in ActiveRegions with no variants Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-bam-index-caching",
              "position": 0
            },
            "label": "Disable Bam Index Caching",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#disable_bam_index_caching",
            "description": "If true, don't cache bam indexes, this will reduce memory requirements but may harm performance if many intervals are specified. Caching is automatically disabled if there are no intervals specified. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--debug",
              "position": 0
            },
            "label": "Debug",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#debug",
            "description": "Print out very verbose debug information about each triggering active region Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:fileTypes": "GZ",
            "label": "dbsnp gzipped",
            "required": false,
            "inputBinding": {
              "valueFrom": {
                "class": "Expression",
                "script": "{\n  if($job.inputs.dbsnp_gz)\n    return '--dbsnp ' + [].concat($job.inputs.dbsnp_gz)[0].path\n  else return ''\n}",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "secondaryFiles": [
                ".tbi"
              ]
            },
            "id": "#dbsnp_gz",
            "type": [
              "null",
              "File"
            ],
            "description": "dbsnp gzipped"
          },
          {
            "inputBinding": {
              "valueFrom": {
                "class": "Expression",
                "script": "{\n  if($job.inputs.db_snp)\n    return '--dbsnp ' + [].concat($job.inputs.db_snp)[0].path\n  else return ''\n}",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "secondaryFiles": [
                ".idx"
              ],
              "position": 0
            },
            "sbg:fileTypes": "VCF",
            "label": "Db Snp",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "-D",
            "type": [
              "null",
              "File"
            ],
            "required": false,
            "id": "#db_snp",
            "description": "DbSNP file Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-variant-md5",
              "position": 0
            },
            "label": "Create Output Variant Md5",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#create_output_variant_md5",
            "description": "If true, create a a MD5 digest any VCF file created. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-variant-index",
              "position": 0
            },
            "label": "Create Output Variant Index",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#create_output_variant_index",
            "description": "If true, create a VCF index when writing a coordinate-sorted VCF file. Default value: true. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-bam-md5",
              "position": 0
            },
            "label": "Create Output Bam Md5",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#create_output_bam_md5",
            "description": "If true, create a MD5 digest for any BAM/SAM/CRAM file created Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-bam-index",
              "position": 0
            },
            "label": "Create Output Bam Index",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#create_output_bam_index",
            "description": "If true, create a BAM/CRAM index when writing a coordinate-sorted BAM/CRAM file. Default value: true. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#cpus_per_job",
            "description": "For tools which support multiprocessing, this value can be used to set the number of threads to be used. Set to 0 for auto-detect (use with caution,as auto-detect will find the optimal value in most cases).",
            "label": "Cpus Per Job"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--contamination-fraction-to-filter",
              "position": 0
            },
            "label": "Contamination Fraction To Filter",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#contamination_fraction_to_filter",
            "type": [
              "null",
              "float"
            ],
            "description": "Fraction of contamination in sequencing data (for all samples) to aggressively remove Default value: 0.0."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--contamination-fraction-per-sample-file",
              "position": 0
            },
            "label": "Contamination Fraction Per Sample File",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#contamination_fraction_per_sample_file",
            "required": false,
            "type": [
              "null",
              "File"
            ],
            "description": "Tab-separated File containing fraction of contamination in sequencing data (per sample) to aggressively remove. Format should be \"<SampleID><TAB><Contamination>\" (Contamination is double) per line; No header. Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--consensus",
              "position": 0
            },
            "label": "Consensus",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#consensus",
            "description": "Consensus mode Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--comp",
              "position": 0
            },
            "label": "Comp",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#comp",
            "type": [
              "null",
              "string"
            ],
            "description": "Comparison VCF file(s) This argument may be specified 0 or more times. Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--cloud-prefetch-buffer",
              "position": 0
            },
            "label": "Cloud Prefetch Buffer",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#cloud_prefetch_buffer",
            "type": [
              "null",
              "int"
            ],
            "description": "Size of the cloud-only prefetch buffer (in MB; 0 to disable). Default value: 40."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--cloud-index-prefetch-buffer",
              "position": 0
            },
            "label": "Cloud Index Prefetch Buffer",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#cloud_index_prefetch_buffer",
            "type": [
              "null",
              "int"
            ],
            "description": "Size of the cloud-only prefetch buffer (in MB; 0 to disable). Defaults to cloudPrefetchBuffer if unset. Default value: -1."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--black-listed-lanes",
              "position": 0
            },
            "label": "Black Listed Lanes",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#black_listed_lanes",
            "type": [
              "null",
              "string"
            ],
            "description": "Keep reads with platform units not on the list This argument must be specified at least once. Required."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--base-quality-score-threshold",
              "position": 0
            },
            "label": "Base Quality Score Threshold",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#base_quality_score_threshold",
            "type": [
              "null",
              "int"
            ],
            "description": "Base qualities below this threshold will be reduced to the minimum (6) Default value: 18."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--bam-writer-type",
              "position": 0
            },
            "label": "Bam Writer Type",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#bam_writer_type",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "ALL_POSSIBLE_HAPLOTYPES",
                  "CALLED_HAPLOTYPES"
                ],
                "type": "enum"
              }
            ],
            "description": "Which haplotypes should be written to the BAM Default value: CALLED_HAPLOTYPES. Possible values: {ALL_POSSIBLE_HAPLOTYPES, CALLED_HAPLOTYPES}."
          },
          {
            "label": "Bam Output",
            "sbg:category": "Advanced Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--bam-output"
            },
            "id": "#bam_output",
            "type": [
              "null",
              "boolean"
            ],
            "description": "File to which assembled haplotypes should be written Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--assembly-region-padding",
              "position": 0
            },
            "label": "Assembly Region Padding",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#assembly_region_padding",
            "type": [
              "null",
              "int"
            ],
            "description": "Number of additional bases of context to include around each assembly region Default value: 100."
          },
          {
            "label": "Annotations To Exclude",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--annotations-to-exclude",
              "position": 0
            },
            "id": "#annotations_to_exclude",
            "type": [
              "null",
              "string"
            ],
            "description": "One or more specific annotations to exclude from variant calls  This argument may be specified 0 or more times. Default value: null."
          },
          {
            "label": "Annotation Group",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--annotation-group"
            },
            "id": "#annotation_group",
            "type": [
              "null",
              "string"
            ],
            "description": "One or more groups of annotations to apply to variant calls  This argument may be specified 0 or more times. Default value: [StandardAnnotation, StandardHCAnnotation]."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--annotation",
              "position": 0
            },
            "label": "Annotation",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#annotation",
            "type": [
              "null",
              "string"
            ],
            "description": "One or more specific annotations to apply to variant calls This argument may be specified 0 or more times. Default value: null."
          },
          {
            "label": "Annotate Nda",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--annotate-with-num-discovered-alleles",
              "position": 0
            },
            "id": "#annotate_nda",
            "type": [
              "null",
              "boolean"
            ],
            "description": "If provided, we will annotate records with the number of alternate alleles that were discovered (but not necessarily genotyped) at a given site Default value: false. Possible values: {true, false}."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--ambig-filter-frac",
              "position": 0
            },
            "label": "Ambig Filter Frac",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#ambig_filter_frac",
            "type": [
              "null",
              "float"
            ],
            "description": "Threshold fraction of non-regular bases (e.g. N) above which to filter Default value: 0.05."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--ambig-filter-bases"
            },
            "label": "Ambig Filter Bases",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#ambig_filter_bases",
            "description": "Threshold number of ambiguous bases. If null, uses threshold fraction; otherwise, overrides threshold fraction. Cannot be used in conjunction with argument(s) maxAmbiguousBaseFraction.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--allow-non-unique-kmers-in-ref",
              "position": 0
            },
            "label": "Allow Non Unique Kmers In Ref",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#allow_non_unique_kmers_in_ref",
            "description": "Allow graphs that have non-unique kmers in the reference Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "label": "Alleles",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "secondaryFiles": [
                ".idx"
              ],
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--alleles",
              "position": 0
            },
            "id": "#alleles",
            "required": false,
            "type": [
              "null",
              "File"
            ],
            "description": "The set of alleles at which to genotype when --genotyping_mode is GENOTYPE_GIVEN_ALLELES Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--all-site-p-ls",
              "position": 0
            },
            "label": "All Site P Ls",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#all_site_p_ls",
            "description": "Annotate all sites with PLs Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--add-output-sam-program-record",
              "position": 0
            },
            "label": "Add Output Sam Program Record",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "boolean"
            ],
            "id": "#add_output_sam_program_record",
            "description": "If true, adds a PG tag to created SAM/BAM/CRAM files. Default value: true. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "label": "Activity Profile Out",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--activity-profile-out"
            },
            "id": "#activity_profile_out",
            "type": [
              "null",
              "string"
            ],
            "description": "Output the raw activity profile results in IGV format. Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--active-probability-threshold",
              "position": 0
            },
            "label": "Active Probability Threshold",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#active_probability_threshold",
            "type": [
              "null",
              "float"
            ],
            "description": "Minimum probability for a locus to be considered active. Default value: 0.002."
          }
        ],
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "https://software.broadinstitute.org/gatk/",
            "label": "Homepage"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/documentation/tooldocs/current/",
            "label": "Documentation"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/download/",
            "label": "Download"
          }
        ],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkitVersion": "4.0.2.0",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "sbg:toolAuthor": "Broad Institute",
        "sbg:projectName": "GATK 4.0 - Demo",
        "baseCommand": [
          "/gatk/gatk",
          "--java-options",
          {
            "class": "Expression",
            "script": "{\n  memory = 0\n  \n  if($job.inputs.memory_per_job){\n  \t memory = $job.inputs.memory_per_job\n  }\n  else{\n    if($job.inputs.wgs_hg38_mode_memory){\n      \treference_name = $job.inputs.reference.path.replace(/^.*[\\\\\\/]/, '')\n      \n       \tif(reference_name.indexOf('38') >-1){\n      \t\tmemory = $job.inputs.wgs_hg38_mode_memory\n    \t}\n        else{\n       \t\tmemory = 2048 \n        }\n    }\n  \telse{\n       memory = 2048\n  \t}\n  }\n  \n  return '\\\"-Xmx'.concat(memory, 'M') + '\\\"'\n}",
            "engine": "#cwl-js-engine"
          },
          "HaplotypeCaller"
        ],
        "stdin": "",
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "teodora.aleksic",
        "outputs": [
          {
            "sbg:fileTypes": "VCF",
            "label": "VCF",
            "type": [
              "null",
              "File"
            ],
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#reads",
              "glob": "*.vcf",
              "secondaryFiles": [
                ".idx"
              ]
            },
            "id": "#output_vcf",
            "description": "A raw, unfiltered, highly specific callset in VCF format."
          },
          {
            "sbg:fileTypes": "BAM",
            "label": "Output BAM",
            "type": [
              "null",
              "File"
            ],
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#reads",
              "glob": "*.bam",
              "secondaryFiles": [
                ".bai"
              ]
            },
            "id": "#output_bam",
            "description": "Reassembled BAM outputted if the appropriate flag is set."
          }
        ],
        "label": "GATK HaplotypeCaller",
        "sbg:createdOn": 1500296570,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": 358.0151683078867,
        "sbg:license": "Open source BSD (3-clause) license",
        "sbg:image_url": null,
        "sbg:contributors": [
          "vladimirk",
          "teodora.aleksic"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": "",
        "id": "vladimirk/gatk-4-0-demo-1/gatk-4-0-haplotypecaller/32",
        "description": "Call germline SNPs and indels via local re-assembly of haplotypes.\n\n###**Overview**  \n\nThe HaplotypeCaller is capable of calling SNPs and indels simultaneously via local de-novo assembly of haplotypes in an active region. In other words, whenever the program encounters a region showing signs of variation, it discards the existing mapping information and completely reassembles the reads in that region. This allows the HaplotypeCaller to be more accurate when calling regions that are traditionally difficult to call, for example when they contain different types of variants close to each other. It also makes the HaplotypeCaller much better at calling indels than position-based callers like UnifiedGenotyper.\n\nIn the GVCF workflow used for scalable variant calling in DNA sequence data, HaplotypeCaller runs per-sample to generate an intermediate GVCF (not to be used in final analysis), which can then be used in GenotypeGVCFs for joint genotyping of multiple samples in a very efficient way. The GVCF workflow enables rapid incremental processing of samples as they roll off the sequencer, as well as scaling to very large cohort sizes (e.g. the 92K exomes of ExAC).\n\nIn addition, HaplotypeCaller is able to handle non-diploid organisms as well as pooled experiment data. Note however that the algorithms used to calculate variant likelihoods is not well suited to extreme allele frequencies (relative to ploidy) so its use is not recommended for somatic (cancer) variant discovery. For that purpose, use Mutect2 instead.\n\nFinally, HaplotypeCaller is also able to correctly handle the splice junctions that make RNAseq a challenge for most variant callers, on the condition that the input read data has previously been processed according to our recommendations as documented here. \n\n###**Input**  \nInput bam file(s) from which to make variant calls\n\n###**Output**  \nEither a VCF or GVCF file with raw, unfiltered SNP and indel calls. Regular VCFs must be filtered either by variant recalibration (Best Practice) or hard-filtering before use in downstream analyses. If using the GVCF workflow, the output is a GVCF file that must first be run through GenotypeGVCFs and then filtering before further analysis.\n\n###**Usage examples**  \nThese are example commands that show how to run HaplotypeCaller for typical use cases. Have a look at the method documentation for the basic GVCF workflow.\n\n####**Single-sample GVCF calling (outputs intermediate GVCF)**\n\n     gatk-launch --javaOptions \"-Xmx4g\" HaplotypeCaller  \\\n       -R reference.fasta \\\n       -I input.bam \\\n       -O output.g.vcf \\\n       -ERC GVCF\n\n####**Single-sample GVCF calling with allele-specific annotations**\n\n     gatk-launch --javaOptions \"-Xmx4g\" HaplotypeCaller  \\\n       -R reference.fasta \\\n       -I input.bam \\\n       -O output.g.vcf \\\n       -ERC GVCF \\\n       -G Standard \\\n       -G AS_Standard\n\n####**Variant calling with bamout to show realigned reads**\n\n     gatk-launch --javaOptions \"-Xmx4g\" HaplotypeCaller  \\\n       -R reference.fasta \\\n       -I input.bam \\\n       -O output.vcf \\\n       -bamout bamout.bam\n\n###**Caveats**\n\n- We have not yet fully tested the interaction between the GVCF-based calling or the multisample calling and the RNAseq-specific functionalities. Use those in combination at your own risk.\n\n###**Special note on ploidy**\n\nThis tool is able to handle many non-diploid use cases; the desired ploidy can be specified using the -ploidy argument. Note however that very high ploidies (such as are encountered in large pooled experiments) may cause performance challenges including excessive slowness. We are working on resolving these limitations.\n\n###**Additional Notes**\n- When working with PCR-free data, be sure to set `-pcr_indel_model NONE` (see argument below).\n- When running in `-ERC GVCF` or `-ERC BP_RESOLUTION` modes, the confidence threshold is automatically set to 0. This cannot be overridden by the command line. The threshold can be set manually to the desired level in the next step of the workflow (GenotypeGVCFs)\n- We recommend using a list of intervals to speed up analysis. See this document for details.\n- When using genotype given alleles mode, GATK HaplotypeCaller will try to confirm mutations in a given BAM file. If there are no reads for a position given in the alleles file, the output VCF will not contain that position.\n- By default, the tool works only with VCF resource files. To use VCF.GZ resource files, the tool wrapper needs to be modified.\n\n###**IMPORTANT NOTICE**  \n\nTools in GATK that require a fasta reference file also look for the reference file's corresponding *.fai* (fasta index) and *.dict* (fasta dictionary) files. The fasta index file allows random access to reference bases and the dictionary file is a dictionary of the contig names and sizes contained within the fasta reference. These two secondary files are essential for GATK to work properly. To append these two files to your fasta reference please use the '***SBG FASTA Indices***' tool within your GATK based workflow before using any of the GATK tools.",
        "sbg:toolkit": "GATK",
        "sbg:content_hash": "afac20e2c9606ccb630707d26f06ba58fba2bb07526ee0d2cc05d7fe80770433e",
        "sbg:revisionNotes": "Latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
        "sbg:revision": 32,
        "sbg:categories": [
          "GATK-4"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1549028728,
        "sbg:id": "h-695200a9/h-440bac15/h-b1bf3307/0",
        "temporaryFailCodes": []
      },
      "id": "#GATK_HaplotypeCaller",
      "sbg:y": 358.0151683078867
    },
    {
      "sbg:x": 931.6679014365909,
      "inputs": [
        {
          "id": "#GATK_IndexFeatureFile.verbosity"
        },
        {
          "id": "#GATK_IndexFeatureFile.use_jdk_inflater"
        },
        {
          "id": "#GATK_IndexFeatureFile.use_jdk_deflater"
        },
        {
          "id": "#GATK_IndexFeatureFile.quiet"
        },
        {
          "id": "#GATK_IndexFeatureFile.memory_per_job"
        },
        {
          "id": "#GATK_IndexFeatureFile.memory_overhead_per_job"
        },
        {
          "source": [
            "#dbsnp"
          ],
          "id": "#GATK_IndexFeatureFile.feature_file"
        }
      ],
      "outputs": [
        {
          "id": "#GATK_IndexFeatureFile.output_with_index"
        },
        {
          "id": "#GATK_IndexFeatureFile.index"
        }
      ],
      "run": {
        "x": 931.6679014365909,
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "dockerImageId": "3c3b8e0ed4e5"
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "class": "Expression",
              "script": "{\n  if($job.inputs.memory_per_job){\n    if($job.inputs.memory_overhead_per_job){\n    \treturn $job.inputs.memory_per_job + $job.inputs.memory_overhead_per_job\n    }\n    else\n  \t\treturn $job.inputs.memory_per_job\n  }\n  else if(!$job.inputs.memory_per_job && $job.inputs.memory_overhead_per_job){\n\t\treturn 2048 + $job.inputs.memory_overhead_per_job  \n  }\n  else\n  \treturn 2048\n}",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          }
        ],
        "sbg:latestRevision": 15,
        "sbg:cmdPreview": "/gatk/gatk --java-options \"-Xmx2048M\" IndexFeatureFile --feature-file /path/to/feature_file.vcf.gz --output feature_file.vcf.gz.tbi",
        "sbg:job": {
          "allocatedResources": {
            "mem": 2048,
            "cpu": 1
          },
          "inputs": {
            "memory_overhead_per_job": 0,
            "memory_per_job": 2048,
            "feature_file": {
              "path": "/path/to/feature_file.vcf.gz",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "use_jdk_inflater": false,
            "use_jdk_deflater": false,
            "QUIET": false
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500296617,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/16",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500367649,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/17",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500640357,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/18",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500887430,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/20",
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1503405190,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/21",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504105732,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/22",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504108418,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/23",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504109513,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/24",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504273463,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/26",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504275173,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/27",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1509714097,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/29",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511522886,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/30",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515587930,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/40",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515590594,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/42",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1520946086,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/43",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1549037925,
            "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "sbg:revision": 15
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "class": "Expression",
              "script": "{\n  \toutput_name = $job.inputs.feature_file.path.split('/').slice(-1)[0]\n    \n    if (output_name.endsWith('.gz')) {\n    \treturn output_name + '.tbi'\n    }\n  \telse {\n     \treturn output_name + '.idx'\n  \t}  \n}",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "prefix": "--output"
          }
        ],
        "sbg:project": "vladimirk/gatk-4-0-demo-1",
        "inputs": [
          {
            "sbg:altPrefix": "",
            "label": "Verbosity",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--verbosity",
              "position": 0
            },
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "ERROR",
                  "WARNING",
                  "INFO",
                  "DEBUG"
                ],
                "type": "enum"
              }
            ],
            "id": "#verbosity",
            "description": "Control verbosity of logging. Default value: INFO. Possible values: {ERROR, WARNING, INFO, DEBUG}."
          },
          {
            "sbg:altPrefix": "",
            "label": "Use Jdk Inflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-inflater",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_jdk_inflater",
            "description": "Whether to use the JdkInflater (as opposed to IntelInflater) Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Use Jdk Deflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-deflater",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_jdk_deflater",
            "description": "Whether to use the JdkDeflater (as opposed to IntelDeflater) Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Quiet",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--quiet",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#quiet",
            "description": "Whether to suppress job-summary info on System.err. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#memory_per_job",
            "label": "Memory Per Job",
            "description": "Memory per job",
            "sbg:category": "Execution"
          },
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#memory_overhead_per_job",
            "label": "Memory Overhead Per Job",
            "description": "Memory overhead per job",
            "sbg:category": "Execution"
          },
          {
            "sbg:altPrefix": "",
            "label": "Feature File",
            "sbg:category": "Required Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--feature-file",
              "position": 0
            },
            "type": [
              "File"
            ],
            "required": true,
            "id": "#feature_file",
            "description": "Feature file (eg., VCF or BED file) to index. Must be in a tribble-supported format Required.",
            "sbg:stageInput": "link"
          }
        ],
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "https://software.broadinstitute.org/gatk/",
            "label": "Homepage"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/documentation/tooldocs/current/",
            "label": "Documentation"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/download/",
            "label": "Download"
          }
        ],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkitVersion": "4.0.2.0",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "sbg:toolAuthor": "Broad Institute",
        "sbg:projectName": "GATK 4.0 - Demo",
        "baseCommand": [
          "/gatk/gatk",
          "--java-options",
          {
            "class": "Expression",
            "script": "{\n  if($job.inputs.memory_per_job){\n  \treturn '\\\"-Xmx'.concat($job.inputs.memory_per_job, 'M') + '\\\"'\n  }\n  \treturn '\\\"-Xmx2048M\\\"'\n}",
            "engine": "#cwl-js-engine"
          },
          "IndexFeatureFile"
        ],
        "stdin": "",
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "teodora.aleksic",
        "outputs": [
          {
            "sbg:fileTypes": "VCF,BED,RECAL",
            "label": "Output file with index",
            "type": [
              "File"
            ],
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#feature_file",
              "glob": {
                "class": "Expression",
                "script": "{\n  \treturn $job.inputs.feature_file.path.split('/').slice(-1)[0]\n}",
                "engine": "#cwl-js-engine"
              },
              "secondaryFiles": [
                ".idx"
              ]
            },
            "id": "#output_with_index",
            "description": "Output file with index."
          },
          {
            "sbg:fileTypes": "IDX",
            "label": "Index file",
            "type": [
              "null",
              "File"
            ],
            "outputBinding": {
              "glob": {
                "class": "Expression",
                "script": "{\n  \toutput_name = $job.inputs.feature_file.path.split('/').slice(-1)[0]\n    \n    if (output_name.endsWith('.gz')) {\n    \treturn output_name + '.tbi'\n    }\n  \telse {\n     \treturn output_name + '.idx'\n  \t}  \n}",
                "engine": "#cwl-js-engine"
              }
            },
            "id": "#index",
            "description": "Index file"
          }
        ],
        "label": "GATK IndexFeatureFile",
        "sbg:createdOn": 1500296617,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": 1019.0484846395861,
        "sbg:license": "Open source BSD (3-clause) license",
        "sbg:contributors": [
          "vladimirk",
          "teodora.aleksic"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": "",
        "id": "vladimirk/gatk-4-0-demo-1/gatk-4-0-index-feature-file/15",
        "description": "Creates indices for Feature-containing files, such as VCF and BED files.\n\n###**Overview** \nCreates indices for Feature-containing files, such as VCF and BED files.\n\n###**Inputs**  \nA feature file to be indexed.  \n\n###**Outputs**  \nAn index file.\n\n###**Usage example**\n\n    java -Xmx4g -jar gatk.jar \\  \n         IndexFeatureFile \\  \n         --feature_file feature_file.vcf \\ \n         --output feature_file.vcf.idx",
        "sbg:content_hash": "af3015979706ca747d636a4dfa5f99cbd6178fdb365d1636631653c6dbab9c3d0",
        "sbg:toolkit": "GATK",
        "sbg:image_url": null,
        "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
        "sbg:revision": 15,
        "sbg:categories": [
          "GATK-4"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1549037925,
        "sbg:id": "h-7185d772/h-de1822aa/h-967685c2/0",
        "temporaryFailCodes": []
      },
      "id": "#GATK_IndexFeatureFile",
      "sbg:y": 1019.0484846395861
    },
    {
      "sbg:x": 945.239030821019,
      "inputs": [
        {
          "id": "#GATK_IndexFeatureFile_1.verbosity"
        },
        {
          "id": "#GATK_IndexFeatureFile_1.use_jdk_inflater"
        },
        {
          "id": "#GATK_IndexFeatureFile_1.use_jdk_deflater"
        },
        {
          "id": "#GATK_IndexFeatureFile_1.quiet"
        },
        {
          "id": "#GATK_IndexFeatureFile_1.memory_per_job"
        },
        {
          "id": "#GATK_IndexFeatureFile_1.memory_overhead_per_job"
        },
        {
          "source": [
            "#mills"
          ],
          "id": "#GATK_IndexFeatureFile_1.feature_file"
        }
      ],
      "outputs": [
        {
          "id": "#GATK_IndexFeatureFile_1.output_with_index"
        },
        {
          "id": "#GATK_IndexFeatureFile_1.index"
        }
      ],
      "run": {
        "x": 945.239030821019,
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "dockerImageId": "3c3b8e0ed4e5"
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "class": "Expression",
              "script": "{\n  if($job.inputs.memory_per_job){\n    if($job.inputs.memory_overhead_per_job){\n    \treturn $job.inputs.memory_per_job + $job.inputs.memory_overhead_per_job\n    }\n    else\n  \t\treturn $job.inputs.memory_per_job\n  }\n  else if(!$job.inputs.memory_per_job && $job.inputs.memory_overhead_per_job){\n\t\treturn 2048 + $job.inputs.memory_overhead_per_job  \n  }\n  else\n  \treturn 2048\n}",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          }
        ],
        "sbg:latestRevision": 15,
        "sbg:cmdPreview": "/gatk/gatk --java-options \"-Xmx2048M\" IndexFeatureFile --feature-file /path/to/feature_file.vcf.gz --output feature_file.vcf.gz.tbi",
        "sbg:job": {
          "allocatedResources": {
            "mem": 2048,
            "cpu": 1
          },
          "inputs": {
            "memory_overhead_per_job": 0,
            "memory_per_job": 2048,
            "feature_file": {
              "path": "/path/to/feature_file.vcf.gz",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "use_jdk_inflater": false,
            "use_jdk_deflater": false,
            "QUIET": false
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500296617,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/16",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500367649,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/17",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500640357,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/18",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500887430,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/20",
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1503405190,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/21",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504105732,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/22",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504108418,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/23",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504109513,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/24",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504273463,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/26",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504275173,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/27",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1509714097,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/29",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511522886,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/30",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515587930,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/40",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515590594,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/42",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1520946086,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/43",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1549037925,
            "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "sbg:revision": 15
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "class": "Expression",
              "script": "{\n  \toutput_name = $job.inputs.feature_file.path.split('/').slice(-1)[0]\n    \n    if (output_name.endsWith('.gz')) {\n    \treturn output_name + '.tbi'\n    }\n  \telse {\n     \treturn output_name + '.idx'\n  \t}  \n}",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "prefix": "--output"
          }
        ],
        "sbg:project": "vladimirk/gatk-4-0-demo-1",
        "inputs": [
          {
            "sbg:altPrefix": "",
            "label": "Verbosity",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--verbosity",
              "position": 0
            },
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "ERROR",
                  "WARNING",
                  "INFO",
                  "DEBUG"
                ],
                "type": "enum"
              }
            ],
            "id": "#verbosity",
            "description": "Control verbosity of logging. Default value: INFO. Possible values: {ERROR, WARNING, INFO, DEBUG}."
          },
          {
            "sbg:altPrefix": "",
            "label": "Use Jdk Inflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-inflater",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_jdk_inflater",
            "description": "Whether to use the JdkInflater (as opposed to IntelInflater) Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Use Jdk Deflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-deflater",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_jdk_deflater",
            "description": "Whether to use the JdkDeflater (as opposed to IntelDeflater) Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Quiet",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--quiet",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#quiet",
            "description": "Whether to suppress job-summary info on System.err. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#memory_per_job",
            "label": "Memory Per Job",
            "description": "Memory per job",
            "sbg:category": "Execution"
          },
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#memory_overhead_per_job",
            "label": "Memory Overhead Per Job",
            "description": "Memory overhead per job",
            "sbg:category": "Execution"
          },
          {
            "sbg:altPrefix": "",
            "label": "Feature File",
            "sbg:category": "Required Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--feature-file",
              "position": 0
            },
            "type": [
              "File"
            ],
            "required": true,
            "id": "#feature_file",
            "description": "Feature file (eg., VCF or BED file) to index. Must be in a tribble-supported format Required.",
            "sbg:stageInput": "link"
          }
        ],
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "https://software.broadinstitute.org/gatk/",
            "label": "Homepage"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/documentation/tooldocs/current/",
            "label": "Documentation"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/download/",
            "label": "Download"
          }
        ],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkitVersion": "4.0.2.0",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "sbg:toolAuthor": "Broad Institute",
        "sbg:projectName": "GATK 4.0 - Demo",
        "baseCommand": [
          "/gatk/gatk",
          "--java-options",
          {
            "class": "Expression",
            "script": "{\n  if($job.inputs.memory_per_job){\n  \treturn '\\\"-Xmx'.concat($job.inputs.memory_per_job, 'M') + '\\\"'\n  }\n  \treturn '\\\"-Xmx2048M\\\"'\n}",
            "engine": "#cwl-js-engine"
          },
          "IndexFeatureFile"
        ],
        "stdin": "",
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "teodora.aleksic",
        "outputs": [
          {
            "sbg:fileTypes": "VCF,BED,RECAL",
            "label": "Output file with index",
            "type": [
              "File"
            ],
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#feature_file",
              "glob": {
                "class": "Expression",
                "script": "{\n  \treturn $job.inputs.feature_file.path.split('/').slice(-1)[0]\n}",
                "engine": "#cwl-js-engine"
              },
              "secondaryFiles": [
                ".idx"
              ]
            },
            "id": "#output_with_index",
            "description": "Output file with index."
          },
          {
            "sbg:fileTypes": "IDX",
            "label": "Index file",
            "type": [
              "null",
              "File"
            ],
            "outputBinding": {
              "glob": {
                "class": "Expression",
                "script": "{\n  \toutput_name = $job.inputs.feature_file.path.split('/').slice(-1)[0]\n    \n    if (output_name.endsWith('.gz')) {\n    \treturn output_name + '.tbi'\n    }\n  \telse {\n     \treturn output_name + '.idx'\n  \t}  \n}",
                "engine": "#cwl-js-engine"
              }
            },
            "id": "#index",
            "description": "Index file"
          }
        ],
        "label": "GATK IndexFeatureFile",
        "sbg:createdOn": 1500296617,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": 843.2409392691023,
        "sbg:license": "Open source BSD (3-clause) license",
        "sbg:contributors": [
          "vladimirk",
          "teodora.aleksic"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": "",
        "id": "vladimirk/gatk-4-0-demo-1/gatk-4-0-index-feature-file/15",
        "description": "Creates indices for Feature-containing files, such as VCF and BED files.\n\n###**Overview** \nCreates indices for Feature-containing files, such as VCF and BED files.\n\n###**Inputs**  \nA feature file to be indexed.  \n\n###**Outputs**  \nAn index file.\n\n###**Usage example**\n\n    java -Xmx4g -jar gatk.jar \\  \n         IndexFeatureFile \\  \n         --feature_file feature_file.vcf \\ \n         --output feature_file.vcf.idx",
        "sbg:content_hash": "af3015979706ca747d636a4dfa5f99cbd6178fdb365d1636631653c6dbab9c3d0",
        "sbg:toolkit": "GATK",
        "sbg:image_url": null,
        "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
        "sbg:revision": 15,
        "sbg:categories": [
          "GATK-4"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1549037925,
        "sbg:id": "h-d0e8caad/h-15ad5d4a/h-d1a4a0e8/0",
        "temporaryFailCodes": []
      },
      "id": "#GATK_IndexFeatureFile_1",
      "sbg:y": 843.2409392691023
    },
    {
      "sbg:x": 938.3335333797737,
      "inputs": [
        {
          "id": "#GATK_IndexFeatureFile_2.verbosity"
        },
        {
          "id": "#GATK_IndexFeatureFile_2.use_jdk_inflater"
        },
        {
          "id": "#GATK_IndexFeatureFile_2.use_jdk_deflater"
        },
        {
          "id": "#GATK_IndexFeatureFile_2.quiet"
        },
        {
          "id": "#GATK_IndexFeatureFile_2.memory_per_job"
        },
        {
          "id": "#GATK_IndexFeatureFile_2.memory_overhead_per_job"
        },
        {
          "source": [
            "#known_indels_1000g_bqsr"
          ],
          "id": "#GATK_IndexFeatureFile_2.feature_file"
        }
      ],
      "outputs": [
        {
          "id": "#GATK_IndexFeatureFile_2.output_with_index"
        },
        {
          "id": "#GATK_IndexFeatureFile_2.index"
        }
      ],
      "run": {
        "x": 938.3335333797737,
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "dockerImageId": "3c3b8e0ed4e5"
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "class": "Expression",
              "script": "{\n  if($job.inputs.memory_per_job){\n    if($job.inputs.memory_overhead_per_job){\n    \treturn $job.inputs.memory_per_job + $job.inputs.memory_overhead_per_job\n    }\n    else\n  \t\treturn $job.inputs.memory_per_job\n  }\n  else if(!$job.inputs.memory_per_job && $job.inputs.memory_overhead_per_job){\n\t\treturn 2048 + $job.inputs.memory_overhead_per_job  \n  }\n  else\n  \treturn 2048\n}",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          }
        ],
        "sbg:latestRevision": 15,
        "sbg:cmdPreview": "/gatk/gatk --java-options \"-Xmx2048M\" IndexFeatureFile --feature-file /path/to/feature_file.vcf.gz --output feature_file.vcf.gz.tbi",
        "sbg:job": {
          "allocatedResources": {
            "mem": 2048,
            "cpu": 1
          },
          "inputs": {
            "memory_overhead_per_job": 0,
            "memory_per_job": 2048,
            "feature_file": {
              "path": "/path/to/feature_file.vcf.gz",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "use_jdk_inflater": false,
            "use_jdk_deflater": false,
            "QUIET": false
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500296617,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/16",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500367649,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/17",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500640357,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/18",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500887430,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/20",
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1503405190,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/21",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504105732,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/22",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504108418,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/23",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504109513,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/24",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504273463,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/26",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504275173,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/27",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1509714097,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/29",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511522886,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/30",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515587930,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/40",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515590594,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/42",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1520946086,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-index-feature-file/43",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1549037925,
            "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "sbg:revision": 15
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "class": "Expression",
              "script": "{\n  \toutput_name = $job.inputs.feature_file.path.split('/').slice(-1)[0]\n    \n    if (output_name.endsWith('.gz')) {\n    \treturn output_name + '.tbi'\n    }\n  \telse {\n     \treturn output_name + '.idx'\n  \t}  \n}",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "prefix": "--output"
          }
        ],
        "sbg:project": "vladimirk/gatk-4-0-demo-1",
        "inputs": [
          {
            "sbg:altPrefix": "",
            "label": "Verbosity",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--verbosity",
              "position": 0
            },
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "ERROR",
                  "WARNING",
                  "INFO",
                  "DEBUG"
                ],
                "type": "enum"
              }
            ],
            "id": "#verbosity",
            "description": "Control verbosity of logging. Default value: INFO. Possible values: {ERROR, WARNING, INFO, DEBUG}."
          },
          {
            "sbg:altPrefix": "",
            "label": "Use Jdk Inflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-inflater",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_jdk_inflater",
            "description": "Whether to use the JdkInflater (as opposed to IntelInflater) Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Use Jdk Deflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-deflater",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_jdk_deflater",
            "description": "Whether to use the JdkDeflater (as opposed to IntelDeflater) Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Quiet",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--quiet",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#quiet",
            "description": "Whether to suppress job-summary info on System.err. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#memory_per_job",
            "label": "Memory Per Job",
            "description": "Memory per job",
            "sbg:category": "Execution"
          },
          {
            "type": [
              "null",
              "int"
            ],
            "id": "#memory_overhead_per_job",
            "label": "Memory Overhead Per Job",
            "description": "Memory overhead per job",
            "sbg:category": "Execution"
          },
          {
            "sbg:altPrefix": "",
            "label": "Feature File",
            "sbg:category": "Required Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--feature-file",
              "position": 0
            },
            "type": [
              "File"
            ],
            "required": true,
            "id": "#feature_file",
            "description": "Feature file (eg., VCF or BED file) to index. Must be in a tribble-supported format Required.",
            "sbg:stageInput": "link"
          }
        ],
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "https://software.broadinstitute.org/gatk/",
            "label": "Homepage"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/documentation/tooldocs/current/",
            "label": "Documentation"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/download/",
            "label": "Download"
          }
        ],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkitVersion": "4.0.2.0",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "sbg:toolAuthor": "Broad Institute",
        "sbg:projectName": "GATK 4.0 - Demo",
        "baseCommand": [
          "/gatk/gatk",
          "--java-options",
          {
            "class": "Expression",
            "script": "{\n  if($job.inputs.memory_per_job){\n  \treturn '\\\"-Xmx'.concat($job.inputs.memory_per_job, 'M') + '\\\"'\n  }\n  \treturn '\\\"-Xmx2048M\\\"'\n}",
            "engine": "#cwl-js-engine"
          },
          "IndexFeatureFile"
        ],
        "stdin": "",
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "teodora.aleksic",
        "outputs": [
          {
            "sbg:fileTypes": "VCF,BED,RECAL",
            "label": "Output file with index",
            "type": [
              "File"
            ],
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#feature_file",
              "glob": {
                "class": "Expression",
                "script": "{\n  \treturn $job.inputs.feature_file.path.split('/').slice(-1)[0]\n}",
                "engine": "#cwl-js-engine"
              },
              "secondaryFiles": [
                ".idx"
              ]
            },
            "id": "#output_with_index",
            "description": "Output file with index."
          },
          {
            "sbg:fileTypes": "IDX",
            "label": "Index file",
            "type": [
              "null",
              "File"
            ],
            "outputBinding": {
              "glob": {
                "class": "Expression",
                "script": "{\n  \toutput_name = $job.inputs.feature_file.path.split('/').slice(-1)[0]\n    \n    if (output_name.endsWith('.gz')) {\n    \treturn output_name + '.tbi'\n    }\n  \telse {\n     \treturn output_name + '.idx'\n  \t}  \n}",
                "engine": "#cwl-js-engine"
              }
            },
            "id": "#index",
            "description": "Index file"
          }
        ],
        "label": "GATK IndexFeatureFile",
        "sbg:createdOn": 1500296617,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": 670.000087658567,
        "sbg:license": "Open source BSD (3-clause) license",
        "sbg:contributors": [
          "vladimirk",
          "teodora.aleksic"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": "",
        "id": "vladimirk/gatk-4-0-demo-1/gatk-4-0-index-feature-file/15",
        "description": "Creates indices for Feature-containing files, such as VCF and BED files.\n\n###**Overview** \nCreates indices for Feature-containing files, such as VCF and BED files.\n\n###**Inputs**  \nA feature file to be indexed.  \n\n###**Outputs**  \nAn index file.\n\n###**Usage example**\n\n    java -Xmx4g -jar gatk.jar \\  \n         IndexFeatureFile \\  \n         --feature_file feature_file.vcf \\ \n         --output feature_file.vcf.idx",
        "sbg:content_hash": "af3015979706ca747d636a4dfa5f99cbd6178fdb365d1636631653c6dbab9c3d0",
        "sbg:toolkit": "GATK",
        "sbg:image_url": null,
        "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
        "sbg:revision": 15,
        "sbg:categories": [
          "GATK-4"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1549037925,
        "sbg:id": "h-40a9338d/h-53b2be94/h-d69aec42/0",
        "temporaryFailCodes": []
      },
      "id": "#GATK_IndexFeatureFile_2",
      "sbg:y": 670.000087658567
    },
    {
      "sbg:x": 2168.3321457754214,
      "inputs": [
        {
          "id": "#GATK_MergeVcfs_1.verbosity"
        },
        {
          "id": "#GATK_MergeVcfs_1.validation_stringency"
        },
        {
          "id": "#GATK_MergeVcfs_1.use_jdk_inflater"
        },
        {
          "id": "#GATK_MergeVcfs_1.use_jdk_deflater"
        },
        {
          "id": "#GATK_MergeVcfs_1.reference"
        },
        {
          "id": "#GATK_MergeVcfs_1.quiet"
        },
        {
          "id": "#GATK_MergeVcfs_1.memory_per_job"
        },
        {
          "id": "#GATK_MergeVcfs_1.memory_overhead_per_job"
        },
        {
          "id": "#GATK_MergeVcfs_1.max_records_in_ram"
        },
        {
          "source": [
            "#GATK_HaplotypeCaller.output_vcf"
          ],
          "id": "#GATK_MergeVcfs_1.input"
        },
        {
          "id": "#GATK_MergeVcfs_1.create_md5_file"
        },
        {
          "id": "#GATK_MergeVcfs_1.create_index"
        },
        {
          "id": "#GATK_MergeVcfs_1.compression_level"
        },
        {
          "id": "#GATK_MergeVcfs_1.clip_intervals",
          "default": true
        }
      ],
      "outputs": [
        {
          "id": "#GATK_MergeVcfs_1.output"
        }
      ],
      "run": {
        "x": 2168.3321457754214,
        "hints": [
          {
            "class": "sbg:CPURequirement",
            "value": 1
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "script": "{\n  if($job.inputs.memory_per_job){\n    if($job.inputs.memory_overhead_per_job){\n    \treturn $job.inputs.memory_per_job + $job.inputs.memory_overhead_per_job\n    }\n    else\n  \t\treturn $job.inputs.memory_per_job\n  }\n  else if(!$job.inputs.memory_per_job && $job.inputs.memory_overhead_per_job){\n\t\treturn 2048 + $job.inputs.memory_overhead_per_job  \n  }\n  else\n  \treturn 2048\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "dockerImageId": ""
          }
        ],
        "sbg:latestRevision": 16,
        "sbg:cmdPreview": "/gatk/gatk --java-options \"-Xmx1M\" MergeVcfs --OUTPUT input-1.vcf  --INPUT /path/to/input-1.vcf --INPUT /path/to/input-2.vcf --INPUT /path/to/input-3.vcf",
        "sbg:job": {
          "allocatedResources": {
            "mem": 6,
            "cpu": 1
          },
          "inputs": {
            "verbosity": null,
            "create_index": false,
            "create_md5_file": false,
            "memory_overhead_per_job": 5,
            "input": [
              {
                "path": "/path/to/input-1.vcf",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              },
              {
                "path": "/path/to/input-2.vcf",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              },
              {
                "path": "/path/to/input-3.vcf",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              }
            ],
            "validation_stringency": null,
            "QUIET": false,
            "CREATE_MD5_FILE": false,
            "clip_intervals": false,
            "quiet": false,
            "memory_per_job": 1,
            "max_records_in_ram": null,
            "compression_level": null,
            "CREATE_INDEX": false,
            "use_jdk_deflater": false,
            "use_jdk_inflater": false
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1506343410,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/5",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1508488837,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/6",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511522896,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/7",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511529512,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/8",
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511787087,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/9",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511797504,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/10",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1513786620,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/11",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515587940,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/21",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515590601,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/23",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515599046,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/24",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516963239,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/25",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516968554,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/26",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1519225872,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/28",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1519648172,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/29",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1520946084,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/30",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1530615364,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/31",
            "sbg:revision": 15
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1549038024,
            "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "sbg:revision": 16
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "script": "{\n  function find_prefix(variants)\n  {\n    var prefix = ''\n    var first = variants[0].path.replace(/^.*[\\\\\\/]/, '')\n    \n    // Finds longest common prefix between variant names\n    for (var i = 1; i < variants.length; ++i)\n    {\n      var j = 0;\n      var current = variants[i].path.replace(/^.*[\\\\\\/]/, '')\n      \n      while(first[j] == current[j] && \n            j < (first.length - 1) && \n            j < (current.length - 1)) ++j\n      \n      // Inits prefixs or shortens it\n      if (i == 1 || prefix.length > j)\n      \tprefix = first.slice(0, j)\n    }\n    \n    // Clips trailing characters\n    while (prefix.endsWith('.') || prefix.endsWith('_') || prefix.endsWith('-'))\n      prefix = prefix.slice(0, prefix.length - 1)\n      \n    return prefix\n  }\n  \n  \n  var variants = [].concat($job.inputs.input)\n  \n  if ($job.inputs.clip_intervals && variants.length > 1)\n  {\n    var first = variants[0].path.replace(/^.*[\\\\\\/]/, '')\n    \n    var extensions = ''\n    \n    if (first.endsWith('.g.vcf'))\n      extensions = '.g.vcf'\n    else if (first.endsWith('.vcf'))\n      extensions = '.vcf'\n    else if (first.endsWith('.g.vcf.gz'))\n      extensions = '.g.vcf.gz'\n    else if (first.endsWith('.vcf.gz'))\n      extensions = '.vcf.gz'\n    \n    var prefix = find_prefix(variants)\n    \n    if (prefix.length > 0)\n      return prefix + extensions\n    else \n      return variants[0].path.replace(/^.*[\\\\\\/]/, '')\n  }\n  else\n    return variants[0].path.replace(/^.*[\\\\\\/]/, '')\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "prefix": "--OUTPUT"
          },
          {
            "valueFrom": {
              "script": "{\n  inputs = $job.inputs.input\n\n  cmd = []\n\n  for (i = 0; i < inputs.length; i++) {\n    cmd.push('--INPUT', inputs[i].path)\n  }\n\n  return cmd.join(' ')\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true
          }
        ],
        "sbg:project": "vladimirk/gatk-4-0-demo-1",
        "inputs": [
          {
            "type": [
              "null",
              {
                "name": "verbosity",
                "symbols": [
                  "ERROR",
                  "WARNING",
                  "INFO",
                  "DEBUG"
                ],
                "type": "enum"
              }
            ],
            "label": "Verbosity",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--VERBOSITY",
              "position": 0
            },
            "sbg:toolDefaultValue": "INFO",
            "id": "#verbosity",
            "description": "Control verbosity of logging. Default value: INFO. Possible values: {ERROR, WARNING, INFO, DEBUG}."
          },
          {
            "type": [
              "null",
              {
                "name": "validation_stringency",
                "symbols": [
                  "STRICT",
                  "LENIENT",
                  "SILENT"
                ],
                "type": "enum"
              }
            ],
            "label": "Validation Stringency",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--VALIDATION_STRINGENCY",
              "position": 0
            },
            "sbg:toolDefaultValue": "STRICT",
            "id": "#validation_stringency",
            "description": "Validation stringency for all SAM files read by this program. Setting stringency to SILENT can improve performance when processing a BAM file in which variable-length data (read, qualities, tags) do not otherwise need to be decoded. Default value: STRICT. Possible values: {STRICT, LENIENT, SILENT}."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Use Jdk Inflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--USE_JDK_INFLATER",
              "position": 0
            },
            "sbg:toolDefaultValue": "false",
            "id": "#use_jdk_inflater",
            "description": "Whether to use the JdkInflater (as opposed to IntelInflater) Default value: false. Possible values: {true, false}."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Use Jdk Deflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--USE_JDK_DEFLATER",
              "position": 0
            },
            "sbg:toolDefaultValue": "false",
            "id": "#use_jdk_deflater",
            "description": "Whether to use the JdkDeflater (as opposed to IntelDeflater) Default value: false. Possible values: {true, false}."
          },
          {
            "label": "Reference",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 0,
              "secondaryFiles": [
                ".fai",
                "^.dict"
              ],
              "prefix": "--REFERENCE_SEQUENCE"
            },
            "id": "#reference",
            "required": false,
            "type": [
              "null",
              "File"
            ],
            "description": "Reference sequence file. Default value: null."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Quiet",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--QUIET",
              "position": 0
            },
            "sbg:toolDefaultValue": "false",
            "id": "#quiet",
            "description": "Whether to suppress job-summary info on System.err. Default value: false. Possible values: {true, false}."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Memory per job in MB",
            "sbg:category": "Execution",
            "sbg:toolDefaultValue": "2048",
            "id": "#memory_per_job",
            "description": "Memory per job in MB.",
            "sbg:stageInput": null
          },
          {
            "label": "Memory overhead per jobin MB",
            "sbg:category": "Execution",
            "id": "#memory_overhead_per_job",
            "type": [
              "null",
              "int"
            ],
            "description": "Memory overhead per job.",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Max Records In Ram",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--MAX_RECORDS_IN_RAM",
              "position": 0
            },
            "sbg:toolDefaultValue": "500000",
            "id": "#max_records_in_ram",
            "description": "When writing SAM files that need to be sorted, this will specify the number of records stored in RAM before spilling to disk. Increasing this number reduces the number of file handles needed to sort a SAM file, and increases the amount of RAM needed. Default value: 500000."
          },
          {
            "label": "Input",
            "sbg:category": "Required Arguments",
            "sbg:altPrefix": "-I",
            "id": "#input",
            "required": true,
            "type": [
              {
                "items": "File",
                "type": "array"
              }
            ],
            "description": "VCF input files File format is determined by file extension. This argument must be specified at least once. Required.",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Create Md5 File",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--CREATE_MD5_FILE",
              "position": 0
            },
            "sbg:toolDefaultValue": "false",
            "id": "#create_md5_file",
            "description": "Whether to create an MD5 digest for any BAM or FASTQ files created. Default value: false. Possible values: {true, false}."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Create Index",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--CREATE_INDEX",
              "position": 0
            },
            "sbg:toolDefaultValue": "true",
            "id": "#create_index",
            "description": "Whether to create a BAM index when writing a coordinate-sorted BAM file. Default value: true. Possible values: {true, false}."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Compression Level",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--COMPRESSION_LEVEL",
              "position": 0
            },
            "sbg:toolDefaultValue": "5",
            "id": "#compression_level",
            "description": "Compression level for all compressed files created (e.g. BAM and GELI). Default value: 5."
          },
          {
            "label": "Clip Intervals",
            "sbg:category": "Optional Arguments",
            "id": "#clip_intervals",
            "type": [
              "null",
              "boolean"
            ],
            "description": "Clip intervals name from output file name",
            "sbg:stageInput": null
          }
        ],
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "https://software.broadinstitute.org/gatk/",
            "label": "Homepage"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/documentation/tooldocs/current/",
            "label": "Documentation"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/download/",
            "label": "Download"
          }
        ],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkitVersion": "4.0.2.0",
        "stdin": "",
        "sbg:toolAuthor": "Broad Institute",
        "sbg:projectName": "GATK 4.0 - Demo",
        "baseCommand": [
          "/gatk/gatk",
          "--java-options",
          {
            "script": "{\n  if($job.inputs.memory_per_job){\n  \treturn '\\\"-Xmx'.concat($job.inputs.memory_per_job, 'M') + '\\\"'\n  }\n  \treturn '\\\"-Xmx2048M\\\"'\n}",
            "class": "Expression",
            "engine": "#cwl-js-engine"
          },
          "MergeVcfs"
        ],
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "teodora.aleksic",
        "outputs": [
          {
            "sbg:fileTypes": "VCF",
            "label": "The merged VCF file.",
            "id": "#output",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#input",
              "glob": {
                "script": "{\n  inputs = [].concat($job.inputs.input)\n  \n  if (inputs[0].path.endsWith('.gz'))\n    return '*.vcf.gz'\n  else\n    return '*.vcf'\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              }
            },
            "type": [
              "null",
              "File"
            ],
            "description": "The merged VCF file. File format is determined by file extension."
          }
        ],
        "sbg:revision": 16,
        "sbg:createdOn": 1506343410,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": 725.476036862965,
        "sbg:license": "Open source BSD (3-clause) license",
        "sbg:contributors": [
          "vladimirk",
          "teodora.aleksic"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": "",
        "id": "vladimirk/gatk-4-0-demo-1/gatk-mergevcfs/16",
        "description": "Merges multiple VCF files into one VCF file. Input files must be sorted by their contigs and, within contigs, by start position. The input files must have the same sample and contig lists. An index file is created and a sequence dictionary is required by default.",
        "sbg:content_hash": "a58f7e73227e60848abbcc3784b1a9bd9ddd17d8e4476ae09f40ed923a5453f36",
        "sbg:toolkit": "GATK",
        "sbg:image_url": null,
        "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
        "label": "GATK MergeVcfs",
        "sbg:categories": [
          "GATK-4"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1549038024,
        "sbg:id": "h-1382dc0d/h-f9dc9cd1/h-07fa7a61/0",
        "temporaryFailCodes": []
      },
      "id": "#GATK_MergeVcfs_1",
      "sbg:y": 725.476036862965
    },
    {
      "sbg:x": 2180.9993659258184,
      "inputs": [
        {
          "source": [
            "#GATK_HaplotypeCaller.output_vcf"
          ],
          "id": "#GATK_GenotypeGVCFs.variants"
        },
        {
          "id": "#GATK_GenotypeGVCFs.use_new_af_calculator"
        },
        {
          "id": "#GATK_GenotypeGVCFs.use_jdk_inflater"
        },
        {
          "id": "#GATK_GenotypeGVCFs.use_jdk_deflater"
        },
        {
          "id": "#GATK_GenotypeGVCFs.standard_min_confidence_threshold_for_calling"
        },
        {
          "id": "#GATK_GenotypeGVCFs.seconds_between_progress_updates"
        },
        {
          "id": "#GATK_GenotypeGVCFs.sample_ploidy"
        },
        {
          "id": "#GATK_GenotypeGVCFs.sample"
        },
        {
          "source": [
            "#SBG_FASTA_Indices.fasta_reference"
          ],
          "id": "#GATK_GenotypeGVCFs.reference"
        },
        {
          "id": "#GATK_GenotypeGVCFs.read_validation_stringency"
        },
        {
          "id": "#GATK_GenotypeGVCFs.read_name"
        },
        {
          "id": "#GATK_GenotypeGVCFs.read_index"
        },
        {
          "id": "#GATK_GenotypeGVCFs.read_filter"
        },
        {
          "id": "#GATK_GenotypeGVCFs.quiet"
        },
        {
          "id": "#GATK_GenotypeGVCFs.pl_filter_name"
        },
        {
          "id": "#GATK_GenotypeGVCFs.minimum_mapping_quality"
        },
        {
          "id": "#GATK_GenotypeGVCFs.min_read_length"
        },
        {
          "id": "#GATK_GenotypeGVCFs.memory_per_job"
        },
        {
          "id": "#GATK_GenotypeGVCFs.memory_overhead_per_job"
        },
        {
          "id": "#GATK_GenotypeGVCFs.maximum_mapping_quality"
        },
        {
          "id": "#GATK_GenotypeGVCFs.max_read_length"
        },
        {
          "id": "#GATK_GenotypeGVCFs.max_genotype_count"
        },
        {
          "id": "#GATK_GenotypeGVCFs.max_fragment_length"
        },
        {
          "id": "#GATK_GenotypeGVCFs.max_alternate_alleles"
        },
        {
          "id": "#GATK_GenotypeGVCFs.library"
        },
        {
          "id": "#GATK_GenotypeGVCFs.lenient"
        },
        {
          "id": "#GATK_GenotypeGVCFs.keep_reverse"
        },
        {
          "id": "#GATK_GenotypeGVCFs.keep_read_group"
        },
        {
          "id": "#GATK_GenotypeGVCFs.intervals_string"
        },
        {
          "id": "#GATK_GenotypeGVCFs.intervals_file"
        },
        {
          "id": "#GATK_GenotypeGVCFs.interval_padding"
        },
        {
          "id": "#GATK_GenotypeGVCFs.interval_merging_rule"
        },
        {
          "id": "#GATK_GenotypeGVCFs.interval_exclusion_padding"
        },
        {
          "id": "#GATK_GenotypeGVCFs.input_prior"
        },
        {
          "id": "#GATK_GenotypeGVCFs.indel_heterozygosity"
        },
        {
          "id": "#GATK_GenotypeGVCFs.heterozygosity_stdev"
        },
        {
          "id": "#GATK_GenotypeGVCFs.heterozygosity"
        },
        {
          "id": "#GATK_GenotypeGVCFs.group"
        },
        {
          "id": "#GATK_GenotypeGVCFs.filter_too_short"
        },
        {
          "id": "#GATK_GenotypeGVCFs.exclude_intervals_string"
        },
        {
          "id": "#GATK_GenotypeGVCFs.exclude_intervals_file"
        },
        {
          "id": "#GATK_GenotypeGVCFs.dont_require_soft_clips_both_ends"
        },
        {
          "id": "#GATK_GenotypeGVCFs.disable_tool_default_read_filters"
        },
        {
          "id": "#GATK_GenotypeGVCFs.disable_sequence_dictionary_validation"
        },
        {
          "id": "#GATK_GenotypeGVCFs.disable_read_filter"
        },
        {
          "id": "#GATK_GenotypeGVCFs.disable_bam_index_caching"
        },
        {
          "id": "#GATK_GenotypeGVCFs.dbsnp"
        },
        {
          "id": "#GATK_GenotypeGVCFs.create_output_variant_md5"
        },
        {
          "id": "#GATK_GenotypeGVCFs.create_output_variant_index"
        },
        {
          "id": "#GATK_GenotypeGVCFs.create_output_bam_md5"
        },
        {
          "id": "#GATK_GenotypeGVCFs.create_output_bam_index"
        },
        {
          "id": "#GATK_GenotypeGVCFs.cloud_prefetch_buffer"
        },
        {
          "id": "#GATK_GenotypeGVCFs.cloud_index_prefetch_buffer"
        },
        {
          "id": "#GATK_GenotypeGVCFs.black_listed_lanes"
        },
        {
          "id": "#GATK_GenotypeGVCFs.black_list"
        },
        {
          "id": "#GATK_GenotypeGVCFs.annotations_to_exclude"
        },
        {
          "id": "#GATK_GenotypeGVCFs.annotation"
        },
        {
          "id": "#GATK_GenotypeGVCFs.annotate_nda"
        },
        {
          "id": "#GATK_GenotypeGVCFs.ambig_filter_frac"
        },
        {
          "id": "#GATK_GenotypeGVCFs.ambig_filter_bases"
        },
        {
          "id": "#GATK_GenotypeGVCFs.add_output_sam_program_record"
        }
      ],
      "outputs": [
        {
          "id": "#GATK_GenotypeGVCFs.vcf"
        }
      ],
      "scatter": "#GATK_GenotypeGVCFs.variants",
      "run": {
        "x": 2180.9993659258184,
        "hints": [
          {
            "class": "sbg:MemRequirement",
            "value": {
              "class": "Expression",
              "script": "{\n  if($job.inputs.memory_per_job){\n    if($job.inputs.memory_overhead_per_job){\n    \treturn $job.inputs.memory_per_job + $job.inputs.memory_overhead_per_job\n    }\n    else\n  \t\treturn $job.inputs.memory_per_job\n  }\n  else if(!$job.inputs.memory_per_job && $job.inputs.memory_overhead_per_job){\n\t\treturn 2048 + $job.inputs.memory_overhead_per_job  \n  }\n  else\n  \treturn 2048\n}",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "dockerImageId": ""
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          }
        ],
        "sbg:latestRevision": 21,
        "sbg:cmdPreview": "/gatk/gatk --java-options \"-Xmx2048M\" GenotypeGVCFs --reference /path/to/reference.ext  --output variants.ext  --variant /path/to/variants.ext",
        "sbg:job": {
          "allocatedResources": {
            "mem": 2048,
            "cpu": 1
          },
          "inputs": {
            "createOutputVariantIndex": true,
            "memory_overhead_per_job": 0,
            "exclude_intervals_string": "",
            "use_jdk_inflater": true,
            "QUIET": true,
            "lenient": true,
            "disableSequenceDictionaryValidation": true,
            "memory_per_job": 2048,
            "disableBamIndexCaching": true,
            "variants": {
              "path": "/path/to/variants.ext",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "createOutputBamMD5": true,
            "createOutputBamIndex": true,
            "use_jdk_deflater": true,
            "createOutputVariantMD5": true,
            "disableToolDefaultReadFilters": true,
            "addOutputSAMProgramRecord": true,
            "annotateNDA": true,
            "intervals_string": "",
            "useNewAFCalculator": true,
            "keepReverse": true,
            "reference": {
              "path": "/path/to/reference.ext",
              "class": "File",
              "size": 0,
              "secondaryFiles": [
                {
                  "path": ".fai"
                },
                {
                  "path": "^.dict"
                }
              ]
            },
            "dontRequireSoftClipsBothEnds": true,
            "ambigFilterBases": 2,
            "interval_merging_rule": "interval_merging_rule-string-value"
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500296429,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/12",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500640346,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/13",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500888771,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/14",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1502718039,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/15",
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1503405179,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/16",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504105716,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/17",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504273013,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/18",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504275157,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/19",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504539153,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/20",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504789598,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/22",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1508488829,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/23",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511522870,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/24",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1513597901,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/26",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1513786603,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/27",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515587916,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/37",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515590570,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/39",
            "sbg:revision": 15
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515599084,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/42",
            "sbg:revision": 16
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516899308,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/43",
            "sbg:revision": 17
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516899356,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/44",
            "sbg:revision": 18
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1519648161,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/45",
            "sbg:revision": 19
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1520946137,
            "sbg:revisionNotes": "Copy of vladimirk/whole-genome-sequencing-gatk-4-0/gatk-4-0-genotypegvcfs/46",
            "sbg:revision": 20
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1549037998,
            "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "sbg:revision": 21
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "class": "Expression",
              "script": "{\n  variant_name = [].concat($job.inputs.variants)[0].path.replace(/^.*[\\\\\\/]/, '').split('.')\n  variant_namebase = variant_name.slice(0, variant_name.length).join('.')\n  variant_namebase = variant_namebase.replace('.g.vcf', '.vcf')\n  return '--output ' + variant_namebase\n}",
              "engine": "#cwl-js-engine"
            },
            "separate": true
          },
          {
            "valueFrom": {
              "class": "Expression",
              "script": "{\n  variants = [].concat($job.inputs.variants)\n\n  cmd = []\n\n  for (i = 0; i < variants.length; i++) {\n    cmd.push('--variant', variants[i].path)\n  }\n\n  return cmd.join(' ')\n}",
              "engine": "#cwl-js-engine"
            },
            "separate": true
          }
        ],
        "sbg:project": "vladimirk/gatk-4-0-demo-1",
        "inputs": [
          {
            "sbg:fileTypes": "G.VCF",
            "label": "Variants",
            "sbg:category": "Required Arguments",
            "sbg:altPrefix": "-V",
            "type": [
              "File"
            ],
            "required": true,
            "id": "#variants",
            "description": "A VCF file containing variants Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Use New Af Calculator",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-new-af-calculator",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_new_af_calculator",
            "description": "If provided, we will use the new AF model instead of the so-called exact model Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Use Jdk Inflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-inflater",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_jdk_inflater",
            "description": "Whether to use the JdkInflater (as opposed to IntelInflater) Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Use Jdk Deflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-deflater",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_jdk_deflater",
            "description": "Whether to use the JdkDeflater (as opposed to IntelDeflater) Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Standard Min Confidence Threshold For Calling",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--standard-min-confidence-threshold-for-calling",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#standard_min_confidence_threshold_for_calling",
            "description": "The minimum phred-scaled confidence threshold at which variants should be called Default value: 10.0."
          },
          {
            "sbg:altPrefix": "",
            "label": "Seconds Between Progress Updates",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--seconds-between-progress-updates",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#seconds_between_progress_updates",
            "description": "Output traversal statistics every time this many seconds elapse Default value: 10.0."
          },
          {
            "sbg:altPrefix": "",
            "label": "Sample Ploidy",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--sample-ploidy",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#sample_ploidy",
            "description": "Ploidy (number of chromosomes) per sample. For pooled data, set to (Number of samples in each pool * Sample Ploidy). Default value: 2."
          },
          {
            "sbg:altPrefix": "",
            "label": "Sample",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--sample",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#sample",
            "description": "The name of the sample(s) to keep, filtering out all others This argument must be specified at least once. Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Reference",
            "sbg:category": "Required Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 0,
              "secondaryFiles": [
                ".fai",
                "^.dict"
              ],
              "prefix": "--reference"
            },
            "type": [
              "File"
            ],
            "required": true,
            "id": "#reference",
            "description": "Reference sequence file Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Read Validation Stringency",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-validation-stringency",
              "position": 0
            },
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "STRICT",
                  "LENIENT",
                  "SILENT"
                ],
                "type": "enum"
              }
            ],
            "id": "#read_validation_stringency",
            "description": "Validation stringency for all SAM/BAM/CRAM/SRA files read by this program. The default stringency value SILENT can improve performance when processing a BAM file in which variable-length data (read, qualities, tags) do not otherwise need to be decoded. Default value: SILENT. Possible values: {STRICT, LENIENT, SILENT}."
          },
          {
            "sbg:altPrefix": "",
            "label": "Read Name",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-name",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#read_name",
            "description": "Keep only reads with this read name Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Read Index",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-index",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#read_index",
            "description": "Indices to use for the read inputs. If specified, an index must be provided for every read input and in the same order as the read inputs. If this argument is not specified, the path to the index for each input will be inferred automatically. This argument may be specified 0 or more times. Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Read Filter",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-filter",
              "position": 0
            },
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "AlignmentAgreesWithHeaderReadFilter",
                  "AllowAllReadsReadFilter",
                  "AmbiguousBaseReadFilter",
                  "CigarContainsNoNOperator",
                  "FirstOfPairReadFilter",
                  "FragmentLengthReadFilter",
                  "GoodCigarReadFilter",
                  "HasReadGroupReadFilter",
                  "LibraryReadFilter",
                  "MappedReadFilter",
                  "MappingQualityAvailableReadFilter",
                  "MappingQualityNotZeroReadFilter",
                  "MappingQualityReadFilter",
                  "MatchingBasesAndQualsReadFilter",
                  "MateDifferentStrandReadFilter",
                  "MateOnSameContigOrNoMappedMateReadFilter",
                  "MetricsReadFilter",
                  "NonZeroFragmentLengthReadFilter",
                  "NonZeroReferenceLengthAlignmentReadFilter",
                  "NotDuplicateReadFilter",
                  "NotOpticalDuplicateReadFilter",
                  "NotSecondaryAlignmentReadFilter",
                  "NotSupplementaryAlignmentReadFilter",
                  "OverclippedReadFilter",
                  "PairedReadFilter",
                  "PassesVendorQualityCheckReadFilter",
                  "PlatformReadFilter",
                  "PlatformUnitReadFilter",
                  "PrimaryLineReadFilter",
                  "ProperlyPairedReadFilter",
                  "ReadGroupBlackListReadFilter",
                  "ReadGroupReadFilter",
                  "ReadLengthEqualsCigarLengthReadFilter",
                  "ReadLengthReadFilter",
                  "ReadNameReadFilter",
                  "ReadStrandFilter",
                  "SampleReadFilter",
                  "SecondOfPairReadFilter",
                  "SeqIsStoredReadFilter",
                  "ValidAlignmentEndReadFilter",
                  "ValidAlignmentStartReadFilter",
                  "WellformedReadFilter"
                ],
                "type": "enum"
              }
            ],
            "id": "#read_filter",
            "description": "Read filters to be applied before analysis This argument may be specified 0 or more times. Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Quiet",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--quiet",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#quiet",
            "description": "Whether to suppress job-summary info on System.err. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Pl Filter Name",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--pl-filter-name",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#pl_filter_name",
            "description": "Keep reads with RG:PL attribute containing this string This argument must be specified at least once. Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Minimum Mapping Quality",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--minimum-mapping-quality",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#minimum_mapping_quality",
            "description": "Minimum mapping quality to keep (inclusive) Default value: 10."
          },
          {
            "sbg:altPrefix": "",
            "label": "Min Read Length",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--min-read-length",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#min_read_length",
            "description": "Keep only reads with length at least equal to the specified value Default value: 1."
          },
          {
            "label": "Memory Per Job",
            "sbg:category": "Execution",
            "type": [
              "null",
              "int"
            ],
            "sbg:toolDefaultValue": "2048",
            "id": "#memory_per_job",
            "description": "Memory per job in MB.",
            "sbg:stageInput": null
          },
          {
            "label": "Memory Overhead Per Job",
            "sbg:category": "Execution",
            "type": [
              "null",
              "int"
            ],
            "sbg:toolDefaultValue": "64",
            "id": "#memory_overhead_per_job",
            "description": "Memory overhead per job.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Maximum Mapping Quality",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--maximum-mapping-quality",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#maximum_mapping_quality",
            "description": "Maximum mapping quality to keep (inclusive) Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Max Read Length",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-read-length",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#max_read_length",
            "description": "Keep only reads with length at most equal to the specified value Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Max Genotype Count",
            "sbg:category": "Advanced Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-genotype-count",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#max_genotype_count",
            "description": "Maximum number of genotypes to consider at any site Default value: 1024."
          },
          {
            "sbg:altPrefix": "",
            "label": "Max Fragment Length",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-fragment-length",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#max_fragment_length",
            "description": "Keep only read pairs with fragment length at most equal to the given value Default value: 1000000."
          },
          {
            "sbg:altPrefix": "",
            "label": "Max Alternate Alleles",
            "sbg:category": "Advanced Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-alternate-alleles",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#max_alternate_alleles",
            "description": "Maximum number of alternate alleles to genotype Default value: 6."
          },
          {
            "sbg:altPrefix": "",
            "label": "Library",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--library",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#library",
            "description": "The name of the library to keep Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Lenient",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--lenient",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#lenient",
            "description": "Lenient processing of VCF files Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Keep Reverse",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--keep-reverse",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#keep_reverse",
            "description": "Keep only reads on the reverse strand Required. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Keep Read Group",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--keep-read-group",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#keep_read_group",
            "description": "The name of the read group to keep Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Intervals String",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--intervals",
              "itemSeparator": null
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#intervals_string",
            "description": "One or more genomic intervals over which to operate This argument may be specified 0 or more times. Default value: null.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "sbg:fileTypes": "TXT, BED",
            "label": "Intervals File",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--intervals"
            },
            "type": [
              "null",
              "File"
            ],
            "required": false,
            "id": "#intervals_file",
            "description": "One or more genomic intervals over which to operate This argument may be specified 0 or more times. Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Interval Padding",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-padding",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#interval_padding",
            "description": "Amount of padding (in bp) to add to each interval you are including. Default value: 0."
          },
          {
            "label": "Interval Set Rule",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-merging-rule",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#interval_merging_rule",
            "description": "Interval merging rule for abutting intervals  Default value: ALL. Possible values: {ALL, OVERLAPPING_ONLY}",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Interval Exclusion Padding",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-exclusion-padding",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#interval_exclusion_padding",
            "description": "Amount of padding (in bp) to add to each interval you are excluding. Default value: 0."
          },
          {
            "sbg:altPrefix": "",
            "label": "Input Prior",
            "sbg:category": "Advanced Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--input-prior",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#input_prior",
            "description": "Input prior for calls This argument may be specified 0 or more times. Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Indel Heterozygosity",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--indel-heterozygosity",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#indel_heterozygosity",
            "description": "Heterozygosity for indel calling. See the GATKDocs for heterozygosity for full details on the meaning of this population genetics concept Default value: 1.25E-4."
          },
          {
            "sbg:altPrefix": "",
            "label": "Heterozygosity Stdev",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--heterozygosity-stdev",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#heterozygosity_stdev",
            "description": "Standard deviation of eterozygosity for SNP and indel calling. Default value: 0.01."
          },
          {
            "sbg:altPrefix": "",
            "label": "Heterozygosity",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--heterozygosity",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#heterozygosity",
            "description": "Heterozygosity value used to compute prior likelihoods for any locus. See the GATKDocs for full details on the meaning of this population genetics concept Default value: 0.001."
          },
          {
            "sbg:altPrefix": "",
            "label": "Group",
            "sbg:category": "Advanced Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--group",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#group",
            "description": "One or more classes/groups of annotations to apply to variant calls This argument may be specified 0 or more times. Default value: [StandardAnnotation]."
          },
          {
            "sbg:altPrefix": "",
            "label": "Filter Too Short",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--filter-too-short",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#filter_too_short",
            "description": "Value for which reads with less than this number of aligned bases is considered too short Default value: 30."
          },
          {
            "sbg:altPrefix": "",
            "label": "Exclude Intervals String",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--exclude-intervals"
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#exclude_intervals_string",
            "description": "One or more genomic intervals to exclude from processing This argument may be specified 0 or more times. Default value: null.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "sbg:fileTypes": "TXT, BED",
            "label": "Exclude Intervals File",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--exclude-intervals"
            },
            "type": [
              "null",
              "File"
            ],
            "required": false,
            "id": "#exclude_intervals_file",
            "description": "One or more genomic intervals to exclude from processing This argument may be specified 0 or more times. Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Dont Require Soft Clips Both Ends",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--dont-require-soft-clips-both-ends",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#dont_require_soft_clips_both_ends",
            "description": "Allow a read to be filtered out based on having only 1 soft-clipped block. By default, both ends must have a soft-clipped block, setting this flag requires only 1 soft-clipped block. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Disable Tool Default Read Filters",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-tool-default-read-filters",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#disable_tool_default_read_filters",
            "description": "Disable all tool default read filters Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Disable Sequence Dictionary Validation",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-sequence-dictionary-validation",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#disable_sequence_dictionary_validation",
            "description": "If specified, do not check the sequence dictionaries from our inputs for compatibility. Use at your own risk! Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Disable Read Filter",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-read-filter",
              "position": 0
            },
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "GoodCigarReadFilter",
                  "MappedReadFilter",
                  "MappingQualityAvailableReadFilter",
                  "MappingQualityReadFilter",
                  "NonZeroReferenceLengthAlignmentReadFilter",
                  "NotDuplicateReadFilter",
                  "NotSecondaryAlignmentReadFilter",
                  "PassesVendorQualityCheckReadFilter",
                  "WellformedReadFilter"
                ],
                "type": "enum"
              }
            ],
            "id": "#disable_read_filter",
            "description": "Read filters to be disabled before analysis This argument may be specified 0 or more times. Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Disable Bam Index Caching",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-bam-index-caching",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#disable_bam_index_caching",
            "description": "If true, don't cache bam indexes, this will reduce memory requirements but may harm performance if many intervals are specified. Caching is automatically disabled if there are no intervals specified. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:fileTypes": "VCF,VCF.GZ",
            "label": "Dbsnp",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 0,
              "secondaryFiles": [
                ".idx"
              ],
              "prefix": "--dbsnp"
            },
            "type": [
              "null",
              "File"
            ],
            "required": false,
            "id": "#dbsnp",
            "description": "DbSNP file Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Create Output Variant Md5",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-variant-md5",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#create_output_variant_md5",
            "description": "If true, create a a MD5 digest any VCF file created. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Create Output Variant Index",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-variant-index",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#create_output_variant_index",
            "description": "If true, create a VCF index when writing a coordinate-sorted VCF file. Default value: true. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Create Output Bam Md5",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-bam-md5",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#create_output_bam_md5",
            "description": "If true, create a MD5 digest for any BAM/SAM/CRAM file created Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Create Output Bam Index",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-bam-index",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#create_output_bam_index",
            "description": "If true, create a BAM/CRAM index when writing a coordinate-sorted BAM/CRAM file. Default value: true. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Cloud Prefetch Buffer",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--cloud-prefetch-buffer",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#cloud_prefetch_buffer",
            "description": "Size of the cloud-only prefetch buffer (in MB; 0 to disable). Default value: 40."
          },
          {
            "sbg:altPrefix": "",
            "label": "Cloud Index Prefetch Buffer",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--cloud-index-prefetch-buffer",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#cloud_index_prefetch_buffer",
            "description": "Size of the cloud-only prefetch buffer (in MB; 0 to disable). Defaults to cloudPrefetchBuffer if unset. Default value: -1."
          },
          {
            "sbg:altPrefix": "",
            "label": "Black Listed Lanes",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--black-listed-lanes",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#black_listed_lanes",
            "description": "Keep reads with platform units not on the list This argument must be specified at least once. Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Black List",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--black-list",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#black_list",
            "description": "This argument must be specified at least once. Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Annotations To Exclude",
            "sbg:category": "Advanced Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--annotations-to-exclude",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#annotations_to_exclude",
            "description": "One or more specific annotations to exclude from recomputation. This argument may be specified 0 or more times. Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Annotation",
            "sbg:category": "Advanced Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--annotation",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#annotation",
            "description": "One or more specific annotations to recompute. This argument may be specified 0 or more times. Default value: null."
          },
          {
            "label": "Annotate Nda",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--annotate-with-num-discovered-alleles",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#annotate_nda",
            "description": "If provided, we will annotate records with the number of alternate alleles that were discovered (but not necessarily genotyped) at a given site Default value: false. Possible values: {true, false}."
          },
          {
            "sbg:altPrefix": "",
            "label": "Ambig Filter Frac",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--ambig-filter-frac",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#ambig_filter_frac",
            "description": "Threshold fraction of non-regular bases (e.g. N) above which to filter Default value: 0.05."
          },
          {
            "sbg:altPrefix": "",
            "label": "Ambig Filter Bases",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--ambig-filter-bases"
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#ambig_filter_bases",
            "description": "Threshold number of ambiguous bases. If null, uses threshold fraction; otherwise, overrides threshold fraction. Cannot be used in conjunction with argument(s) maxAmbiguousBaseFraction.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Add Output Sam Program Record",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--add-output-sam-program-record",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#add_output_sam_program_record",
            "description": "If true, adds a PG tag to created SAM/BAM/CRAM files. Default value: true. Possible values: {true, false}.",
            "sbg:stageInput": null
          }
        ],
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "https://software.broadinstitute.org/gatk/",
            "label": "Homepage"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/documentation/tooldocs/current/",
            "label": "Documentation"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/download/",
            "label": "Download"
          }
        ],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkitVersion": "4.0.2.0",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "sbg:toolAuthor": "Broad Institute",
        "sbg:projectName": "GATK 4.0 - Demo",
        "baseCommand": [
          "/gatk/gatk",
          "--java-options",
          {
            "class": "Expression",
            "script": "{\n  if($job.inputs.memory_per_job){\n  \treturn '\\\"-Xmx'.concat($job.inputs.memory_per_job, 'M') + '\\\"'\n  }\n  \treturn '\\\"-Xmx2048M\\\"'\n}",
            "engine": "#cwl-js-engine"
          },
          "GenotypeGVCFs"
        ],
        "stdin": "",
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "teodora.aleksic",
        "outputs": [
          {
            "sbg:fileTypes": "VCF",
            "label": "Output VCF",
            "type": [
              "null",
              "File"
            ],
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#variants",
              "glob": "*.vcf"
            },
            "id": "#vcf",
            "description": "Output VCF."
          }
        ],
        "label": "GATK GenotypeGVCFs",
        "sbg:createdOn": 1500296429,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": 429.60407044863155,
        "sbg:license": "Open source BSD (3-clause) license",
        "sbg:image_url": null,
        "sbg:contributors": [
          "vladimirk",
          "teodora.aleksic"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": "",
        "id": "vladimirk/gatk-4-0-demo-1/gatk-4-0-genotypegvcfs/21",
        "description": "Perform joint genotyping on one or more samples pre-called with HaplotypeCaller.\n\n###**Overview**  \nThis tool is designed to perform joint genotyping on multiple samples pre-called with HaplotypeCaller to produce a multi-sample callset in a highly scalable manner. However it can also be run on a single sample at a time to produce a single-sample callset. In any case, the input samples must possess genotype likelihoods produced by HaplotypeCaller with `-ERC GVCF` or `-ERC BP_RESOLUTION`.re-genotype the newly merged record, and then re-annotate it.\n\n###**Input**  \nOne or more GVCFs produced by in HaplotypeCaller with the `-ERC GVCF` or `-ERC BP_RESOLUTION` settings, containing the samples to joint-genotype. \n\n###**Output**  \nA final VCF in which all samples have been jointly genotyped. \n\n###**Usage example**   \n\n####**Perform joint genotyping on a set of GVCFs enumerated in the command line**\n\n     gatk-launch --javaOptions \"-Xmx4g\" GenotypeGVCFs \\\n       -R reference.fasta \\\n       -V input1.g.vcf \\\n       -V input2.g.vcf \\\n       -V input3.g.vcf \\\n       -O output.vcf\n\n####**Perform joint genotyping on a set of GVCFs listed in a text file, one per line**\n\n     gatk-launch --javaOptions \"-Xmx4g\" GenotypeGVCFs \\\n       -R reference.fasta \\\n       -V input_gvcfs.list \\\n       -O output.vcf\n \n###**Caveat**  \nOnly GVCF files produced by HaplotypeCaller (or CombineGVCFs) can be used as input for this tool. Some other programs produce files that they call GVCFs but those lack some important information (accurate genotype likelihoods for every position) that GenotypeGVCFs requires for its operation. \n\n###**Special note on ploidy**  \nThis tool is able to handle any ploidy (or mix of ploidies) intelligently; there is no need to specify ploidy for non-diploid organisms.  \n\n###**Additional Notes**\n- By default, the tool works only with VCF resource files. To use VCF.GZ resource files, the tool wrapper needs to be modified.\n\n###**IMPORTANT NOTICE**  \n\nTools in GATK that require a fasta reference file also look for the reference file's corresponding *.fai* (fasta index) and *.dict* (fasta dictionary) files. The fasta index file allows random access to reference bases and the dictionary file is a dictionary of the contig names and sizes contained within the fasta reference. These two secondary files are essential for GATK to work properly. To append these two files to your fasta reference please use the '***SBG FASTA Indices***' tool within your GATK based workflow before using any of the GATK tools.",
        "sbg:toolkit": "GATK",
        "sbg:content_hash": "a179a4be55f88eaa446a9937ba43d8cf44ab2f4eff97685676538af0e98eaaaec",
        "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
        "sbg:revision": 21,
        "sbg:categories": [
          "GATK-4"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1549037998,
        "sbg:id": "h-94db38e6/h-6cd82263/h-5baf5378/0",
        "temporaryFailCodes": [],
        "sbg:wrapperAuthor": "filip_tubic"
      },
      "id": "#GATK_GenotypeGVCFs",
      "sbg:y": 429.60407044863155
    },
    {
      "sbg:x": 2371.082607145145,
      "inputs": [
        {
          "id": "#GATK_MergeVcfs.verbosity"
        },
        {
          "id": "#GATK_MergeVcfs.validation_stringency"
        },
        {
          "id": "#GATK_MergeVcfs.use_jdk_inflater"
        },
        {
          "id": "#GATK_MergeVcfs.use_jdk_deflater"
        },
        {
          "id": "#GATK_MergeVcfs.reference"
        },
        {
          "id": "#GATK_MergeVcfs.quiet"
        },
        {
          "id": "#GATK_MergeVcfs.memory_per_job"
        },
        {
          "id": "#GATK_MergeVcfs.memory_overhead_per_job"
        },
        {
          "id": "#GATK_MergeVcfs.max_records_in_ram"
        },
        {
          "source": [
            "#GATK_GenotypeGVCFs.vcf"
          ],
          "id": "#GATK_MergeVcfs.input"
        },
        {
          "id": "#GATK_MergeVcfs.create_md5_file"
        },
        {
          "id": "#GATK_MergeVcfs.create_index"
        },
        {
          "id": "#GATK_MergeVcfs.compression_level"
        },
        {
          "id": "#GATK_MergeVcfs.clip_intervals",
          "default": true
        }
      ],
      "outputs": [
        {
          "id": "#GATK_MergeVcfs.output"
        }
      ],
      "run": {
        "x": 2371.082607145145,
        "hints": [
          {
            "class": "sbg:CPURequirement",
            "value": 1
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "script": "{\n  if($job.inputs.memory_per_job){\n    if($job.inputs.memory_overhead_per_job){\n    \treturn $job.inputs.memory_per_job + $job.inputs.memory_overhead_per_job\n    }\n    else\n  \t\treturn $job.inputs.memory_per_job\n  }\n  else if(!$job.inputs.memory_per_job && $job.inputs.memory_overhead_per_job){\n\t\treturn 2048 + $job.inputs.memory_overhead_per_job  \n  }\n  else\n  \treturn 2048\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "dockerImageId": ""
          }
        ],
        "sbg:latestRevision": 16,
        "sbg:cmdPreview": "/gatk/gatk --java-options \"-Xmx1M\" MergeVcfs --OUTPUT input-1.vcf  --INPUT /path/to/input-1.vcf --INPUT /path/to/input-2.vcf --INPUT /path/to/input-3.vcf",
        "sbg:job": {
          "allocatedResources": {
            "mem": 6,
            "cpu": 1
          },
          "inputs": {
            "verbosity": null,
            "create_index": false,
            "create_md5_file": false,
            "memory_overhead_per_job": 5,
            "input": [
              {
                "path": "/path/to/input-1.vcf",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              },
              {
                "path": "/path/to/input-2.vcf",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              },
              {
                "path": "/path/to/input-3.vcf",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              }
            ],
            "validation_stringency": null,
            "QUIET": false,
            "CREATE_MD5_FILE": false,
            "clip_intervals": false,
            "quiet": false,
            "memory_per_job": 1,
            "max_records_in_ram": null,
            "compression_level": null,
            "CREATE_INDEX": false,
            "use_jdk_deflater": false,
            "use_jdk_inflater": false
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1506343410,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/5",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1508488837,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/6",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511522896,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/7",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511529512,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/8",
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511787087,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/9",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511797504,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/10",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1513786620,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/11",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515587940,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/21",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515590601,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/23",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515599046,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/24",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516963239,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/25",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516968554,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/26",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1519225872,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/28",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1519648172,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/29",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1520946084,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/30",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1530615364,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-mergevcfs/31",
            "sbg:revision": 15
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1549038024,
            "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "sbg:revision": 16
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "script": "{\n  function find_prefix(variants)\n  {\n    var prefix = ''\n    var first = variants[0].path.replace(/^.*[\\\\\\/]/, '')\n    \n    // Finds longest common prefix between variant names\n    for (var i = 1; i < variants.length; ++i)\n    {\n      var j = 0;\n      var current = variants[i].path.replace(/^.*[\\\\\\/]/, '')\n      \n      while(first[j] == current[j] && \n            j < (first.length - 1) && \n            j < (current.length - 1)) ++j\n      \n      // Inits prefixs or shortens it\n      if (i == 1 || prefix.length > j)\n      \tprefix = first.slice(0, j)\n    }\n    \n    // Clips trailing characters\n    while (prefix.endsWith('.') || prefix.endsWith('_') || prefix.endsWith('-'))\n      prefix = prefix.slice(0, prefix.length - 1)\n      \n    return prefix\n  }\n  \n  \n  var variants = [].concat($job.inputs.input)\n  \n  if ($job.inputs.clip_intervals && variants.length > 1)\n  {\n    var first = variants[0].path.replace(/^.*[\\\\\\/]/, '')\n    \n    var extensions = ''\n    \n    if (first.endsWith('.g.vcf'))\n      extensions = '.g.vcf'\n    else if (first.endsWith('.vcf'))\n      extensions = '.vcf'\n    else if (first.endsWith('.g.vcf.gz'))\n      extensions = '.g.vcf.gz'\n    else if (first.endsWith('.vcf.gz'))\n      extensions = '.vcf.gz'\n    \n    var prefix = find_prefix(variants)\n    \n    if (prefix.length > 0)\n      return prefix + extensions\n    else \n      return variants[0].path.replace(/^.*[\\\\\\/]/, '')\n  }\n  else\n    return variants[0].path.replace(/^.*[\\\\\\/]/, '')\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "prefix": "--OUTPUT"
          },
          {
            "valueFrom": {
              "script": "{\n  inputs = $job.inputs.input\n\n  cmd = []\n\n  for (i = 0; i < inputs.length; i++) {\n    cmd.push('--INPUT', inputs[i].path)\n  }\n\n  return cmd.join(' ')\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true
          }
        ],
        "sbg:project": "vladimirk/gatk-4-0-demo-1",
        "inputs": [
          {
            "type": [
              "null",
              {
                "name": "verbosity",
                "symbols": [
                  "ERROR",
                  "WARNING",
                  "INFO",
                  "DEBUG"
                ],
                "type": "enum"
              }
            ],
            "label": "Verbosity",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--VERBOSITY",
              "position": 0
            },
            "sbg:toolDefaultValue": "INFO",
            "id": "#verbosity",
            "description": "Control verbosity of logging. Default value: INFO. Possible values: {ERROR, WARNING, INFO, DEBUG}."
          },
          {
            "type": [
              "null",
              {
                "name": "validation_stringency",
                "symbols": [
                  "STRICT",
                  "LENIENT",
                  "SILENT"
                ],
                "type": "enum"
              }
            ],
            "label": "Validation Stringency",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--VALIDATION_STRINGENCY",
              "position": 0
            },
            "sbg:toolDefaultValue": "STRICT",
            "id": "#validation_stringency",
            "description": "Validation stringency for all SAM files read by this program. Setting stringency to SILENT can improve performance when processing a BAM file in which variable-length data (read, qualities, tags) do not otherwise need to be decoded. Default value: STRICT. Possible values: {STRICT, LENIENT, SILENT}."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Use Jdk Inflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--USE_JDK_INFLATER",
              "position": 0
            },
            "sbg:toolDefaultValue": "false",
            "id": "#use_jdk_inflater",
            "description": "Whether to use the JdkInflater (as opposed to IntelInflater) Default value: false. Possible values: {true, false}."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Use Jdk Deflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--USE_JDK_DEFLATER",
              "position": 0
            },
            "sbg:toolDefaultValue": "false",
            "id": "#use_jdk_deflater",
            "description": "Whether to use the JdkDeflater (as opposed to IntelDeflater) Default value: false. Possible values: {true, false}."
          },
          {
            "label": "Reference",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "position": 0,
              "secondaryFiles": [
                ".fai",
                "^.dict"
              ],
              "prefix": "--REFERENCE_SEQUENCE"
            },
            "id": "#reference",
            "required": false,
            "type": [
              "null",
              "File"
            ],
            "description": "Reference sequence file. Default value: null."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Quiet",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--QUIET",
              "position": 0
            },
            "sbg:toolDefaultValue": "false",
            "id": "#quiet",
            "description": "Whether to suppress job-summary info on System.err. Default value: false. Possible values: {true, false}."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Memory per job in MB",
            "sbg:category": "Execution",
            "sbg:toolDefaultValue": "2048",
            "id": "#memory_per_job",
            "description": "Memory per job in MB.",
            "sbg:stageInput": null
          },
          {
            "label": "Memory overhead per jobin MB",
            "sbg:category": "Execution",
            "id": "#memory_overhead_per_job",
            "type": [
              "null",
              "int"
            ],
            "description": "Memory overhead per job.",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Max Records In Ram",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--MAX_RECORDS_IN_RAM",
              "position": 0
            },
            "sbg:toolDefaultValue": "500000",
            "id": "#max_records_in_ram",
            "description": "When writing SAM files that need to be sorted, this will specify the number of records stored in RAM before spilling to disk. Increasing this number reduces the number of file handles needed to sort a SAM file, and increases the amount of RAM needed. Default value: 500000."
          },
          {
            "label": "Input",
            "sbg:category": "Required Arguments",
            "sbg:altPrefix": "-I",
            "id": "#input",
            "required": true,
            "type": [
              {
                "items": "File",
                "type": "array"
              }
            ],
            "description": "VCF input files File format is determined by file extension. This argument must be specified at least once. Required.",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Create Md5 File",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--CREATE_MD5_FILE",
              "position": 0
            },
            "sbg:toolDefaultValue": "false",
            "id": "#create_md5_file",
            "description": "Whether to create an MD5 digest for any BAM or FASTQ files created. Default value: false. Possible values: {true, false}."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Create Index",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--CREATE_INDEX",
              "position": 0
            },
            "sbg:toolDefaultValue": "true",
            "id": "#create_index",
            "description": "Whether to create a BAM index when writing a coordinate-sorted BAM file. Default value: true. Possible values: {true, false}."
          },
          {
            "type": [
              "null",
              "int"
            ],
            "label": "Compression Level",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--COMPRESSION_LEVEL",
              "position": 0
            },
            "sbg:toolDefaultValue": "5",
            "id": "#compression_level",
            "description": "Compression level for all compressed files created (e.g. BAM and GELI). Default value: 5."
          },
          {
            "label": "Clip Intervals",
            "sbg:category": "Optional Arguments",
            "id": "#clip_intervals",
            "type": [
              "null",
              "boolean"
            ],
            "description": "Clip intervals name from output file name",
            "sbg:stageInput": null
          }
        ],
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "https://software.broadinstitute.org/gatk/",
            "label": "Homepage"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/documentation/tooldocs/current/",
            "label": "Documentation"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/download/",
            "label": "Download"
          }
        ],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkitVersion": "4.0.2.0",
        "stdin": "",
        "sbg:toolAuthor": "Broad Institute",
        "sbg:projectName": "GATK 4.0 - Demo",
        "baseCommand": [
          "/gatk/gatk",
          "--java-options",
          {
            "script": "{\n  if($job.inputs.memory_per_job){\n  \treturn '\\\"-Xmx'.concat($job.inputs.memory_per_job, 'M') + '\\\"'\n  }\n  \treturn '\\\"-Xmx2048M\\\"'\n}",
            "class": "Expression",
            "engine": "#cwl-js-engine"
          },
          "MergeVcfs"
        ],
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "teodora.aleksic",
        "outputs": [
          {
            "sbg:fileTypes": "VCF",
            "label": "The merged VCF file.",
            "id": "#output",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#input",
              "glob": {
                "script": "{\n  inputs = [].concat($job.inputs.input)\n  \n  if (inputs[0].path.endsWith('.gz'))\n    return '*.vcf.gz'\n  else\n    return '*.vcf'\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              }
            },
            "type": [
              "null",
              "File"
            ],
            "description": "The merged VCF file. File format is determined by file extension."
          }
        ],
        "sbg:revision": 16,
        "sbg:createdOn": 1506343410,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": 430.35403109466665,
        "sbg:license": "Open source BSD (3-clause) license",
        "sbg:contributors": [
          "vladimirk",
          "teodora.aleksic"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": "",
        "id": "vladimirk/gatk-4-0-demo-1/gatk-mergevcfs/16",
        "description": "Merges multiple VCF files into one VCF file. Input files must be sorted by their contigs and, within contigs, by start position. The input files must have the same sample and contig lists. An index file is created and a sequence dictionary is required by default.",
        "sbg:content_hash": "a58f7e73227e60848abbcc3784b1a9bd9ddd17d8e4476ae09f40ed923a5453f36",
        "sbg:toolkit": "GATK",
        "sbg:image_url": null,
        "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
        "label": "GATK MergeVcfs",
        "sbg:categories": [
          "GATK-4"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1549038024,
        "sbg:id": "h-460e83ff/h-ae5413e6/h-38466df4/0",
        "temporaryFailCodes": []
      },
      "id": "#GATK_MergeVcfs",
      "sbg:y": 430.35403109466665
    },
    {
      "sbg:x": 1537.2389526859488,
      "inputs": [
        {
          "id": "#GATK_ApplyBQSR.verbosity"
        },
        {
          "id": "#GATK_ApplyBQSR.use_original_qualities"
        },
        {
          "id": "#GATK_ApplyBQSR.use_jdk_inflater"
        },
        {
          "id": "#GATK_ApplyBQSR.use_jdk_deflater"
        },
        {
          "id": "#GATK_ApplyBQSR.static_quantized_quals"
        },
        {
          "id": "#GATK_ApplyBQSR.seconds_between_progress_updates"
        },
        {
          "id": "#GATK_ApplyBQSR.sample"
        },
        {
          "id": "#GATK_ApplyBQSR.round_down_quantized"
        },
        {
          "id": "#GATK_ApplyBQSR.reference"
        },
        {
          "id": "#GATK_ApplyBQSR.read_validation_stringency"
        },
        {
          "id": "#GATK_ApplyBQSR.read_name"
        },
        {
          "id": "#GATK_ApplyBQSR.read_index"
        },
        {
          "id": "#GATK_ApplyBQSR.read_filter"
        },
        {
          "id": "#GATK_ApplyBQSR.quiet"
        },
        {
          "id": "#GATK_ApplyBQSR.quantize_quals"
        },
        {
          "id": "#GATK_ApplyBQSR.preserve_qscores_less_than"
        },
        {
          "id": "#GATK_ApplyBQSR.pl_filter_name"
        },
        {
          "id": "#GATK_ApplyBQSR.minimum_mapping_quality"
        },
        {
          "id": "#GATK_ApplyBQSR.min_read_length"
        },
        {
          "id": "#GATK_ApplyBQSR.memory_per_job",
          "default": 2000
        },
        {
          "id": "#GATK_ApplyBQSR.memory_overhead_per_job",
          "default": 60
        },
        {
          "id": "#GATK_ApplyBQSR.maximum_mapping_quality"
        },
        {
          "id": "#GATK_ApplyBQSR.max_read_length"
        },
        {
          "id": "#GATK_ApplyBQSR.max_fragment_length"
        },
        {
          "id": "#GATK_ApplyBQSR.library"
        },
        {
          "id": "#GATK_ApplyBQSR.lenient"
        },
        {
          "id": "#GATK_ApplyBQSR.keep_reverse"
        },
        {
          "id": "#GATK_ApplyBQSR.keep_read_group"
        },
        {
          "id": "#GATK_ApplyBQSR.intervals_string"
        },
        {
          "source": [
            "#SBG_Prepare_Intervals.intervals"
          ],
          "id": "#GATK_ApplyBQSR.intervals_file"
        },
        {
          "id": "#GATK_ApplyBQSR.interval_set_rule"
        },
        {
          "id": "#GATK_ApplyBQSR.interval_merging_rule"
        },
        {
          "id": "#GATK_ApplyBQSR.interval_exclusion_padding"
        },
        {
          "id": "#GATK_ApplyBQSR.input_cram"
        },
        {
          "source": [
            "#BWA_MEM_Bundle_0_7_17.aligned_reads"
          ],
          "id": "#GATK_ApplyBQSR.input_bam"
        },
        {
          "id": "#GATK_ApplyBQSR.include_interval_name_in_output_name",
          "default": true
        },
        {
          "id": "#GATK_ApplyBQSR.global_q_score_prior"
        },
        {
          "id": "#GATK_ApplyBQSR.filter_too_short"
        },
        {
          "id": "#GATK_ApplyBQSR.exclude_intervas_string"
        },
        {
          "id": "#GATK_ApplyBQSR.exclude_intervals_file"
        },
        {
          "id": "#GATK_ApplyBQSR.emit_original_quals"
        },
        {
          "id": "#GATK_ApplyBQSR.dont_require_soft_clips_both_ends"
        },
        {
          "id": "#GATK_ApplyBQSR.disable_tool_default_read_filters"
        },
        {
          "id": "#GATK_ApplyBQSR.disable_sequence_dictionary_validation"
        },
        {
          "id": "#GATK_ApplyBQSR.disable_read_filter"
        },
        {
          "id": "#GATK_ApplyBQSR.disable_bam_index_caching"
        },
        {
          "id": "#GATK_ApplyBQSR.create_output_variant_md5"
        },
        {
          "id": "#GATK_ApplyBQSR.create_output_variant_index"
        },
        {
          "id": "#GATK_ApplyBQSR.create_output_bam_md5"
        },
        {
          "id": "#GATK_ApplyBQSR.cloud_prefetch_buffer"
        },
        {
          "id": "#GATK_ApplyBQSR.cloud_index_prefetch_buffer"
        },
        {
          "source": [
            "#GATK_BaseRecalibrator.recalibration_file"
          ],
          "id": "#GATK_ApplyBQSR.bqsr_recal_file"
        },
        {
          "id": "#GATK_ApplyBQSR.black_listed_lanes"
        },
        {
          "id": "#GATK_ApplyBQSR.black_list"
        },
        {
          "id": "#GATK_ApplyBQSR.ambig_filter_frac"
        },
        {
          "id": "#GATK_ApplyBQSR.ambig_filter_bases"
        },
        {
          "id": "#GATK_ApplyBQSR.add_output_vcf_command_line"
        },
        {
          "id": "#GATK_ApplyBQSR.add_output_sam_program_record"
        }
      ],
      "outputs": [
        {
          "id": "#GATK_ApplyBQSR.output"
        }
      ],
      "scatter": "#GATK_ApplyBQSR.intervals_file",
      "run": {
        "x": 1537.2389526859488,
        "hints": [
          {
            "class": "sbg:CPURequirement",
            "value": 1
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "script": "{\n  if($job.inputs.memory_per_job){\n    if($job.inputs.memory_overhead_per_job){\n    \treturn $job.inputs.memory_per_job + $job.inputs.memory_overhead_per_job\n    }\n    else\n  \t\treturn $job.inputs.memory_per_job\n  }\n  else if(!$job.inputs.memory_per_job && $job.inputs.memory_overhead_per_job){\n\t\treturn 2048 + $job.inputs.memory_overhead_per_job  \n  }\n  else\n  \treturn 2048\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "dockerImageId": ""
          }
        ],
        "sbg:latestRevision": 31,
        "sbg:cmdPreview": "/gatk/gatk --java-options \"-Xmx2048M\" ApplyBQSR --bqsr-recal-file /path/to/bqsr.grp --output input_cram-1_1.recalibrated.cram  --create-output-bam-index",
        "sbg:job": {
          "allocatedResources": {
            "cpu": 1,
            "mem": 2048
          },
          "inputs": {
            "createOutputVariantIndex": true,
            "input_cram": [
              {
                "path": "/path/to/input_cram-1.cram",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              },
              {
                "path": "/path/to/input_cram-2.ext",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              }
            ],
            "memory_overhead_per_job": 0,
            "disableSequenceDictionaryValidation": true,
            "use_jdk_inflater": false,
            "QUIET": true,
            "lenient": false,
            "intervals_file": {
              "path": "/path/to/1.bed",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "reference": {
              "path": "/path/to/reference.ext",
              "class": "File",
              "size": 0,
              "secondaryFiles": [
                {
                  "path": ".fai"
                },
                {
                  "path": "^.dict"
                }
              ]
            },
            "memory_per_job": 2048,
            "disableBamIndexCaching": true,
            "createOutputBamMD5": true,
            "createOutputBamIndex": true,
            "use_jdk_deflater": false,
            "createOutputVariantMD5": true,
            "bqsr_recal_file": {
              "path": "/path/to/bqsr.grp",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "disableToolDefaultReadFilters": true,
            "addOutputSAMProgramRecord": true,
            "input_bam": null,
            "emit_original_quals": false,
            "exclude_intervas_string": "",
            "intervals_string": "",
            "addOutputVCFCommandLine": true,
            "keepReverse": true,
            "useOriginalQualities": true,
            "interval_merging_rule": "",
            "dontRequireSoftClipsBothEnds": true,
            "ambigFilterBases": 4,
            "include_interval_name_in_output_name": true,
            "round_down_quantized": false
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500296630,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/14",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500640320,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/15",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500887412,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/16",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1501605489,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/17",
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1501610676,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/18",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1502190441,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/19",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1502283422,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/21",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1502287200,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/22",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1502287213,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/23",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1502288276,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/24",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1502718016,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/25",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1503405145,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/26",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504105684,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/27",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504272777,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/28",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504275123,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/29",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504789528,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/30",
            "sbg:revision": 15
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511522826,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/31",
            "sbg:revision": 16
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1513786566,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/32",
            "sbg:revision": 17
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515587867,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/44",
            "sbg:revision": 18
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515590545,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/46",
            "sbg:revision": 19
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515599120,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/49",
            "sbg:revision": 20
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516365801,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/50",
            "sbg:revision": 21
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516370357,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/51",
            "sbg:revision": 22
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516960377,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/52",
            "sbg:revision": 23
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1516972151,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/54",
            "sbg:revision": 24
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1519648144,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/56",
            "sbg:revision": 25
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1520946186,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/57",
            "sbg:revision": 26
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1522248805,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/58",
            "sbg:revision": 27
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1531405403,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/62",
            "sbg:revision": 28
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1531407772,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/67",
            "sbg:revision": 29
          },
          {
            "sbg:modifiedBy": "nikola_jovanovic",
            "sbg:modifiedOn": 1535119074,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/gatk-applybqsr/68",
            "sbg:revision": 30
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1549037862,
            "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "sbg:revision": 31
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "script": "{\n  interval_name = ''\n  \n  if ($job.inputs.include_interval_name_in_output_name){\n    if($job.inputs.intervals_file){\n      interval_path = [].concat($job.inputs.intervals_file)[0].path\n      interval_name = interval_path.split('/')[interval_path.split('/').length - 1].split('.')\n      interval_name.pop()\n      interval_name = '_' + interval_name.join('')\n    }\n  }\n  input = ''\n  if($job.inputs.input_cram){\n    input = [].concat($job.inputs.input_cram)[0].path.split('/').slice(-1)[0]\n  }\n  if($job.inputs.input_bam){\n    input = [].concat($job.inputs.input_bam)[0].path.split('/').slice(-1)[0]\n  }\n  input = input.split('.')\n  input = input.slice(0, -1).join('.') + interval_name +  '.recalibrated.' + input.slice(-1)\n  return input\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "prefix": "--output"
          },
          {
            "valueFrom": "--create-output-bam-index",
            "separate": true
          },
          {
            "valueFrom": {
              "script": "{\n  interval_name = ''\n  interval_name = ''\n  \n  if ($job.inputs.include_interval_name_in_output_name){\n    if($job.inputs.intervals_file){\n      interval_path = [].concat($job.inputs.intervals_file)[0].path\n      interval_name = interval_path.split('/')[interval_path.split('/').length - 1].split('.')\n      interval_name.pop()\n      interval_name = '_' + interval_name.join('')\n    }\n  }\n  ext = 'bam'\n  input = ''\n  if($job.inputs.input_cram){\n\treturn ''\n  }\n  if($job.inputs.input_bam){\n    input = [].concat($job.inputs.input_bam)[0].path.split('/').slice(-1)[0]\n    input = input.split('.')\n    input_bai = input.slice(0, -1).join('.') + interval_name +  '.recalibrated.bai'\n    input_bam_bai = input.slice(0, -1).join('.') + interval_name +  '.recalibrated.bam.bai'\n\n    return ' && mv ' + input_bai + ' ' + input_bam_bai\n  }\n}",
              "class": "Expression",
              "engine": "#cwl-js-engine"
            },
            "separate": false,
            "position": 100
          }
        ],
        "sbg:project": "vladimirk/gatk-4-0-demo-1",
        "inputs": [
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--verbosity",
              "position": 0
            },
            "description": "Control verbosity of logging. Default value: INFO. Possible values: {ERROR, WARNING, INFO, DEBUG}.",
            "label": "Verbosity",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "ERROR",
                  "WARNING",
                  "INFO",
                  "DEBUG"
                ],
                "type": "enum"
              }
            ],
            "id": "#verbosity",
            "sbg:toolDefaultValue": "INFO"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-original-qualities",
              "position": 0
            },
            "description": "Use the base quality scores from the OQ tag Default value: false. Possible values: {true, false}.",
            "label": "Use Original Qualities",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#use_original_qualities",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-inflater",
              "position": 0
            },
            "description": "Whether to use the JdkInflater (as opposed to IntelInflater) Default value: false. Possible values: {true, false}.",
            "label": "Use Jdk Inflater",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#use_jdk_inflater",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-deflater",
              "position": 0
            },
            "description": "Whether to use the JdkDeflater (as opposed to IntelDeflater) Default value: false. Possible values: {true, false}.",
            "label": "Use Jdk Deflater",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#use_jdk_deflater",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--static-quantized-quals",
              "position": 0
            },
            "description": "Use static quantized quality scores to a given number of levels (with -bqsr) This argument may be specified 0 or more times. Default value: null. Cannot be used in conjuction with argument(s) quantizationLevels (qq).",
            "label": "Static Quantized Quals",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#static_quantized_quals",
            "sbg:toolDefaultValue": "null"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--seconds-between-progress-updates",
              "position": 0
            },
            "description": "Output traversal statistics every time this many seconds elapse Default value: 10.0.",
            "label": "Seconds Between Progress Updates",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "float"
            ],
            "id": "#seconds_between_progress_updates",
            "sbg:toolDefaultValue": "10"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--sample",
              "position": 0
            },
            "description": "The name of the sample(s) to keep, filtering out all others This argument must be specified at least once. Required.",
            "label": "Sample",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "string"
            ],
            "id": "#sample",
            "sbg:toolDefaultValue": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--round-down-quantized",
              "position": 0
            },
            "description": "Round quals down to nearest quantized qual Default value: false. Possible values: {true, false} Cannot be used in conjuction with argument(s) quantizationLevels (qq).",
            "label": "Round Down Quantized",
            "sbg:category": "Advanced Arguments",
            "sbg:altPrefix": "",
            "id": "#round_down_quantized",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "sbg:fileTypes": "FASTA, FA",
            "label": "Reference",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "secondaryFiles": [
                ".fai",
                "^.dict"
              ],
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--reference",
              "position": 0
            },
            "id": "#reference",
            "required": false,
            "type": [
              "null",
              "File"
            ],
            "description": "Reference sequence Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-validation-stringency",
              "position": 0
            },
            "description": "Validation stringency for all SAM/BAM/CRAM/SRA files read by this program. The default stringency value SILENT can improve performance when processing a BAM file in which variable-length data (read, qualities, tags) do not otherwise need to be decoded. Default value: SILENT. Possible values: {STRICT, LENIENT, SILENT}.",
            "label": "Read Validation Stringency",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "STRICT",
                  "LENIENT",
                  "SILENT"
                ],
                "type": "enum"
              }
            ],
            "id": "#read_validation_stringency",
            "sbg:toolDefaultValue": "SILENT"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-name",
              "position": 0
            },
            "description": "Keep only reads with this read name Required.",
            "label": "Read Name",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "string"
            ],
            "id": "#read_name",
            "sbg:toolDefaultValue": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-index",
              "position": 0
            },
            "description": "Indices to use for the read inputs. If specified, an index must be provided for every read input and in the same order as the read inputs. If this argument is not specified, the path to the index for each input will be inferred automatically. This argument may be specified 0 or more times. Default value: null.",
            "label": "Read Index",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "string"
            ],
            "id": "#read_index",
            "sbg:toolDefaultValue": "null"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-filter",
              "position": 0
            },
            "description": "Read filters to be applied before analysis This argument may be specified 0 or more times. Default value: null.",
            "label": "Read Filter",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "AlignmentAgreesWithHeaderReadFilter",
                  "AllowAllReadsReadFilter",
                  "AmbiguousBaseReadFilter",
                  "CigarContainsNoNOperator",
                  "FirstOfPairReadFilter",
                  "FragmentLengthReadFilter",
                  "GoodCigarReadFilter",
                  "HasReadGroupReadFilter",
                  "LibraryReadFilter",
                  "MappedReadFilter",
                  "MappingQualityAvailableReadFilter",
                  "MappingQualityNotZeroReadFilter",
                  "MappingQualityReadFilter",
                  "MatchingBasesAndQualsReadFilter",
                  "MateDifferentStrandReadFilter",
                  "MateOnSameContigOrNoMappedMateReadFilter",
                  "MetricsReadFilter",
                  "NonZeroFragmentLengthReadFilter",
                  "NonZeroReferenceLengthAlignmentReadFilter",
                  "NotDuplicateReadFilter",
                  "NotOpticalDuplicateReadFilter",
                  "NotSecondaryAlignmentReadFilter",
                  "NotSupplementaryAlignmentReadFilter",
                  "OverclippedReadFilter",
                  "PairedReadFilter",
                  "PassesVendorQualityCheckReadFilter",
                  "PlatformReadFilter",
                  "PlatformUnitReadFilter",
                  "PrimaryLineReadFilter",
                  "ProperlyPairedReadFilter",
                  "ReadGroupBlackListReadFilter",
                  "ReadGroupReadFilter",
                  "ReadLengthEqualsCigarLengthReadFilter",
                  "ReadLengthReadFilter",
                  "ReadNameReadFilter",
                  "ReadStrandFilter",
                  "SampleReadFilter",
                  "SecondOfPairReadFilter",
                  "SeqIsStoredReadFilter",
                  "ValidAlignmentEndReadFilter",
                  "ValidAlignmentStartReadFilter",
                  "WellformedReadFilter"
                ],
                "type": "enum"
              }
            ],
            "id": "#read_filter",
            "sbg:toolDefaultValue": "null"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--quiet",
              "position": 0
            },
            "description": "Whether to suppress job-summary info on System.err. Default value: false. Possible values: {true, false}.",
            "label": "Quiet",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#quiet",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--quantize-quals",
              "position": 0
            },
            "description": "Quantize quality scores to a given number of levels Default value: 0. Cannot be used in conjuction with argument(s) staticQuantizationQuals (SQQ) roundDown (RDQ).",
            "label": "Quantize Quals",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#quantize_quals",
            "sbg:toolDefaultValue": "0"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--preserve-qscores-less-than",
              "position": 0
            },
            "description": "Don't recalibrate bases with quality scores less than this threshold Default value: 6.",
            "label": "Preserve Qscores Less Than",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#preserve_qscores_less_than",
            "sbg:toolDefaultValue": "6"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--pl-filter-name",
              "position": 0
            },
            "description": "Keep reads with RG:PL attribute containing this string This argument must be specified at least once. Required.",
            "label": "Pl Filter Name",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "string"
            ],
            "id": "#pl_filter_name",
            "sbg:toolDefaultValue": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--minimum-mapping-quality",
              "position": 0
            },
            "description": "Minimum mapping quality to keep (inclusive) Default value: 10.",
            "label": "Minimum Mapping Quality",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#minimum_mapping_quality",
            "sbg:toolDefaultValue": "10"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--min-read-length",
              "position": 0
            },
            "description": "Keep only reads with length at least equal to the specified value Default value: 1.",
            "label": "Min Read Length",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#min_read_length",
            "sbg:toolDefaultValue": "1"
          },
          {
            "type": [
              "null",
              "int"
            ],
            "sbg:stageInput": null,
            "id": "#memory_per_job",
            "label": "Memory Per Job",
            "sbg:category": "Execution"
          },
          {
            "type": [
              "null",
              "int"
            ],
            "sbg:stageInput": null,
            "id": "#memory_overhead_per_job",
            "label": "Memory Overhead Per Job",
            "sbg:category": "Execution"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--maximum-mapping-quality",
              "position": 0
            },
            "description": "Maximum mapping quality to keep (inclusive) Default value: null.",
            "label": "Maximum Mapping Quality",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#maximum_mapping_quality",
            "sbg:toolDefaultValue": "null"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-read-length",
              "position": 0
            },
            "description": "Keep only reads with length at most equal to the specified value Required.",
            "label": "Max Read Length",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#max_read_length",
            "sbg:toolDefaultValue": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-fragment-length",
              "position": 0
            },
            "description": "Keep only read pairs with fragment length at most equal to the given value Default value: 1000000.",
            "label": "Max Fragment Length",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#max_fragment_length",
            "sbg:toolDefaultValue": "1000000"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--library",
              "position": 0
            },
            "description": "The name of the library to keep Required.",
            "label": "Library",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "string"
            ],
            "id": "#library",
            "sbg:toolDefaultValue": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--lenient",
              "position": 0
            },
            "description": "Lenient processing of VCF files Default value: false. Possible values: {true, false}.",
            "label": "Lenient",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#lenient",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--keep-reverse",
              "position": 0
            },
            "label": "Keep Reverse",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#keep_reverse",
            "type": [
              "null",
              "boolean"
            ],
            "description": "Keep only reads on the reverse strand Required. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--keep-read-group",
              "position": 0
            },
            "description": "The name of the read group to keep Required.",
            "label": "Keep Read Group",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "string"
            ],
            "id": "#keep_read_group",
            "sbg:toolDefaultValue": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--intervals"
            },
            "label": "Intervals String",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#intervals_string",
            "type": [
              "null",
              "string"
            ],
            "description": "One or more genomic intervals over which to operate This argument may be specified 0 or more times. Default value: null.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--intervals"
            },
            "sbg:fileTypes": "TXT, BED",
            "label": "Intervals File",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "File"
            ],
            "required": false,
            "id": "#intervals_file",
            "description": "One or more genomic intervals over which to operate This argument may be specified 0 or more times. Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-set-rule",
              "position": 0
            },
            "description": "Set merging approach to use for combining interval inputs Default value: UNION. Possible values: {UNION, INTERSECTION}.",
            "label": "Interval Set Rule",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "UNION",
                  "INTERSECTION"
                ],
                "type": "enum"
              }
            ],
            "id": "#interval_set_rule",
            "sbg:toolDefaultValue": "UNION"
          },
          {
            "description": "Interval merging rule for abutting intervals  Default value: ALL. Possible values: {ALL, OVERLAPPING_ONLY}",
            "label": "Interval Padding",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-merging-rule",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#interval_merging_rule",
            "sbg:toolDefaultValue": "0",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-exclusion-padding",
              "position": 0
            },
            "description": "Amount of padding (in bp) to add to each interval you are excluding. Default value: 0.",
            "label": "Interval Exclusion Padding",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#interval_exclusion_padding",
            "sbg:toolDefaultValue": "0"
          },
          {
            "sbg:fileTypes": "CRAM",
            "label": "Input cram",
            "sbg:category": "Required Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "prefix": "--input",
              "secondaryFiles": [
                ".crai"
              ]
            },
            "id": "#input_cram",
            "required": false,
            "type": [
              "null",
              {
                "items": "File",
                "type": "array"
              }
            ],
            "description": "CRAM file containing reads This argument must be specified at least once."
          },
          {
            "sbg:fileTypes": "BAM",
            "label": "Input bam",
            "sbg:category": "Required Arguments",
            "inputBinding": {
              "position": 0,
              "itemSeparator": null,
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--input",
              "secondaryFiles": [
                ".bai"
              ]
            },
            "id": "#input_bam",
            "required": false,
            "type": [
              "null",
              {
                "items": "File",
                "type": "array"
              }
            ],
            "description": "BAM/SAM file containing reads This argument must be specified at least once."
          },
          {
            "type": [
              "null",
              "boolean"
            ],
            "label": "Include Interval Name In Output Name",
            "sbg:toolDefaultValue": "FALSE",
            "id": "#include_interval_name_in_output_name",
            "description": "Include interval name in output name.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--global-q-score-prior",
              "position": 0
            },
            "description": "Global Qscore Bayesian prior to use for BQSR Default value: -1.0.",
            "label": "Global Q Score Prior",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "float"
            ],
            "id": "#global_q_score_prior",
            "sbg:toolDefaultValue": "-1"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--filter-too-short",
              "position": 0
            },
            "description": "Value for which reads with less than this number of aligned bases is considered too short Default value: 30.",
            "label": "Filter Too Short",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#filter_too_short",
            "sbg:toolDefaultValue": "30"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--exclude-intervals"
            },
            "label": "Exclude Intervas String",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#exclude_intervas_string",
            "type": [
              "null",
              "string"
            ],
            "description": "One or more genomic intervals to exclude from processing This argument may be specified 0 or more times. Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--exclude-intervals"
            },
            "sbg:fileTypes": "TXT, BED",
            "label": "Exclude Intervals File",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "File"
            ],
            "required": false,
            "id": "#exclude_intervals_file",
            "description": "One or more genomic intervals to exclude from processing This argument may be specified 0 or more times. Default value: null."
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--emit-original-quals",
              "position": 0
            },
            "description": "Emit original base qualities under the OQ tag Default value: false. Possible values: {true, false}.",
            "label": "Emit Original Quals",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#emit_original_quals",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--dont-require-soft-clips-both-ends",
              "position": 0
            },
            "description": "Allow a read to be filtered out based on having only 1 soft-clipped block. By default, both ends must have a soft-clipped block, setting this flag requires only 1 soft-clipped block. Default value: false. Possible values: {true, false}.",
            "label": "Dont Require Soft Clips Both Ends",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#dont_require_soft_clips_both_ends",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-tool-default-read-filters",
              "position": 0
            },
            "description": "Disable all tool default read filters Default value: false. Possible values: {true, false}.",
            "label": "Disable Tool Default Read Filters",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#disable_tool_default_read_filters",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-sequence-dictionary-validation",
              "position": 0
            },
            "description": "If specified, do not check the sequence dictionaries from our inputs for compatibility. Use at your own risk! Default value: false. Possible values: {true, false}.",
            "label": "Disable Sequence Dictionary Validation",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#disable_sequence_dictionary_validation",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "GoodCigarReadFilter",
                  "MappedReadFilter",
                  "MappingQualityAvailableReadFilter",
                  "MappingQualityReadFilter",
                  "NonZeroReferenceLengthAlignmentReadFilter",
                  "NotDuplicateReadFilter",
                  "NotSecondaryAlignmentReadFilter",
                  "PassesVendorQualityCheckReadFilter",
                  "WellformedReadFilter"
                ],
                "type": "enum"
              }
            ],
            "label": "Disable Read Filter",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-read-filter",
              "position": 0
            },
            "sbg:toolDefaultValue": null,
            "id": "#disable_read_filter",
            "description": "Read filters to be disabled before analysis  This argument may be specified 0 or more times. Default value: null. Possible Values: {WellformedReadFilter}"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-bam-index-caching",
              "position": 0
            },
            "description": "If true, don't cache bam indexes, this will reduce memory requirements but may harm performance if many intervals are specified. Caching is automatically disabled if there are no intervals specified. Default value: false. Possible values: {true, false}.",
            "label": "Disable Bam Index Caching",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#disable_bam_index_caching",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-variant-md5",
              "position": 0
            },
            "description": "If true, create a a MD5 digest any VCF file created. Default value: false. Possible values: {true, false}.",
            "label": "Create Output Variant Md5",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#create_output_variant_md5",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-variant-index",
              "position": 0
            },
            "description": "If true, create a VCF index when writing a coordinate-sorted VCF file. Default value: true. Possible values: {true, false}.",
            "label": "Create Output Variant Index",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#create_output_variant_index",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "true",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-bam-md5",
              "position": 0
            },
            "description": "If true, create a MD5 digest for any BAM/SAM/CRAM file created Default value: false. Possible values: {true, false}.",
            "label": "Create Output Bam Md5",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#create_output_bam_md5",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "false",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--cloud-prefetch-buffer",
              "position": 0
            },
            "description": "Size of the cloud-only prefetch buffer (in MB; 0 to disable). Default value: 40.",
            "label": "Cloud Prefetch Buffer",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#cloud_prefetch_buffer",
            "sbg:toolDefaultValue": "40"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--cloud-index-prefetch-buffer",
              "position": 0
            },
            "description": "Size of the cloud-only prefetch buffer (in MB; 0 to disable). Defaults to cloudPrefetchBuffer if unset. Default value: -1.",
            "label": "Cloud Index Prefetch Buffer",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "int"
            ],
            "id": "#cloud_index_prefetch_buffer",
            "sbg:toolDefaultValue": "-1"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--bqsr-recal-file",
              "position": 0
            },
            "description": "Input recalibration table for BQSR Required.",
            "label": "Bqsr Recal File",
            "sbg:category": "Required Arguments",
            "sbg:altPrefix": "",
            "type": [
              "File"
            ],
            "required": true,
            "id": "#bqsr_recal_file",
            "sbg:toolDefaultValue": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--black-listed-lanes",
              "position": 0
            },
            "description": "Keep reads with platform units not on the list This argument must be specified at least once. Required.",
            "label": "Black Listed Lanes",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "string"
            ],
            "id": "#black_listed_lanes",
            "sbg:toolDefaultValue": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--black-list",
              "position": 0
            },
            "description": "This argument must be specified at least once. Required.",
            "label": "Black List",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "string"
            ],
            "id": "#black_list",
            "sbg:toolDefaultValue": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--ambig-filter-frac",
              "position": 0
            },
            "description": "Threshold fraction of ambiguous bases Default value: 0.05.",
            "label": "Ambig Filter Frac",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "type": [
              "null",
              "float"
            ],
            "id": "#ambig_filter_frac",
            "sbg:toolDefaultValue": "0"
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--ambig-filter-bases"
            },
            "label": "Ambig Filter Bases",
            "sbg:category": "Conditional Arguments for readFilter",
            "sbg:altPrefix": "",
            "id": "#ambig_filter_bases",
            "type": [
              "null",
              "int"
            ],
            "description": "Threshold number of ambiguous bases. If null, uses threshold fraction; otherwise, overrides threshold fraction. Cannot be used in conjunction with argument(s) maxAmbiguousBaseFraction.",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--add-output-vcf-command-line",
              "position": 0
            },
            "description": "If true, adds a command line header line to created VCF files. Default value: true. Possible values: {true, false}.",
            "label": "Add Output Vcf Command Line",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#add_output_vcf_command_line",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "true",
            "sbg:stageInput": null
          },
          {
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--add-output-sam-program-record",
              "position": 0
            },
            "description": "If true, adds a PG tag to created SAM/BAM/CRAM files. Default value: true. Possible values: {true, false}.",
            "label": "Add Output Sam Program Record",
            "sbg:category": "Optional Arguments",
            "sbg:altPrefix": "",
            "id": "#add_output_sam_program_record",
            "type": [
              "null",
              "boolean"
            ],
            "sbg:toolDefaultValue": "true",
            "sbg:stageInput": null
          }
        ],
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "https://software.broadinstitute.org/gatk/",
            "label": "Homepage"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/documentation/tooldocs/current/",
            "label": "Documentation"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/download/",
            "label": "Download"
          }
        ],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkitVersion": "4.0.2.0",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "sbg:toolAuthor": "Broad Institute",
        "sbg:projectName": "GATK 4.0 - Demo",
        "baseCommand": [
          "/gatk/gatk",
          "--java-options",
          {
            "script": "{\n  if($job.inputs.memory_per_job){\n  \treturn '\\\"-Xmx'.concat($job.inputs.memory_per_job, 'M') + '\\\"'\n  }\n  \treturn '\\\"-Xmx2048M\\\"'\n}",
            "class": "Expression",
            "engine": "#cwl-js-engine"
          },
          "ApplyBQSR"
        ],
        "stdin": "",
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "teodora.aleksic",
        "outputs": [
          {
            "sbg:fileTypes": "BAM,SAM,CRAM",
            "label": "Output",
            "id": "#output",
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#input_bam",
              "glob": {
                "script": "{\n  if($job.inputs.input_cram){\n  \tinput = [].concat($job.inputs.input_cram)[0].path.split('/').slice(-1)[0]    \n  }\n  if($job.inputs.input_bam){\n  \tinput = [].concat($job.inputs.input_bam)[0].path.split('/').slice(-1)[0]\n  }\n  input = input.split('.').slice(-1)[0]\n  \n  return '*.' + input\n}",
                "class": "Expression",
                "engine": "#cwl-js-engine"
              },
              "secondaryFiles": [
                ".bai",
                ".crai"
              ],
              "sbg:metadata": {
                "intervals_file": {
                  "script": "{ \n  if ($job.inputs.intervals_file)\n  \treturn $job.inputs.intervals_file.path.split('/').pop()\n  else\n  \treturn ''\n}",
                  "class": "Expression",
                  "engine": "#cwl-js-engine"
                }
              }
            },
            "type": [
              "null",
              "File"
            ],
            "description": "Recalibrated BAM/SAM/CRAM file"
          }
        ],
        "sbg:revision": 31,
        "sbg:createdOn": 1500296630,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": 230.48012695630874,
        "sbg:license": "Open source BSD (3-clause) license",
        "sbg:image_url": null,
        "sbg:contributors": [
          "vladimirk",
          "teodora.aleksic",
          "nikola_jovanovic"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": "",
        "id": "vladimirk/gatk-4-0-demo-1/gatk-4-0-applybqsr/31",
        "description": "Apply base quality score recalibration.\n\n###**Overview**  \n\nThis tool performs the second pass in a two-stage process called Base Quality Score Recalibration (BQSR). Specifically, it recalibrates the base qualities of the input reads based on the recalibration table produced by the BaseRecalibrator tool, and outputs a recalibrated BAM or CRAM file.\n\n####**Summary of the BQSR procedure**\n\nThe goal of this procedure is to correct for systematic bias that affect the assignment of base quality scores by the sequencer. The first pass consists of calculating error empirically and finding patterns in how error varies with basecall features over all bases. The relevant observations are written to a recalibration table. The second pass consists of applying numerical corrections to each individual basecall based on the patterns identified in the first step (recorded in the recalibration table) and write out the recalibrated data to a new BAM or CRAM file.\n\n###**Inputs**  \n\n- A BAM or CRAM file containing input read data\n- The covariates table (= recalibration file) generated by BaseRecalibrator on the input BAM or CRAM file\n\n###**Output**  \n\nA BAM or CRAM file containing the recalibrated read data\n\n###**Usage example**  \n\n    ./gatk-launch ApplyBQSR \\   \n         -R reference.fasta \\ \n         -I input.bam \\  \n         -BQSR recalibration.table \\  \n         -O output.bam  \n\n###**Notes**\n\n- This tool replaces the use of PrintReads for the application of base quality score recalibration as practiced in earlier versions of GATK (2.x and 3.x).\n- You should only run ApplyBQSR with the covariates table created from the input BAM or CRAM file(s).\n- Original qualities can be retained in the output file under the \"OQ\" tag if desired. See the `--emit_original_quals` argument for details.  \n\n###**IMPORTANT NOTICE**  \n\nTools in GATK that require a fasta reference file also look for the reference file's corresponding *.fai* (fasta index) and *.dict* (fasta dictionary) files. The fasta index file allows random access to reference bases and the dictionary file is a dictionary of the contig names and sizes contained within the fasta reference. These two secondary files are essential for GATK to work properly. To append these two files to your fasta reference please use the '***SBG FASTA Indices***' tool within your GATK based workflow before using any of the GATK tools.",
        "sbg:toolkit": "GATK",
        "sbg:content_hash": "a5ce018863d19853b0f0ab2596dfe87cfd249927aff46a9a602d5bb839176df6f",
        "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
        "label": "GATK ApplyBQSR",
        "sbg:categories": [
          "GATK-4"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1549037862,
        "sbg:id": "h-2bdb7e9c/h-8003a165/h-2e3800f1/0",
        "temporaryFailCodes": [],
        "sbg:wrapperAuthor": "filip_tubic"
      },
      "id": "#GATK_ApplyBQSR",
      "sbg:y": 230.48012695630874
    },
    {
      "sbg:x": 1373.9937475652316,
      "inputs": [
        {
          "id": "#GATK_BaseRecalibrator.verbosity"
        },
        {
          "id": "#GATK_BaseRecalibrator.use_original_qualities"
        },
        {
          "id": "#GATK_BaseRecalibrator.use_jdk_inflater"
        },
        {
          "id": "#GATK_BaseRecalibrator.use_jdk_deflater"
        },
        {
          "id": "#GATK_BaseRecalibrator.seconds_between_progress_updates"
        },
        {
          "id": "#GATK_BaseRecalibrator.sample"
        },
        {
          "source": [
            "#SBG_FASTA_Indices.fasta_reference"
          ],
          "id": "#GATK_BaseRecalibrator.reference"
        },
        {
          "source": [
            "#BWA_MEM_Bundle_0_7_17.aligned_reads"
          ],
          "id": "#GATK_BaseRecalibrator.reads"
        },
        {
          "id": "#GATK_BaseRecalibrator.read_validation_stringency"
        },
        {
          "id": "#GATK_BaseRecalibrator.read_name"
        },
        {
          "id": "#GATK_BaseRecalibrator.read_index"
        },
        {
          "id": "#GATK_BaseRecalibrator.read_filter"
        },
        {
          "id": "#GATK_BaseRecalibrator.quiet"
        },
        {
          "id": "#GATK_BaseRecalibrator.quantizing_levels"
        },
        {
          "id": "#GATK_BaseRecalibrator.preserve_qscores_less_than"
        },
        {
          "id": "#GATK_BaseRecalibrator.pl_filter_name"
        },
        {
          "id": "#GATK_BaseRecalibrator.mismatches_default_quality"
        },
        {
          "id": "#GATK_BaseRecalibrator.mismatches_context_size"
        },
        {
          "id": "#GATK_BaseRecalibrator.minimum_mapping_quality"
        },
        {
          "id": "#GATK_BaseRecalibrator.min_read_length"
        },
        {
          "id": "#GATK_BaseRecalibrator.memory_per_job"
        },
        {
          "id": "#GATK_BaseRecalibrator.memory_overhead_per_job"
        },
        {
          "id": "#GATK_BaseRecalibrator.maximum_mapping_quality"
        },
        {
          "id": "#GATK_BaseRecalibrator.maximum_cycle_value"
        },
        {
          "id": "#GATK_BaseRecalibrator.max_read_length"
        },
        {
          "id": "#GATK_BaseRecalibrator.max_fragment_length"
        },
        {
          "id": "#GATK_BaseRecalibrator.low_quality_tail"
        },
        {
          "id": "#GATK_BaseRecalibrator.library"
        },
        {
          "id": "#GATK_BaseRecalibrator.lenient"
        },
        {
          "source": [
            "#GATK_IndexFeatureFile.output_with_index",
            "#GATK_IndexFeatureFile_2.output_with_index",
            "#GATK_IndexFeatureFile_1.output_with_index"
          ],
          "id": "#GATK_BaseRecalibrator.known_sites"
        },
        {
          "id": "#GATK_BaseRecalibrator.keep_reverse"
        },
        {
          "id": "#GATK_BaseRecalibrator.keep_read_group"
        },
        {
          "id": "#GATK_BaseRecalibrator.intervals_string",
          "default": "20"
        },
        {
          "id": "#GATK_BaseRecalibrator.intervals_file"
        },
        {
          "id": "#GATK_BaseRecalibrator.interval_set_rule"
        },
        {
          "id": "#GATK_BaseRecalibrator.interval_merging_rule"
        },
        {
          "id": "#GATK_BaseRecalibrator.interval_exclusion_padding"
        },
        {
          "id": "#GATK_BaseRecalibrator.insertions_default_quality"
        },
        {
          "id": "#GATK_BaseRecalibrator.indels_context_size"
        },
        {
          "id": "#GATK_BaseRecalibrator.filter_too_short"
        },
        {
          "id": "#GATK_BaseRecalibrator.exclude_intervals_string"
        },
        {
          "id": "#GATK_BaseRecalibrator.exclude_intervals_file"
        },
        {
          "id": "#GATK_BaseRecalibrator.dont_require_soft_clips_both_ends"
        },
        {
          "id": "#GATK_BaseRecalibrator.disable_tool_default_read_filters"
        },
        {
          "id": "#GATK_BaseRecalibrator.disable_sequence_dictionary_validation"
        },
        {
          "id": "#GATK_BaseRecalibrator.disable_read_filter"
        },
        {
          "id": "#GATK_BaseRecalibrator.disable_bam_index_caching"
        },
        {
          "id": "#GATK_BaseRecalibrator.deletions_default_quality"
        },
        {
          "id": "#GATK_BaseRecalibrator.default_base_qualities"
        },
        {
          "id": "#GATK_BaseRecalibrator.create_output_variant_md5"
        },
        {
          "id": "#GATK_BaseRecalibrator.create_output_variant_index"
        },
        {
          "id": "#GATK_BaseRecalibrator.create_output_bam_md5"
        },
        {
          "id": "#GATK_BaseRecalibrator.create_output_bam_index"
        },
        {
          "id": "#GATK_BaseRecalibrator.cloud_prefetch_buffer"
        },
        {
          "id": "#GATK_BaseRecalibrator.cloud_index_prefetch_buffer"
        },
        {
          "id": "#GATK_BaseRecalibrator.bqsr_baq_gap_open_penalty"
        },
        {
          "id": "#GATK_BaseRecalibrator.black_listed_lanes"
        },
        {
          "id": "#GATK_BaseRecalibrator.black_list"
        },
        {
          "id": "#GATK_BaseRecalibrator.binary_tag_name"
        },
        {
          "id": "#GATK_BaseRecalibrator.ambig_filter_frac"
        },
        {
          "id": "#GATK_BaseRecalibrator.ambig_filter_bases"
        },
        {
          "id": "#GATK_BaseRecalibrator.add_output_vcf_command_line"
        },
        {
          "id": "#GATK_BaseRecalibrator.add_output_sam_program_record"
        }
      ],
      "outputs": [
        {
          "id": "#GATK_BaseRecalibrator.recalibration_file"
        },
        {
          "id": "#GATK_BaseRecalibrator.performance_summary"
        }
      ],
      "run": {
        "x": 1373.9937475652316,
        "hints": [
          {
            "class": "DockerRequirement",
            "dockerPull": "images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "dockerImageId": "3c3b8e0ed4e5"
          },
          {
            "class": "sbg:MemRequirement",
            "value": {
              "class": "Expression",
              "script": "{\n  if($job.inputs.memory_per_job){\n    if($job.inputs.memory_overhead_per_job){\n    \treturn $job.inputs.memory_per_job + $job.inputs.memory_overhead_per_job\n    }\n    else\n  \t\treturn $job.inputs.memory_per_job\n  }\n  else if(!$job.inputs.memory_per_job && $job.inputs.memory_overhead_per_job){\n\t\treturn 2048 + $job.inputs.memory_overhead_per_job  \n  }\n  else\n  \treturn 2048\n}",
              "engine": "#cwl-js-engine"
            }
          },
          {
            "class": "sbg:CPURequirement",
            "value": 1
          }
        ],
        "sbg:latestRevision": 23,
        "sbg:cmdPreview": "/gatk/gatk --java-options \"-Xmx4M\" BaseRecalibrator --input /path/to/reads-1.ext --input /path/to/reads-2.ext --reference /path/to/reference.ext  --output reads-1.recal_data.grp  --create-output-bam-index  --known-sites /path/to/known_sites-1.ext",
        "sbg:job": {
          "allocatedResources": {
            "mem": 5,
            "cpu": 1
          },
          "inputs": {
            "createOutputVariantIndex": 5.081587263149359,
            "useOriginalQualities": true,
            "secondsBetweenProgressUpdates": 1,
            "threads_per_job": 2,
            "memory_overhead_per_job": 1,
            "known_sites": [
              {
                "path": "/path/to/known_sites-1.ext",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              }
            ],
            "exclude_intervals_file": {
              "path": "/path/to/exclude_intervals_file.ext",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "use_jdk_inflater": true,
            "add_output_vcf_command_line": true,
            "QUIET": true,
            "lenient": true,
            "intervals_file": {
              "path": "/path/to/intervals_file.ext",
              "class": "File",
              "size": 0,
              "secondaryFiles": []
            },
            "keepReverse": true,
            "memory_per_job": 4,
            "createOutputBamMD5": 1.7560880637573613,
            "createOutputBamIndex": 6.802465483383213,
            "use_jdk_deflater": true,
            "cpu_per_job": 2,
            "createOutputVariantMD5": 0.6317428673703886,
            "disableSequenceDictionaryValidation": true,
            "disableToolDefaultReadFilters": true,
            "no_cmdline_in_header": true,
            "exclude_intervals_string": "exclude_intervals_string-string-value",
            "addOutputSAMProgramRecord": true,
            "reference": {
              "path": "/path/to/reference.ext",
              "class": "File",
              "size": 0,
              "secondaryFiles": [
                {
                  "path": ".fai"
                },
                {
                  "path": "^.dict"
                }
              ]
            },
            "reads": [
              {
                "path": "/path/to/reads-1.ext",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              },
              {
                "path": "/path/to/reads-2.ext",
                "class": "File",
                "size": 0,
                "secondaryFiles": []
              }
            ],
            "intervals_string": "intervals_string-string-value",
            "disableBamIndexCaching": true,
            "dontRequireSoftClipsBothEnds": true,
            "ambigFilterBases": 2,
            "interval_merging_rule": "interval_merging_rule-string-value"
          }
        },
        "sbg:sbgMaintained": false,
        "sbg:revisionsInfo": [
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500296554,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/16",
            "sbg:revision": 0
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500640330,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/17",
            "sbg:revision": 1
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1500887417,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/20",
            "sbg:revision": 2
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1502111498,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/23",
            "sbg:revision": 3
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1502718029,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/24",
            "sbg:revision": 4
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1503064609,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/31",
            "sbg:revision": 5
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1503064951,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/32",
            "sbg:revision": 6
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1503405166,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/34",
            "sbg:revision": 7
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504105701,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/42",
            "sbg:revision": 8
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504272902,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/44",
            "sbg:revision": 9
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504275139,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/45",
            "sbg:revision": 10
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1504280144,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/46",
            "sbg:revision": 11
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1504789585,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/48",
            "sbg:revision": 12
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1507625019,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/49",
            "sbg:revision": 13
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1511522861,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/50",
            "sbg:revision": 14
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1513786582,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/51",
            "sbg:revision": 15
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515587884,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/62",
            "sbg:revision": 16
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515590561,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/65",
            "sbg:revision": 17
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515594349,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/66",
            "sbg:revision": 18
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1515599103,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/69",
            "sbg:revision": 19
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1519396104,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/70",
            "sbg:revision": 20
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1519648152,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/71",
            "sbg:revision": 21
          },
          {
            "sbg:modifiedBy": "teodora.aleksic",
            "sbg:modifiedOn": 1520946168,
            "sbg:revisionNotes": "Copy of vladimirk/whole-exome-pipeline-bwa-gatk-4-0-with-metrics-demo/GATK_BaseRecalibrator/72",
            "sbg:revision": 22
          },
          {
            "sbg:modifiedBy": "vladimirk",
            "sbg:modifiedOn": 1549037893,
            "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
            "sbg:revision": 23
          }
        ],
        "arguments": [
          {
            "valueFrom": {
              "class": "Expression",
              "script": "{\n  read_name = [].concat($job.inputs.reads)[0].path.replace(/^.*[\\\\\\/]/, '').split('.')\n  read_namebase = read_name.slice(0, read_name.length-1).join('.')\n  return '--output ' + read_namebase + '.recal_data.grp'\n}",
              "engine": "#cwl-js-engine"
            },
            "separate": true,
            "prefix": ""
          },
          {
            "valueFrom": "--create-output-bam-index",
            "separate": true
          },
          {
            "valueFrom": {
              "class": "Expression",
              "script": "{\n  known_sites = [].concat($job.inputs.known_sites)\n\n  cmd = []\n\n  for (i = 0; i < known_sites.length; i++) {\n    cmd.push('--known-sites', known_sites[i].path)\n  }\n\n  return cmd.join(' ')\n}",
              "engine": "#cwl-js-engine"
            },
            "separate": true
          }
        ],
        "sbg:project": "vladimirk/gatk-4-0-demo-1",
        "inputs": [
          {
            "sbg:altPrefix": "",
            "label": "Verbosity",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--verbosity",
              "position": 0
            },
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "ERROR",
                  "WARNING",
                  "INFO",
                  "DEBUG"
                ],
                "type": "enum"
              }
            ],
            "id": "#verbosity",
            "description": "Control verbosity of logging. Default value: INFO. Possible values: {ERROR, WARNING, INFO, DEBUG}."
          },
          {
            "sbg:altPrefix": "",
            "label": "Use Original Qualities",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-original-qualities",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_original_qualities",
            "description": "Use the base quality scores from the OQ tag Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Use Jdk Inflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-inflater",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_jdk_inflater",
            "description": "Whether to use the JdkInflater (as opposed to IntelInflater) Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Use Jdk Deflater",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--use-jdk-deflater",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#use_jdk_deflater",
            "description": "Whether to use the JdkDeflater (as opposed to IntelDeflater) Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Seconds Between Progress Updates",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--seconds-between-progress-updates",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#seconds_between_progress_updates",
            "description": "Output traversal statistics every time this many seconds elapse Default value: 10.0."
          },
          {
            "sbg:altPrefix": "",
            "label": "Sample",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--sample",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#sample",
            "description": "The name of the sample(s) to keep, filtering out all others This argument must be specified at least once. Required."
          },
          {
            "sbg:altPrefix": "",
            "sbg:fileTypes": "FASTA, FA",
            "label": "Reference",
            "sbg:category": "Required Arguments",
            "inputBinding": {
              "loadContents": true,
              "separate": true,
              "prefix": "--reference",
              "secondaryFiles": [
                ".fai",
                "^.dict"
              ],
              "sbg:cmdInclude": true
            },
            "type": [
              "File"
            ],
            "required": true,
            "id": "#reference",
            "description": "Reference sequence file Required."
          },
          {
            "sbg:altPrefix": "",
            "sbg:fileTypes": "CRAM, BAM",
            "label": "Reads",
            "sbg:category": "Required Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--input",
              "secondaryFiles": [
                ".bai"
              ],
              "itemSeparator": null
            },
            "type": [
              {
                "items": "File",
                "type": "array"
              }
            ],
            "required": true,
            "id": "#reads",
            "description": "BAM/SAM/CRAM file containing reads This argument must be specified at least once. Required.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Read Validation Stringency",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-validation-stringency",
              "position": 0
            },
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "STRICT",
                  "LENIENT",
                  "SILENT"
                ],
                "type": "enum"
              }
            ],
            "id": "#read_validation_stringency",
            "description": "Validation stringency for all SAM/BAM/CRAM/SRA files read by this program. The default stringency value SILENT can improve performance when processing a BAM file in which variable-length data (read, qualities, tags) do not otherwise need to be decoded. Default value: SILENT. Possible values: {STRICT, LENIENT, SILENT}."
          },
          {
            "sbg:altPrefix": "",
            "label": "Read Name",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-name",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#read_name",
            "description": "Keep only reads with this read name Required."
          },
          {
            "label": "Read Index",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-index",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#read_index",
            "description": "Indices to use for the read inputs. If specified, an index must be provided for every read input and in the same order as the read inputs. If this argument is not specified, the path to the index for each input will be inferred automatically.  This argument may be specified 0 or more times. Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Read Filter",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--read-filter",
              "position": 0
            },
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "AlignmentAgreesWithHeaderReadFilter",
                  "AllowAllReadsReadFilter",
                  "AmbiguousBaseReadFilter",
                  "CigarContainsNoNOperator",
                  "FirstOfPairReadFilter",
                  "FragmentLengthReadFilter",
                  "GoodCigarReadFilter",
                  "HasReadGroupReadFilter",
                  "LibraryReadFilter",
                  "MappedReadFilter",
                  "MappingQualityAvailableReadFilter",
                  "MappingQualityNotZeroReadFilter",
                  "MappingQualityReadFilter",
                  "MatchingBasesAndQualsReadFilter",
                  "MateDifferentStrandReadFilter",
                  "MateOnSameContigOrNoMappedMateReadFilter",
                  "MetricsReadFilter",
                  "NonZeroFragmentLengthReadFilter",
                  "NonZeroReferenceLengthAlignmentReadFilter",
                  "NotDuplicateReadFilter",
                  "NotOpticalDuplicateReadFilter",
                  "NotSecondaryAlignmentReadFilter",
                  "NotSupplementaryAlignmentReadFilter",
                  "OverclippedReadFilter",
                  "PairedReadFilter",
                  "PassesVendorQualityCheckReadFilter",
                  "PlatformReadFilter",
                  "PlatformUnitReadFilter",
                  "PrimaryLineReadFilter",
                  "ProperlyPairedReadFilter",
                  "ReadGroupBlackListReadFilter",
                  "ReadGroupReadFilter",
                  "ReadLengthEqualsCigarLengthReadFilter",
                  "ReadLengthReadFilter",
                  "ReadNameReadFilter",
                  "ReadStrandFilter",
                  "SampleReadFilter",
                  "SecondOfPairReadFilter",
                  "SeqIsStoredReadFilter",
                  "ValidAlignmentEndReadFilter",
                  "ValidAlignmentStartReadFilter",
                  "WellformedReadFilter"
                ],
                "type": "enum"
              }
            ],
            "id": "#read_filter",
            "description": "Read filters to be applied before analysis This argument may be specified 0 or more times. Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Quiet",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--quiet",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#quiet",
            "description": "Whether to suppress job-summary info on System.err. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "label": "Quantizing Levels",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--quantizing-levels",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "sbg:toolDefaultValue": "16",
            "id": "#quantizing_levels",
            "description": "number of distinct quality scores in the quantized output  Default value: 16."
          },
          {
            "sbg:altPrefix": "",
            "label": "Preserve Qscores Less Than",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--preserve-qscores-less-than",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#preserve_qscores_less_than",
            "description": "Don't recalibrate bases with quality scores less than this threshold (with -bqsr) Default value: 6."
          },
          {
            "sbg:altPrefix": "",
            "label": "Pl Filter Name",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--pl-filter-name",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#pl_filter_name",
            "description": "Keep reads with RG:PL attribute containing this string This argument must be specified at least once. Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Mismatches Default Quality",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--mismatches-default-quality",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#mismatches_default_quality",
            "description": "Default quality for the base mismatches covariate Default value: -1."
          },
          {
            "sbg:altPrefix": "",
            "label": "Mismatches Context Size",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--mismatches-context-size",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#mismatches_context_size",
            "description": "Size of the k-mer context to be used for base mismatches Default value: 2."
          },
          {
            "sbg:altPrefix": "",
            "label": "Minimum Mapping Quality",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--minimum-mapping-quality",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#minimum_mapping_quality",
            "description": "Minimum mapping quality to keep (inclusive) Default value: 10."
          },
          {
            "sbg:altPrefix": "",
            "label": "Min Read Length",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--min-read-length",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#min_read_length",
            "description": "Keep only reads with length at least equal to the specified value Default value: 1."
          },
          {
            "id": "#memory_per_job",
            "type": [
              "null",
              "int"
            ],
            "label": "Memory Per Job",
            "description": "Memory per job",
            "sbg:stageInput": null
          },
          {
            "id": "#memory_overhead_per_job",
            "type": [
              "null",
              "int"
            ],
            "label": "Memory Overhead Per Job",
            "description": "Memory Overhead Per Job",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Maximum Mapping Quality",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--maximum-mapping-quality",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#maximum_mapping_quality",
            "description": "Maximum mapping quality to keep (inclusive) Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Maximum Cycle Value",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--maximum-cycle-value",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#maximum_cycle_value",
            "description": "The maximum cycle value permitted for the Cycle covariate Default value: 500."
          },
          {
            "sbg:altPrefix": "",
            "label": "Max Read Length",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-read-length",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#max_read_length",
            "description": "Keep only reads with length at most equal to the specified value Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Max Fragment Length",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--max-fragment-length",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#max_fragment_length",
            "description": "Keep only read pairs with fragment length at most equal to the given value Default value: 1000000."
          },
          {
            "sbg:altPrefix": "",
            "label": "Low Quality Tail",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--low-quality-tail",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#low_quality_tail",
            "description": "Minimum quality for the bases in the tail of the reads to be considered Default value: 2."
          },
          {
            "sbg:altPrefix": "",
            "label": "Library",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--library",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#library",
            "description": "The name of the library to keep Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Lenient",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--lenient",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#lenient",
            "description": "Lenient processing of VCF files Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "-knownSites",
            "sbg:fileTypes": "TXT, BED, VCF",
            "label": "Known Sites",
            "sbg:category": "Required Arguments",
            "inputBinding": {
              "valueFrom": {
                "class": "Expression",
                "script": "{\n\treturn ''\n}",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "secondaryFiles": [
                ".idx"
              ]
            },
            "type": [
              {
                "items": "File",
                "type": "array"
              }
            ],
            "required": true,
            "id": "#known_sites",
            "description": "One or more databases of known polymorphic sites used to exclude regions around known polymorphisms from analysis. This argument must be specified at least once. Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Keep Reverse",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--keep-reverse",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#keep_reverse",
            "description": "Keep only reads on the reverse strand Required. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Keep Read Group",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--keep-read-group",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#keep_read_group",
            "description": "The name of the read group to keep Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Intervals String",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "valueFrom": {
                "class": "Expression",
                "script": "{\n    if ($job.inputs.reference && $job.inputs.intervals_string){\n        fasta = $job.inputs.reference.contents\n        interval = $job.inputs.intervals_string\n        // fasta - UCSC format\n        if (fasta.indexOf(\">chr\") != -1){\n            // INTERVAL - UCSC format, all w/ chr\n            if (interval.indexOf(\"chr\") != -1){\n                return interval\n            }// if (interval.indexOf(\"chr\") == -1)\n            // interval - 1000G format, convert to UCSC\n            else{\n                if (Number(interval) || interval == \"X\" || interval == \"Y\"){\n                    return \"chr\".concat(interval)\n                }// if (Number(interval)|| interval == \"X\" || interval == \"Y\")\n                else{\n                    if (interval == \"MT\"){\n                        return \"chrM\"\n                    }//if (interval == \"MT\")\n                    else{\n                        if(Number(interval.substr(2,6))<211){\n                            n = Number(interval.substr(2,6)) - 190;\n                            s = \"chr\";\n                            s = s.concat(n.toString());\n                            s = s.concat(\"_gl\");\n                            s = s.concat(interval.substr(2,6));\n                            s = s.concat(\"_random\");\n                            return s\n                        }// if(Number(interval.substr(2,interval.length-2))<211)\n                        else{\n                            if(Number(interval.substr(2,6))<250) {\n                                s = \"chrUn_gl\";\n                                s = s.concat(interval.substr(2,6));\n                                return s\n                            }//if(Number(interval.substr(2,interval.length-2))<250)\n                            else {\n                                return interval\n                            }//if(Number(interval.substr(2,interval.length-2))<250) - else\n                        }// if(Number(interval.substr(2,interval.length-2))<211) - else\n                    }//if (interval == \"MT\") - else\n                }//if (Number(interval)|| interval == \"X\" || interval == \"Y\") - else\n            }//if (interval.indexOf(\"chr\") == -1) - else\n        }//if (fasta.indexOf(\">chr\") == -1)\n        // fasta - 1000G format\n        else{\n            //interval - USCS format, all w/ chr, convert to 1000G\n            if(interval.indexOf(\"chr\") != -1){\n                if(Number(interval.substr(3,2)) && interval.length<6 || interval == \"chrX\" || interval == \"chrY\"){\n                    return interval.substr(3,2)\n                }//if(Number(interval.substr(3,interval.length)) != NaN || interval == \"chrX\" || bsqr == \"chrY\")\n                else{\n                    if (interval == \"chrM\") {\n                        return \"MT\"\n                    }//if (interval == \"chrM\")\n                    else{\n                        s = \"GL\";\n                        s = s.concat(interval.substr(8,6));\n                        s = s.concat(\".1\");\n                        return s\n                    }//if (interval == \"chrM\") - else\n                }//if(Number(interval.substr(3,interval.length)) != NaN || interval == \"chrX\" || bsqr == \"chrY\") - else\n            }//if($job.inputs.interval.indexOf(\"chr\") == -1)\n            // interval - 1000G format\n            else{\n                return interval\n            }//(interval.indexOf(\"chr\") == -1) - else\n        }//if (fasta.indexOf(\">chr\") == -1) - else\n    }//if ($job.inputs.fasta && $job.inputs.interval)\n}\n",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--intervals"
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#intervals_string",
            "description": "One or more genomic intervals over which to operate This argument may be specified 0 or more times. Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "sbg:fileTypes": "TXT, BED",
            "label": "Intervals File",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--intervals"
            },
            "type": [
              "null",
              "File"
            ],
            "required": false,
            "id": "#intervals_file",
            "description": "One or more genomic intervals over which to operate This argument may be specified 0 or more times. Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Interval Set Rule",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-set-rule",
              "position": 0
            },
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "UNION",
                  "INTERSECTION"
                ],
                "type": "enum"
              }
            ],
            "id": "#interval_set_rule",
            "description": "Set merging approach to use for combining interval inputs Default value: UNION. Possible values: {UNION, INTERSECTION}."
          },
          {
            "label": "Interval merging rule",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-padding",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#interval_merging_rule",
            "description": "Interval merging rule for abutting intervals  Default value: ALL. Possible values: {ALL, OVERLAPPING_ONLY}",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Interval Exclusion Padding",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--interval-exclusion-padding",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#interval_exclusion_padding",
            "description": "Amount of padding (in bp) to add to each interval you are excluding. Default value: 0."
          },
          {
            "sbg:altPrefix": "",
            "label": "Insertions Default Quality",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--insertions-default-quality",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#insertions_default_quality",
            "description": "Default quality for the base insertions covariate Default value: 45."
          },
          {
            "sbg:altPrefix": "",
            "label": "Indels Context Size",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--indels-context-size",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#indels_context_size",
            "description": "Size of the k-mer context to be used for base insertions and deletions Default value: 3."
          },
          {
            "sbg:altPrefix": "",
            "label": "Filter Too Short",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--filter-too-short",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#filter_too_short",
            "description": "Value for which reads with less than this number of aligned bases is considered too short Default value: 30."
          },
          {
            "sbg:altPrefix": "",
            "label": "Exclude Intervals String",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--exclude-intervals"
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#exclude_intervals_string",
            "description": "One or more genomic intervals to exclude from processing This argument may be specified 0 or more times. Default value: null.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "sbg:fileTypes": "TXT, BED",
            "label": "Exclude Intervals File",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--exclude-intervals"
            },
            "type": [
              "null",
              "File"
            ],
            "required": false,
            "id": "#exclude_intervals_file",
            "description": "One or more genomic intervals to exclude from processing This argument may be specified 0 or more times. Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Dont Require Soft Clips Both Ends",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--dont-require-soft-clips-both-ends",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#dont_require_soft_clips_both_ends",
            "description": "Allow a read to be filtered out based on having only 1 soft-clipped block. By default, both ends must have a soft-clipped block, setting this flag requires only 1 soft-clipped block. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Disable Tool Default Read Filters",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-tool-default-read-filters",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#disable_tool_default_read_filters",
            "description": "Disable all tool default read filters Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Disable Sequence Dictionary Validation",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-sequence-dictionary-validation",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#disable_sequence_dictionary_validation",
            "description": "If specified, do not check the sequence dictionaries from our inputs for compatibility. Use at your own risk! Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "label": "Disable Read Filter",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-read-filter",
              "position": 0
            },
            "type": [
              "null",
              {
                "name": "null",
                "symbols": [
                  "GoodCigarReadFilter",
                  "MappedReadFilter",
                  "MappingQualityAvailableReadFilter",
                  "MappingQualityReadFilter",
                  "NonZeroReferenceLengthAlignmentReadFilter",
                  "NotDuplicateReadFilter",
                  "NotSecondaryAlignmentReadFilter",
                  "PassesVendorQualityCheckReadFilter",
                  "WellformedReadFilter"
                ],
                "type": "enum"
              }
            ],
            "id": "#disable_read_filter",
            "description": "Read filters to be disabled before analysis  This argument may be specified 0 or more                               times. Default value: null. Possible Values: {MappedReadFilter,                               MappingQualityAvailableReadFilter, MappingQualityNotZeroReadFilter,                               NotDuplicateReadFilter, NotSecondaryAlignmentReadFilter,                               PassesVendorQualityCheckReadFilter, WellformedReadFilter}"
          },
          {
            "sbg:altPrefix": "",
            "label": "Disable Bam Index Caching",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--disable-bam-index-caching",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#disable_bam_index_caching",
            "description": "If true, don't cache bam indexes, this will reduce memory requirements but may harm performance if many intervals are specified. Caching is automatically disabled if there are no intervals specified. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Deletions Default Quality",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--deletions-default-quality",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#deletions_default_quality",
            "description": "Default quality for the base deletions covariate Default value: 45."
          },
          {
            "sbg:altPrefix": "",
            "label": "Default Base Qualities",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--default-base-qualities",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#default_base_qualities",
            "description": "Assign a default base quality Default value: -1."
          },
          {
            "sbg:altPrefix": "",
            "label": "Create Output Variant Md5",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-variant-md5",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#create_output_variant_md5",
            "description": "If true, create a a MD5 digest any VCF file created. Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Create Output Variant Index",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-variant-index",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#create_output_variant_index",
            "description": "If true, create a VCF index when writing a coordinate-sorted VCF file. Default value: true. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Create Output Bam Md5",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-bam-md5",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#create_output_bam_md5",
            "description": "If true, create a MD5 digest for any BAM/SAM/CRAM file created Default value: false. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Create Output Bam Index",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--create-output-bam-index",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#create_output_bam_index",
            "description": "If true, create a BAM/CRAM index when writing a coordinate-sorted BAM/CRAM file. Default value: true. Possible values: {true, false}.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Cloud Prefetch Buffer",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--cloud-prefetch-buffer",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#cloud_prefetch_buffer",
            "description": "Size of the cloud-only prefetch buffer (in MB; 0 to disable). Default value: 40."
          },
          {
            "sbg:altPrefix": "",
            "label": "Cloud Index Prefetch Buffer",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--cloud-index-prefetch-buffer",
              "position": 0
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#cloud_index_prefetch_buffer",
            "description": "Size of the cloud-only prefetch buffer (in MB; 0 to disable). Defaults to cloudPrefetchBuffer if unset. Default value: -1."
          },
          {
            "sbg:altPrefix": "",
            "label": "Bqsr Baq Gap Open Penalty",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--bqsr-baq-gap-open-penalty",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#bqsr_baq_gap_open_penalty",
            "description": "BQSR BAQ gap open penalty (Phred Scaled). Default value is 40. 30 is perhaps better for whole genome call sets Default value: 40.0."
          },
          {
            "sbg:altPrefix": "",
            "label": "Black Listed Lanes",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--black-listed-lanes",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#black_listed_lanes",
            "description": "Keep reads with platform units not on the list This argument must be specified at least once. Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Black List",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--black-list",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#black_list",
            "description": "This argument must be specified at least once. Required."
          },
          {
            "sbg:altPrefix": "",
            "label": "Binary Tag Name",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--binary-tag-name",
              "position": 0
            },
            "type": [
              "null",
              "string"
            ],
            "id": "#binary_tag_name",
            "description": "The binary tag covariate name if using it Default value: null."
          },
          {
            "sbg:altPrefix": "",
            "label": "Ambig Filter Frac",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--ambig-filter-frac",
              "position": 0
            },
            "type": [
              "null",
              "float"
            ],
            "id": "#ambig_filter_frac",
            "description": "Threshold fraction of non-regular bases (e.g. N) above which to filter Default value: 0.05."
          },
          {
            "sbg:altPrefix": "",
            "label": "Ambig Filter Bases",
            "sbg:category": "Conditional Arguments for readFilter",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--ambig-filter-bases"
            },
            "type": [
              "null",
              "int"
            ],
            "id": "#ambig_filter_bases",
            "description": "Threshold number of ambiguous bases. If null, uses threshold fraction; otherwise, overrides threshold fraction. Cannot be used in conjunction with argument(s) maxAmbiguousBaseFraction.",
            "sbg:stageInput": null
          },
          {
            "label": "Adds a command line header line to created VCF file",
            "sbg:toolDefaultValue": "TRUE",
            "inputBinding": {
              "valueFrom": {
                "class": "Expression",
                "script": "{\n  return ''\n}",
                "engine": "#cwl-js-engine"
              },
              "sbg:cmdInclude": true,
              "separate": false,
              "prefix": "--add-output-vcf-command-line"
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#add_output_vcf_command_line",
            "description": "If true, adds a command line header line to created VCF file. Default value: true.",
            "sbg:stageInput": null
          },
          {
            "sbg:altPrefix": "",
            "label": "Add Output Sam Program Record",
            "sbg:category": "Optional Arguments",
            "inputBinding": {
              "sbg:cmdInclude": true,
              "separate": true,
              "prefix": "--add-output-sam-program-record",
              "position": 0
            },
            "type": [
              "null",
              "boolean"
            ],
            "id": "#add_output_sam_program_record",
            "description": "If true, adds a PG tag to created SAM/BAM/CRAM files. Default value: true. Possible values: {true, false}.",
            "sbg:stageInput": null
          }
        ],
        "appUrl": "/u/vladimirk/gatk-3-7/apps/#vladimirk/gatk-3-7/gatk-3-7-baserecalibrator/5",
        "class": "CommandLineTool",
        "sbg:publisher": "sbg",
        "sbg:links": [
          {
            "id": "https://software.broadinstitute.org/gatk/",
            "label": "Homepage"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/documentation/tooldocs/current/",
            "label": "Documentation"
          },
          {
            "id": "https://software.broadinstitute.org/gatk/download/",
            "label": "Download"
          }
        ],
        "sbg:modifiedBy": "vladimirk",
        "sbg:toolkitVersion": "4.0.2.0",
        "requirements": [
          {
            "class": "ExpressionEngineRequirement",
            "id": "#cwl-js-engine",
            "requirements": [
              {
                "class": "DockerRequirement",
                "dockerPull": "rabix/js-engine"
              }
            ]
          }
        ],
        "sbg:toolAuthor": "Broad Institute",
        "sbg:projectName": "GATK 4.0 - Demo",
        "baseCommand": [
          "/gatk/gatk",
          "--java-options",
          {
            "class": "Expression",
            "script": "{\n  if($job.inputs.memory_per_job){\n  \treturn '\\\"-Xmx'.concat($job.inputs.memory_per_job, 'M') + '\\\"'\n  }\n  \treturn '\\\"-Xmx2048M\\\"'\n}",
            "engine": "#cwl-js-engine"
          },
          "BaseRecalibrator"
        ],
        "stdin": "",
        "$namespaces": {
          "sbg": "https://sevenbridges.com"
        },
        "sbg:createdBy": "teodora.aleksic",
        "outputs": [
          {
            "sbg:fileTypes": "GRP",
            "label": "BQSR Table",
            "type": [
              "File"
            ],
            "outputBinding": {
              "sbg:inheritMetadataFrom": "#reads",
              "glob": "*.recal_data.grp"
            },
            "id": "#recalibration_file",
            "description": "The output recalibration table file to create."
          },
          {
            "id": "#performance_summary",
            "outputBinding": {
              "glob": "*.txt"
            },
            "type": [
              "null",
              "File"
            ],
            "label": "Performance Summary",
            "description": "Test"
          }
        ],
        "label": "GATK BaseRecalibrator",
        "sbg:createdOn": 1500296554,
        "successCodes": [],
        "sbg:validationErrors": [],
        "y": 347.8573746624536,
        "sbg:license": "Open source BSD (3-clause) license",
        "sbg:contributors": [
          "vladimirk",
          "teodora.aleksic"
        ],
        "sbg:appVersion": [
          "sbg:draft-2"
        ],
        "stdout": "",
        "id": "vladimirk/gatk-4-0-demo-1/gatk-4-0-baserecalibrator/23",
        "description": "First pass of the base quality score recalibration -- Generates recalibration table based on various covariates (such as read group, reported quality score, machine cycle, and nucleotide context).\n\n###**Overview**  \n\nThis walker is designed to work as the first pass in a two-pass processing step. It does a by-locus traversal operating only at sites that are not in dbSNP. We assume that all reference mismatches we see are therefore errors and indicative of poor base quality. This walker generates tables based on various user-specified covariates (such as read group, reported quality score, cycle, and context). Since there is a large amount of data one can then calculate an empirical probability of error given the particular covariates seen at this site, where p(error) = num mismatches / num observations. The output file is a table (of the several covariate values, num observations, num mismatches, empirical quality score).\n\nNote: ReadGroupCovariate and QualityScoreCovariate are required covariates and will be added for the user regardless of whether or not they were specified.\n\n###**Inputs**  \n\nThe input read data whose base quality scores need to be assessed.\nA database of known polymorphic sites to skip over.\n\n###**Output**  \n\nA GATK Report file with many tables:\n\n- The list of arguments\n- The quantized qualities table\n- The recalibration table by read group\n- The recalibration table by quality score\n- The recalibration table for all the optional covariates\n\nThe GATK Report is intended to be easy to read by humans or computers. Check out the documentation of the GATKReport to learn how to manipulate this table.\n\n###**Usage example**  \n\n     ./gatk-launch BaseRecalibrator \\ \n     \t -R reference.fasta \\ \n         -I input.bam \\   \n         --knownSites latest_dbsnp.vcf \\  \n         -O recalibration.table \n\n###**Additional Notes**\n\n- By default, the tool works only with VCF resource files. To use VCF.GZ resource files, the tool wrapper needs to be modified.\n\n###**IMPORTANT NOTICE**  \n\nTools in GATK that require a fasta reference file also look for the reference file's corresponding *.fai* (fasta index) and *.dict* (fasta dictionary) files. The fasta index file allows random access to reference bases and the dictionary file is a dictionary of the contig names and sizes contained within the fasta reference. These two secondary files are essential for GATK to work properly. To append these two files to your fasta reference please use the '***SBG FASTA Indices***' tool within your GATK based workflow before using any of the GATK tools.",
        "sbg:content_hash": "aebfc4537c12c76bab4ce6a9908bedb940363006dd0a1b0a8b6eff1771821210a",
        "sbg:toolkit": "GATK",
        "sbg:image_url": null,
        "sbg:revisionNotes": "latest docker images.sbgenomics.com/vladimirk/gatk:4.1.0.0",
        "sbg:revision": 23,
        "sbg:categories": [
          "GATK-4"
        ],
        "cwlVersion": "sbg:draft-2",
        "sbg:modifiedOn": 1549037893,
        "sbg:id": "h-d69e7446/h-bc03518f/h-4fb36bb7/0",
        "temporaryFailCodes": []
      },
      "id": "#GATK_BaseRecalibrator",
      "sbg:y": 347.8573746624536
    }
  ],
  "class": "Workflow",
  "description": "This Whole Genome Sequencing (WGS) workflow identifies variants from a human whole-genome resequencing experiment by using the [Broad Institute's](https://software.broadinstitute.org/gatk/best-practices/) best-practices workflow for alignment and variant calling.\n\nThis workflow performs optimally on data from experiments which utilize a PCR-free library preparation protocol and targets 30x mean coverage across the genome. However, it is also suitable for a range of coverages (verified up to 150x). Although WGS generally has lower coverage than Whole Exome Sequencing (WES), this method can detect variants outside of protein-coding areas and can detect changes affecting regulatory regions and various controlling mechanisms. These characteristics allow for a wider application of the workflow, especially in cases when novel variants are expected. For example, WGS can be used if the phenotype or family history strongly implicates genetic etiology but the phenotype does not correspond to a specific disorder for which a test targeting a particular gene is clinically available.\n\n## Workflow structure\n\nThe workflow follows the Broad Institute\u2019s best practices and utilizes the Broad Institute's GATK 4.0.0.0 tools. A separate step is undertaken to assess the quality of sequenced reads using Babraham Institute's tool, FastQC. \n\nSequenced reads are first aligned with the BWA-MEM 0.7.17 tool. Then, duplicates are removed. The next step uses algorithms developed by the Broad Institute to do a re-evaluation of the qualities of sequenced bases. Generated BAM files are pooled together, and variant calling is performed. For more information on how variant calling is performed, please refer to the [Broad Institute's web site](https://software.broadinstitute.org/gatk/best-practices/).\n\nTo obtain the optimal usage of a computational instance\u2019s resources, analysis is divided into a number of jobs which correspond to the number of *chromosomal* regions in the input BED file plus one additional job for much smaller, mitochondrial, and global contigs. The SBG PrepareIntervals tool splits the input BED file (Target BED) into several smaller BED files. GATK BaseRecalibrator, set to use only reads from chromosome 20, collects all the BAM files and uses only those covered with the BQSR intervals string input to create the model for base quality score recalibration (BQSR). This lowers execution time while preserving a similar quality of recalibration. GATK ApplyBQSR applies quality mapping table received from GATK BaseRecalibrator to the BAMs received from BWA-MEM. GATK ApplyBQSR also works in scatter mode set on intervals input (one job per BED file) received from the SBG PrepareIntervals tool. GATK HaplotypeCaller is scattered by BAM file received from GATK ApplyBQSR and performs variant calling on each of the BAMs, outputting raw genotype variant calling files (GVCF). Each of the GVCFs is passed to GATK GenotypeGVCFs which converts it to a VCF. All GVCFs and VCFs from the intervals are merged.\n\n## Workflow performance\n\n| Sample             | Instance type (c5 instance) | Execution time | Cost (Spot) | Cost (On demand) | Instance type (c4 instance) | Execution time | Cost (Spot) | Cost (On demand) |\n|--------------------|-----------------------------|----------------|-------------|------------------|-----------------------------|----------------|-------------|------------------|\n| HG001 30x PCR-free | c5.9xlarge (HDD 700GB)      | 7:24:04        | 5.51$       | 11.49$           | c4.8xlarge (HDD 700GB)      | 8:32:28        | 4.68$       | 13.78$           |\n| HG001 30x PCR-prep | c5.9xlarge (HDD 700GB)      | 10:09:22       | 7.56$       | 15.77$           | c4.8xlarge (HDD 700GB)      | 12:59:43       | 7.11$       | 20.97$           |\n| HG001 50x PCR-free | c5.9xlarge (HDD 700GB)      | 10:35:15       | 7.88$       | 16.44$           | c4.8xlarge (HDD 700GB)      | 12:44:03       | 7.56$       | 20.54$           |\n\n## Required inputs\n\n- Reference or TAR with BWA reference indices\n- Target BED file - Chromosomal intervals of this BED are used for parallelization (scattering)\n- DBSNP database - Database with known variants from the population used with base quality score recalibration, variant calling and variant quality score recalibration\n- Mills INDEL database - Database of known indels in the population used with variant recalibration (VCF)\n- Known indels 1000g fused with BQSR\n- FASTQ reads Illumina paired-end reads from the sequencer.\n- Threads for BWA MEM (default value is 36, which is equal to the number of CPUs on the c4.8xlarge instance)\n- Threads for Sambamba sort (default value is 36, which is equal to the number of CPUs on the c4.8xlarge instance)\n- Memory per job for HaplotypeCaller (default value is 2200 MB)\n\n## Outputs\n\n- Genome coverage metrics\n- Alignment metrics\n- Genotype variant calling format file (GVCF)\n- Aligned Reads from BWA-MEM ([BAM](https://samtools.github.io/hts-specs/SAMv1.pdf))\n- Raw variant calling format file (VCF)\n- FastQC Report\n\n## Important issues\n\n- In order to complete the execution of the workflow, the following fields in the metadata of FASTQ files must be set: **Paired-end, Sample ID and Platform**.\n- All reference files must correspond to the same reference genome (HG19, GRCh 37, HG38,...). If some of the reference files has contigs not listed in reference genome the pipeline cannot be executed.\n- BWA-MEM index files are packed together with the reference genome in the TAR files which are available on SBG Public files. With that indexing step in the pipeline can be skipped and its total execution will be faster.\n- If HG38 is used, it is recommended to lower the number of BWA MEM and Sambamba sort threads. For input files with ~30x coverage the recommended value for both parameters is 15, while for input files with ~50x coverage the recommended value for both parameters is 10. If threads number is not set and HG38 is used the threads for BWA-MEM will be set to 10.\n- If HG38 is used, it is recommended to increase the memory per job for HaplotypeCaller from 2048 MB to at least 4096 MB depending on the type of sample and coverage. If memory_per_job for HaplotypeCaller is not set and HG38 is used the memory for HaplotypeCaller is set 4096 MB.\n-  If HG38 is used it will automatically perform alt contig processing from [Broad](https://gatkforums.broadinstitute.org/gatk/discussion/8017/how-to-map-reads-to-a-reference-with-alternate-contigs-like-grch38) by including additional alt index from bwa.kit. The alignments on primary assembly reference will be done correctly and for proper alignment on alt contigs please run additional post processing.\n- Variant Quality Score Recalibration (VQSR) has been left out of this workflow since it is not optimized for single sample filtering and is also going to be deprecated by Broad's upcoming [deep learning](https://software.broadinstitute.org/gatk/blog?id=10996) filtering. This workflow will feature the new deep learning tool once it becomes available.",
  "sbg:toolkit": "GATK",
  "sbg:toolkitVersion": "4.1.0.0",
  "requirements": [],
  "label": "Whole Genome Sequencing - BWA + GATK 4.0 (with Metrics)",
  "sbg:categories": [
    "WGS",
    "GATK-4"
  ],
  "cwlVersion": "sbg:draft-2",
  "sbg:canvas_zoom": 0.5999999999999996,
  "sbg:appVersion": [
    "sbg:draft-2"
  ],
  "id": "https://api.sbgenomics.com/v2/apps/admin/sbg-public-data/whole-genome-sequencing-bwa-gatk-4-0/54/raw/",
  "sbg:id": "admin/sbg-public-data/whole-genome-sequencing-bwa-gatk-4-0/54",
  "sbg:revision": 54,
  "sbg:revisionNotes": "revision in description 4.1.0.0",
  "sbg:modifiedOn": 1551696389,
  "sbg:modifiedBy": "admin",
  "sbg:createdOn": 1501857801,
  "sbg:createdBy": "admin",
  "sbg:project": "admin/sbg-public-data",
  "sbg:sbgMaintained": false,
  "sbg:validationErrors": [],
  "sbg:contributors": [
    "admin"
  ],
  "sbg:latestRevision": 54,
  "sbg:publisher": "sbg",
  "sbg:content_hash": "a1fb1b693f5ed10567ddfcc087640c3e940498ab1126688e6e6021e2bf28bd34c"
}