Skip to content

Commit dd6be5d

Browse files
committed
Merge branch '4.0.0' of github.com:deeptools/deepTools into filtering
2 parents b6b5846 + 735aca8 commit dd6be5d

32 files changed

+630
-2243
lines changed

docs/content/advanced_features.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ Some of the features of deepTools are not self-explanatory. Below, we provide li
99
* :doc:`feature/unscaled_regions`
1010
* :doc:`feature/read_offsets`
1111
* :doc:`feature/plotFingerprint_QC_metrics`
12-
* :doc:`feature/plotly`
1312
* :doc:`feature/effectiveGenomeSize`

docs/content/changelog.rst

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,50 @@
11
Changes in deepTools4.0
22
=======================
33

4-
# Changes
5-
6-
## bamCoverage
7-
8-
- --no_collapse flag to not merge bins with equal coverage values together.
9-
10-
## computeMatrix
11-
12-
- --sortRegions 'no' option no longer exists
13-
- Sorting ascend / descend no longer has subsorting by position.
14-
- --quiet / -q option no longer exists.
15-
- bed files in computeMatrix no longer support '#' to define groups.
16-
- 'chromosome matching' i.e. chr1 <-> 1, chrMT <-> MT is no longer performed.
17-
18-
## normalization
19-
20-
- Exactscaling is no longer an option, it's always performed.
21-
22-
## alignmentSieve
23-
24-
- options label, smartLabels, genomeChunkLength are removed.
25-
- ignoreDuplicates is removed, and (if wanted) should be set by the SamFlagExclude setting.
26-
27-
# Testing
4+
Plotting
5+
--------
6+
7+
* Plots in general:
8+
- Removed Plotly for all graphics.
9+
- Optional ggplot theme (--ggplot).
10+
- Using standard Matplotlib color scheme.
11+
12+
* plotHeatmap and plotProfile:
13+
- Adjusted the legend position to be outside the plot area, preventing overlap with the subplots.
14+
- Split and wrapped longer sample names to avoid overlap with other labels.
15+
- Eliminated overlapping x and y-axis ticks for improved readability.
16+
- Removed the file extensions from input files when using them as labels in the plots.
17+
18+
* plotEnrichment:
19+
- Added spacing between bars in bar plots for improved visual clarity.
20+
- Retained only sample names, when provided with the complete file path and name.
21+
22+
* plotPCA:
23+
- Using scikit-learn for computing PCA.
24+
- New option to add labels for each point (--addLabels).
25+
- Expander for colors and markers, for example ``--colors red:3 blue:3`` is expanded as ``[red, red, red, blue, blue, blue]``.
26+
- Scree plot is showing lines for individual and accumulated variation.
27+
- Points are by default rainbow colored circles.
28+
29+
Core
30+
----
31+
32+
* bamCoverage
33+
- --no_collapse flag to not merge bins with equal coverage values together.
2834

29-
## computeMatrix
30-
- referencePoint: TSS, center, TES
31-
- sortRegions: descend, ascend, keep
32-
- sortUsing: mean, median, max, min, sum, region_length
33-
- averageTypeBins: mean, median, min, max ,std, sum
34-
- skipZeros
35-
- duplicate renaming _r1, _r2, ...
36-
- GTF, BED3, BED6, BED12, mixedBED (?)
37-
- scaleRegions, un5, un3, regionbodylength, metagene
38-
39-
## alignmentSieve
40-
41-
- unmapped reads to unfiltered_out
42-
43-
## multiBamSummary
44-
- npz output has labels encoded as u8s, no longer strings.
45-
46-
# Todo
47-
48-
- AlignmentSieve: Shift, Bed, Optimization.
49-
- bamCoverage / bamCompare: filtering, extend.
35+
* computeMatrix
36+
- --sortRegions 'no' option no longer exists
37+
- Sorting ascend / descend no longer has subsorting by position.
38+
- --quiet / -q option no longer exists.
39+
- bed files in computeMatrix no longer support '#' to define groups.
40+
- 'chromosome matching' i.e. chr1 <-> 1, chrMT <-> MT is no longer performed.
41+
42+
* normalization
43+
- Exactscaling is no longer an option, it's always performed.
44+
45+
* alignmentSieve
46+
- options label, smartLabels, genomeChunkLength are removed.
47+
- ignoreDuplicates is removed, and (if wanted) should be set by the SamFlagExclude setting.
48+
49+
Testing
50+
-------

