Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
511 changes: 0 additions & 511 deletions pixi.lock

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions pydeeptools/deeptools/bamPEFragmentSize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@

import argparse
import sys

import matplotlib
import numpy as np

matplotlib.use("Agg")
matplotlib.rcParams["pdf.fonttype"] = 42
matplotlib.rcParams["svg.fonttype"] = "none"
from deeptools import matplotlib_defaults
from importlib.metadata import version

import matplotlib.pyplot as plt

from deeptools.getFragmentAndReadSize import get_read_and_fragment_length

# own tools
Expand Down
8 changes: 2 additions & 6 deletions pydeeptools/deeptools/correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import numpy as np
import scipy.cluster.hierarchy as sch
import scipy.stats
import matplotlib as mpl
mpl.use('Agg')
mpl.rcParams['pdf.fonttype'] = 42
mpl.rcParams['svg.fonttype'] = 'none'
from deeptools import matplotlib_defaults
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.ticker
Expand Down Expand Up @@ -246,7 +243,7 @@ def plot_correlation(self, plot_filename, plot_title='', vmax=None,
font_size = 5
else:
font_size = int(14 - 0.25 * num_rows)
mpl.rcParams.update({'font.size': font_size})
matplotlib.rcParams.update({'font.size': font_size})
# set the minimum and maximum values
if vmax is None:
vmax = 1
Expand Down Expand Up @@ -348,7 +345,6 @@ def plot_scatter(self, plot_filename, plot_title='', image_format=None, log1p=Fa
grids = gridspec.GridSpec(num_samples, num_samples)
grids.update(wspace=0, hspace=0)
fig = plt.figure(figsize=(2 * num_samples, 2 * num_samples))
plt.rcParams['font.size'] = 8.0
plt.suptitle(plot_title)
if log1p is True:
self.matrix = np.log1p(self.matrix)
Expand Down
8 changes: 2 additions & 6 deletions pydeeptools/deeptools/correlation_heatmap.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
from matplotlib import use as mplt_use
mplt_use('Agg')
from deeptools import matplotlib_defaults
from deeptools import cm # noqa: F401
import matplotlib.pyplot as plt
import numpy as np
import scipy.cluster.hierarchy as sch
from matplotlib import rcParams
import matplotlib.colors as pltcolors
import copy

rcParams['pdf.fonttype'] = 42
rcParams['svg.fonttype'] = 'none'
old_settings = np.seterr(all='ignore')


Expand All @@ -26,7 +22,7 @@ def plot_correlation(corr_matrix, labels, plotFileName, vmax=None,
font_size = 5
else:
font_size = int(14 - 0.25 * num_rows)
rcParams.update({'font.size': font_size})
matplotlib.rcParams.update({'font.size': font_size})
# set the minimum and maximum values
if vmax is None:
vmax = 1
Expand Down
5 changes: 1 addition & 4 deletions pydeeptools/deeptools/heatmapper_utilities.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import numpy as np
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['svg.fonttype'] = 'none'
from deeptools import matplotlib_defaults
import matplotlib.colors as pltcolors
import textwrap

Expand Down
22 changes: 22 additions & 0 deletions pydeeptools/deeptools/matplotlib_defaults.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import matplotlib

# Backend should be set before importing pyplot
matplotlib.use("Agg")

# Central matplotlib configuration
matplotlib.rcParams.update({

# Output compatibility
"pdf.fonttype": 42,
"ps.fonttype": 42,
"svg.fonttype": "none",

# Fonts
"font.size": 8.0,

# Figure defaults
"figure.dpi": 100,
"savefig.dpi": 200,
})


5 changes: 1 addition & 4 deletions pydeeptools/deeptools/plotCorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import sys
import argparse
import numpy as np
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['svg.fonttype'] = 'none'
from deeptools import matplotlib_defaults
import matplotlib.pyplot as plt
from importlib.metadata import version
from deeptools.correlation import Correlation
Expand Down
6 changes: 1 addition & 5 deletions pydeeptools/deeptools/plotCoverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
import sys
import argparse
import numpy as np

import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['svg.fonttype'] = 'none'
from deeptools import matplotlib_defaults
import matplotlib.pyplot as plt
from importlib.metadata import version
import deeptools.countReadsPerBin as countR
Expand Down
5 changes: 1 addition & 4 deletions pydeeptools/deeptools/plotEnrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import sys
import argparse
import numpy as np
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['svg.fonttype'] = 'none'
from deeptools import matplotlib_defaults
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec

Expand Down
5 changes: 1 addition & 4 deletions pydeeptools/deeptools/plotFingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import sys
import argparse
import numpy as np
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['svg.fonttype'] = 'none'
from deeptools import matplotlib_defaults
import matplotlib.pyplot as plt
from scipy import interpolate
from scipy.stats import poisson
Expand Down
7 changes: 3 additions & 4 deletions pydeeptools/deeptools/plotHeatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
from collections import OrderedDict
import numpy as np
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['svg.fonttype'] = 'none'
from deeptools import matplotlib_defaults
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
import matplotlib.gridspec as gridspec
Expand Down Expand Up @@ -290,8 +288,9 @@ def plotMatrix(hm, outFileName,
yMin = [yMin]
if not isinstance(yMax, list):
yMax = [yMax]

plt.rcParams['font.size'] = matplotlib.rcParams['font.size']

plt.rcParams['font.size'] = 8.0
fontP = FontProperties()

showSummaryPlot = False
Expand Down
5 changes: 1 addition & 4 deletions pydeeptools/deeptools/plotPCA.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

import sys
import argparse
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['svg.fonttype'] = 'none'
from deeptools import matplotlib_defaults
from importlib.metadata import version
from deeptools.correlation import Correlation
from deeptools.parserCommon import writableFile, expand_list
Expand Down
6 changes: 1 addition & 5 deletions pydeeptools/deeptools/plotProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import argparse
import numpy as np
from math import ceil
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['svg.fonttype'] = 'none'
from deeptools import matplotlib_defaults
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
from matplotlib import colors as pltcolors
Expand Down Expand Up @@ -178,7 +175,6 @@ def __init__(self, hm, out_file_name,
cols = self.numplots
self.grids = gridspec.GridSpec(rows, cols)

plt.rcParams['font.size'] = 8.0
self.font_p = FontProperties()
self.font_p.set_size('small')

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pydeeptools/deeptools/test/test_data/plotCorrelation_result1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pydeeptools/deeptools/test/test_data/plotCorrelation_result2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pydeeptools/deeptools/test/test_plotPCA/test_plotPCA_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions pydeeptools/deeptools/test/test_plotPCA/test_plotPCA_default.tsv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Component wt1 wt2 wt3 kd1 kd2 kd3 Eigenvalue
1 -1.9593953629718786 -0.05992632052266235 0.01551443898050737 0.36087262695399747 -0.06417725736658209 0.012713770441420403 5.807692278755936
2 -3.359410695125286 0.14539309680293142 -0.13474864281257853 -0.01241116566407577 -0.12363598259527717 -0.060663076611993313 0.07423028883557825
3 -2.335822964750958 -0.09987722598713865 -0.034135419740642575 -0.07165342296216214 0.051703858136008 0.13732570368291072 0.04897177773493676
4 -0.3078978392240127 -0.004185214180292649 -0.013424388619809194 0.05146245577652413 -0.0794287737098722 0.07458644503209262 0.03680941552538939
5 -1.280108686154136 0.07795301634249859 -0.047687205636145584 -0.023214274278218 -0.03240567700055615 0.0742066588868442 0.026706723301448194
6 -3.1274153845376063 -0.17202014078313513 0.08493798982333466 0.014293535309782638 0.018508562924869645 0.1575339674343244 0.017613563942900697
1 -1.9593953629718786 -0.0599263205226625 0.015514438980507314 0.3608726269539977 -0.06417725736658203 0.012713770441420292 5.807692278755936
2 -3.359410695125286 0.1453930968029311 -0.13474864281257853 -0.012411165664075682 -0.12363598259527717 -0.060663076611993313 0.07423028883557825
3 -2.335822964750958 -0.0998772259871388 -0.03413541974064263 -0.07165342296216205 0.05170385813600817 0.13732570368291072 0.04897177773493676
4 -0.3078978392240127 -0.004185214180292667 -0.013424388619809201 0.051462455776524134 -0.0794287737098722 0.07458644503209262 0.03680941552538939
5 -1.280108686154136 0.0779530163424985 -0.04768720563614561 -0.023214274278217935 -0.0324056770005561 0.0742066588868442 0.026706723301448194
6 -3.1274153845376063 -0.17202014078313563 0.08493798982333454 0.014293535309782737 0.01850856292486998 0.1575339674343244 0.017613563942900697
Binary file modified pydeeptools/deeptools/test/test_plotProfile/plotProfile_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading