8000 fix #969 by dpryan79 · Pull Request #970 · deeptools/deepTools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix #969 #970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Aug 10, 2020
Merged
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
9 changes: 9 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
3.5.0

* Fixed a small issue in computeGCBias (issue #969)
* Added dataRange to computeMatricOperation to return min,max,median and 10th and 90th percentile.
* Fixed a small typo in bamCompare. (issue #966)
* Save the output matrix of the plotheatmap in a format to be compatible with running plotheatmap on it again.(issue #953)
* Different colors can now be set by user for plotProfile --plotType heatmap (issue #956)
* `auto` option now has been added to the zMin and zMax of plotHeatmap. (issue #908)

3.4.3

* Changed iteritems() in estimateEscaleFactor to its python3 compatible items().
Expand Down
2 changes: 1 addition & 1 deletion deeptools/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# This file is originally generated from Git information by running 'setup.py
# version'. Distribution tarballs contain a pre-generated copy of this file.

__version__ = '3.4.3'
__version__ = '3.5.0'
2 changes: 1 addition & 1 deletion deeptools/computeGCBias.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def plotGCbias(file_name, frequencies, reads_per_gc, region_size, image_format=N
plt.setp(bp['whiskers'], color='black', linestyle='dashed')
plt.setp(bp['fliers'], marker='None')
# get the whisker that spands the most
y_max = max([x.get_data()[1][1] for x in bp['whiskers']])
y_max = np.nanmax([x.get_data()[1][1] for x in bp['whiskers']])
ax1.set_ylim(0 - (y_max * 0.05), y_max * 1.05)
ax1.set_ylabel('Number of reads')
ax1.set_xlabel('GC fraction')
Expand Down
13 changes: 7 additions & 6 deletions deeptools/parserCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,7 @@ def numberOfProcessors(string):
raise argparse.ArgumentTypeError("the given value {} is not valid. "
"Error message: {}\nThe number of "
"available processors in your "
"computer is {}.".format(string, e,
availProc))
"computer is {}.".format(string, e, availProc))

if numberOfProcessors > availProc:
numberOfProcessors = availProc
Expand Down Expand Up @@ -704,15 +703,17 @@ def heatmapperOptionalArgs(mode=['heatmap', 'profile'][0]):
default=None,
help='Minimum value for the heatmap intensities. Multiple values, separated by '
'spaces can be set for each heatmap. If the number of zMin values is smaller than'
'the number of heatmaps the values are recycled.',
type=float,
'the number of heatmaps the values are recycled. If a value is set to "auto", it will be set '
' to the first percentile of the matrix values.',
type=str,
nargs='+')
optional.add_argument('--zMax', '-max',
default=None,
help='Maximum value for the heatmap intensities. Multiple values, separated by '
'spaces can be set for each heatmap. If the number of zMax values is smaller than'
'the number of heatmaps the values are recycled.',
type=float,
'the number of heatmaps the values are recycled. If a value is set to "auto", it will be set '
' to the 98th percentile of the matrix values.',
type=str,
nargs='+')
optional.add_argument('--heatmapHeight',
help='Plot height in cm. The default for the heatmap '
Expand Down
27 changes: 27 additions & 0 deletions deeptools/plotHeatmap.py
Original file line number Diff line FE0F number Diff line change
Expand Up @@ -412,6 +412,16 @@ def plotMatrix(hm, outFileName,
zMin = [None]
else:
zMin = [zMin] # convert to list to support multiple entries
elif 'auto' in zMin:
matrix_flatten = hm.matrix.flatten()
auto_min = np.percentile(matrix_flatten, 1.0)
if np.isnan(auto_min):
auto_min = None
new_mins = [float(x) if x != 'auto' else auto_min for x in zMin]
zMin = new_mins
else:
new_mins = [float(x) for x in zMin]
zMin = new_mins

if zMax is None:
if matrix_flatten is None:
Expand All @@ -422,6 +432,23 @@ def plotMatrix(hm, outFileName,
zMax = [None]
else:
zMax = [zMax]
elif 'auto' in zMax:
matrix_flatten = hm.matrix.flatten()
auto_max = np.percentile(matrix_flatten, 98.0)
if np.isnan(auto_max):
auto_max = None
new_maxs = [float(x) if x != 'auto' else auto_max for x in zMax]
zMax = new_maxs
else:
new_maxs = [float(x) for x in zMax]
zMax = new_maxs
if (len(zMin) > 1) & (len(zMax) > 1):
for index, value in enumerate(zMax):
if value <= zMin[index]:
sys.stderr.write("Warnirng: In bigwig {}, the given zmin ({}) is larger than "
"or equal to the given zmax ({}). Thus, it has been set "
"to None. \n".format(index + 1, zMin[index], value))
zMin[index] = None

if yMin is None:
yMin = [None]
Expand Down
4 changes: 2 additions & 2 deletions galaxy/wrapper/deepTools_macros.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<macros>

<token name="@THREADS@">--numberOfProcessors "\${GALAXY_SLOTS:-4}"</token>
<token name="@WRAPPER_VERSION@">3.4.3.0</token>
<token name="@WRAPPER_VERSION@">3.5.0.0</token>
<xml name="requirements">
<requirements>
<requirement type="package" version="3.4.3">deeptools</requirement>
<requirement type="package" version="3.5.0">deeptools</requirement>
<requirement type="package" version="1.9">samtools</requirement>
</requirements>
<expand macro="stdio" />
Expand Down
0