Workflow: bam-bedgraph-bigwig.cwl

Fetched 2023-01-14 23:43:41 GMT

Workflow converts input BAM file into bigWig and bedGraph files. Input BAM file should be sorted by coordinates (required by `bam_to_bedgraph` step). If `split` input is not provided use true by default. Default logic is implemented in `valueFrom` field of `split` input inside `bam_to_bedgraph` step to avoid possible bug in cwltool with setting default values for workflow inputs. `scale` has higher priority over the `mapped_reads_number`. The last one is used to calculate `-scale` parameter for `bedtools genomecov` (step `bam_to_bedgraph`) only in a case when input `scale` is not provided. All logic is implemented inside `bedtools-genomecov.cwl`. `bigwig_filename` defines the output name only for generated bigWig file. `bedgraph_filename` defines the output name for generated bedGraph file and can influence on generated bigWig filename in case when `bigwig_filename` is not provided. All workflow inputs and outputs don't have `format` field to avoid format incompatibility errors when workflow is used as subworkflow.

children parents
Workflow as SVG
  • Selected
  • Default Values
  • Nested Workflows
  • Tools
  • Inputs/Outputs

Inputs

ID Type Title Doc
dutp Boolean (Optional)

Change strand af the mate read, so both reads come from the same strand

scale Float (Optional)

Coefficient to scale the genome coverage by a constant factor

split Boolean (Optional)

Calculate genome coverage for each part of the splitted by 'N' and 'D' read

strand String (Optional)

Calculate genome coverage of intervals from a specific strand

bam_file File Input BAM file

Input BAM file, sorted by coordinates

pairchip Boolean (Optional)

Enable paired-end genome coverage calculation

fragment_size Integer (Optional)

Set fixed fragment size for genome coverage calculation

bigwig_filename String (Optional)

Output filename for generated bigWig

bedgraph_filename String (Optional)

Output filename for generated bedGraph

chrom_length_file File

Tab delimited chromosome length file: <chromName><TAB><chromSize>

mapped_reads_number Integer (Optional)

Parameter to calculate scale as 1000000/mapped_reads_number. Ignored by bedtools-genomecov.cwl in bam_to_bedgraph step if scale is provided

Steps

ID Runs Label Doc
sort_bedgraph
linux-sort.cwl (CommandLineTool)

Tool sorts data from `unsorted_file` by key

`default_output_filename` function returns file name identical to `unsorted_file`, if `output_filename` is not provided.

bam_to_bedgraph
bedtools-genomecov.cwl (CommandLineTool)

Tool calculates genome coverage from input bam/bed/gff/vcf using `bedtools genomecov`

Depending on `input_file` extension additional prefix is used: if `*.bam` use `-ibam`, else use `-i`.

`scale` and `mapped_reads_number` inputs result in the same parameter `-scale`. If `scale` is not provided, check if `mapped_reads_number` is not null and calculate `-scale` as `1000000/mapped_reads_number`. If both inputs are null, `bedtools genomecov` will use its default scaling value.

`default_output_filename` function returns default output filename and is used when `output_filename` is not provided. Default output file extention is `.tab`. If bedGraph should be generated (check flags `inputs.depth`), extension is updated to `.bedGraph`. Default basename of the output file is generated on the base of `input_file` basename.

sorted_bedgraph_to_bigwig
ucsc-bedgraphtobigwig.cwl (CommandLineTool)

Tool converts bedGraph to bigWig file.

`default_output_filename` function returns filename for generated bigWig if `output_filename` is not provided. Default filename is generated on the base of `bedgraph_file` basename with the updated to `*.bigWig` extension.

Outputs

ID Type Label Doc
bigwig_file File

Output bigWig file

bedgraph_file File bedGraph output file

Output bedGraph file

Permalink: https://w3id.org/cwl/view/git/4360fb2e778ecee42e5f78f83b78c65ab3a2b1df/tools/bam-bedgraph-bigwig.cwl