File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -2151,7 +2151,7 @@ def reg_str_to_list(regstr):
2151
2151
2152
2152
def mapbp (args ):
2153
2153
"""
2154
- Outputs mapping positions for the given reference genome coordinate
2154
+ Outputs mapping positions for the given reference genome coordinate
2155
2155
"""
2156
2156
import pysam
2157
2157
from collections import defaultdict , deque
Original file line number Diff line number Diff line change @@ -533,4 +533,17 @@ def inlineplotsr(ax, args):
533
533
# sys.exit('Error in saving the figure. Try using a different backend.' + '\n' + e.with_traceback())
534
534
# logger.info('Finished')
535
535
536
- return ax
536
+ return ax
537
+
538
+
539
+ def loghist (x , ax , bins = 10 ):
540
+ """
541
+ Generate the plot on a logarithmic histogram
542
+ """
543
+ import numpy as np
544
+ hist , bins = np .histogram (x , bins = bins )
545
+ logbins = np .logspace (np .log10 (bins [0 ]), np .log10 (bins [- 1 ]), len (bins ))
546
+ ax .hist (x , bins = logbins )
547
+ ax .set_xscale ('log' )
548
+ return ax
549
+ # END
You can’t perform that action at this time.
0 commit comments