@prefix LoadListingRequirement: <http://commonwl.org/cwltool#LoadListingRequirement/> .
@prefix CommandLineBinding: <https://w3id.org/cwl/cwl#CommandLineBinding/> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix DockerRequirement: <https://w3id.org/cwl/cwl#DockerRequirement/> .
@prefix Workflow: <https://w3id.org/cwl/cwl#Workflow/> .
@prefix InlineJavascriptRequirement: <https://w3id.org/cwl/cwl#InlineJavascriptRequirement/> .
@prefix sld:   <https://w3id.org/cwl/salad#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix CommandOutputBinding: <https://w3id.org/cwl/cwl#CommandOutputBinding/> .
@prefix ns2:   <http://commonwl.org/cwltool#> .
@prefix ns1:   <http://schema.org/> .
@prefix NetworkAccess: <http://commonwl.org/cwltool#NetworkAccess/> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix cwl:   <https://w3id.org/cwl/cwl#> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#bai>
        rdfs:comment  "Generate BAI-format index for BAM files [default]. If input isn't cram.\n" ;
        sld:type      xsd:boolean , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#du>
        rdfs:comment      "Change strand af the mate read (so both reads from the same strand) useful for strand specific.\nWorks for BAM files only\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  11 ;
                            CommandLineBinding:prefix    "-du"
                          ] ;
        sld:type          xsd:boolean , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#threads>
        rdfs:comment  "Set number of sorting and compression threads [1] (Only for sorting)\n" ;
        sld:type      xsd:int , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/fragment_size>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#fragment_size> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bedgraph_file>
        rdfs:comment      "bedGraph output file" ;
        rdfs:label        "bedGraph output file" ;
        cwl:outputSource  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sort_bedgraph/sorted_file> ;
        sld:type          cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#bedgraph_file>
        rdfs:comment      "Four column bedGraph file: <chrom> <start> <end> <value>\n" ;
        cwl:inputBinding  [ CommandLineBinding:position
                          10 ] ;
        sld:type          cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#scale>
        rdfs:comment      "Scale the coverage by a constant factor.\nEach coverage value is multiplied by this factor before being reported.\nUseful for normalizing coverage by, e.g., reads per million (RPM).\n- Default is 1.0; i.e., unscaled.\n- (FLOAT)\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  6 ;
                            CommandLineBinding:prefix    "-scale"
                          ] ;
        sld:type          xsd:float , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/output_filename>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bedgraph_filename> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/scale>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#scale> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#samtools_sort_index/sort_input>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_file> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#samtools_sort_index/threads>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#threads> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#m3>
        rdfs:comment      "Calculate coverage of 3\" positions (instead of entire interval)\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  15 ;
                            CommandLineBinding:prefix    "-3"
                          ] ;
        sld:type          xsd:boolean , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl>
        a                        cwl:Workflow ;
        ns2:original_cwlVersion  "v1.0" ;
        Workflow:steps           <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#samtools_sort_index> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_to_bigwig> ;
        cwl:cwlVersion           <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/v1.2> ;
        cwl:hints                [ a       <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/LoadListingRequirement> ;
                                   LoadListingRequirement:loadListing
                                           "deep_listing"
                                 ] ;
        cwl:hints                [ a                            <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/NetworkAccess> ;
                                   NetworkAccess:networkAccess  true
                                 ] ;
        cwl:inputs               <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#mapped_reads_number> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#chrom_length_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#output_file_prefix> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#threads> ;
        cwl:outputs              <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bigwig_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bambai_pair> ;
        cwl:requirements         [ a  cwl:StepInputExpressionRequirement ] ;
        cwl:requirements         [ a  cwl:MultipleInputFeatureRequirement ] ;
        cwl:requirements         [ a  cwl:SubworkflowFeatureRequirement ] ;
        cwl:requirements         [ a  cwl:InlineJavascriptRequirement ] .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sort_bedgraph>
        cwl:in   <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sort_bedgraph/key> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sort_bedgraph/unsorted_file> ;
        cwl:out  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sort_bedgraph/sorted_file> ;
        cwl:run  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/linux-sort.cwl> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bigwig_file>
        rdfs:comment      "bigWig output file" ;
        rdfs:label        "bigWig output file" ;
        cwl:outputSource  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sorted_bedgraph_to_bigwig/bigwig_file> ;
        sld:type          cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl>
        a                        cwl:CommandLineTool ;
        rdfs:comment             "Tool calculates genome coverage from input bam/bed/gff/vcf using `bedtools genomecov`\n\nDepending on `input_file` extension additional prefix is used: if `*.bam` use `-ibam`, else use `-i`.\n\n`scale` and `mapped_reads_number` inputs result in the same parameter `-scale`. If `scale` is not provided, check if\n`mapped_reads_number` is not null and calculate `-scale` as `1000000/mapped_reads_number`. If both inputs are\nnull, `bedtools genomecov` will use its default scaling value.\n\n`default_output_filename` function returns default output filename and is used when `output_filename` is not provided.\nDefault output file extention is `.tab`. If bedGraph should be generated (check flags `inputs.depth`), extension is\nupdated to `.bedGraph`. Default basename of the output file is generated on the base of `input_file` basename.\n" ;
        ns2:original_cwlVersion  "v1.0" ;
        ns1:about                "Usage: bedtools genomecov [OPTIONS] -i <bed/gff/vcf> -g <genome>\n\nOptions:\n\t-ibam\t\tThe input file is in BAM format.\n\t\t\tNote: BAM _must_ be sorted by position\n\n\t-d\t\tReport the depth at each genome position (with one-based coordinates).\n\t\t\tDefault behavior is to report a histogram.\n\n\t-dz\t\tReport the depth at each genome position (with zero-based coordinates).\n\t\t\tReports only non-zero positions.\n\t\t\tDefault behavior is to report a histogram.\n\n\t-bg\t\tReport depth in BedGraph format. For details, see:\n\t\t\tgenome.ucsc.edu/goldenPath/help/bedgraph.html\n\n\t-bga\t\tReport depth in BedGraph format, as above (-bg).\n\t\t\tHowever with this option, regions with zero\n\t\t\tcoverage are also reported. This allows one to\n\t\t\tquickly extract all regions of a genome with 0\n\t\t\tcoverage by applying: \"grep -w 0$\" to the output.\n\n\t-split\t\tTreat \"split\" BAM or BED12 entries as distinct BED intervals.\n\t\t\twhen computing coverage.\n\t\t\tFor BAM files, this uses the CIGAR \"N\" and \"D\" operations\n\t\t\tto infer the blocks for computing coverage.\n\t\t\tFor BED12 files, this uses the BlockCount, BlockStarts, and BlockEnds\n\t\t\tfields (i.e., columns 10,11,12).\n\n\t-strand\t\tCalculate coverage of intervals from a specific strand.\n\t\t\tWith BED files, requires at least 6 columns (strand is column 6).\n\t\t\t- (STRING): can be + or -\n\n\t-pc\t\tCalculate coverage of pair-end fragments.\n\t\t\tWorks for BAM files only\n\t-fs\t\tForce to use provided fragment size instead of read length\n\t\t\tWorks for BAM files only\n\t-du\t\tChange strand af the mate read (so both reads from the same strand) useful for strand specific\n\t\t\tWorks for BAM files only\n\t-5\t\tCalculate coverage of 5\" positions (instead of entire interval).\n\n\t-3\t\tCalculate coverage of 3\" positions (instead of entire interval).\n\n\t-max\t\tCombine all positions with a depth >= max into\n\t\t\ta single bin in the histogram. Irrelevant\n\t\t\tfor -d and -bedGraph\n\t\t\t- (INTEGER)\n\n\t-scale\t\tScale the coverage by a constant factor.\n\t\t\tEach coverage value is multiplied by this factor before being reported.\n\t\t\tUseful for normalizing coverage by, e.g., reads per million (RPM).\n\t\t\t- Default is 1.0; i.e., unscaled.\n\t\t\t- (FLOAT)\n\n\t-trackline\tAdds a UCSC/Genome-Browser track line definition in the first line of the output.\n\t\t\t- See here for more details about track line definition:\n\t\t\t      http://genome.ucsc.edu/goldenPath/help/bedgraph.html\n\t\t\t- NOTE: When adding a trackline definition, the output BedGraph can be easily\n\t\t\t      uploaded to the Genome Browser as a custom track,\n\t\t\t      BUT CAN NOT be converted into a BigWig file (w/o removing the first line).\n\n\t-trackopts\tWrites additional track line definition parameters in the first line.\n\t\t\t- Example:\n\t\t\t   -trackopts 'name=\"My Track\" visibility=2 color=255,30,30'\n\t\t\t   Note the use of single-quotes if you have spaces in your parameters.\n\t\t\t- (TEXT)\n\nNotes:\n\t(1) The genome file should tab delimited and structured as follows:\n\t <chromName><TAB><chromSize>\n\n\tFor example, Human (hg19):\n\tchr1\t249250621\n\tchr2\t243199373\n\t...\n\tchr18_gl000207_random\t4262\n\n\t(2) The input BED (-i) file must be grouped by chromosome.\n\t A simple \"sort -k 1,1 <BED> > <BED>.sorted\" will suffice.\n\n\t(3) The input BAM (-ibam) file must be sorted by position.\n\t A \"samtools sort <BAM>\" should suffice.\n\nTips:\n\tOne can use the UCSC Genome Browser's MySQL database to extract\n\tchromosome sizes. For example, H. sapiens:\n\n\tmysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -e \\\n\t\"select chrom, size from hg19.chromInfo\" > hg19.genome\n" ;
        ns1:codeRepository       "https://github.com/Barski-lab/workflows" ;
        ns1:creator              [ a               ns1:Organization ;
                                   ns1:department  [ a               ns1:Organization ;
                                                     ns1:department  [ a              ns1:Organization ;
                                                                       ns1:legalName  "Barski Research Lab" ;
                                                                       ns1:member     [ a           ns1:Person ;
                                                                                        ns1:email   "mailto:misha.kotliar@gmail.com" ;
                                                                                        ns1:name    "Michael Kotliar" ;
                                                                                        ns1:sameAs  <http://orcid.org/0000-0002-6486-3898>
                                                                                      ]
                                                                     ] ;
                                                     ns1:legalName   "Allergy and Immunology"
                                                   ] ;
                                   ns1:legalName   "Cincinnati Children's Hospital Medical Center" ;
                                   ns1:location    [ a                    ns1:PostalAddress ;
                                                     ns1:addressCountry   "USA" ;
                                                     ns1:addressLocality  "Cincinnati" ;
                                                     ns1:addressRegion    "OH" ;
                                                     ns1:postalCode       "45229" ;
                                                     ns1:streetAddress    "3333 Burnet Ave" ;
                                                     ns1:telephone        "+1(513)636-4200"
                                                   ] ;
                                   ns1:logo        "https://www.cincinnatichildrens.org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new.png"
                                 ] ;
        ns1:downloadUrl          "https://raw.githubusercontent.com/Barski-lab/workflows/master/tools/bedtools-genomecov.cwl" ;
        ns1:isPartOf             [ a         ns1:CreativeWork ;
                                   ns1:name  "Common Workflow Language" ;
                                   ns1:url   "http://commonwl.org/"
                                 ] ;
        ns1:license              "http://www.apache.org/licenses/LICENSE-2.0" ;
        ns1:mainEntity           <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/metadata/bedtools-metadata.yaml> ;
        ns1:name                 "bedtools-genomecov" ;
        cwl:baseCommand          ( "bedtools" "genomecov" ) ;
        cwl:cwlVersion           <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/v1.2> ;
        cwl:hints                [ a       <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/LoadListingRequirement> ;
                                   LoadListingRequirement:loadListing
                                           "deep_listing"
                                 ] ;
        cwl:hints                [ a                            <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/NetworkAccess> ;
                                   NetworkAccess:networkAccess  true
                                 ] ;
        cwl:hints                [ a                             cwl:DockerRequirement ;
                                   DockerRequirement:dockerPull  "biowardrobe2/bedtools2:v2.26.0"
                                 ] ;
        cwl:inputs               <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#scale> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#chrom_length_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#strand> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#m5> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#split> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#output_filename> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#mapped_reads_number> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#max> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#fragment_size> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#input_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#pairchip> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#du> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#depth> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#m3> ;
        cwl:outputs              <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#genome_coverage_file> ;
        cwl:requirements         [ a       cwl:InlineJavascriptRequirement ;
                                   InlineJavascriptRequirement:expressionLib
                                           "var default_output_filename = function() { let ext = (inputs.depth == \"-bg\" || inputs.depth == \"-bga\")?\".bedGraph\":\".tab\"; return inputs.input_file.location.split('/').slice(-1)[0].split('.').slice(0,-1).join('.') + ext; };"
                                 ] ;
        cwl:stdout               "${\n  if (inputs.output_filename == null){\n    return default_output_filename();\n  } else {\n    return inputs.output_filename;\n  }\n}\n" .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#unc>
        rdfs:comment      "Disable compression\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  5 ;
                            CommandLineBinding:prefix    "-unc"
                          ] ;
        sld:type          xsd:boolean , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/linux-sort.cwl#key>
        rdfs:comment      "-k, --key=POS1[,POS2]\nstart a key at POS1, end it at POS2 (origin 1)\n" ;
        cwl:inputBinding  [ CommandLineBinding:position
                          1 ] ;
        sld:type          [ cwl:inputBinding  [ CommandLineBinding:prefix
                                              "-k" ] ;
                            sld:items         xsd:string ;
                            sld:type          sld:array
                          ] .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#chrom_length_file>
        rdfs:comment      "Input genome file. Needed only when -i flag. The genome file is tab delimited <chromName><TAB><chromSize>\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  17 ;
                            CommandLineBinding:prefix    "-g"
                          ] ;
        sld:type          cwl:File , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#strand>
        rdfs:comment  "Calculate genome coverage of intervals from a specific strand" ;
        rdfs:label    "Enable strand specific genome coverage calculation" ;
        sld:type      xsd:string , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#dutp>
        rdfs:comment  "Change strand af the mate read, so both reads come from the same strand" ;
        rdfs:label    "Enable dUTP" ;
        sld:type      xsd:boolean , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sort_bedgraph/unsorted_file>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/genome_coverage_file> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_to_bigwig>
        cwl:in   <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_to_bigwig/chrom_length_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_to_bigwig/bam_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_to_bigwig/mapped_reads_number> ;
        cwl:out  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_to_bigwig/bigwig_file> ;
        cwl:run  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#strand>
        rdfs:comment      "Calculate coverage of intervals from a specific strand.\nWith BED files, requires at least 6 columns (strand is column 6).\n- (STRING): can be + or -\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  9 ;
                            CommandLineBinding:prefix    "-strand"
                          ] ;
        sld:type          xsd:string , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_to_bigwig/mapped_reads_number>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#mapped_reads_number> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_to_bigwig/bam_file>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#samtools_sort_index/bam_bai_pair> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#input_file>
        rdfs:comment      "The input file can be in BAM format (Note: BAM must be sorted by position) or <bed/gff/vcf>.\nPrefix is selected on the base of input file extension\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  16 ;
                            cwl:valueFrom                "${\n  var prefix = ((/.*\\.bam$/i).test(inputs.input_file.path))?'-ibam':'-i';\n  return [prefix, inputs.input_file.path];\n}\n"
                          ] ;
        sld:type          cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/du>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#dutp> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#items_per_slot>
        rdfs:comment      "Number of data points bundled at lowest level. Default 1024\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  6 ;
                            CommandLineBinding:prefix    "-itemsPerSlot=" ;
                            CommandLineBinding:separate  false
                          ] ;
        sld:type          xsd:int , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#pairchip>
        rdfs:comment  "Enable paired-end genome coverage calculation" ;
        rdfs:label    "Enable paired-end genome coverage calculation" ;
        sld:type      xsd:boolean , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/metadata/ucsc-metadata.yaml>
        a                        ns1:SoftwareSourceCode ;
        ns1:about                "UCSC genome browser bioinformatic utilities\n" ;
        ns1:license              "https://opensource.org/licenses/GPL-3.0" ;
        ns1:name                 "UCSC userApps" ;
        ns1:programmingLanguage  "C++" ;
        ns1:targetProduct        [ a                        ns1:SoftwareApplication ;
                                   ns1:applicationCategory  "commandline tool" ;
                                   ns1:downloadURL          "http://hgdownload.cse.ucsc.edu/admin/exe/userApps.v358.src.tgz" ;
                                   ns1:softwareVersion      "v358"
                                 ] ;
        ns1:url                  "https://genome.ucsc.edu/util.html" .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#fragment_size>
        rdfs:comment      "Set fixed fragment size\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  12 ;
                            CommandLineBinding:prefix    "-fs"
                          ] ;
        sld:type          xsd:int , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#samtools_sort_index>
        cwl:in   <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#samtools_sort_index/sort_input> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#samtools_sort_index/threads> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#samtools_sort_index/sort_output_filename> ;
        cwl:out  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#samtools_sort_index/bam_bai_pair> ;
        cwl:run  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#depth>
        rdfs:comment      "Report the depth type. By default, bedtools genomecov will compute a histogram of coverage\nfor the genome file provided (intputs.chrom_length_file)\n" ;
        cwl:inputBinding  [ CommandLineBinding:position
                          5 ] ;
        sld:type          <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#depth/depth> , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/metadata/samtools-metadata.yaml>
        a                        ns1:SoftwareSourceCode ;
        ns1:about                "A suite of programs for interacting with high-throughput sequencing data. It consists of three separate repositories: Samtools (Reading/writing/editing/indexing/viewing SAM/BAM/CRAM format), BCFtools (Reading/writing BCF2/VCF/gVCF files and calling/filtering/summarising SNP and short indel sequence variants) and HTSlib (A C library for reading/writing high-throughput sequencing data).\n" ;
        ns1:codeRepository       "https://github.com/samtools/samtools.git" ;
        ns1:creator              [ a           ns1:Organization ;
                                   ns1:member  [ a                ns1:Person ;
                                                 ns1:description  "Designed and implemented the\nRAZF format, an alternative indexable compression format. RAZF is no longer\nused by or provided with SAMtools. Source code remains available in older\nSAMtools 0.1.x releases and from the standalone branch in the repository.\n" ;
                                                 ns1:name         "Jue Ruan"
                                               ] ;
                                   ns1:name    "Beijing Genome Institute"
                                 ] ;
        ns1:creator              [ a           ns1:Organization ;
                                   ns1:member  [ a                ns1:Person ;
                                                 ns1:description  "wrote most of the initial source codes of SAMtools and various converters." ;
                                                 ns1:name         "Heng Li"
                                               ] ;
                                   ns1:name    "Sanger Institute"
                                 ] ;
        ns1:creator              [ a           ns1:Organization ;
                                   ns1:member  [ a                ns1:Person ;
                                                 ns1:description  "A major contributor to the\nSAM/BAM specification. He designed and implemented the BGZF format, the\nunderlying indexable compression format for the BAM format. BGZF does\nnot support arithmetic between file offsets.\n" ;
                                                 ns1:name         "Bob Handsaker"
                                               ] ;
                                   ns1:name    "Broad Institute"
                                 ] ;
        ns1:creator              [ a                ns1:Person ;
                                   ns1:description  "contributed the header parsing library sam_header.c and sam2vcf.pl script." ;
                                   ns1:name         "Petr Danecek"
                                 ] ;
        ns1:creator              [ a                ns1:Person ;
                                   ns1:description  "updated novo2sam.pl to support gapped alignment by novoalign." ;
                                   ns1:name         "Colin Hercus"
                                 ] ;
        ns1:discussionUrl        "https://lists.sourceforge.net/lists/listinfo/samtools-devel" , "https://lists.sourceforge.net/lists/listinfo/samtools-help" ;
        ns1:license              "https://opensource.org/licenses/MIT" , "https://opensource.org/licenses/BSD-3-Clause" ;
        ns1:name                 "samtools" ;
        ns1:programmingLanguage  "C, Perl" ;
        ns1:publication          <http://dx.doi.org/10.1093/bioinformatics/btr509> , <http://dx.doi.org/10.1093/bioinformatics/btp352> , <http://dx.doi.org/10.1093/bioinformatics/btr076> ;
        ns1:targetProduct        [ a                        ns1:SoftwareApplication ;
                                   ns1:applicationCategory  "commandline tool" ;
                                   ns1:softwareVersion      "1.4"
                                 ] ;
        ns1:url                  "http://www.htslib.org/" .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#mapped_reads_number>
        rdfs:comment  "Parameter to calculate scale as 1000000/mapped_reads_number. Ignored by bedtools-genomecov.cwl in\nbam_to_bedgraph step if scale is provided\n" ;
        rdfs:label    "Mapped reads number" ;
        sld:type      xsd:int , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/depth>
        cwl:default  "-bg" .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/pairchip>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#pairchip> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#output_file_prefix>
        rdfs:comment  "Corresponds to UID" ;
        rdfs:label    "Prefix for all generated output files" ;
        sld:type      xsd:string .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bedgraph_filename>
        rdfs:comment  "Output filename for generated bedGraph" ;
        rdfs:label    "bedGraph output filename" ;
        sld:type      xsd:string , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/metadata/bedtools-metadata.yaml>
        a                        ns1:SoftwareSourceCode ;
        ns1:about                "A software suite for the comparison, manipulation and annotation of genomic features in browser extensible data (BED) and general feature format (GFF) format. BEDTools also supports the comparison of sequence alignments in BAM format to both BED and GFF features. The tools are extremely efficient and allow the user to compare large datasets (e.g. next-generation sequencing data) with both public and custom genome annotation tracks. BEDTools can be combined with one another as well as with standard UNIX commands, thus facilitating routine genomics tasks as well as pipelines that can quickly answer intricate questions of large genomic datasets.\n" ;
        ns1:codeRepository       "https://github.com/arq5x/bedtools2" ;
        ns1:creator              [ a           ns1:Organization ;
                                   ns1:member  [ a                ns1:Person ;
                                                 ns1:description  "Main author" ;
                                                 ns1:name         "Neil Kindlon"
                                               ] ;
                                   ns1:member  [ a                ns1:Person ;
                                                 ns1:description  "Main author" ;
                                                 ns1:name         "Aaron Quinlan"
                                               ] ;
                                   ns1:name    "University of Utah"
                                 ] ;
        ns1:discussionUrl        "https://groups.google.com/forum/#!forum/bedtools-discuss" , "https://github.com/arq5x/bedtools2/issues" ;
        ns1:license              "https://opensource.org/licenses/GPL-2.0" ;
        ns1:name                 "bowtie2" ;
        ns1:programmingLanguage  "C++" ;
        ns1:publication          <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/metadata/bedtools-metadata.yaml#10.1093/bioinformatics/btq033> ;
        ns1:targetProduct        [ a                        ns1:SoftwareApplication ;
                                   ns1:applicationCategory  "command line tool" ;
                                   ns1:softwareVersion      "2.26.0"
                                 ] ;
        ns1:url                  "http://bedtools.readthedocs.org" .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sorted_bedgraph_to_bigwig/bedgraph_file>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sort_bedgraph/sorted_file> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#depth/depth>
        sld:symbols  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#depth/depth/-bg> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#depth/depth/-bga> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#depth/depth/-d> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#depth/depth/-dz> ;
        sld:type     sld:enum .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#sort_input>
        rdfs:comment      "Input only in.sam|in.bam|in.cram. Optionally could be supplemented with index file in secondaryFiles\n" ;
        cwl:inputBinding  [ CommandLineBinding:position
                          16 ] ;
        sld:type          cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#chrom_length_file>
        rdfs:comment  "Tab delimited chromosome length file: <chromName><TAB><chromSize>" ;
        rdfs:label    "Chromosome length file" ;
        sld:type      cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#threads>
        rdfs:comment  "Number of threads for those steps that support multithreading" ;
        rdfs:label    "Number of threads" ;
        cwl:default   2 ;
        sld:type      xsd:int , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/metadata/bedtools-metadata.yaml#10.1093/bioinformatics/btq033>
        a           ns1:ScholarlyArticle ;
        ns1:author  [ a         ns1:Person ;
                      ns1:name  "Aaron R. Quinlan"
                    ] ;
        ns1:author  [ a         ns1:Person ;
                      ns1:name  "Ira M. Hall"
                    ] ;
        ns1:name    "BEDTools: a flexible suite of utilities for comparing genomic features" ;
        ns1:url     "https://academic.oup.com/bioinformatics/article-lookup/doi/10.1093/bioinformatics/btq033" .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#scale>
        rdfs:comment  "Coefficient to scale the genome coverage by a constant factor" ;
        rdfs:label    "Genome coverage scaling coefficient" ;
        sld:type      xsd:float , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#bigwig_file>
        cwl:outputBinding  [ CommandOutputBinding:glob
                          "${\n    if (inputs.output_filename == \"\"){\n      return default_output_filename();\n    } else {\n      return inputs.output_filename;\n    }\n}\n" ] ;
        sld:type           cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#trigger>
        rdfs:comment  "If true - run samtools, if false - return sort_input and optional index file in secondaryFiles, previously staged\ninto output directory.\n" ;
        cwl:default   true ;
        sld:type      xsd:boolean , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/linux-sort.cwl#unsorted_file>
        cwl:inputBinding  [ CommandLineBinding:position
                          4 ] ;
        sld:type          cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl>
        a                        cwl:CommandLineTool ;
        rdfs:comment             "Tool to sort and index input BAM/SAM/CRAM.\nIf input `trigger` is set to `true` or isn't set at all (`true` is used by default), run `samtools sort` and\n`samtools index`, return sorted BAM and BAI/CSI index file.\nIf input `trigger` is set to `false`, return unchanged `sort_input` (BAM/SAM/CRAM) and index (BAI/CSI, if provided in\n`secondaryFiles`) files, previously staged into output directory.\n\nBefore execution `baseCommand`, `sort_input` and `secondaryFiles` (if provided) are staged into directory\nset as docker parameter `--workdir` (tool's output directory), using `InitialWorkDirRequirement`. Setting\n`writable: true` makes cwl-runner to make copies of the `sort_input` and `secondaryFiles` (if provided) and mount\nthem to docker container with `rw` mode as part of `--workdir` (if set to false, the files staged into output\ndirectory will be mounted to docker container separately with `ro` mode). Because both `samtools sort` and\n`samtools index` can overwrite files with the same names (and in case of `samtools sort` even the input file can be\noverwritten), we don't need to rename any of the staged files.\n\nTrigger logic is implemented in two bash scripts set by default as `bash_script_sort` and `bash_script_index` inputs.\nFor both of then, if the first argument $0 (which is `trigger` input) is true, run `samtools sort/index` with the rest\nof the arguments. If $0 is not true, skip `samtools sort/index` and return `sort_input` and `secondaryFiles`\n(if provided) staged into output directory.\n\nInput `trigger` is Boolean, but returns String, because of `valueFrom` field. The `valueFrom` is used, because if `trigger`\nis false, cwl-runner doesn't append this argument at all to the the `baseCommand` - new feature of CWL v1.0.2. Alternatively,\n`prefix` field could be used, but it causes changing in script logic.\n\nIf using `sort_output_filename`, the output file extension should be `*.bam`, because `samtools sort` defines the output\nfile format on the base of the file extension. If `*.sam` is sed as output filename, it cannot be usefully indexed\nby `samtools index`.\n\n`default_bam` function is used to generate output filename for `samtools sort` if input `sort_output_filename` is not\nset or when `trigger` is false and we need to return `sort_input` and `secondaryFiles` (if provided) files staged into\noutput directory. Output filename is generated on the base of `sort_input` basename with `.bam` extension by default.\n\n`ext` function is used to return the index file extension (BAI/CSI) based on `csi` and `bai` inputs according to the\nfollowing logic\n  `csi` &&  `bai`  => BAI\n !`csi` && !`bai ` => BAI\n  `csi` && !`bai ` => CSI\n" ;
        ns2:original_cwlVersion  "v1.0" ;
        ns1:about                "Usage: samtools sort [options...] [in.bam]\nOptions:\n  -l INT     Set compression level, from 0 (uncompressed) to 9 (best)\n  -m INT     Set maximum memory per thread; suffix K/M/G recognized [768M]\n  -n         Sort by read name\n  -o FILE    Write final output to FILE rather than standard output\n  -T PREFIX  Write temporary files to PREFIX.nnnn.bam\n      --input-fmt-option OPT[=VAL]\n               Specify a single input file format option in the form\n               of OPTION or OPTION=VALUE\n  -O, --output-fmt FORMAT[,OPT[=VAL]]...\n               Specify output format (SAM, BAM, CRAM)\n      --output-fmt-option OPT[=VAL]\n               Specify a single output file format option in the form\n               of OPTION or OPTION=VALUE\n      --reference FILE\n               Reference sequence FASTA FILE [null]\n  -@, --threads INT\n               Number of additional threads to use [0]\n\nUsage: samtools index [-bc] [-m INT] <in.bam> [out.index]\nOptions:\n  -b       Generate BAI-format index for BAM files [default]\n  -c       Generate CSI-format index for BAM files\n  -m INT   Set minimum interval size for CSI indices to 2^INT [14]\n  -@ INT   Sets the number of threads [none]\n" ;
        ns1:codeRepository       "https://github.com/Barski-lab/workflows" ;
        ns1:creator              [ a               ns1:Organization ;
                                   ns1:department  [ a               ns1:Organization ;
                                                     ns1:department  [ a              ns1:Organization ;
                                                                       ns1:legalName  "Barski Research Lab" ;
                                                                       ns1:member     [ a           ns1:Person ;
                                                                                        ns1:email   "mailto:misha.kotliar@gmail.com" ;
                                                                                        ns1:name    "Michael Kotliar" ;
                                                                                        ns1:sameAs  <http://orcid.org/0000-0002-6486-3898>
                                                                                      ]
                                                                     ] ;
                                                     ns1:legalName   "Allergy and Immunology"
                                                   ] ;
                                   ns1:legalName   "Cincinnati Children's Hospital Medical Center" ;
                                   ns1:location    [ a                    ns1:PostalAddress ;
                                                     ns1:addressCountry   "USA" ;
                                                     ns1:addressLocality  "Cincinnati" ;
                                                     ns1:addressRegion    "OH" ;
                                                     ns1:postalCode       "45229" ;
                                                     ns1:streetAddress    "3333 Burnet Ave" ;
                                                     ns1:telephone        "+1(513)636-4200"
                                                   ] ;
                                   ns1:logo        "https://www.cincinnatichildrens.org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new.png"
                                 ] ;
        ns1:downloadUrl          "https://raw.githubusercontent.com/Barski-lab/workflows/master/tools/samtools-sort-index.cwl" ;
        ns1:isPartOf             [ a         ns1:CreativeWork ;
                                   ns1:name  "Common Workflow Language" ;
                                   ns1:url   "http://commonwl.org/"
                                 ] ;
        ns1:license              "http://www.apache.org/licenses/LICENSE-2.0" ;
        ns1:mainEntity           <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/metadata/samtools-metadata.yaml> ;
        ns1:name                 "samtools-sort-index" ;
        cwl:arguments            ( [ CommandLineBinding:position  6 ;
                                     cwl:valueFrom                "${ return inputs.trigger ? \"true\" : \"false\" }\n"
                                   ]
                                   [ CommandLineBinding:position  13 ;
                                     CommandLineBinding:prefix    "-O" ;
                                     cwl:valueFrom                "bam"
                                   ]
                                   [ CommandLineBinding:position  15 ;
                                     CommandLineBinding:prefix    "-@" ;
                                     cwl:valueFrom                "$(inputs.threads?inputs.threads:1)"
                                   ]
                                   [ CommandLineBinding:position    17 ;
                                     CommandLineBinding:shellQuote  false ;
                                     cwl:valueFrom                  ";"
                                   ]
                                   [ CommandLineBinding:position  18 ;
                                     cwl:valueFrom                "bash"
                                   ]
                                   [ CommandLineBinding:position  19 ;
                                     cwl:valueFrom                "-c"
                                   ]
                                   [ CommandLineBinding:position  21 ;
                                     cwl:valueFrom                "${ return inputs.trigger ? \"true\" : \"false\" }\n"
                                   ]
                                   [ CommandLineBinding:position  23 ;
                                     cwl:valueFrom                "$(inputs.bai?'-b':inputs.csi?'-c':[])"
                                   ]
                                   [ CommandLineBinding:position  25 ;
                                     CommandLineBinding:prefix    "-@" ;
                                     cwl:valueFrom                "$(inputs.threads?inputs.threads:1)"
                                   ]
                                   [ CommandLineBinding:position  26 ;
                                     cwl:valueFrom                "${\n    if (inputs.sort_output_filename == \"\" || inputs.trigger == false){\n      return default_bam();\n    } else {\n      return inputs.sort_output_filename;\n    }\n}\n"
                                   ]
                                   [ CommandLineBinding:position  27 ;
                                     cwl:valueFrom                "${\n    if (inputs.sort_output_filename == \"\" || inputs.trigger == false){\n      return default_bam() + ext();\n    } else {\n      return inputs.sort_output_filename + ext();\n    }\n}\n"
                                   ]
                                 ) ;
        cwl:baseCommand          ( "bash" "-c" ) ;
        cwl:cwlVersion           <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/v1.2> ;
        cwl:hints                [ a                             cwl:DockerRequirement ;
                                   DockerRequirement:dockerPull  "biowardrobe2/samtools:v1.4"
                                 ] ;
        cwl:hints                [ a       <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/LoadListingRequirement> ;
                                   LoadListingRequirement:loadListing
                                           "deep_listing"
                                 ] ;
        cwl:hints                [ a                            <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/NetworkAccess> ;
                                   NetworkAccess:networkAccess  true
                                 ] ;
        cwl:inputs               <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#bash_script_index> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#trigger> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#csi_interval> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#sort_input> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#csi> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#sort_output_filename> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#sort_compression_level> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#threads> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#bash_script_sort> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#bai> ;
        cwl:outputs              <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#bam_bai_pair> ;
        cwl:requirements         [ a  cwl:ShellCommandRequirement ] ;
        cwl:requirements         [ a            cwl:InitialWorkDirRequirement ;
                                   cwl:listing  "${\n  return  [\n            {\n              \"entry\": inputs.sort_input,\n              \"entryname\": inputs.sort_input.basename,\n              \"writable\": true\n            }\n          ]\n}\n"
                                 ] ;
        cwl:requirements         [ a       cwl:InlineJavascriptRequirement ;
                                   InlineJavascriptRequirement:expressionLib
                                           "var default_bam = function() { if (inputs.trigger == true){ return inputs.sort_input.location.split('/').slice(-1)[0].split('.').slice(0,-1).join('.')+\".bam\"; } else { return inputs.sort_input.location.split('/').slice(-1)[0]; } };" , "var ext = function() { if (inputs.csi && !inputs.bai){ return '.csi'; } else { return '.bai'; } };"
                                 ] .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_file>
        rdfs:comment  "BAM file mapped to reference genome" ;
        rdfs:label    "BAM file" ;
        sld:type      cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bigwig_file>
        rdfs:comment      "Generated bigWig file for reference genome" ;
        rdfs:label        "Reference bigWig file" ;
        cwl:outputSource  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_to_bigwig/bigwig_file> ;
        sld:type          cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#block_size>
        rdfs:comment      "Number of items to bundle in r-tree.  Default 256\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  7 ;
                            CommandLineBinding:prefix    "-blockSize=" ;
                            CommandLineBinding:separate  false
                          ] ;
        sld:type          xsd:int , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#bash_script_index>
        rdfs:comment      "Bash function to run samtools index with all input parameters or skip it if trigger is false\n" ;
        cwl:default       "#!/bin/bash\nif [ \"$0\" = \"true\" ]\nthen\n  echo \"Run: samtools index \" ${@:1}\n  samtools index \"${@:1}\"\nelse\n  echo \"Skip samtools index \" ${@:1}\nfi\n" ;
        cwl:inputBinding  [ CommandLineBinding:position
                          20 ] ;
        sld:type          xsd:string , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#csi>
        rdfs:comment  "Generate CSI-format index for BAM files. If input isn't cram.\n" ;
        sld:type      xsd:boolean , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sorted_bedgraph_to_bigwig>
        cwl:in   <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sorted_bedgraph_to_bigwig/bedgraph_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sorted_bedgraph_to_bigwig/chrom_length_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sorted_bedgraph_to_bigwig/output_filename> ;
        cwl:out  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sorted_bedgraph_to_bigwig/bigwig_file> ;
        cwl:run  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl> .

