From 288311ea56ca7f313e3f15053c2d04f841da210a Mon Sep 17 00:00:00 2001 From: Devon Ryan Date: Sat, 2 May 2020 15:45:03 +0200 Subject: [PATCH 1/7] Fix status badge --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 149f174dd..cf0521747 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # deepTools -[![Build Status](https://travis-ci.org/deeptools/deepTools.svg?branch=master)](https://travis-ci.org/deeptools/deepTools) [![Documentation Status](https://readthedocs.org/projects/deeptools/badge/)](http://deeptools.readthedocs.org/) [![PyPI Version](https://img.shields.io/pypi/v/deeptools.svg?style=plastic)](https://pypi.org/project/deepTools/) +[![Build Status](https://dev.azure.com/dpryan79/dpryan79/_apis/build/status/deeptools.deepTools?branchName=master)](https://dev.azure.com/dpryan79/dpryan79/_build/latest?definitionId=1&branchName=master) +[![Documentation Status](https://readthedocs.org/projects/deeptools/badge/)](http://deeptools.readthedocs.org/) [![PyPI Version](https://img.shields.io/pypi/v/deeptools.svg?style=plastic)](https://pypi.org/project/deepTools/) [![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/deeptools/README.html) ## User-friendly tools for exploring deep-sequencing data From 3bb56cc0a2d7b5517d6b155368fe2500bfbb3c9a Mon Sep 17 00:00:00 2001 From: LeilyR Date: Fri, 21 Aug 2020 12:23:52 +0200 Subject: [PATCH 2/7] release 3.5.0 (#990) * Fixes for 3.4.2 * disable azure on OSX * Closes #945 * computeMatricOperation dataRange (#951) * Added dataRange to computeMatricOperation to return min,max,median and 10th and 90th percentile. * fixed pep8 * more pep8 fix * fixed test_sieve of azure tests * one more fix for test_sieve * imported pysam to test_readFiltering.py * updated hash values for test_sieve * fixed galaxy computeMatrixOperation.xml * More fixes for galaxy wrapper * fixed a little typo in bamCompare (#967) * save the output matrix of the plotheatmap in a format to be compatible with running plotheatmap on it again (#968) * Plot profile color map (#971) * Now colors can be set by user for any heatmap in plotProfile. A bug in tick index for plotting heatmap is also fixed. * added a small description * pep8 fix * added sortUsingSamples and clusterUsingSamples to the galaxy wrapper * [WIP] added auto to plotheatmap #908 (#982) * added auto to plotheatmap * fixed lint, added warning message, updated the help for zmin, zmax * galaxy test plotPCA * lower down the delat for potPCA galaxy test * fix #969 (#970) * fix #969 * PEP8 * updated changes.txt * fixed a little bug in parseCommon.py which caused flake8 failure. * [WIP] added auto to plotheatmap #908 (#982) * added auto to plotheatmap * fixed lint, added warning message, updated the help for zmin, zmax * galaxy test plotPCA * lower down the delat for potPCA galaxy test * updated version and changes * removed alpha from plotPCA test * removed compare="sim_size" * fixed plotHeatmap.xml by removing size from the the params and adding anitizer for the 2 new params. * upated change.txt * updated the doc html Co-authored-by: Devon Ryan --- CHANGES.txt | 10 +++++ deeptools/_version.py | 2 +- deeptools/bamCompare.py | 2 +- deeptools/computeGCBias.py | 2 +- deeptools/computeMatrixOperations.py | 29 ++++++++++++++ deeptools/correctGCBias.py | 8 ++-- deeptools/parserCommon.py | 23 +++++------ deeptools/plotHeatmap.py | 29 +++++++++++++- deeptools/plotProfile.py | 17 +++++--- deeptools/test/test_readFiltering.py | 10 +++-- galaxy/wrapper/computeMatrixOperations.xml | 13 +++++- galaxy/wrapper/deepTools_macros.xml | 4 +- galaxy/wrapper/plotHeatmap.xml | 46 ++++++++++++++++------ 13 files changed, 153 insertions(+), 42 deletions(-) mode change 100644 => 100755 deeptools/computeMatrixOperations.py mode change 100644 => 100755 deeptools/correctGCBias.py diff --git a/CHANGES.txt b/CHANGES.txt index ae06baeb6..bc55fc624 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,13 @@ +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) + * Added the `auto` option to the zMin and zMax of plotHeatmap. (issue #908) + * Added `--sortUsingSamples` and `--clusterUsingSamples` to the plotHeatmap galaxy wrapper. (issue #976) + 3.4.3 * Changed iteritems() in estimateEscaleFactor to its python3 compatible items(). diff --git a/deeptools/_version.py b/deeptools/_version.py index e6b2d2c77..a39b0da3c 100755 --- a/deeptools/_version.py +++ b/deeptools/_version.py @@ -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' diff --git a/deeptools/bamCompare.py b/deeptools/bamCompare.py index bbbbe848b..9f19321f9 100644 --- a/deeptools/bamCompare.py +++ b/deeptools/bamCompare.py @@ -254,7 +254,7 @@ def main(args=None): if args.normalizeUsing == 'None': args.normalizeUsing = None # For the sake of sanity if args.scaleFactorsMethod != 'None' and args.normalizeUsing: - sys.exit("`--normalizeUsing {}` is only valid if you also use `--scaleFactorMethod None`! To prevent erroneous output, I will quit now.\n".format(args.normalizeUsing)) + sys.exit("`--normalizeUsing {}` is only valid if you also use `--scaleFactorsMethod None`! To prevent erroneous output, I will quit now.\n".format(args.normalizeUsing)) # Get mapping statistics bam1, mapped1, unmapped1, stats1 = bamHandler.openBam(args.bamfile1, returnStats=True, nThreads=args.numberOfProcessors) diff --git a/deeptools/computeGCBias.py b/deeptools/computeGCBias.py index cc27b88be..d5d9a326d 100644 --- a/deeptools/computeGCBias.py +++ b/deeptools/computeGCBias.py @@ -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') diff --git a/deeptools/computeMatrixOperations.py b/deeptools/computeMatrixOperations.py old mode 100644 new mode 100755 index a67cdd7a2..2212dd1f8 --- a/deeptools/computeMatrixOperations.py +++ b/deeptools/computeMatrixOperations.py @@ -46,6 +46,9 @@ def parse_arguments(): or computeMatrixOperations sort -h +or + computeMatrixOperations dataRange -h + """, epilog='example usages:\n' 'computeMatrixOperations subset -m input.mat.gz -o output.mat.gz --group "group 1" "group 2" --samples "sample 3" "sample 10"\n\n' @@ -126,6 +129,14 @@ def parse_arguments(): help='Sort a matrix file to correspond to the order of entries in the desired input file(s). The groups of regions designated by the files must be present in the order found in the output of computeMatrix (otherwise, use the subset command first). Note that this subcommand can also be used to remove unwanted regions, since regions not present in the input file(s) will be omitted from the output.', usage='Example usage:\n computeMatrixOperations sort -m input.mat.gz -R regions1.bed regions2.bed regions3.gtf -o input.sorted.mat.gz\n\n') + # dataRange + subparsers.add_parser( + 'dataRange', + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + parents=[infoArgs()], + help='Returns the min, max, median, 10th and 90th percentile of the matrix values per sample.', + usage='Example usage:\n computeMatrixOperations dataRange -m input.mat.gz\n\n') + parser.add_argument('--version', action='version', version='%(prog)s {}'.format(__version__)) @@ -300,6 +311,22 @@ def printInfo(matrix): print("\t{0}".format(sample)) +def printDataRange(matrix): + """ + Prints the min, max, median, 10th and 90th percentile of the matrix values per sample. + """ + print("Samples\tMin\tMax\tMedian\t10th\t90th") + for i, sample in enumerate(matrix.matrix.sample_labels): + start = matrix.matrix.sample_boundaries[i] + end = matrix.matrix.sample_boundaries[i + 1] + sample_matrix = matrix.matrix.matrix[..., start:end] + print("{0}\t{1}\t{2}\t{3}\t{4}\t{5}".format(sample, np.amin(sample_matrix), + np.amax(sample_matrix), + np.ma.median(sample_matrix), + np.percentile(sample_matrix, 10), + np.percentile(sample_matrix, 90))) + + def relabelMatrix(matrix, args): """ Relabel the samples and groups in a matrix @@ -771,6 +798,8 @@ def main(args=None): if args.command == 'info': printInfo(hm) + if args.command == 'dataRange': + printDataRange(hm) elif args.command == 'subset': sIdx = getSampleBounds(args, hm) gIdx, gBounds = getGroupBounds(args, hm) diff --git a/deeptools/correctGCBias.py b/deeptools/correctGCBias.py old mode 100644 new mode 100755 index 5ac1ad8b7..d69322483 --- a/deeptools/correctGCBias.py +++ b/deeptools/correctGCBias.py @@ -239,10 +239,10 @@ def writeCorrected_worker(chrNameBam, chrNameBit, start, end, step): try: if debug: endTime = time.time() - print("{}, processing {} ({:.1f} per sec) ") - "reads @ {}:{}-{}".format(multiprocessing.current_process().name, - i, i / (endTime - startTime), - chrNameBit, start, end) + print("{}, processing {} ({:.1f} per sec) " + "reads @ {}:{}-{}".format(multiprocessing.current_process().name, + i, i / (endTime - startTime), + chrNameBit, start, end)) except NameError: pass diff --git a/deeptools/parserCommon.py b/deeptools/parserCommon.py index f0e9fd1b5..ef4f4d074 100755 --- a/deeptools/parserCommon.py +++ b/deeptools/parserCommon.py @@ -358,11 +358,10 @@ def numberOfProcessors(string): "{} is not a valid number of processors".format(string)) except Exception as e: - raise argparse.ArgumentTypeError("the value given is not valid. " + 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 @@ -444,7 +443,7 @@ def heatmapperOutputArgs(args=None, output.add_argument('--outFileNameMatrix', help='If this option is given, then the matrix ' 'of values underlying the heatmap will be saved ' - 'using this name, e.g. MyMatrix.tab.', + 'using this name, e.g. MyMatrix.gz.', metavar='FILE', type=writableFile) @@ -614,9 +613,9 @@ def heatmapperOptionalArgs(mode=['heatmap', 'profile'][0]): optional.add_argument('--sortUsingSamples', help='List of sample numbers (order as in matrix), ' - 'that are used for sorting by --sortUsing, ' - 'no value uses all samples, ' - 'example: --sortUsingSamples 1 3', + 'which are used by --sortUsing for sorting. ' + 'If no value is set, it uses all samples. ' + 'Example: --sortUsingSamples 1 3', type=int, nargs='+') optional.add_argument('--linesAtTickMarks', @@ -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 ' diff --git a/deeptools/plotHeatmap.py b/deeptools/plotHeatmap.py index 0cabe046d..aee0a6280 100644 --- a/deeptools/plotHeatmap.py +++ b/deeptools/plotHeatmap.py @@ -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: @@ -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] @@ -833,7 +860,7 @@ def main(args=None): hm.matrix.computeSilhouette(args.args.hclust) if args.outFileNameMatrix: - hm.save_matrix_values(args.outFileNameMatrix) + hm.save_matrix(args.outFileNameMatrix) if args.outFileSortedRegions: hm.save_BED(args.outFileSortedRegions) diff --git a/deeptools/plotProfile.py b/deeptools/plotProfile.py index 2cad0a32c..e953e4550 100755 --- a/deeptools/plotProfile.py +++ b/deeptools/plotProfile.py @@ -6,6 +6,7 @@ import argparse import numpy as np +from math import ceil import matplotlib matplotlib.use('Agg') matplotlib.rcParams['pdf.fonttype'] = 42 @@ -458,6 +459,13 @@ def plotly_hexbin(self): py.plot(fig, filename=self.out_file_name, auto_open=False) def plot_heatmap(self): + cmap = ['RdYlBu_r'] + if self.color_list is not None: # check the length to be equal to the numebr of plots otherwise multiply it! + cmap = self.color_list + if len(cmap) < self.numplots: + all_colors = cmap + for i in range(ceil(self.numplots / len(cmap))): + cmap.extend(all_colors) matrix_flatten = None if self.y_min == [None]: matrix_flatten = self.hm.matrix.flatten() @@ -479,7 +487,6 @@ def plot_heatmap(self): ax_list = [] # turn off y ticks - for plot in range(self.numplots): labels = [] col = plot % self.plots_per_row @@ -503,9 +510,10 @@ def plot_heatmap(self): if self.per_group: title = self.hm.matrix.group_labels[plot] + tickIdx = plot % self.hm.matrix.get_num_samples() else: title = self.hm.matrix.sample_labels[plot] - + tickIdx = plot ax.set_title(title) mat = [] # when drawing a heatmap (in contrast to drawing lines) for data_idx in range(self.numlines): @@ -526,13 +534,12 @@ def plot_heatmap(self): label = sub_matrix['group'] labels.append(label) mat.append(np.ma.__getattribute__(self.averagetype)(sub_matrix['matrix'], axis=0)) - img = ax.imshow(np.vstack(mat), interpolation='nearest', - cmap='RdYlBu_r', aspect='auto', vmin=localYMin, vmax=localYMax) + cmap=cmap[plot], aspect='auto', vmin=localYMin, vmax=localYMax) self.fig.colorbar(img, cax=cax) totalWidth = np.vstack(mat).shape[1] - xticks, xtickslabel = self.getTicks(plot) + xticks, xtickslabel = self.getTicks(tickIdx) if np.ceil(max(xticks)) != float(totalWidth - 1): tickscale = float(totalWidth) / max(xticks) xticks_use = [x * tickscale for x in xticks] diff --git a/deeptools/test/test_readFiltering.py b/deeptools/test/test_readFiltering.py index ae74df560..65c5a43f3 100644 --- a/deeptools/test/test_readFiltering.py +++ b/deeptools/test/test_readFiltering.py @@ -4,6 +4,8 @@ import os.path from os import unlink import hashlib +import pysam + ROOT = os.path.dirname(os.path.abspath(__file__)) + "/test_data/" BAMFILE_FILTER = ROOT + "test_filtering.bam" @@ -72,12 +74,12 @@ def test_sieve(): 'test_filtering\t5\t193\n'] assert_equal(resp, expected) unlink(outlog) - h = hashlib.md5(open(outfile, "rb").read()).hexdigest() - assert(h == "977bdab227a4dbfa3fc9f27c23a3e0b7") + h = hashlib.md5(pysam.view(outfile).encode('utf-8')).hexdigest() + assert(h == "acbc4443fb0387bfd6c412af9d4fc414") unlink(outfile) - h = hashlib.md5(open(outfiltered, "rb").read()).hexdigest() - assert(h == "762e79b7a2245ff6b2cea4139a1455de") + h1 = hashlib.md5(pysam.view(outfiltered).encode('utf-8')).hexdigest() + assert(h1 == "b90befdd5f073f14acb9a38661f301ad") unlink(outfiltered) diff --git a/galaxy/wrapper/computeMatrixOperations.xml b/galaxy/wrapper/computeMatrixOperations.xml index 21b0d6231..40ebbccf1 100644 --- a/galaxy/wrapper/computeMatrixOperations.xml +++ b/galaxy/wrapper/computeMatrixOperations.xml @@ -71,6 +71,9 @@ -m $submodule.matrixFile -R '#echo "' '".join($files)#' -o $outFileName + #else if $submodule.command == "dataRange": + dataRange + -m $submodule.matrixFile #end if ]]> @@ -85,6 +88,7 @@ + + + + + + @@ -205,7 +215,8 @@ What it does +----------------+--------------------------------------------------------------------------------------------------------------------------+ + sort | Sorts the given file so regions are in the order of occurence in the input BED/GTF file(s). | +----------------+--------------------------------------------------------------------------------------------------------------------------+ - ++ 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. diff --git a/galaxy/wrapper/deepTools_macros.xml b/galaxy/wrapper/deepTools_macros.xml index 6bd2674dc..6cc2547fc 100755 --- a/galaxy/wrapper/deepTools_macros.xml +++ b/galaxy/wrapper/deepTools_macros.xml @@ -1,10 +1,10 @@ --numberOfProcessors "\${GALAXY_SLOTS:-4}" - 3.4.3.0 + 3.5.0.0 - deeptools + deeptools samtools diff --git a/galaxy/wrapper/plotHeatmap.xml b/galaxy/wrapper/plotHeatmap.xml index 9f7b34e94..98ddc1c5b 100644 --- a/galaxy/wrapper/plotHeatmap.xml +++ b/galaxy/wrapper/plotHeatmap.xml @@ -75,9 +75,15 @@ #if str($advancedOpt.yMin).strip() != "": --yMin $advancedOpt.yMin #end if - #if $advancedOpt.yMax: + #if str($advancedOpt.yMax).strip() != "": --yMax $advancedOpt.yMax #end if + #if str($advancedOpt.sortUsingSamples).strip() != "": + --sortUsingSamples $advancedOpt.sortUsingSamples + #end if + #if str($advancedOpt.clusterUsingSamples).strip() != "": + --clusterUsingSamples $advancedOpt.clusterUsingSamples + #end if --xAxisLabel '$advancedOpt.xAxisLabel' --yAxisLabel '$advancedOpt.yAxisLabel' @@ -134,6 +140,15 @@ + + + + + + - - - - - heatmap and colorbar - - - - @@ -214,7 +229,7 @@ - + + + + + + From 7811ae7f642641caddb407971006d7d536091122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gr=C3=BCning?= Date: Fri, 21 Aug 2020 20:40:09 +0200 Subject: [PATCH 3/7] add usegalaxy.eu badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cf0521747..394353d21 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://dev.azure.com/dpryan79/dpryan79/_apis/build/status/deeptools.deepTools?branchName=master)](https://dev.azure.com/dpryan79/dpryan79/_build/latest?definitionId=1&branchName=master) [![Documentation Status](https://readthedocs.org/projects/deeptools/badge/)](http://deeptools.readthedocs.org/) [![PyPI Version](https://img.shields.io/pypi/v/deeptools.svg?style=plastic)](https://pypi.org/project/deepTools/) [![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/deeptools/README.html) +[![European Galaxy server](https://img.shields.io/badge/usegalaxy-.eu-brightgreen?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAASCAYAAABB7B6eAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsTAAALEwEAmpwYAAACC2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25Vbml0PjI8L3RpZmY6UmVzb2x1dGlvblVuaXQ+CiAgICAgICAgIDx0aWZmOkNvbXByZXNzaW9uPjE8L3RpZmY6Q29tcHJlc3Npb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOlBob3RvbWV0cmljSW50ZXJwcmV0YXRpb24+MjwvdGlmZjpQaG90b21ldHJpY0ludGVycHJldGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KD0UqkwAAAn9JREFUOBGlVEuLE0EQruqZiftwDz4QYT1IYM8eFkHFw/4HYX+GB3/B4l/YP+CP8OBNTwpCwFMQXAQPKtnsg5nJZpKdni6/6kzHvAYDFtRUT71f3UwAEbkLch9ogQxcBwRKMfAnM1/CBwgrbxkgPAYqlBOy1jfovlaPsEiWPROZmqmZKKzOYCJb/AbdYLso9/9B6GppBRqCrjSYYaquZq20EUKAzVpjo1FzWRDVrNay6C/HDxT92wXrAVCH3ASqq5VqEtv1WZ13Mdwf8LFyyKECNbgHHAObWhScf4Wnj9CbQpPzWYU3UFoX3qkhlG8AY2BTQt5/EA7qaEPQsgGLWied0A8VKrHAsCC1eJ6EFoUd1v6GoPOaRAtDPViUr/wPzkIFV9AaAZGtYB568VyJfijV+ZBzlVZJ3W7XHB2RESGe4opXIGzRTdjcAupOK09RA6kzr1NTrTj7V1ugM4VgPGWEw+e39CxO6JUw5XhhKihmaDacU2GiR0Ohcc4cZ+Kq3AjlEnEeRSazLs6/9b/kh4eTC+hngE3QQD7Yyclxsrf3cpxsPXn+cFdenF9aqlBXMXaDiEyfyfawBz2RqC/O9WF1ysacOpytlUSoqNrtfbS642+4D4CS9V3xb4u8P/ACI4O810efRu6KsC0QnjHJGaq4IOGUjWTo/YDZDB3xSIxcGyNlWcTucb4T3in/3IaueNrZyX0lGOrWndstOr+w21UlVFokILjJLFhPukbVY8OmwNQ3nZgNJNmKDccusSb4UIe+gtkI+9/bSLJDjqn763f5CQ5TLApmICkqwR0QnUPKZFIUnoozWcQuRbC0Km02knj0tPYx63furGs3x/iPnz83zJDVNtdP3QAAAABJRU5ErkJggg==)](https://usegalaxy.eu/root?tool_id=deeptools_multi_bam_summary) ## User-friendly tools for exploring deep-sequencing data From 920ab5909a47912ac135e3cb8632db59594f0c6e Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 16 Sep 2020 16:17:38 +0200 Subject: [PATCH 4/7] return proper numpy s in plotFingerprint.py (instead of strings) --- deeptools/plotFingerprint.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deeptools/plotFingerprint.py b/deeptools/plotFingerprint.py index f1f118fa4..db7fdac60 100644 --- a/deeptools/plotFingerprint.py +++ b/deeptools/plotFingerprint.py @@ -202,10 +202,10 @@ def getCHANCE(args, idx, mat): """ # Get the index of the reference sample if args.JSDsample not in args.bamfiles: - return ["NA", "NA", "NA"] + return [np.NAN, np.NAN, np.NAN] refIdx = args.bamfiles.index(args.JSDsample) if refIdx == idx: - return ["NA", "NA", "NA"] + return [np.NAN, np.NAN, np.NAN] subMatrix = np.copy(mat[:, [idx, refIdx]]) subMatrix[np.isnan(subMatrix)] = 0 @@ -271,10 +271,10 @@ def getJSD(args, idx, mat): # Get the index of the reference sample if args.JSDsample not in args.bamfiles: - return "NA" + return np.NAN refIdx = args.bamfiles.index(args.JSDsample) if refIdx == idx: - return "NA" + return np.NAN # These will hold the coverage histograms chip = np.zeros(MAXLEN, dtype=np.int) @@ -338,7 +338,7 @@ def signalAndBinDist(x): if abs(sum(PMFinput) - 1) > 0.01 or abs(sum(PMFchip) - 1) > 0.01: sys.stderr.write("Warning: At least one PMF integral is significantly different from 1! The JSD will not be returned") - return "NA" + return np.NAN # Compute the JSD from the PMFs M = (PMFinput + PMFchip) / 2.0 From ee709968c7067f0eaf5019605a8f9d1d95400702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gr=C3=BCning?= Date: Fri, 21 Aug 2020 20:40:09 +0200 Subject: [PATCH 5/7] add usegalaxy.eu badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cf0521747..394353d21 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://dev.azure.com/dpryan79/dpryan79/_apis/build/status/deeptools.deepTools?branchName=master)](https://dev.azure.com/dpryan79/dpryan79/_build/latest?definitionId=1&branchName=master) [![Documentation Status](https://readthedocs.org/projects/deeptools/badge/)](http://deeptools.readthedocs.org/) [![PyPI Version](https://img.shields.io/pypi/v/deeptools.svg?style=plastic)](https://pypi.org/project/deepTools/) [![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/deeptools/README.html) +[![European Galaxy server](https://img.shields.io/badge/usegalaxy-.eu-brightgreen?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAASCAYAAABB7B6eAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsTAAALEwEAmpwYAAACC2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25Vbml0PjI8L3RpZmY6UmVzb2x1dGlvblVuaXQ+CiAgICAgICAgIDx0aWZmOkNvbXByZXNzaW9uPjE8L3RpZmY6Q29tcHJlc3Npb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOlBob3RvbWV0cmljSW50ZXJwcmV0YXRpb24+MjwvdGlmZjpQaG90b21ldHJpY0ludGVycHJldGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KD0UqkwAAAn9JREFUOBGlVEuLE0EQruqZiftwDz4QYT1IYM8eFkHFw/4HYX+GB3/B4l/YP+CP8OBNTwpCwFMQXAQPKtnsg5nJZpKdni6/6kzHvAYDFtRUT71f3UwAEbkLch9ogQxcBwRKMfAnM1/CBwgrbxkgPAYqlBOy1jfovlaPsEiWPROZmqmZKKzOYCJb/AbdYLso9/9B6GppBRqCrjSYYaquZq20EUKAzVpjo1FzWRDVrNay6C/HDxT92wXrAVCH3ASqq5VqEtv1WZ13Mdwf8LFyyKECNbgHHAObWhScf4Wnj9CbQpPzWYU3UFoX3qkhlG8AY2BTQt5/EA7qaEPQsgGLWied0A8VKrHAsCC1eJ6EFoUd1v6GoPOaRAtDPViUr/wPzkIFV9AaAZGtYB568VyJfijV+ZBzlVZJ3W7XHB2RESGe4opXIGzRTdjcAupOK09RA6kzr1NTrTj7V1ugM4VgPGWEw+e39CxO6JUw5XhhKihmaDacU2GiR0Ohcc4cZ+Kq3AjlEnEeRSazLs6/9b/kh4eTC+hngE3QQD7Yyclxsrf3cpxsPXn+cFdenF9aqlBXMXaDiEyfyfawBz2RqC/O9WF1ysacOpytlUSoqNrtfbS642+4D4CS9V3xb4u8P/ACI4O810efRu6KsC0QnjHJGaq4IOGUjWTo/YDZDB3xSIxcGyNlWcTucb4T3in/3IaueNrZyX0lGOrWndstOr+w21UlVFokILjJLFhPukbVY8OmwNQ3nZgNJNmKDccusSb4UIe+gtkI+9/bSLJDjqn763f5CQ5TLApmICkqwR0QnUPKZFIUnoozWcQuRbC0Km02knj0tPYx63furGs3x/iPnz83zJDVNtdP3QAAAABJRU5ErkJggg==)](https://usegalaxy.eu/root?tool_id=deeptools_multi_bam_summary) ## User-friendly tools for exploring deep-sequencing data From d8dec04bbbba16c945988d8e57bba80995f27123 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 16 Sep 2020 16:17:38 +0200 Subject: [PATCH 6/7] return proper numpy s in plotFingerprint.py (instead of strings) --- deeptools/plotFingerprint.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deeptools/plotFingerprint.py b/deeptools/plotFingerprint.py index f1f118fa4..db7fdac60 100644 --- a/deeptools/plotFingerprint.py +++ b/deeptools/plotFingerprint.py @@ -202,10 +202,10 @@ def getCHANCE(args, idx, mat): """ # Get the index of the reference sample if args.JSDsample not in args.bamfiles: - return ["NA", "NA", "NA"] + return [np.NAN, np.NAN, np.NAN] refIdx = args.bamfiles.index(args.JSDsample) if refIdx == idx: - return ["NA", "NA", "NA"] + return [np.NAN, np.NAN, np.NAN] subMatrix = np.copy(mat[:, [idx, refIdx]]) subMatrix[np.isnan(subMatrix)] = 0 @@ -271,10 +271,10 @@ def getJSD(args, idx, mat): # Get the index of the reference sample if args.JSDsample not in args.bamfiles: - return "NA" + return np.NAN refIdx = args.bamfiles.index(args.JSDsample) if refIdx == idx: - return "NA" + return np.NAN # These will hold the coverage histograms chip = np.zeros(MAXLEN, dtype=np.int) @@ -338,7 +338,7 @@ def signalAndBinDist(x): if abs(sum(PMFinput) - 1) > 0.01 or abs(sum(PMFchip) - 1) > 0.01: sys.stderr.write("Warning: At least one PMF integral is significantly different from 1! The JSD will not be returned") - return "NA" + return np.NAN # Compute the JSD from the PMFs M = (PMFinput + PMFchip) / 2.0 From 83afbf7ad1ab79eaf4fbcfac5300108ea0f391d6 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Thu, 17 Sep 2020 17:56:53 +0200 Subject: [PATCH 7/7] update expected plotFingerprint output to nan instead of NA --- .../wrapper/test-data/plotFingerprint_quality_metrics.tabular | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy/wrapper/test-data/plotFingerprint_quality_metrics.tabular b/galaxy/wrapper/test-data/plotFingerprint_quality_metrics.tabular index 1a5bb2d70..6ca501819 100644 --- a/galaxy/wrapper/test-data/plotFingerprint_quality_metrics.tabular +++ b/galaxy/wrapper/test-data/plotFingerprint_quality_metrics.tabular @@ -1,3 +1,3 @@ Sample AUC Synthetic AUC X-intercept Synthetic X-intercept Elbow Point Synthetic Elbow Point JS Distance Synthetic JS Distance % genome enriched diff. enrichment CHANCE divergence -bowtie2 test1.bam 0.00493632029863651 0.481650684757865 0.984443061605476 1.1531044350267195e-24 0.9849408836341008 0.5232688298112538 NA 0.26900449806812143 NA NA NA +bowtie2 test1.bam 0.00493632029863651 0.481650684757865 0.984443061605476 1.1531044350267195e-24 0.9849408836341008 0.5232688298112538 nan 0.26900449806812143 nan nan nan bowtie2 test1.bam 0.00493632029863651 0.481650684757865 0.984443061605476 1.1531044350267195e-24 0.9849408836341008 0.5232688298112538 0.0 0.26900449806812143 0 0 0