Skip to content

Commit

Permalink
Merge pull request #1018 from deeptools/fix_1013
Browse files Browse the repository at this point in the history
  • Loading branch information
LeilyR authored Jan 20, 2021
2 parents 57e61f5 + 1567748 commit d560650
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .planemo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ else
fi

planemo lint ${wrappers}
planemo test --no_dependency_resolution --galaxy_branch release_18.05 --install_galaxy ${wrappers} 2>&1 | grep -v -e "^galaxy" | grep -v -e "^requests"
planemo test --no_dependency_resolution --galaxy_branch release_20.09 --install_galaxy ${wrappers} 2>&1 | grep -v -e "^galaxy" | grep -v -e "^requests"
test ${PIPESTATUS[0]} -eq 0
2 changes: 1 addition & 1 deletion deeptools/bamPEFragmentSize.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def main(args=None):

if args.plotFileFormat == 'plotly':
fig = go.Figure()
fig['data'] = data
fig.add_traces(data)
fig['layout']['yaxis1'].update(title='Frequency')
fig['layout']['xaxis1'].update(title='Fragment Length')
fig['layout'].update(title=args.plotTitle)
Expand Down
2 changes: 1 addition & 1 deletion deeptools/computeGCBias.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def plotlyGCbias(file_name, frequencies, reads_per_gc, region_size):
x = np.linspace(0, 1, frequencies.shape[0])
trace = go.Scatter(x=x, y=np.log2(frequencies[:, 2]), xaxis='x2', yaxis='y2', showlegend=False, line=dict(color='rgb(107,174,214)'))
data.append(trace)
fig['data'] = data
fig.add_traces(data)
fig['layout']['annotations'] = annos
py.plot(fig, filename=file_name, auto_open=False)

Expand Down
5 changes: 2 additions & 3 deletions deeptools/computeMatrixOperations.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def parse_arguments():
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
parents=[infoArgs(), relabelArgs()],
help="Change sample and/or group label information",
usage='An example usage is:\n computeMatrixOperations relabel -m input.mat.gz -o output.mat.gz --samples "sample 1" "sample 2"\n\n')
usage='An example usage is:\n computeMatrixOperations relabel -m input.mat.gz -o output.mat.gz --sampleLabels "sample 1" "sample 2"\n\n')