<http://dx.doi.org/10.1093/bioinformatics/btr509>
        a         ns1:ScholarlyArticle ;
        ns1:name  "(Li, 2011) A statistical framework for SNP calling, mutation discovery, association mapping and population genetical parameter estimation from sequencing data. Bioinformatics." ;
        ns1:url   "http://www.ncbi.nlm.nih.gov/pubmed/21903627" .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#split>
        rdfs:comment      "treat \"split\" BAM or BED12 entries as distinct BED intervals.\nwhen computing coverage.\nFor BAM files, this uses the CIGAR \"N\" and \"D\" operations\nto infer the blocks for computing coverage.\nFor BED12 files, this uses the BlockCount, BlockStarts, and BlockEnds\nfields (i.e., columns 10,11,12).\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  8 ;
                            CommandLineBinding:prefix    "-split"
                          ] ;
        sld:type          xsd:boolean , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sorted_bedgraph_to_bigwig/chrom_length_file>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#chrom_length_file> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/split>
        cwl:source     <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#split> ;
        cwl:valueFrom  "${\n  if (self == null){\n    return true;\n  } else {\n    return self;\n  }\n}\n" .

<http://dx.doi.org/10.1093/bioinformatics/btp352>
        a         ns1:ScholarlyArticle ;
        ns1:name  "(Li et al., 2009) The Sequence Alignment/Map format and SAMtools. Bioinformatics." ;
        ns1:url   "http://www.ncbi.nlm.nih.gov/pubmed/19505943" .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#genome_coverage_file>
        rdfs:comment       "Generated genome coverage output file\n" ;
        cwl:outputBinding  [ CommandOutputBinding:glob
                          "${\n  if (inputs.output_filename == null){\n    return default_output_filename();\n  } else {\n    return inputs.output_filename;\n  }\n}\n" ] ;
        sld:type           cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/strand>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#strand> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/input_file>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_file> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bambai_pair>
        rdfs:comment      "Coordinate sorted BAM file mapped to reference genome" ;
        rdfs:label        "Reference BAM" ;
        cwl:outputSource  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#samtools_sort_index/bam_bai_pair> ;
        sld:type          cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph>
        cwl:in   <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/split> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/depth> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/du> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/output_filename> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/mapped_reads_number> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/fragment_size> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/input_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/strand> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/scale> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/pairchip> ;
        cwl:out  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/genome_coverage_file> ;
        cwl:run  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#sort_compression_level>
        rdfs:comment      "SORT: desired compression level for the final output file, ranging from 0 (uncompressed)\nor 1 (fastest but minimal compression) to 9 (best compression but slowest to write),\nsimilarly to gzip(1)'s compression level setting.\nIf -l is not used, the default compression level will apply.\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  11 ;
                            CommandLineBinding:prefix    "-l"
                          ] ;
        sld:type          xsd:int , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/linux-sort.cwl#sorted_file>
        rdfs:comment       "Sorted file\n" ;
        cwl:outputBinding  [ CommandOutputBinding:glob
                          "${\n  if (inputs.output_filename == null){\n    return default_output_filename();\n  } else {\n    return inputs.output_filename;\n  }\n}\n" ] ;
        sld:type           cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl>
        a                        cwl:Workflow ;
        rdfs:comment             "Workflow converts input BAM file into bigWig and bedGraph files\n" ;
        ns2:original_cwlVersion  "v1.0" ;
        ns1:about                "Workflow converts input BAM file into bigWig and bedGraph files.\n\nInput BAM file should be sorted by coordinates (required by `bam_to_bedgraph` step).\n\nIf `split` input is not provided use true by default. Default logic is implemented in `valueFrom` field of `split`\ninput inside `bam_to_bedgraph` step to avoid possible bug in cwltool with setting default values for workflow inputs.\n\n`scale` has higher priority over the `mapped_reads_number`. The last one is used to calculate `-scale` parameter for\n`bedtools genomecov` (step `bam_to_bedgraph`) only in a case when input `scale` is not provided. All logic is\nimplemented inside `bedtools-genomecov.cwl`.\n\n`bigwig_filename` defines the output name only for generated bigWig file. `bedgraph_filename` defines the output name\nfor generated bedGraph file and can influence on generated bigWig filename in case when `bigwig_filename` is not provided.\n\nAll workflow inputs and outputs don't have `format` field to avoid format incompatibility errors when workflow is used\nas subworkflow." ;
        ns1:codeRepository       "https://github.com/Barski-lab/workflows" ;
        ns1:creator              [ a               ns1:Organization ;
                                   ns1:department  [ a               ns1:Organization ;
                                                     ns1:department  [ a              ns1:Organization ;
                                                                       ns1:legalName  "Barski Research Lab" ;
                                                                       ns1:member     [ a           ns1:Person ;
                                                                                        ns1:email   "mailto:Andrey.Kartashov@cchmc.org" ;
                                                                                        ns1:name    "Andrey Kartashov" ;
                                                                                        ns1:sameAs  <http://orcid.org/0000-0001-9102-5681>
                                                                                      ] ;
                                                                       ns1:member     [ a           ns1:Person ;
                                                                                        ns1:email   "mailto:misha.kotliar@gmail.com" ;
                                                                                        ns1:name    "Michael Kotliar" ;
                                                                                        ns1:sameAs  <http://orcid.org/0000-0002-6486-3898>
                                                                                      ]
                                                                     ] ;
                                                     ns1:legalName   "Allergy and Immunology"
                                                   ] ;
                                   ns1:legalName   "Cincinnati Children's Hospital Medical Center" ;
                                   ns1:location    [ a                    ns1:PostalAddress ;
                                                     ns1:addressCountry   "USA" ;
                                                     ns1:addressLocality  "Cincinnati" ;
                                                     ns1:addressRegion    "OH" ;
                                                     ns1:postalCode       "45229" ;
                                                     ns1:streetAddress    "3333 Burnet Ave" ;
                                                     ns1:telephone        "+1(513)636-4200"
                                                   ] ;
                                   ns1:logo        "https://www.cincinnatichildrens.org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new.png"
                                 ] ;
        ns1:downloadUrl          "https://raw.githubusercontent.com/Barski-lab/workflows/master/workflows/bam-bedgraph-bigwig.cwl" ;
        ns1:isPartOf             [ a         ns1:CreativeWork ;
                                   ns1:name  "Common Workflow Language" ;
                                   ns1:url   "http://commonwl.org/"
                                 ] ;
        ns1:license              "http://www.apache.org/licenses/LICENSE-2.0" ;
        ns1:name                 "bam-bedgraph-bigwig" ;
        Workflow:steps           <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sort_bedgraph> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sorted_bedgraph_to_bigwig> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph> ;
        cwl:cwlVersion           <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/v1.2> ;
        cwl:hints                [ a       <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/LoadListingRequirement> ;
                                   LoadListingRequirement:loadListing
                                           "deep_listing"
                                 ] ;
        cwl:hints                [ a                            <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/NetworkAccess> ;
                                   NetworkAccess:networkAccess  true
                                 ] ;
        cwl:inputs               <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#scale> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bedgraph_filename> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#fragment_size> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#strand> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#pairchip> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bigwig_filename> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#split> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#dutp> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#chrom_length_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#mapped_reads_number> ;
        cwl:outputs              <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bedgraph_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bigwig_file> ;
        cwl:requirements         [ a  cwl:StepInputExpressionRequirement ] ;
        cwl:requirements         [ a  cwl:InlineJavascriptRequirement ] .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sort_bedgraph/key>
        cwl:default  "1,1" , "2,2n" .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#sort_output_filename>
        rdfs:comment      "Write the final sorted output to FILE. Only out.bam|out.cram.\nIf output file extension is set to SAM, tool will fail on the index step\n" ;
        cwl:default       "" ;
        cwl:inputBinding  [ CommandLineBinding:position  12 ;
                            CommandLineBinding:prefix    "-o" ;
                            cwl:valueFrom                "${\n    if (self == \"\" || inputs.trigger == false){\n      return default_bam();\n    } else {\n      return self;\n    }\n}\n"
                          ] ;
        sld:type          xsd:string , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#csi_interval>
        rdfs:comment      "Set minimum interval size for CSI indices to 2^INT [14]\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  24 ;
                            CommandLineBinding:prefix    "-m"
                          ] ;
        sld:type          xsd:int , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#pairchip>
        rdfs:comment      "pair-end chip seq experiment\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  10 ;
                            CommandLineBinding:prefix    "-pc"
                          ] ;
        sld:type          xsd:boolean , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_file>
        rdfs:comment  "Input BAM file, sorted by coordinates" ;
        rdfs:label    "Input BAM file" ;
        sld:type      cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#bam_bai_pair>
        cwl:outputBinding   [ CommandOutputBinding:glob
                          "${\n    if (inputs.sort_output_filename == \"\" || inputs.trigger == false){\n      return default_bam();\n    } else {\n      return inputs.sort_output_filename;\n    }\n}\n" ] ;
        cwl:secondaryFiles  []  ;
        sld:type            cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bigwig_filename>
        rdfs:comment  "Output filename for generated bigWig" ;
        rdfs:label    "bigWig output filename" ;
        sld:type      xsd:string , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#chrom_length_file>
        rdfs:comment      "Two-column chromosome length file: <chromosome name> <size in bases>\n" ;
        cwl:inputBinding  [ CommandLineBinding:position
                          11 ] ;
        sld:type          cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/linux-sort.cwl>
        a                        cwl:CommandLineTool ;
        rdfs:comment             "Tool sorts data from `unsorted_file` by key\n\n`default_output_filename` function returns file name identical to `unsorted_file`, if `output_filename` is not provided.\n" ;
        ns2:original_cwlVersion  "v1.0" ;
        ns1:codeRepository       "https://github.com/Barski-lab/workflows" ;
        ns1:creator              [ a               ns1:Organization ;
                                   ns1:department  [ a               ns1:Organization ;
                                                     ns1:department  [ a              ns1:Organization ;
                                                                       ns1:legalName  "Barski Research Lab" ;
                                                                       ns1:member     [ a           ns1:Person ;
                                                                                        ns1:email   "mailto:Andrey.Kartashov@cchmc.org" ;
                                                                                        ns1:name    "Andrey Kartashov" ;
                                                                                        ns1:sameAs  <http://orcid.org/0000-0001-9102-5681>
                                                                                      ] ;
                                                                       ns1:member     [ a           ns1:Person ;
                                                                                        ns1:email   "mailto:misha.kotliar@gmail.com" ;
                                                                                        ns1:name    "Michael Kotliar" ;
                                                                                        ns1:sameAs  <http://orcid.org/0000-0002-6486-3898>
                                                                                      ]
                                                                     ] ;
                                                     ns1:legalName   "Allergy and Immunology"
                                                   ] ;
                                   ns1:legalName   "Cincinnati Children's Hospital Medical Center" ;
                                   ns1:location    [ a                    ns1:PostalAddress ;
                                                     ns1:addressCountry   "USA" ;
                                                     ns1:addressLocality  "Cincinnati" ;
                                                     ns1:addressRegion    "OH" ;
                                                     ns1:postalCode       "45229" ;
                                                     ns1:streetAddress    "3333 Burnet Ave" ;
                                                     ns1:telephone        "+1(513)636-4200"
                                                   ] ;
                                   ns1:logo        "https://www.cincinnatichildrens.org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new.png"
                                 ] ;
        ns1:downloadUrl          "https://raw.githubusercontent.com/Barski-lab/workflows/master/tools/linux-sort.cwl" ;
        ns1:isPartOf             [ a         ns1:CreativeWork ;
                                   ns1:name  "Common Workflow Language" ;
                                   ns1:url   "http://commonwl.org/"
                                 ] ;
        ns1:license              "http://www.apache.org/licenses/LICENSE-2.0" ;
        ns1:name                 "linux-sort" ;
        cwl:baseCommand          ( "sort" ) ;
        cwl:cwlVersion           <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/v1.2> ;
        cwl:hints                [ a                             cwl:DockerRequirement ;
                                   DockerRequirement:dockerPull  "biowardrobe2/scidap:v0.0.2"
                                 ] ;
        cwl:hints                [ a       <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/LoadListingRequirement> ;
                                   LoadListingRequirement:loadListing
                                           "deep_listing"
                                 ] ;
        cwl:hints                [ a                            <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/NetworkAccess> ;
                                   NetworkAccess:networkAccess  true
                                 ] ;
        cwl:inputs               <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/linux-sort.cwl#output_filename> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/linux-sort.cwl#unsorted_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/linux-sort.cwl#key> ;
        cwl:outputs              <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/linux-sort.cwl#sorted_file> ;
        cwl:requirements         [ a       cwl:InlineJavascriptRequirement ;
                                   InlineJavascriptRequirement:expressionLib
                                           "var default_output_filename = function() { return inputs.unsorted_file.location.split('/').slice(-1)[0]; };"
                                 ] ;
        cwl:stdout               "${\n  if (inputs.output_filename == null){\n    return default_output_filename();\n  } else {\n    return inputs.output_filename;\n  }\n}\n" .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#output_filename>
        rdfs:comment  "Name for generated output file\n" ;
        sld:type      xsd:string , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#bam_to_bigwig/chrom_length_file>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#chrom_length_file> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl>
        a                        cwl:CommandLineTool ;
        rdfs:comment             "Tool converts bedGraph to bigWig file.\n\n`default_output_filename` function returns filename for generated bigWig if `output_filename` is not provided.\nDefault filename is generated on the base of `bedgraph_file` basename with the updated to `*.bigWig` extension.\n" ;
        ns2:original_cwlVersion  "v1.0" ;
        ns1:about                "usage:\n   bedGraphToBigWig in.bedGraph chrom.sizes out.bw\nwhere in.bedGraph is a four column file in the format:\n      <chrom> <start> <end> <value>\nand chrom.sizes is a two-column file/URL: <chromosome name> <size in bases>\nand out.bw is the output indexed big wig file.\nIf the assembly <db> is hosted by UCSC, chrom.sizes can be a URL like\n  http://hgdownload.cse.ucsc.edu/goldenPath/<db>/bigZips/<db>.chrom.sizes\nor you may use the script fetchChromSizes to download the chrom.sizes file.\nIf not hosted by UCSC, a chrom.sizes file can be generated by running\ntwoBitInfo on the assembly .2bit file.\nThe input bedGraph file must be sorted, use the unix sort command:\n  sort -k1,1 -k2,2n unsorted.bedGraph > sorted.bedGraph\noptions:\n   -blockSize=N - Number of items to bundle in r-tree.  Default 256\n   -itemsPerSlot=N - Number of data points bundled at lowest level. Default 1024\n   -unc - If set, do not use compression.\n" ;
        ns1:codeRepository       "https://github.com/Barski-lab/workflows" ;
        ns1:creator              [ a               ns1:Organization ;
                                   ns1:department  [ a               ns1:Organization ;
                                                     ns1:department  [ a              ns1:Organization ;
                                                                       ns1:legalName  "Barski Research Lab" ;
                                                                       ns1:member     [ a           ns1:Person ;
                                                                                        ns1:email   "mailto:misha.kotliar@gmail.com" ;
                                                                                        ns1:name    "Michael Kotliar" ;
                                                                                        ns1:sameAs  <http://orcid.org/0000-0002-6486-3898>
                                                                                      ] ;
                                                                       ns1:member     [ a           ns1:Person ;
                                                                                        ns1:email   "mailto:Andrey.Kartashov@cchmc.org" ;
                                                                                        ns1:name    "Andrey Kartashov" ;
                                                                                        ns1:sameAs  <http://orcid.org/0000-0001-9102-5681>
                                                                                      ]
                                                                     ] ;
                                                     ns1:legalName   "Allergy and Immunology"
                                                   ] ;
                                   ns1:legalName   "Cincinnati Children's Hospital Medical Center" ;
                                   ns1:location    [ a                    ns1:PostalAddress ;
                                                     ns1:addressCountry   "USA" ;
                                                     ns1:addressLocality  "Cincinnati" ;
                                                     ns1:addressRegion    "OH" ;
                                                     ns1:postalCode       "45229" ;
                                                     ns1:streetAddress    "3333 Burnet Ave" ;
                                                     ns1:telephone        "+1(513)636-4200"
                                                   ] ;
                                   ns1:logo        "https://www.cincinnatichildrens.org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new.png"
                                 ] ;
        ns1:downloadUrl          "https://raw.githubusercontent.com/Barski-lab/workflows/master/tools/ucsc-bedgraphtobigwig.cwl" ;
        ns1:isPartOf             [ a         ns1:CreativeWork ;
                                   ns1:name  "Common Workflow Language" ;
                                   ns1:url   "http://commonwl.org/"
                                 ] ;
        ns1:license              "http://www.apache.org/licenses/LICENSE-2.0" ;
        ns1:mainEntity           <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/metadata/ucsc-metadata.yaml> ;
        ns1:name                 "ucsc-bedgraphtobigwig" ;
        cwl:baseCommand          ( "bedGraphToBigWig" ) ;
        cwl:cwlVersion           <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/v1.2> ;
        cwl:hints                [ a                             cwl:DockerRequirement ;
                                   DockerRequirement:dockerPull  "biowardrobe2/ucscuserapps:v358"
                                 ] ;
        cwl:hints                [ a       <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/LoadListingRequirement> ;
                                   LoadListingRequirement:loadListing
                                           "deep_listing"
                                 ] ;
        cwl:hints                [ a                            <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/NetworkAccess> ;
                                   NetworkAccess:networkAccess  true
                                 ] ;
        cwl:inputs               <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#bedgraph_file> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#output_filename> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#block_size> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#unc> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#items_per_slot> , <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#chrom_length_file> ;
        cwl:outputs              <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#bigwig_file> ;
        cwl:requirements         [ a       cwl:InlineJavascriptRequirement ;
                                   InlineJavascriptRequirement:expressionLib
                                           "var default_output_filename = function() { let basename = inputs.bedgraph_file.location.split('/').slice(-1)[0]; let root = basename.split('.').slice(0,-1).join('.'); let ext = \".bigWig\"; return (root == \"\")?basename+ext:root+ext; };"
                                 ] .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#mapped_reads_number>
        rdfs:comment  "Uniquely mapped to reference genome reads number" ;
        rdfs:label    "Uniquely mapped reads number" ;
        sld:type      xsd:int .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#samtools_sort_index/sort_output_filename>
        cwl:source     <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#output_file_prefix> ;
        cwl:valueFrom  "$(self+\".bam\")" .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/allele-process-reference.cwl#chrom_length_file>
        rdfs:comment  "Chromosome length file for reference genome" ;
        rdfs:label    "Chromosome length file for reference genome" ;
        sld:type      cwl:File .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/ucsc-bedgraphtobigwig.cwl#output_filename>
        rdfs:comment      "If set, writes the output bigWig file to output_filename,\notherwise generates filename from default_output_filename()\n" ;
        cwl:default       "" ;
        cwl:inputBinding  [ CommandLineBinding:position  12 ;
                            cwl:valueFrom                "${\n    if (self == \"\"){\n      return default_output_filename();\n    } else {\n      return self;\n    }\n}\n"
                          ] ;
        sld:type          xsd:string , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#m5>
        rdfs:comment      "Calculate coverage of 5\" positions (instead of entire interval)\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  14 ;
                            CommandLineBinding:prefix    "-5"
                          ] ;
        sld:type          xsd:boolean , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/linux-sort.cwl#output_filename>
        rdfs:comment  "Name for generated output file\n" ;
        sld:type      xsd:string , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#mapped_reads_number>
        rdfs:comment      "Optional parameter to calculate scale as 1000000/mapped_reads_number if inputs.scale is not provided\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  7 ;
                            CommandLineBinding:prefix    "-scale" ;
                            cwl:valueFrom                "${\n  if (inputs.scale){\n    return null;\n  } else if (inputs.mapped_reads_number) {\n    return 1000000/inputs.mapped_reads_number;\n  } else {\n    return null;\n  }\n}\n"
                          ] ;
        sld:type          xsd:int , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#fragment_size>
        rdfs:comment  "Set fixed fragment size for genome coverage calculation" ;
        rdfs:label    "Fixed fragment size" ;
        sld:type      xsd:int , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/samtools-sort-index.cwl#bash_script_sort>
        rdfs:comment      "Bash function to run samtools sort with all input parameters or skip it if trigger is false\n" ;
        cwl:default       "#!/bin/bash\nif [ \"$0\" = \"true\" ]\nthen\n  echo \"Run: samtools sort \" ${@:1}\n  samtools sort \"${@:1}\"\nelse\n  echo \"Skip samtools sort \" ${@:1}\nfi\n" ;
        cwl:inputBinding  [ CommandLineBinding:position
                          5 ] ;
        sld:type          xsd:string , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#split>
        rdfs:comment  "Calculate genome coverage for each part of the splitted by 'N' and 'D' read" ;
        rdfs:label    "Split reads by 'N' and 'D'" ;
        sld:type      xsd:boolean , sld:null .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bam_to_bedgraph/mapped_reads_number>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#mapped_reads_number> .

<http://dx.doi.org/10.1093/bioinformatics/btr076>
        a         ns1:ScholarlyArticle ;
        ns1:name  "(Li, 2011) Improving SNP discovery by base alignment quality. Bioinformatics." ;
        ns1:url   "http://www.ncbi.nlm.nih.gov/pubmed/21320865" .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#sorted_bedgraph_to_bigwig/output_filename>
        cwl:source  <https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/subworkflows/bam-bedgraph-bigwig.cwl#bigwig_filename> .

<https://w3id.org/cwl/view/git/14d0618786c1499e8626f234341e99782a1e55c2/tools/bedtools-genomecov.cwl#max>
        rdfs:comment      "Combine all positions with a depth >= max into\na single bin in the histogram. Irrelevant\nfor -d and -bedGraph\n- (INTEGER)\n" ;
        cwl:inputBinding  [ CommandLineBinding:position  13 ;
                            CommandLineBinding:prefix    "-max"
                          ] ;
        sld:type          xsd:int , sld:null .
