Skip to content

Commit

Permalink
Merge pull request #104 from CCBR/plot-peaks
Browse files Browse the repository at this point in the history
Improve peak widths plot
  • Loading branch information
kelly-sovacool authored Sep 29, 2023
2 parents cbbfa95 + 15db321 commit 45f6ef7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
14 changes: 10 additions & 4 deletions bin/plot_peak_widths.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ if (length(args) < 1) {
stop("Error: not enough positional arguments.\n Example usage:\n Rscript plot_peak_widths.R path/to/peak_widths.tsv")
}
tsv_filename <- args[1]
peak_dat <- read_tsv(tsv_filename)
peak_dat <- read_tsv(tsv_filename) %>%
mutate(peak_width = chromEnd - chromStart)
xmin <- peak_dat %>%
pull(peak_width) %>%
min()
xmax <- peak_dat %>%
pull(peak_width) %>%
max()

peak_widths_hist <- peak_dat %>%
mutate(peak_width = chromEnd - chromStart) %>%
ggplot(aes(peak_width, fill = tool)) +
geom_histogram(alpha = 0.7, position = "identity") +
scale_x_log10(
breaks = scales::trans_breaks("log10", function(x) 10^x),
labels = scales::trans_format("log10", scales::math_format(10^.x))
limits = c(xmin - 10^2, xmax + 10^2),
labels = scales::label_log(digits = 2)
) +
scale_fill_viridis_d() +
guides(fill = guide_legend(
Expand Down
26 changes: 13 additions & 13 deletions docs/user-guide/examples/multiqc_report.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/local/peaks.nf
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ process GEM {
--expt ${chip} \\
--ctrl ${input} \\
--out ${meta.id} \\
--fold ${params.gem.fold}
--fold ${params.gem.fold} \\
--k_min ${params.gem.k_min} \\
--k_max ${params.gem.k_max} \\
--nrf \\
Expand Down

0 comments on commit 45f6ef7

Please sign in to comment.