Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
drpatelh committed Jul 1, 2020
1 parent ba857e1 commit 15fa2fe
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

* [#138](https://github.com/nf-core/chipseq/issues/138) - Add social preview image
* [#153](https://github.com/nf-core/chipseq/issues/153) - Add plotHeatmap
* [#159](https://github.com/nf-core/chipseq/issues/159) - expose bwa mem -T parameter
* [nf-core/atacseq#63](https://github.com/nf-core/atacseq/issues/63) - Added multicore support for Trim Galore!
* [nf-core/atacseq#71](https://github.com/nf-core/atacseq/issues/71) - consensus_peaks.mLb.clN.boolean.intersect.plot.pdf not generated
* [nf-core/atacseq#75](https://github.com/nf-core/atacseq/issues/75) - Include gene annotation versions in multiqc report
Expand All @@ -22,6 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* Replace `set` with `tuple` and `file()` with `path()` in all processes
* Capitalise process names
* Parameters:
* `--bwa_min_score` to set minimum alignment score for BWA MEM
* `--macs_fdr` to provide FDR threshold for MACS2 peak calling
* `--macs_pvalue` to provide p-value threshold for MACS2 peak calling
* `--skip_peak_qc` to skip MACS2 peak QC plot generation
Expand Down
35 changes: 20 additions & 15 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* [`--skip_trimming`](#--skip_trimming)
* [`--save_trimmed`](#--save_trimmed)
* [Alignments](#alignments)
* [`--bwa_min_score`](#--bwa_min_score)
* [`--keep_dups`](#--keep_dups)
* [`--keep_multi_map`](#--keep_multi_map)
* [`--save_align_intermeds`](#--save_align_intermeds)
Expand Down Expand Up @@ -337,11 +338,11 @@ If provided, alignments that overlap with the regions in this file will be filte

### `--save_reference`

If the BWA index is generated by the pipeline use this parameter to save it to your results folder. These can then be used for future pipeline runs, reducing processing times.
If the BWA index is generated by the pipeline use this parameter to save it to your results folder. These can then be used for future pipeline runs, reducing processing times (Default: false).

### `--igenomes_ignore`

Do not load `igenomes.config` when running the pipeline. You may choose this option if you observe clashes between custom parameters and those supplied in `igenomes.config`.
Do not load `igenomes.config` when running the pipeline. You may choose this option if you observe clashes between custom parameters and those supplied in `igenomes.config` (Default: false).

## Adapter trimming

Expand All @@ -361,31 +362,35 @@ You can specify custom trimming parameters as follows:

### `--skip_trimming`

Skip the adapter trimming step. Use this if your input FastQ files have already been trimmed outside of the workflow or if you're very confident that there is no adapter contamination in your data.
Skip the adapter trimming step. Use this if your input FastQ files have already been trimmed outside of the workflow or if you're very confident that there is no adapter contamination in your data (Default: false).

### `--save_trimmed`

By default, trimmed FastQ files will not be saved to the results directory. Specify this flag (or set to true in your config file) to copy these files to the results directory when complete.
By default, trimmed FastQ files will not be saved to the results directory. Specify this flag (or set to true in your config file) to copy these files to the results directory when complete (Default: false).

## Alignments

### `--bwa_min_score`

Don’t output BWA MEM alignments with score lower than this parameter (Default: false).

### `--keep_dups`

Duplicate reads are not filtered from alignments.
Duplicate reads are not filtered from alignments (Default: false).

### `--keep_multi_map`

Reads mapping to multiple locations in the genome are not filtered from alignments.
Reads mapping to multiple locations in the genome are not filtered from alignments (Default: false).

### `--save_align_intermeds`

By default, intermediate BAM files will not be saved. The final BAM files created after the appropriate filtering step are always saved to limit storage usage. Set to true to also save other intermediate BAM files.
By default, intermediate BAM files will not be saved. The final BAM files created after the appropriate filtering step are always saved to limit storage usage. Set to true to also save other intermediate BAM files (Default: false).

## Peaks

### `--narrow_peak`

MACS2 is run by default with the [`--broad`](https://github.com/taoliu/MACS#--broad) flag. Specify this flag to call peaks in narrowPeak mode.
MACS2 is run by default with the [`--broad`](https://github.com/taoliu/MACS#--broad) flag. Specify this flag to call peaks in narrowPeak mode (Default: false).

### `--broad_cutoff`

Expand All @@ -401,37 +406,37 @@ p-value cutoff for peak detection, `--macs_fdr` and `--macs_pvalue` are mutually

### `--min_reps_consensus`

Number of biological replicates required from a given condition for a peak to contribute to a consensus peak . If you are confident you have good reproducibility amongst your replicates then you can increase the value of this parameter to create a "reproducible" set of consensus of peaks. For example, a value of 2 will mean peaks that have been called in at least 2 replicates will contribute to the consensus set of peaks, and as such peaks that are unique to a given replicate will be discarded.
Number of biological replicates required from a given condition for a peak to contribute to a consensus peak . If you are confident you have good reproducibility amongst your replicates then you can increase the value of this parameter to create a "reproducible" set of consensus of peaks. For example, a value of 2 will mean peaks that have been called in at least 2 replicates will contribute to the consensus set of peaks, and as such peaks that are unique to a given replicate will be discarded (Default: 1).

```bash
-- min_reps_consensus 1
```

### `--save_macs_pileup`

Instruct MACS2 to create bedGraph files using the `-B --SPMR` parameters.
Instruct MACS2 to create bedGraph files using the `-B --SPMR` parameters (Default: false).

### `--skip_peak_qc`

Skip MACS2 peak QC plot generation.
Skip MACS2 peak QC plot generation (Default: false).

### `--skip_peak_annotation`

Skip annotation of MACS2 and consensus peaks with HOMER.
Skip annotation of MACS2 and consensus peaks with HOMER (Default: false).

### `--skip_consensus_peaks`

Skip consensus peak generation, annotation and counting.
Skip consensus peak generation, annotation and counting (Default: false).

## Differential analysis

### `--deseq2_vst`

Use `vst` transformation instead of `rlog` with DESeq2. See [DESeq2 docs](http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#data-transformations-and-visualization).
Use `vst` transformation instead of `rlog` with DESeq2. See [DESeq2 docs](http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#data-transformations-and-visualization) (Default: false).

### `--skip_diff_analysis`

Skip differential binding analysis with DESeq2.
Skip differential binding analysis with DESeq2 (Default: false).

## Skipping QC steps

Expand Down
4 changes: 4 additions & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def helpMessage() {
--save_trimmed [bool] Save the trimmed FastQ files in the results directory (Default: false)
Alignments
--bwa_min_score [int] Don’t output BWA MEM alignments with score lower than this parameter (Default: false)
--keep_dups [bool] Duplicate reads are not filtered from alignments (Default: false)
--keep_multi_map [bool] Reads mapping to multiple locations are not filtered from alignments (Default: false)
--save_align_intermeds [bool] Save the intermediate BAM files from the alignment step - not done by default (Default: false)
Expand Down Expand Up @@ -228,6 +229,7 @@ summary['GTF File'] = params.gtf
if (params.gene_bed) summary['Gene BED File'] = params.gene_bed
if (params.bwa_index) summary['BWA Index'] = params.bwa_index
if (params.blacklist) summary['Blacklist BED'] = params.blacklist
if (params.bwa_min_score) summary['BWA Min Score'] = params.bwa_min_score
summary['MACS2 Genome Size'] = params.macs_gsize ?: 'Not supplied'
summary['Min Consensus Reps'] = params.min_reps_consensus
if (params.macs_gsize) summary['MACS2 Narrow Peaks'] = params.narrow_peak ? 'Yes' : 'No'
Expand Down Expand Up @@ -587,11 +589,13 @@ process BWA_MEM {
if (params.seq_center) {
rg = "\'@RG\\tID:${name}\\tSM:${name.split('_')[0..-2].join('_')}\\tPL:ILLUMINA\\tLB:${name}\\tPU:1\\tCN:${params.seq_center}\'"
}
score = params.bwa_min_score ? "-T ${params.bwa_min_score}" : ''
"""
bwa mem \\
-t $task.cpus \\
-M \\
-R $rg \\
$score \\
${index}/${bwa_base} \\
$reads \\
| samtools view -@ $task.cpus -b -h -F 0x0100 -O BAM -o ${prefix}.bam -
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ params {
save_trimmed = false

// Options: Alignments
bwa_min_score = false
keep_dups = false
keep_multi_map = false
save_align_intermeds = false
Expand Down

0 comments on commit 15fa2fe

Please sign in to comment.