Skip to content

Commit

Permalink
Fix median aggregation - close #69
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarrimar committed Oct 18, 2021
1 parent 39c5826 commit 143dbd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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
../ggsashimi.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, fixed y-scale
../ggsashimi.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
## Example #2. Mean coverage and number of reads supporting inclusion and exclusion, no gene annotation, TIFF output (350 PPI), custom size, default colors, fixed y-scale
../ggsashimi.py -b input_bams.tsv -c chr10:27040584-27048100 -M 10 -C 3 -O 3 -A mean --alpha 1 -F tiff -R 350 --base-size=16 --height=3 --width=18 --fix-y-scale


4 changes: 2 additions & 2 deletions ggsashimi.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ def get_debug_info():
row_i = c()
if (nrow(junctions) >0 ) {
junctions$jlabel = as.character(junctions$count)
junctions = setNames(junctions[,.(max(y), max(yend),round(mean(count)),paste(jlabel,collapse=",")), keyby=.(x,xend)], names(junctions))
junctions = setNames(junctions[,.(max(y), max(yend),round(%(args.aggr)s(count)),paste(jlabel,collapse=",")), keyby=.(x,xend)], names(junctions))
if ("%(args.aggr)s" != "") {
junctions = setNames(junctions[,.(max(y), max(yend),round(%(args.aggr)s(count)),round(%(args.aggr)s(count))), keyby=.(x,xend)], names(junctions))
}
Expand Down Expand Up @@ -902,7 +902,7 @@ def get_debug_info():
if (nrow(junctions) >0 ) {
junctions$jlabel = as.character(junctions$count)
junctions = setNames(junctions[,.(max(y), max(yend),round(mean(count)),paste(jlabel,collapse=",")), keyby=.(x,xend)], names(junctions))
junctions = setNames(junctions[,.(max(y), max(yend),round(%(args.aggr)s(count)),paste(jlabel,collapse=",")), keyby=.(x,xend)], names(junctions))
if ("%(args.aggr)s" != "") {
junctions = setNames(junctions[,.(max(y), max(yend),round(%(args.aggr)s(count)),round(%(args.aggr)s(count))), keyby=.(x,xend)], names(junctions))
}
Expand Down

0 comments on commit 143dbd9

Please sign in to comment.