Skip to content

Commit

Permalink
Random arc position to avoid overlapping - #11
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarrimar committed Mar 19, 2021
1 parent 890cf40 commit f33d4c5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/example_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Example #1. Overlay, intron shrinkage, gene annotation, PDF output, custom size and colors
../sashimi-plot.py -b input_bams.tsv -c chr10:27040584-27048100 -g annotation.gtf -M 10 -C 3 -O 3 --shrink --alpha 0.25 --base-size=20 --ann-height=4 --height=3 --width=18 -P palette.txt

## Example #2. Median coverage and number of reads supporting inclusion and exclusion, no gene annotation, TIFF output (350 PPI), custom size, default colors
../sashimi-plot.py -b input_bams.tsv -c chr10:27040584-27048100 -M 10 -C 3 -O 3 -A median --alpha 1 -F tiff -R 350 --base-size=16 --height=3 --width=18
## Example #2. Median coverage and number of reads supporting inclusion and exclusion, no gene annotation, TIFF output (350 PPI), custom size, default colors, fixed y-scale
../sashimi-plot.py -b input_bams.tsv -c chr10:27040584-27048100 -M 10 -C 3 -O 3 -A median --alpha 1 -F tiff -R 350 --base-size=16 --height=3 --width=18 --fix-y-scale


Binary file modified examples/sashimi.pdf
Binary file not shown.
Binary file modified examples/sashimi.tiff
Binary file not shown.
9 changes: 5 additions & 4 deletions sashimi-plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,8 @@ def get_debug_info():
j[4] = ifelse(length(d[x==j[2]+1,y])==0, 0, max(as.numeric(d[x==j[2]+1,y])))
}
if (i%%%%2 != 0) { #top
maxheight_j = max(maxheight_j, max(j[3:4]) * 1.2)
set.seed(mean(j[3:4]))
maxheight_j = max(maxheight_j, max(j[3:4]) * runif(1, 1.2, 1.5))
}
}
}
Expand Down Expand Up @@ -918,8 +919,8 @@ def get_debug_info():
# Find intron midpoint
xmid = round(mean(j[1:2]), 1)
ypad = 0.2*(j[2]-j[1])/(max(d[,x])-min(d[,x]))
ymid = max(j[3:4]) * (1 + ypad)
set.seed(mean(j[3:4]))
ymid = max(j[3:4]) * runif(1, 1.2, 1.5)
# Thickness of the arch
lwd = scale_lwd(j[5]/j_tot_counts)
Expand All @@ -931,7 +932,7 @@ def get_debug_info():
# Choose position of the arch (top or bottom)
nss = i
if (nss%%%%2 == 0) { #bottom
ymid = -(0.2 + ypad) * maxheight
ymid = -runif(1, 0.2, 0.4) * maxheight
# Draw the arcs
# Left
curve = xsplineGrob(x=c(0, 0, 1, 1), y=c(1, 0, 0, 0), shape=1, gp=curve_par)
Expand Down

0 comments on commit f33d4c5

Please sign in to comment.