Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding peak-calling with Genrich (fix #108) and multi-mapping read analysis #331

Draft
wants to merge 19 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/multiqc/merged_library_frip_score_header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#id: 'mlib_frip_score'
#section_name: 'MERGED LIB: MACS2 peak FRiP score'
#section_name: 'MERGED LIB: MACS2: Peak FRiP score'
#description: "is generated by calculating the fraction of all mapped reads that fall
# into the MACS2 called peak regions. A read must overlap a peak by at least 20% to be counted.
# See <a href='https://www.encodeproject.org/data-standards/terms/' target='_blank'>FRiP score</a>."
Expand Down
14 changes: 14 additions & 0 deletions assets/multiqc/merged_library_joint_genrich_frip_score_header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#id: 'mlib_joint_genrich_frip_score'
#section_name: 'MERGED LIB: Genrich (joint): Peak FRiP score'
#description: "is generated by calculating the fraction of all mapped reads that fall
# into the Genrich called peak regions. A read must overlap a peak by at least 20% to be counted.
# See <a href='https://www.encodeproject.org/data-standards/terms/' target='_blank'>FRiP score</a>."
#plot_type: 'bargraph'
#anchor: 'mlib_frip_score'
#pconfig:
# title: 'FRiP score'
# ylab: 'FRiP score'
# ymax: 1
# ymin: 0
# tt_decimals: 2
# cpswitch: False
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#id: 'mlib_joint_genrich_peak_annotation'
#section_name: 'MERGED LIB: Genrich (joint): HOMER peak annotation'
#description: "is generated by calculating the proportion of peaks assigned to genomic features by
# <a href='http://homer.ucsd.edu/homer/ngs/annotation.html' target='_blank'>HOMER annotatePeaks.pl</a>."
#plot_type: 'bargraph'
#anchor: 'mlib_peak_annotation'
#pconfig:
# title: 'Peak to feature proportion'
# ylab: 'Peak count'
10 changes: 10 additions & 0 deletions assets/multiqc/merged_library_joint_genrich_peak_count_header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#id: 'mlib_joint_genrich_peak_count'
#section_name: 'MERGED LIB: Genrich (joint): Peak count'
#description: "is calculated from total number of peaks called by
# <a href='https://github.com/jsh58/Genrich' target='_blank'>Genrich</a>"
#plot_type: 'bargraph'
#anchor: 'mlib_peak_count'
#pconfig:
# title: 'Total peak count'
# ylab: 'Peak count'
# cpswitch: False
2 changes: 1 addition & 1 deletion assets/multiqc/merged_library_peak_annotation_header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#id: 'mlib_peak_annotation'
#section_name: 'MERGED LIB: HOMER peak annotation'
#section_name: 'MERGED LIB: MACS2: HOMER peak annotation'
#description: "is generated by calculating the proportion of peaks assigned to genomic features by
# <a href='http://homer.ucsd.edu/homer/ngs/annotation.html' target='_blank'>HOMER annotatePeaks.pl</a>."
#plot_type: 'bargraph'
Expand Down
2 changes: 1 addition & 1 deletion assets/multiqc/merged_library_peak_count_header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#id: 'mlib_peak_count'
#section_name: 'MERGED LIB: MACS2 peak count'
#section_name: 'MERGED LIB: MACS2: Peak count'
#description: "is calculated from total number of peaks called by
# <a href='https://github.com/taoliu/MACS' target='_blank'>MACS2</a>"
#plot_type: 'bargraph'
Expand Down
14 changes: 14 additions & 0 deletions assets/multiqc/merged_library_sep_genrich_frip_score_header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#id: 'mlib_sep_genrich_frip_score'
#section_name: 'MERGED LIB: Genrich (sep): Peak FRiP score'
#description: "is generated by calculating the fraction of all mapped reads that fall
# into the Genrich called peak regions. A read must overlap a peak by at least 20% to be counted.
# See <a href='https://www.encodeproject.org/data-standards/terms/' target='_blank'>FRiP score</a>."
#plot_type: 'bargraph'
#anchor: 'mlib_frip_score'
#pconfig:
# title: 'FRiP score'
# ylab: 'FRiP score'
# ymax: 1
# ymin: 0
# tt_decimals: 2
# cpswitch: False
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#id: 'mlib_sep_genrich_peak_annotation'
#section_name: 'MERGED LIB: Genrich (sep): HOMER peak annotation'
#description: "is generated by calculating the proportion of peaks assigned to genomic features by
# <a href='http://homer.ucsd.edu/homer/ngs/annotation.html' target='_blank'>HOMER annotatePeaks.pl</a>."
#plot_type: 'bargraph'
#anchor: 'mlib_peak_annotation'
#pconfig:
# title: 'Peak to feature proportion'
# ylab: 'Peak count'
10 changes: 10 additions & 0 deletions assets/multiqc/merged_library_sep_genrich_peak_count_header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#id: 'mlib_sep_genrich_peak_count'
#section_name: 'MERGED LIB: Genrich (sep): Peak count'
#description: "is calculated from total number of peaks called by
# <a href='https://github.com/jsh58/Genrich' target='_blank'>Genrich</a>"
#plot_type: 'bargraph'
#anchor: 'mlib_peak_count'
#pconfig:
# title: 'Total peak count'
# ylab: 'Peak count'
# cpswitch: False
2 changes: 1 addition & 1 deletion assets/multiqc/merged_replicate_frip_score_header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#id: 'mrep_frip_score'
#section_name: 'MERGED REP: MACS2 peak FRiP score'
#section_name: 'MERGED REP: MACS: Peak FRiP score'
#description: "is generated by calculating the fraction of all mapped reads that fall
# into the MACS2 called peak regions. A read must overlap a peak by at least 20% to be counted.
# See <a href='https://www.encodeproject.org/data-standards/terms/' target='_blank'>FRiP score</a>."
Expand Down
2 changes: 1 addition & 1 deletion assets/multiqc/merged_replicate_peak_annotation_header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#id: 'mrep_peak_annotation'
#section_name: 'MERGED REP: HOMER peak annotation'
#section_name: 'MERGED REP: MACS2: HOMER peak annotation'
#description: "is generated by calculating the proportion of peaks assigned to genomic features by
# <a href='http://homer.ucsd.edu/homer/ngs/annotation.html' target='_blank'>HOMER annotatePeaks.pl</a>."
#plot_type: 'bargraph'
Expand Down
2 changes: 1 addition & 1 deletion assets/multiqc/merged_replicate_peak_count_header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#id: 'mrep_peak_count'
#section_name: 'MERGED REP: MACS2 Peak count'
#section_name: 'MERGED REP: MACS2: Peak count'
#description: "is calculated from total number of peaks called by
# <a href='https://github.com/taoliu/MACS' target='_blank'>MACS2</a>"
#plot_type: 'bargraph'
Expand Down
14 changes: 13 additions & 1 deletion assets/multiqc_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,14 @@ module_order:
- "./macs2/merged_replicate/featurecounts/*.summary"

report_section_order:
mlib_peak_count:
mlib_sep_genrich_peak_count:
before: mlib_deeptools
mlib_sep_genrich_frip_score:
before: mlib_sep_genrich_peak_count
mlib_sep_genrich_peak_annotation:
before: mlib_sep_genrich_frip_score
mlib_peak_count:
before: mlib_sep_genrich_peak_annotation
mlib_frip_score:
before: mlib_peak_count
mlib_peak_annotation:
Expand All @@ -115,6 +121,12 @@ report_section_order:
before: mrep_featurecounts
mrep_deseq2_clustering_1:
before: mrep_deseq2_pca_1
mlib_joint_genrich_peak_count:
before: mrep_deseq2_clustering_1
mlib_joint_genrich_frip_score:
before: mlib_joint_genrich_peak_count
mlib_joint_genrich_peak_annotation:
before: mlib_joint_genrich_frip_score
"nf-core-atacseq-methods-description":
order: -1000
software_versions:
Expand Down
1 change: 1 addition & 0 deletions bin/plot_homer_annotatepeaks.r
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ for (idx in 1:length(HomerFiles)) {
dist.freq[which(unique.gene.dat$Distance.to.TSS < 10000)] <- "< 10kb"
dist.freq[which(unique.gene.dat$Distance.to.TSS < 5000)] <- "< 5kb"
dist.freq[which(unique.gene.dat$Distance.to.TSS < 2000)] <- "< 2kb"
dist.freq[which(unique.gene.dat$Distance.to.TSS < 1000)] <- "< 1kb"
dist.freq <- as.data.frame(table(dist.freq))
colnames(dist.freq) <- c("distance",sampleid)
dist.melt <- melt(dist.freq)
Expand Down
2 changes: 1 addition & 1 deletion bin/plot_macs2_qc.r → bin/plot_peaks_qc.r
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ library(scales)
option_list <- list(make_option(c("-i", "--peak_files"), type="character", default=NULL, help="Comma-separated list of peak files.", metavar="path"),
make_option(c("-s", "--sample_ids"), type="character", default=NULL, help="Comma-separated list of sample ids associated with peak files. Must be unique and in same order as peaks files input.", metavar="string"),
make_option(c("-o", "--outdir"), type="character", default='./', help="Output directory", metavar="path"),
make_option(c("-p", "--outprefix"), type="character", default='macs2_peakqc', help="Output prefix", metavar="string"))
make_option(c("-p", "--outprefix"), type="character", default='_peakqc', help="Output prefix", metavar="string"))

opt_parser <- OptionParser(option_list=option_list)
opt <- parse_args(opt_parser)
Expand Down
5 changes: 5 additions & 0 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ process {
withLabel:process_long {
time = { check_max( 20.h * task.attempt, 'time' ) }
}
withLabel:process_ultra {
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
memory = { check_max( 150.GB * task.attempt, 'memory' ) }
time = { check_max( 120.h * task.attempt, 'time' ) }
}
withLabel:process_high_memory {
memory = { check_max( 200.GB * task.attempt, 'memory' ) }
}
Expand Down
Loading
Loading