Workflow: ChIP-Seq pipeline single-read
# ChIP-Seq basic analysis workflow for single-read data Reads are aligned to the reference genome with [Bowtie](http://bowtie-bio.sourceforge.net/index.shtml). Results are saved as coordinate sorted [BAM](http://samtools.github.io/hts-specs/SAMv1.pdf) alignment and index BAI files. Optionally, PCR duplicates can be removed. To obtain coverage in [bigWig](https://genome.ucsc.edu/goldenpath/help/bigWig.html) format, average fragment length is calculated by [MACS2](https://github.com/taoliu/MACS), and individual reads are extended to this length in the 3’ direction. Areas of enrichment identified by MACS2 are saved in ENCODE [narrow peak](http://genome.ucsc.edu/FAQ/FAQformat.html#format12) or [broad peak](https://genome.ucsc.edu/FAQ/FAQformat.html#format13) formats. Called peaks together with the nearest genes are saved in TSV format. In addition to basic statistics (number of total/mapped/multi-mapped/unmapped/duplicate reads), pipeline generates several quality control measures. Base frequency plots are used to estimate adapter contamination, a frequent occurrence in low-input ChIP-Seq experiments. Expected distinct reads count from [Preseq](http://smithlabresearch.org/software/preseq/) can be used to estimate read redundancy for a given sequencing depth. Average tag density profiles can be used to estimate ChIP enrichment for promoter proximal histone modifications. Use of different parameters for different antibodies (calling broad or narrow peaks) is possible. Additionally, users can elect to use BAM file from another experiment as control for MACS2 peak calling. ## Cite as *Kartashov AV, Barski A. BioWardrobe: an integrated platform for analysis of epigenomics and transcriptomics data. Genome Biol. 2015;16(1):158. Published 2015 Aug 7. [doi:10.1186/s13059-015-0720-3](https://www.ncbi.nlm.nih.gov/pubmed/26248465)* ## Software versions - Bowtie 1.2.0 - Samtools 1.4 - Preseq 2.0 - MACS2 2.1.1.20160309 - Bedtools 2.26.0 - UCSC userApps v358 ## Inputs | ID | Label | Description | Required | Default | Upstream analyses | | ------------------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: | ------- | ------------------------------- | | **fastq\_file** | FASTQ file | Single-read sequencing data in FASTQ format (fastq, fq, bzip2, gzip, zip) | + | | | | **indices\_folder** | Genome indices | Directory with the genome indices generated by Bowtie | + | | genome\_indices/bowtie\_indices | | **annotation\_file** | Genome annotation file | Genome annotation file in TSV format | + | | genome\_indices/annotation | | **genome\_size** | Effective genome size | The length of the mappable genome (hs, mm, ce, dm or number, for example 2.7e9) | + | | genome\_indices/genome\_size | | **chrom\_length** | Chromosome lengths file | Chromosome lengths file in TSV format | + | | genome\_indices/chrom\_length | | **broad\_peak** | Call broad peaks | Make MACS2 call broad peaks by linking nearby highly enriched regions | + | | | | **control\_file** | Control ChIP-Seq single-read experiment | Indexed BAM file from the ChIP-Seq single-read experiment to be used as a control for MACS2 peak calling | | Null | control\_file/bambai\_pair | | **exp\_fragment\_size** | Expected fragment size | Expected fragment size for read extenstion towards 3' end if *force\_fragment\_size* was set to True or if calculated by MACS2 fragment size was less that 80 bp | | 150 | | | **force\_fragment\_size** | Force peak calling with expected fragment size | Make MACS2 don't build the shifting model and use expected fragment size for read extenstion towards 3' end | | False | | | **clip\_3p\_end** | Clip from 3' end | Number of base pairs to clip from 3' end | | 0 | | | **clip\_5p\_end** | Clip from 5' end | Number of base pairs to clip from 5' end | | 0 | | | **remove\_duplicates** | Remove PCR duplicates | Remove PCR duplicates from sorted BAM file | | False | | | **threads** | Number of threads | Number of threads for those steps that support multithreading | | 2 | | ## Outputs | ID | Label | Description | Required | Visualization | | ------------------------ | ---------------------------------- | ------------------------------------------------------------------------------------ | :------: | ------------------------------------------------------------------ | | **fastx\_statistics** | FASTQ quality statistics | FASTQ quality statistics in TSV format | + | *Base Frequency* and *Quality Control* plots in *QC Plots* tab | | **bambai\_pair** | Aligned reads | Coordinate sorted BAM alignment and index BAI files | + | *Nucleotide Sequence Alignments* track in *IGV Genome Browser* tab | | **bigwig** | Genome coverage | Genome coverage in bigWig format | + | *Genome Coverage* track in *IGV Genome Browser* tab | | **iaintersect\_result** | Gene annotated peaks | MACS2 peak file annotated with nearby genes | + | *Peak Coordinates* table in *Peak Calling* tab | | **atdp\_result** | Average Tag Density Plot | Average Tag Density Plot file in TSV format | + | *Average Tag Density Plot* in *QC Plots* tab | | **macs2\_called\_peaks** | Called peaks | Called peaks file with 1-based coordinates in XLS format | + | | | **macs2\_narrow\_peaks** | Narrow peaks | Called peaks file in ENCODE narrow peak format | | *Narrow peaks* track in *IGV Genome Browser* tab | | **macs2\_broad\_peaks** | Broad peaks | Called peaks file in ENCODE broad peak format | | *Broad peaks* track in *IGV Genome Browser* tab | | **preseq\_estimates** | Expected Distinct Reads Count Plot | Expected distinct reads count file from Preseq in TSV format | | *Expected Distinct Reads Count Plot* in *QC Plots* tab | | **workflow\_statistics** | Workflow execution statistics | Overall workflow execution statistics from bowtie\_aligner and samtools\_rmdup steps | + | *Overview* tab and experiment's preview | | **bowtie\_log** | Read alignment log | Read alignment log file from Bowtie | + | |
- 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 (Optional) | Call broad peaks |
Make MACS2 call broad peaks by linking nearby highly enriched regions |
fastq_file | File [FASTQ] | FASTQ file |
Single-read sequencing data in FASTQ format (fastq, fq, bzip2, gzip, zip) |
clip_3p_end | Integer (Optional) | Clip from 3' end |
Number of base pairs to clip from 3' end |
clip_5p_end | Integer (Optional) | Clip from 5' end |
Number of base pairs to clip from 5' end |
genome_size | String | Effective genome size |
The length of the mappable genome (hs, mm, ce, dm or number, for example 2.7e9) |
chrom_length | File [Textual format] | Chromosome lengths file |
Chromosome lengths file in TSV format |
control_file | File (Optional) [BAM] | Control ChIP-Seq single-read experiment |
Indexed BAM file from the ChIP-Seq single-read experiment to be used as a control for MACS2 peak calling |
promoter_dist | Integer (Optional) | Max distance from gene TSS (in both direction) overlapping which the peak will be assigned to the promoter region |
Max distance from gene TSS (in both direction) overlapping which the peak will be assigned to the promoter region |
upstream_dist | Integer (Optional) | Max distance from the promoter (only in upstream direction) overlapping which the peak will be assigned to the upstream region |
Max distance from the promoter (only in upstream direction) overlapping which the peak will be assigned to the upstream region |
indices_folder | Directory | Genome indices |
Directory with the genome indices generated by Bowtie |
annotation_file | File [TSV] | Genome annotation file |
Genome annotation file in TSV format |
exp_fragment_size | Integer (Optional) | Expected fragment size |
Expected fragment size for read extenstion towards 3' end if force_fragment_size was set to True or if calculated by MACS2 fragment size was less that 80 bp |
remove_duplicates | Boolean (Optional) | Remove PCR duplicates |
Remove PCR duplicates from sorted BAM file |
force_fragment_size | Boolean (Optional) | Force peak calling with expected fragment size |
Make MACS2 don't build the shifting model and use expected fragment size for read extenstion towards 3' end |
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 |
|
bam_to_bigwig |
../tools/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(s). If several FASTQ files are provided, they will be concatenated in the order that corresponds to files in input. 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 \"\", otherwise use '.fastq' - 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. |
|
get_statistics |
../tools/collect-statistics-chip-seq.cwl
(CommandLineTool)
|
Tool processes and combines log files generated by Trimgalore, Bowtie, Samtools and MACS2. |
|
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) |
|
get_bam_statistics |
../tools/samtools-stats.cwl
(CommandLineTool)
|
Generates statistics for the input BAM file. |
|
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. |
|
get_bam_statistics_after_filtering |
../tools/samtools-stats.cwl
(CommandLineTool)
|
Generates statistics for the input BAM file. |
Outputs
ID | Type | Label | Doc |
---|---|---|---|
bigwig | File [bigWig] | Genome coverage |
Genome coverage in bigWig format |
bowtie_log | File [Textual format] | Read alignment log |
Read alignment log file from Bowtie |
atdp_result | File [TSV] | Average Tag Density Plot |
Average Tag Density Plot file in TSV format |
bambai_pair | File [BAM] | Aligned reads |
Coordinate sorted BAM alignment and index BAI files |
unaligned_fastq | File[] (Optional) [FASTQ] | Unaligned FASTQ file(s) |
Unaligned FASTQ file(s) |
fastx_statistics | File [Textual format] | FASTQ quality statistics |
FASTQ quality statistics in TSV format |
preseq_estimates | File (Optional) [TSV] | Expected Distinct Reads Count Plot |
Expected distinct reads count file from Preseq in TSV format |
macs2_broad_peaks | File (Optional) [ENCODE broad peak format] | Broad peaks |
Called peaks file in ENCODE broad peak format |
multimapped_fastq | File[] (Optional) [FASTQ] | Multimapped FASTQ file(s) |
Multimapped FASTQ file(s) |
iaintersect_result | File [TSV] | Gene annotated peaks |
MACS2 peak file annotated with nearby genes |
macs2_called_peaks | File [xls] | Called peaks |
Called peaks file with 1-based coordinates in XLS format |
macs2_narrow_peaks | File (Optional) [ENCODE narrow peak format] | Narrow peaks |
Called peaks file in ENCODE narrow peak format |
mapped_reads_number | Integer | Mapped reads number |
Mapped reads number for downstream analyses |
bam_statistics_report | File [Textual format] | BAM statistics report (original) |
BAM statistics report (right after alignment and sorting) |
estimated_fragment_size | Integer | Estimated fragment size |
Estimated fragment size for downstream analyses |
workflow_statistics_tsv | File [TSV] | Workflow execution statistics |
Overall workflow execution statistics from bowtie_aligner and samtools_rmdup steps |
workflow_statistics_yaml | File (Optional) [YAML] | YAML formatted combined log |
YAML formatted combined log |
workflow_statistics_markdown | File (Optional) [TIDE TXT] | Markdown formatted combined log |
Markdown formatted combined log |
bam_statistics_report_after_filtering | File [Textual format] | BAM statistics report (after filtering) |
BAM statistics report (after all filters applied) |
https://w3id.org/cwl/view/git/8a92669a566589d80fde9d151054ffc220ed4ddd/workflows/chipseq-se.cwl