# subset
subparsers.add_parser(
Expand Down Expand Up @@ -795,10 +795,9 @@ def main(args=None):
hm = heatmapper.heatmapper()
if not isinstance(args.matrixFile, list):
hm.read_matrix_file(args.matrixFile)

if args.command == 'info':
printInfo(hm)
if args.command == 'dataRange':
elif args.command == 'dataRange':
printDataRange(hm)
elif args.command == 'subset':
sIdx = getSampleBounds(args, hm)
Expand Down
4 changes: 2 additions & 2 deletions deeptools/correlation.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def plotly_scatter(self, plot_filename, corr_matrix, plot_title='', minXVal=None
data[-1]['colorbar'].update(title="log10(instances per bin)", titleside="right")
data[-1].update(showscale=True)

fig['data'] = data
fig.add_traces(data)
fig['layout'].update(title=plot_title, showlegend=False, annotations=annos)

offline.plot(fig, filename=plot_filename, auto_open=False)
Expand Down Expand Up @@ -589,7 +589,7 @@ def plotly_pca(self, plotFile, Wt, pvar, PCs, eigenvalues, cols, plotTitle):
annos.append({'yanchor': 'bottom', 'xref': 'paper', 'xanchor': 'center', 'yref': 'paper', 'text': 'PCA', 'y': 1.0, 'x': 0.25, 'font': {'size': 16}, 'showarrow': False})
annos.append({'yanchor': 'bottom', 'xref': 'paper', 'xanchor': 'center', 'yref': 'paper', 'text': 'Scree plot', 'y': 1.0, 'x': 0.75, 'font': {'size': 16}, 'showarrow': False})

fig['data'] = data
fig.add_traces(data)
fig['layout']['annotations'] = annos
offline.plot(fig, filename=plotFile, auto_open=False)

Expand Down
2 changes: 1 addition & 1 deletion deeptools/plotCoverage.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def main(args=None):
# Don't clip plots
y_max = max(y_max)
if args.plotFileFormat == "plotly":
fig['data'] = data
fig.add_traces(data)
fig['layout']['yaxis1'].update(range=[0.0, min(1, y_max + (y_max * 0.10))])
fig['layout']['yaxis2'].update(range=[0.0, 1.0])
py.plot(fig, filename=args.plotFile, auto_open=False)
Expand Down
2 changes: 1 addition & 1 deletion deeptools/plotEnrichment.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def plotEnrichment(args, featureCounts, totalCounts, features):
ax.set_ylim(0.0, 100.0)

if args.plotFileFormat == 'plotly':
fig['data'] = data
fig.add_traces(data)
py.plot(fig, filename=args.plotFile, auto_open=False)
# colors
else:
Expand Down
2 changes: 1 addition & 1 deletion deeptools/plotFingerprint.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def main(args=None):

if args.plotFileFormat == 'plotly':
fig = go.Figure()
fig['data'] = data
fig.add_traces(data)
fig['layout'].update(title=args.plotTitle)
fig['layout']['xaxis1'].update(title="rank")
fig['layout']['yaxis1'].update(title="fraction w.r.t bin with highest coverage")
Expand Down
2 changes: 1 addition & 1 deletion deeptools/plotHeatmap.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def plotlyMatrix(hm,
trace.update(zmin=zMinUse, zmax=zMaxUse, colorscale=convertCmap(cmap[0], vmin=zMinUse, vmax=zMaxUse))

dataSummary.extend(dataHeatmap)
fig['data'] = dataSummary
fig.add_traces(dataSummary)
fig['layout']['annotations'] = annos
py.plot(fig, filename=outFilename, auto_open=False)

Expand Down
11 changes: 6 additions & 5 deletions deeptools/plotProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def plotly_hexbin(self):
for trace in data:
trace.update(zmin=vmin, zmax=vmax)

fig['data'] = data
fig.add_traces(data)
fig['layout']['annotations'] = annos
py.plot(fig, filename=self.out_file_name, auto_open=False)

Expand Down Expand Up @@ -668,7 +668,7 @@ def plotly_heatmap(self):
zmaxUse = self.y_max[i % len(self.y_max)]
trace.update(zmin=zminUse, zmax=zmaxUse)

fig['data'] = data
fig.add_traces(data)
fig['layout']['annotations'] = annos
py.plot(fig, filename=self.out_file_name, auto_open=False)

Expand Down Expand Up @@ -828,15 +828,16 @@ def plotly_profile(self):
yMin = None
yMax = None
for i in range(self.numplots):
row = rows - i / self.plots_per_row - 1
row = np.floor(i / self.plots_per_row)
# row = rows - i / self.plots_per_row - 1
col = i % self.plots_per_row
xanchor = 'x{}'.format(i + 1)
yanchor = 'y{}'.format(i + 1)
base = row * (domainHeight + bufferHeight)
domain = [base, base + domainHeight]
titleY = base + domainHeight
base = col * (domainWidth + bufferWidth)
fig['layout']['yaxis{}'.format(i + 1)] = {'domain': domain, 'title': self.y_axis_label, 'anchor': xanchor, 'autorange': False}
base = col * (domainWidth + bufferWidth)
domain = [base, base + domainWidth]
titleX = base + 0.5 * domainWidth
fig['layout']['xaxis{}'.format(i + 1)] = {'domain': domain, 'anchor': yanchor}
Expand Down Expand Up @@ -900,7 +901,7 @@ def plotly_profile(self):
yRange[1] = self.y_max[i % len(self.y_max)]
fig['layout'][yaxis].update(range=yRange)

fig['data'] = data
fig.add_traces(data)
fig['layout']['annotations'] = annos
py.plot(fig, filename=self.out_file_name, auto_open=False)

Expand Down
2 changes: 1 addition & 1 deletion deeptools/utilities.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def convertCmap(c, vmin=0, vmax=1):
h = 1.0 / 254
colorScale = []
for k in range(255):
C = map(np.uint8, np.array(cmap(k * h)[:3]) * 255)
C = list(map(np.uint8, np.array(cmap(k * h)[:3]) * 255))
colorScale.append([k * h, 'rgb' + str((C[0], C[1], C[2]))])

return colorScale
Expand Down
3 changes: 2 additions & 1 deletion galaxy/wrapper/computeMatrixOperations.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#else if $submodule.command == "dataRange":
dataRange
-m $submodule.matrixFile
> $outFileTxt
#end if
]]>
</command>
Expand Down Expand Up @@ -159,7 +160,6 @@
<when value="dataRange">
<param argument="matrixFile" format="deeptools_compute_matrix_archive" type="data"
label="Matrix file from the computeMatrix tool" help=""/>
</param>
</when>
</conditional>
</inputs>
Expand Down Expand Up @@ -218,6 +218,7 @@ What it does
+ dataRange | Returns the min, max, median, 10th and 90th percentile of the matrix values per sample. |
+----------------+--------------------------------------------------------------------------------------------------------------------------+
These operations are useful when you want to run computeMatrix on multiple files (thereby keeping all of the values together) and later exclude regions/samples or add new ones. Another common use would be if you require the output of computeMatrix to be sorted to match the order of regions in the input file.
-----
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ pysam>=0.14.0
py2bit>=0.2.0
numpydoc>=0.5
pyBigWig>=0.2.1
plotly>=2.0.0
plotly>=4.9
deeptoolsintervals>=0.1.8
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def openREADME():
"numpydoc >= 0.5",
"pyBigWig >= 0.2.1",
"py2bit >= 0.2.0",
"plotly >= 2.0.0",
"plotly >= 4.9",
"deeptoolsintervals >= 0.1.8"
],
zip_safe=True,
Expand Down

0 comments on commit d560650

Please sign in to comment.