Workflow: ChIP-Seq pipeline single-read
The original [BioWardrobe's](https://biowardrobe.com) [PubMed ID:26248465](https://www.ncbi.nlm.nih.gov/pubmed/26248465) **ChIP-Seq** basic analysis workflow for a **single-read** experiment. A [FASTQ](http://maq.sourceforge.net/fastq.shtml) input file has to be provided. The pipeline produces a sorted BAM file alongside with index BAI file, quality statistics of the input FASTQ file, coverage by estimated fragments as a BigWig file, peaks calling data in a form of narrowPeak or broadPeak files, islands with the assigned nearest genes and region type, data for average tag density plot. Workflow starts with step *fastx\_quality\_stats* from FASTX-Toolkit to calculate quality statistics for input FASTQ file. At the same time `bowtie` is used to align reads from input FASTQ file to reference genome *bowtie\_aligner*. The output of this step is an unsorted SAM file which is being sorted and indexed by `samtools sort` and `samtools index` *samtools\_sort\_index*. Depending on workflow’s input parameters indexed and sorted BAM file can be processed by `samtools rmdup` *samtools\_rmdup* to get rid of duplicated reads. If removing duplicates is not required the original BAM and BAI files are returned. Otherwise step *samtools\_sort\_index\_after\_rmdup* repeat `samtools sort` and `samtools index` with BAM and BAI files without duplicates. Next `macs2 callpeak` performs peak calling *macs2\_callpeak* and the next step reports *macs2\_island\_count* the number of islands and estimated fragment size. If the latter is less that 80bp (hardcoded in the workflow) `macs2 callpeak` is rerun again with forced fixed fragment size value (*macs2\_callpeak\_forced*). It is also possible to force MACS2 to use pre set fragment size in the first place. Next step (*macs2\_stat*) is used to define which of the islands and estimated fragment size should be used in workflow output: either from *macs2\_island\_count* step or from *macs2\_island\_count\_forced* step. If input trigger of this step is set to True it means that *macs2\_callpeak\_forced* step was run and it returned different from *macs2\_callpeak* step results, so *macs2\_stat* step should return [fragments\_new, fragments\_old, islands\_new], if trigger is False the step returns [fragments\_old, fragments\_old, islands\_old], where sufix \"old\" defines results obtained from *macs2\_island\_count* step and sufix \"new\" - from *macs2\_island\_count\_forced* step. The following two steps (*bamtools\_stats* and *bam\_to\_bigwig*) are used to calculate coverage from BAM file and save it in BigWig format. For that purpose bamtools stats returns the number of mapped reads which is then used as scaling factor by bedtools genomecov when it performs coverage calculation and saves it as a BEDgraph file whichis then sorted and converted to BigWig format by bedGraphToBigWig tool from UCSC utilities. Step *get\_stat* is used to return a text file with statistics in a form of [TOTAL, ALIGNED, SUPRESSED, USED] reads count. Step *island\_intersect* assigns nearest genes and regions to the islands obtained from *macs2\_callpeak\_forced*. Step *average\_tag\_density* is used to calculate data for average tag density plot from the BAM file.
- Selected
- |
- Default Values
- Nested Workflows
- Tools
- Inputs/Outputs
Inputs
ID | Type | Title | Doc |
---|---|---|---|
threads | Integer (Optional) | Number of threads |
Number of threads for those steps that support multithreading |
broad_peak | Boolean | Callpeak broad |
Set to call broad peak for MACS2 |
fastq_file | File [FASTQ] | FASTQ input file |
Reads data in a FASTQ format, received after single end sequencing |
clip_3p_end | Integer (Optional) | Clip from 3p end |
Number of bases to clip from the 3p end |
clip_5p_end | Integer (Optional) | Clip from 5p end |
Number of bases to clip from the 5p end |
genome_size | String | Effective genome size |
MACS2 effective genome size: hs, mm, ce, dm or number, for example 2.7e9 |
chrom_length | File [Textual format] | Chromosomes length file |
Chromosomes length file |
control_file | File (Optional) [BAM] | Use experiment as a control |
Use experiment as a control for MACS2 peak calling |
indices_folder | Directory | Indexed genome folder (bowtie) |
Path to indexed genome folder by **bowtie** |
annotation_file | File [TSV] | Annotation file |
Tab-separated annotation file |
exp_fragment_size | Integer (Optional) | Expected fragment size |
Expected fragment size for MACS2 |
remove_duplicates | Boolean (Optional) | Remove duplicates |
Calls samtools rmdup to remove duplicates from sortesd BAM file |
force_fragment_size | Boolean (Optional) | Force fragment size |
Force MACS2 to use exp_fragment_size |
Steps
ID | Runs | Label | Doc |
---|---|---|---|
preseq |
../tools/preseq-lc-extrap.cwl
(CommandLineTool)
|
Tool runs preseq lc_extrap. Only BAM input file is supported (-B option is used by default) successCodes: [1] - is used to pass this tool as a step in a workflow in case the BAM file was not correct for Preseq Discarded arguments: -V, -vals input is a text file containing only the observed counts -H, -hist input is a text file containing the observed histogram |
|
get_stat |
../tools/python-get-stat-chipseq.cwl
(CommandLineTool)
|
python-get-stat-rnaseq |
Processing log files generated by BioWardrobe's ChIP-Seq workflows to produce expiriment quality table. |
bam_to_bigwig |
../subworkflows/bam-bedgraph-bigwig.cwl
(Workflow)
|
Workflow converts input BAM file into bigWig and bedGraph files |
|
extract_fastq |
../tools/extract-fastq.cwl
(CommandLineTool)
|
Tool to decompress input FASTQ file Bash script's logic: - disable case sensitive glob check - check if root name of input file already include '.fastq' or '.fq' extension. If yes, set DEFAULT_EXT to \"\" - check file type, decompress if needed - return 1, if file type is not recognized This script also works of input file doesn't have any extension at all |
|
bowtie_aligner |
../tools/bowtie-alignreads.cwl
(CommandLineTool)
|
Tool maps input raw reads files to reference genome using Bowtie. |
|
macs2_callpeak |
../tools/macs2-callpeak-biowardrobe-only.cwl
(CommandLineTool)
|
Tool runs peak calling using MACS2 within the custom script `run.py` |
|
samtools_rmdup |
../tools/samtools-rmdup.cwl
(CommandLineTool)
|
Tool to remove duplicates from coordinate sorted BAM file set as input `bam_file`.
If input `trigger` is set to `true` or isn't set at all (`true` is used by default), run `samtools rmdup`, return
newly generated BAM file without duplicates and log as outputs `rmdup_output` and `rmdup_log`.
If input `trigger` is set to `false`, return unchanged BAM and index files (if provided in secondaryFiles),
previously staged into output directory, and log. |
|
island_intersect |
../tools/iaintersect.cwl
(CommandLineTool)
|
Tool assigns each peak obtained from MACS2 to a gene and region (upstream, promoter, exon, intron, intergenic) |
|
average_tag_density |
../tools/atdp.cwl
(CommandLineTool)
|
Tool calculates average tag density profile around all annotated TSS. |
|
fastx_quality_stats |
../tools/fastx-quality-stats.cwl
(CommandLineTool)
|
Tool calculates statistics on the base of FASTQ file quality scores. If `output_filename` is not provided call function `default_output_filename` to return default output file name generated as `input_file` basename + `.fastxstat` extension. |
|
samtools_sort_index |
../tools/samtools-sort-index.cwl
(CommandLineTool)
|
Tool to sort and index input BAM/SAM/CRAM.
If input `trigger` is set to `true` or isn't set at all (`true` is used by default), run `samtools sort` and
`samtools index`, return sorted BAM and BAI/CSI index file.
If input `trigger` is set to `false`, return unchanged `sort_input` (BAM/SAM/CRAM) and index (BAI/CSI, if provided in
`secondaryFiles`) files, previously staged into output directory. |
|
samtools_sort_index_after_rmdup |
../tools/samtools-sort-index.cwl
(CommandLineTool)
|
Tool to sort and index input BAM/SAM/CRAM.
If input `trigger` is set to `true` or isn't set at all (`true` is used by default), run `samtools sort` and
`samtools index`, return sorted BAM and BAI/CSI index file.
If input `trigger` is set to `false`, return unchanged `sort_input` (BAM/SAM/CRAM) and index (BAI/CSI, if provided in
`secondaryFiles`) files, previously staged into output directory. |
Outputs
ID | Type | Label | Doc |
---|---|---|---|
bigwig | File [bigWig] | BigWig file |
Generated BigWig file |
atdp_log | File [TSV] | ATDP log |
Average Tag Density generated log |
macs2_log | File (Optional) [Textual format] | MACS2 log |
MACS2 output log |
bowtie_log | File [Textual format] | BOWTIE alignment log |
BOWTIE generated alignment log |
atdp_result | File [TSV] | ATDP results |
Average Tag Density generated results |
bambai_pair | File [BAM] | Coordinate sorted BAM alignment file (+index BAI) |
Coordinate sorted BAM file and BAI index file |
get_stat_log | File (Optional) [Textual format] | Old Bowtie & Samtools Rmdup combined log |
Processed and combined Bowtie aligner and Samtools rmdup log |
macs2_moder_r | File (Optional) [Textual format] | MACS2 generated R script |
R script to produce a PDF image about the model based on your data |
iaintersect_log | File [TSV] | Island intersect log |
Iaintersect generated log |
fastx_statistics | File [Textual format] | FASTQ statistics |
fastx_quality_stats generated FASTQ file quality statistics file |
preseq_estimates | File (Optional) [TSV] | Preseq estimates |
Preseq estimated results |
macs2_broad_peaks | File (Optional) [ENCODE broad peak format] | Broad peaks |
Contains the peak locations together with peak summit, pvalue and qvalue |
macs2_gapped_peak | File (Optional) [bed12] | Gapped peaks |
Contains both the broad region and narrow peaks |
iaintersect_result | File [TSV] | Island intersect results |
Iaintersect generated results |
macs2_called_peaks | File (Optional) [xls] | Called peaks |
XLS file to include information about called peaks |
macs2_narrow_peaks | File (Optional) [ENCODE narrow peak format] | Narrow peaks |
Contains the peak locations together with peak summit, pvalue and qvalue |
macs2_peak_summits | File (Optional) [BED] | Peak summits |
Contains the peak summits locations for every peaks |
samtools_rmdup_log | File [Textual format] | Remove duplicates log |
Samtools rmdup generated log |
macs2_fragment_stat | File (Optional) [Textual format] | FRAGMENT, FRAGMENTE, ISLANDS |
fragment, calculated fragment, islands count from MACS2 results |
get_stat_formatted_log | File (Optional) [TSV] | Bowtie & Samtools Rmdup combined formatted log |
Processed and combined Bowtie aligner and Samtools rmdup formatted log |
https://w3id.org/cwl/view/git/9bf0aa495735f8081bb5870cb32fc898b9e6eb22/workflows/chipseq-se.cwl