Skip to content

Commit

Permalink
Merge pull request #47 from ulelab/dev
Browse files Browse the repository at this point in the history
Pre-release updates
  • Loading branch information
amchakra committed Sep 10, 2021
2 parents d270bda + 6ebd81c commit f72d9b7
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 223 deletions.
50 changes: 50 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @amchakra @CharlotteAnne

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.
*.js @js-owner

# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.
*.go docs@example.com

# Teams can be specified as code owners as well. Teams should
# be identified in the format @org/team-name. Teams must have
# explicit write access to the repository. In this example,
# the octocats team in the octo-org organization owns all .txt files.
*.txt @octo-org/octocats

# In this example, @doctocat owns any files in the build/logs
# directory at the root of the repository and any of its
# subdirectories.
/build/logs/ @doctocat

# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
docs/* docs@example.com

# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.
apps/ @octocat

# In this example, @doctocat owns any file in the `/docs`
# directory in the root of your repository and any of its
# subdirectories.
/docs/ @doctocat

# In this example, @octocat owns any file in the `/apps`
# directory in the root of your repository except for the `/apps/github`
# subdirectory, as its owners are left empty.
/apps/ @octocat
/apps/github
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ Where multiple files are specified for a parameter, these should be comma-separa

* `--highlight` can be used to specify a region in the format `'start_coordinate:end_coordinate'`. This will be highlighted by grey shading.

* `--tidy_y_labels` can be use to tidy the y-axis labels and keep alternate ones if there are 5 or more.

### 2. Auxiliary plot

* `-y` or `--auxiliary` can be used to supply the auxiliary tracks. These should be in a standard 6-column BED format. Optionally, if a 9-column BED file is supplied then the 9th column `itemRgb` will be used to colour the intervals. These tracks could be peak intervals, but could be any features of interest. You can label the tracks with `--auxiliary_labels`, otherwise the first 10 characters of the filename are used.
Expand Down Expand Up @@ -225,8 +227,10 @@ cd test
-w 50 \
-y 'test_Alu_rev.bed.gz' \
--auxiliary_labels 'reverse Alu' \
--coverage 'test_CTRL_plus.bigwig,test_KD1_plus.bigwig,test_KD2_plus.bigwig' \
--coverage_labels 'CTRL,KD1,KD2' \
--coverage 'test_ERR127306_plus.bigwig,test_ERR127307_plus.bigwig,test_ERR127308_plus.bigwig,test_ERR127309_plus.bigwig,test_ERR127302_plus.bigwig,test_ERR127303_plus.bigwig,test_ERR127304_plus.bigwig,test_ERR127305_plus.bigwig' \
--coverage_labels 'CTRL1 1,CTRL1 2,CTRL2 1,CTRL2 2,KD1 1,KD1 2,KD2 1,KD2 2' \
--coverage_colours '#A1D99B,#74C476,#31A354,#006D2C,#FDAE6B,#E6550D,#FC9272,#DE2D26' \
--coverage_groups 'CTRL,CTRL,CTRL,CTRL,KD,KD,KD,KD' \
-g CD55_gencode.v34lift37.annotation.gtf.gz \
-r 'chr1:207513000:207515000:+' \
--highlight '207513650:207513800' \
Expand Down
28 changes: 10 additions & 18 deletions clipplotr
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ option_list <- list(make_option(c("-x", "--xlinks"), action = "store", type = "c
make_option(c("", "--highlight"), action = "store", type = "character", help = "Region to highlight as 35754106:35856276"),
make_option(c("-n", "--normalisation"), action = "store", type = "character", help = "Normalisation options: none, maxpeak, libsize, custom, libsize_maxpeak, custom_maxpeak [default %default]", default = "libsize"),
make_option(c("", "--size_factors"), action = "store", type = "character", help = "Size factors for custom normalisation (comma separated)"),
make_option(c("", "--scale_y"), action = "store_true", type = "logical", help = "Scale facetted CLIP y-axis", default = FALSE),
make_option(c("", "--scale_y"), action = "store_true", type = "logical", help = "Scale CLIP y-axis for each group independently", default = FALSE),
make_option(c("", "--tidy_y_labels"), action = "store", type = "integer", help = "Keep this many y-axis labels (may be slightly more or fewer depending on data)"),
make_option(c("-s", "--smoothing"), action = "store", type = "character", help = "Smoothing options: none, rollmean, gaussian [default %default]", default = "rollmean"),
make_option(c("-w", "--smoothing_window"), action = "store", type = "integer", help = "Smoothing window [default %default]", default = 100),
make_option(c("-a", "--annotation"), action = "store", type = "character", help = "Annotation options: original, gene, transcript, none [default %default]", default = "transcript"),
Expand Down Expand Up @@ -391,6 +392,13 @@ if(!is.null(opt$highlight)) {

}

if(!is.null(opt$tidy_y_labels)) {

# p.iclip <- p.iclip + scale_y_continuous(breaks = scales::breaks_extended(n = opt$tidy_y_labels))
p.iclip <- p.iclip + scale_y_continuous(n.breaks = opt$tidy_y_labels)

}

# ==========
# Part 1b - top half: auxiliary file annotation (eg.peaks)
# ==========
Expand Down Expand Up @@ -515,7 +523,6 @@ if(!is.null(opt$coverage)) {
y = "Coverage",
colour = "") +
scale_colour_manual(values = coverage_colours) +
# facet_grid(exp ~ ., labeller=label_wrap_gen(10)) +
theme_minimal_grid() + theme(legend.position = "bottom") + theme(strip.text.y = element_text(size = 10, angle = 0, hjust = 0)) +
xlim(start(region.gr), end(region.gr))

Expand All @@ -527,7 +534,6 @@ if(!is.null(opt$coverage)) {
y = "Coverage",
colour = "") +
scale_colour_tableau(palette = "Superfishel Stone") +
# facet_grid(exp ~ ., labeller=label_wrap_gen(10)) +
theme_minimal_grid() + theme(legend.position = "bottom") + theme(strip.text.y = element_text(size = 10, angle = 0, hjust = 0)) +
xlim(start(region.gr), end(region.gr))

Expand Down Expand Up @@ -671,11 +677,6 @@ if(opt$annotation == "transcript") {
# Plot
p.annot <- ggplot() +
geom_segment(data = sel.region.tiled.dt, mapping = aes(x = start, xend = end, y = group, yend = group), arrow = arrow(length = unit(0.1, "cm")), colour = "grey50") +
# geom_rect(data = sel.exons_tx.dt, mapping = aes(xmin = start, xmax = end, ymin = group - 0.25, ymax = group + 0.25), fill = "black") +
# geom_rect(data = sel.cds_tx.dt, mapping = aes(xmin = start, xmax = end, ymin = group - 0.25, ymax = group + 0.25), fill = "black") +
# geom_rect(data = sel.utr5_tx.dt, mapping = aes(xmin = start, xmax = end, ymin = group - 0.15, ymax = group + 0.15), fill = "black") +
# geom_rect(data = sel.utr3_tx.dt, mapping = aes(xmin = start, xmax = end, ymin = group - 0.15, ymax = group + 0.15), fill = "black") +
# geom_text(data = tx.order.dt, aes(label = transcript_id, y = group, x = centre), size = 3, vjust = 0) +
geom_rect(data = sel.exons_tx.dt, mapping = aes(xmin = start, xmax = end, ymin = group - 0.25, ymax = group + 0.25, fill = gene)) +
geom_rect(data = sel.cds_tx.dt, mapping = aes(xmin = start, xmax = end, ymin = group - 0.25, ymax = group + 0.25, fill = gene)) +
geom_rect(data = sel.utr5_tx.dt, mapping = aes(xmin = start, xmax = end, ymin = group - 0.15, ymax = group + 0.15, fill = gene)) +
Expand All @@ -687,14 +688,6 @@ if(opt$annotation == "transcript") {
fill = "") +
coord_cartesian(xlim = c(start(region), end(region)))

#
# if(opt$show_tx_name == TRUE) {
#
# p.annot <- p.annot + geom_text(data = tx.order.dt, aes(label = transcript_id, y = group + 0.3, x = centre), size = 3, vjust = 0)
# # Need to fix ones that are outside of window
#
# }

}

# ==========
Expand Down Expand Up @@ -777,8 +770,7 @@ if(is.null(opt$ratios)){ #if the user hasnt specified ratios
# Could change this to ifelse depending on annotation style
}
p <- p + plot_layout(heights = ratios)
} else { #if the user has specified ratios
# rts = unlist(strsplit(opt$ratios, ",")) # This is already defined at the beginning
} else {
p <- p.iclip
ratios <- rts[[1]]
if(exists("p.auxiliary")) {
Expand Down
42 changes: 18 additions & 24 deletions examples/make_plots_for_figures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ $CLIPPLOTR \
-w 50 \
-y 'Alu_rev.bed.gz' \
--auxiliary_labels 'reverse Alu' \
--coverage 'CTRL.bigwig,KD1.bigwig,KD2.bigwig' \
--coverage 'ERR127306_plus.bigwig,ERR127307_plus.bigwig,ERR127308_plus.bigwig,ERR127309_plus.bigwig,ERR127302_plus.bigwig,ERR127303_plus.bigwig,ERR127304_plus.bigwig,ERR127305_plus.bigwig' \
--coverage_labels 'CTRL1 1,CTRL1 2,CTRL2 1,CTRL2 2,KD1 1,KD1 2,KD2 1,KD2 2' \
--coverage_colours '#A1D99B,#74C476,#31A354,#006D2C,#FDAE6B,#E6550D,#FC9272,#DE2D26' \
--coverage_groups 'CTRL,CTRL,CTRL,CTRL,KD,KD,KD,KD' \
-g gencode.v34lift37.annotation.gtf.gz \
-r 'chr1:207513000:207515000:+' \
--highlight '207513650:207513800' \
Expand Down Expand Up @@ -83,27 +86,15 @@ $CLIPPLOTR \
-n libsize \
-y 'HepG2.bed.gz,K562.bed.gz' \
--auxiliary_labels 'HepG2 peaks,K562 peaks' \
-g gencode.v34.annotation.gtf.gz \
-g gencode.v34.basic.annotation.gtf.gz \
-r 'chr17:8458500:8469500:+' \
--highlight '8462500:8467500' \
-a gene \
--ratio '2,0.5,0,0.25' \
--size_x 200 \
--size_y 200 \
-o '../../plots/NDEL1_libsize_gene.pdf'

# $CLIPPLOTR \
# -x 'ENCFF239CML.xl.bed.gz,ENCFF170YQV.xl.bed.gz,ENCFF515BTB.xl.bed.gz,ENCFF537RYR.xl.bed.gz,ENCFF296GDR.xl.bed.gz,ENCFF212IIR.xl.bed.gz' \
# -l 'HepG2 IP1,HepG2 IP2,HepG2 SMI,K562 IP1,K562_IP2,K562 SMI' \
# -c '#324376,#586BA4,#B4BCD6,#771434,#A54D69,#D2A6B4' \
# --groups 'HepG2,HepG2,HepG2,K562,K562,K562' \
# -n libsize \
# -y 'HepG2.bed.gz,K562.bed.gz' \
# --auxiliary_labels 'HepG2 peaks,K562 peaks' \
# -g gencode.v34.annotation.gtf.gz \
# -r 'chr17:8458500:8469500:+' \
# -a transcript \
# -o '../../plots/NDEL1_libsize.pdf'

$CLIPPLOTR \
-x 'ENCFF239CML.xl.bed.gz,ENCFF170YQV.xl.bed.gz,ENCFF515BTB.xl.bed.gz,ENCFF537RYR.xl.bed.gz,ENCFF296GDR.xl.bed.gz,ENCFF212IIR.xl.bed.gz' \
-l 'HepG2 IP1,HepG2 IP2,HepG2 SMI,K562 IP1,K562_IP2,K562 SMI' \
Expand All @@ -112,37 +103,40 @@ $CLIPPLOTR \
-n libsize \
--scale_y \
-g gencode.v34.annotation.gtf.gz \
-r 'chr17:8458500:8469500:+' \
-r 'chr17:8462500:8467500:+' \
-a none \
--ratio '2,0.5,0,0.25' \
--size_x 200 \
--size_y 100 \
--tidy_y_labels 4 \
-o '../../plots/NDEL1_libsize_scaled.pdf'

$CLIPPLOTR \
-x 'ENCFF239CML.xl.bed.gz,ENCFF170YQV.xl.bed.gz,ENCFF515BTB.xl.bed.gz,ENCFF537RYR.xl.bed.gz,ENCFF296GDR.xl.bed.gz,ENCFF212IIR.xl.bed.gz' \
-l 'HepG2 IP1,HepG2 IP2,HepG2 SMI,K562 IP1,K562_IP2,K562 SMI' \
-c '#324376,#586BA4,#B4BCD6,#771434,#A54D69,#D2A6B4' \
--groups 'HepG2,HepG2,HepG2,K562,K562,K562' \
-n libsize_maxpeak \
-n maxpeak \
-g gencode.v34.annotation.gtf.gz \
-r 'chr17:8458500:8469500:+' \
-r 'chr17:8462500:8467500:+' \
-a none \
--ratio '2,0.5,0,0.25' \
--size_x 205 \
--size_x 198 \
--size_y 100 \
-o '../../plots/NDEL1_libsize_maxpeak.pdf'
--tidy_y_labels 3 \
-o '../../plots/NDEL1_maxpeak.pdf'

$CLIPPLOTR \
-x 'ENCFF239CML.xl.bed.gz,ENCFF170YQV.xl.bed.gz,ENCFF515BTB.xl.bed.gz,ENCFF537RYR.xl.bed.gz,ENCFF296GDR.xl.bed.gz,ENCFF212IIR.xl.bed.gz' \
-l 'HepG2 IP1,HepG2 IP2,HepG2 SMI,K562 IP1,K562_IP2,K562 SMI' \
-c '#324376,#586BA4,#B4BCD6,#771434,#A54D69,#D2A6B4' \
--groups 'HepG2,HepG2,HepG2,K562,K562,K562' \
-n maxpeak \
-n libsize_maxpeak \
-g gencode.v34.annotation.gtf.gz \
-r 'chr17:8458500:8469500:+' \
-r 'chr17:8462500:8467500:+' \
-a none \
--ratio '2,0.5,0,0.25' \
--size_x 200 \
--size_x 207 \
--size_y 100 \
-o '../../plots/NDEL1_maxpeak.pdf'
--tidy_y_labels 3 \
-o '../../plots/NDEL1_libsize_maxpeak.pdf'
Loading

0 comments on commit f72d9b7

Please sign in to comment.