pydeeptools/deeptools/bamPEFragmentSize.py

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,13 @@
99
matplotlib.use('Agg')
1010
matplotlib.rcParams['pdf.fonttype'] = 42
1111
matplotlib.rcParams['svg.fonttype'] = 'none'
12-
from deeptools import cm # noqa: F401
1312
import matplotlib.pyplot as plt
1413

15-
import plotly.offline as py
16-
import plotly.graph_objs as go
17-
1814
# own tools
1915
from deeptools.parserCommon import writableFile
2016
from deeptools.getFragmentAndReadSize import get_read_and_fragment_length
2117
from importlib.metadata import version
2218

23-
2419
def parse_arguments():
2520
parser = argparse.ArgumentParser(
2621
description='This tool calculates the fragment sizes for read pairs given a BAM file from paired-end sequencing.'
@@ -51,8 +46,11 @@ def parse_arguments():
5146
'ending. The available options are: png, '
5247
'eps, pdf, svg and plotly.',
5348
default=None,
54-
choices=['png', 'pdf', 'svg', 'eps', 'plotly'])
55-
49+
choices=['png', 'pdf', 'svg', 'eps'])
50+
parser.add_argument('--ggplot',
51+
help='Use ggplot theme for figures',
52+
action='store_true')
53+
5654
parser.add_argument('--numberOfProcessors', '-p',
5755
help='Number of processors to use. The default is '
5856
'to use 1. (Default: %(default)s)',
@@ -311,6 +309,9 @@ def main(args=None):
311309
if args.table is not None:
312310
printTable(args, fraglengths, readlengths)
313311

312+
if args.ggplot:
313+
plt.style.use('ggplot')
314+
314315
if args.histogram:
315316
if args.samplesLabel:
316317
if len(args.bamfiles) != len(args.samplesLabel):
@@ -331,38 +332,18 @@ def main(args=None):
331332
else:
332333
maxVal = d['mean'] * 2
333334

334-
if args.plotFileFormat == 'plotly':
335-
trace = go.Histogram(x=d['lengths'],
336-
histnorm='probability',
337-
opacity=0.5,
338-
name=labels[i],
339-
nbinsx=100,
340-
xbins=dict(start=d['min'], end=maxVal))
341-
data.append(trace)
342-
else:
343-
plt.bar(d['lengths'][1][:-1], height=d['lengths'][0],
344-
width=d['lengths'][1][1:] - d['lengths'][1][:-1],
345-
align='edge', log=args.logScale,
346-
alpha=0.5, label=labels[i])
335+
plt.bar(d['lengths'][1][:-1], height=d['lengths'][0],
336+
width=d['lengths'][1][1:] - d['lengths'][1][:-1],
337+
align='edge', log=args.logScale,
338+
alpha=0.5, label=labels[i])
347339
i += 1
348340

349-
if args.plotFileFormat == 'plotly':
350-
fig = go.Figure()
351-
fig.add_traces(data)
352-
fig['layout']['yaxis1'].update(title='Frequency')
353-
fig['layout']['xaxis1'].update(title='Fragment Length')
354-
fig['layout'].update(title=args.plotTitle)
355-
fig['layout'].update(showlegend=True)
356-
if args.logScale:
357-
fig['layout']['yaxis1'].update(type='log')
358-
py.plot(fig, filename=args.histogram, auto_open=False)
359-
else:
360-
plt.xlabel('Fragment Length')
361-
plt.ylabel('Frequency')
362-
plt.legend(loc='upper right')
363-
plt.title(args.plotTitle)
364-
plt.savefig(args.histogram, bbox_inches=0, format=args.plotFileFormat)
365-
plt.close()
341+
plt.xlabel('Fragment Length')
342+
plt.ylabel('Frequency')
343+
plt.legend(loc='upper right')
344+
plt.title(args.plotTitle)
345+
plt.savefig(args.histogram, bbox_inches=0, format=args.plotFileFormat)
346+
plt.close()
366347

367348

368349
if __name__ == "__main__":

0 commit comments

Comments
 (0)