From d89bb848a685542e06eae40c33b07dcb11a4fd47 Mon Sep 17 00:00:00 2001 From: Ye Chang Date: Thu, 19 Jan 2023 02:45:10 -0600 Subject: [PATCH 1/4] fix numpy --- deeptools/heatmapper.py | 6 +++--- deeptools/sumCoveragePerBin.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deeptools/heatmapper.py b/deeptools/heatmapper.py index 6a95ba0052..1a2e5f03c6 100644 --- a/deeptools/heatmapper.py +++ b/deeptools/heatmapper.py @@ -777,7 +777,7 @@ def read_matrix_file(self, matrix_file): # split the line into bed interval and matrix values region = line.split('\t') chrom, start, end, name, score, strand = region[0:6] - matrix_row = np.ma.masked_invalid(np.fromiter(region[6:], np.float)) + matrix_row = np.ma.masked_invalid(np.fromiter(region[6:], np.float64)) matrix_rows.append(matrix_row) starts = start.split(",") ends = end.split(",") @@ -852,7 +852,7 @@ def save_matrix(self, file_name): # join np_array values # keeping nans while converting them to strings if not np.ma.is_masked(score_list[idx]): - np.float(score_list[idx]) + np.float64(score_list[idx]) matrix_values = "\t".join( np.char.mod('%f', self.matrix.matrix[idx, :])) starts = ["{0}".format(x[0]) for x in region[1]] @@ -1345,7 +1345,7 @@ def removeempty(self): to_keep = [] score_list = np.ma.masked_invalid(np.mean(self.matrix, axis=1)) for idx, region in enumerate(self.regions): - if np.ma.is_masked(score_list[idx]) or np.float(score_list[idx]) == 0: + if np.ma.is_masked(score_list[idx]) or np.float64(score_list[idx]) == 0: continue else: to_keep.append(idx) diff --git a/deeptools/sumCoveragePerBin.py b/deeptools/sumCoveragePerBin.py index 705da7150b..b6a722a20c 100644 --- a/deeptools/sumCoveragePerBin.py +++ b/deeptools/sumCoveragePerBin.py @@ -90,7 +90,7 @@ def get_coverage_of_region(self, bamHandle, chrom, regions, except: # bigWig input, as used by plotFingerprint if bamHandle.chroms(chrom): - _ = np.array(bamHandle.stats(chrom, regStart, regEnd, type="mean", nBins=nRegBins), dtype=np.float) + _ = np.array(bamHandle.stats(chrom, regStart, regEnd, type="mean", nBins=nRegBins), dtype=np.float64) _[np.isnan(_)] = 0.0 _ = _ * tileSize coverages += _ From 2d93f8f83a21b0243f10960f3a82b9a578328cb0 Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Wed, 31 May 2023 15:41:02 +0200 Subject: [PATCH 2/4] update versions of tool wrappers --- galaxy/wrapper/alignmentSieve.xml | 2 +- galaxy/wrapper/bamCompare.xml | 2 +- galaxy/wrapper/bamCoverage.xml | 2 +- galaxy/wrapper/bamPEFragmentSize.xml | 2 +- galaxy/wrapper/bigwigAverage.xml | 2 +- galaxy/wrapper/bigwigCompare.xml | 2 +- galaxy/wrapper/computeGCBias.xml | 2 +- galaxy/wrapper/computeMatrix.xml | 2 +- galaxy/wrapper/computeMatrixOperations.xml | 2 +- galaxy/wrapper/correctGCBias.xml | 2 +- galaxy/wrapper/deepTools_macros.xml | 4 ++-- galaxy/wrapper/estimateReadFiltering.xml | 2 +- galaxy/wrapper/multiBamSummary.xml | 2 +- galaxy/wrapper/multiBigwigSummary.xml | 2 +- galaxy/wrapper/plotCorrelation.xml | 2 +- galaxy/wrapper/plotCoverage.xml | 2 +- galaxy/wrapper/plotEnrichment.xml | 2 +- galaxy/wrapper/plotFingerprint.xml | 2 +- galaxy/wrapper/plotHeatmap.xml | 2 +- galaxy/wrapper/plotPCA.xml | 2 +- galaxy/wrapper/plotProfiler.xml | 2 +- 21 files changed, 22 insertions(+), 22 deletions(-) diff --git a/galaxy/wrapper/alignmentSieve.xml b/galaxy/wrapper/alignmentSieve.xml index 850a0b9ace..cbc2e8eae6 100644 --- a/galaxy/wrapper/alignmentSieve.xml +++ b/galaxy/wrapper/alignmentSieve.xml @@ -1,4 +1,4 @@ - + Filter BAM/CRAM files according to specified parameters alignmentSieve diff --git a/galaxy/wrapper/bamCompare.xml b/galaxy/wrapper/bamCompare.xml index 4c5e45bb10..239fe7adab 100644 --- a/galaxy/wrapper/bamCompare.xml +++ b/galaxy/wrapper/bamCompare.xml @@ -1,4 +1,4 @@ - + normalizes and compares two BAM or CRAM files to obtain the ratio, log2ratio or difference between them bamCompare diff --git a/galaxy/wrapper/bamCoverage.xml b/galaxy/wrapper/bamCoverage.xml index b5828928dd..e19759833c 100644 --- a/galaxy/wrapper/bamCoverage.xml +++ b/galaxy/wrapper/bamCoverage.xml @@ -1,4 +1,4 @@ - + generates a coverage bigWig file from a given BAM or CRAM file bamCoverage diff --git a/galaxy/wrapper/bamPEFragmentSize.xml b/galaxy/wrapper/bamPEFragmentSize.xml index 2eb126f4b6..a4c29ccc2b 100644 --- a/galaxy/wrapper/bamPEFragmentSize.xml +++ b/galaxy/wrapper/bamPEFragmentSize.xml @@ -1,4 +1,4 @@ - + Estimate the predominant cDNA fragment length from paired-end sequenced BAM/CRAM files bamPEFragmentSize diff --git a/galaxy/wrapper/bigwigAverage.xml b/galaxy/wrapper/bigwigAverage.xml index a061efd463..5588c05277 100644 --- a/galaxy/wrapper/bigwigAverage.xml +++ b/galaxy/wrapper/bigwigAverage.xml @@ -1,4 +1,4 @@ - + normalizes and average multiple bigWig files bigwigAverage diff --git a/galaxy/wrapper/bigwigCompare.xml b/galaxy/wrapper/bigwigCompare.xml index 9609f83665..bb158458ca 100644 --- a/galaxy/wrapper/bigwigCompare.xml +++ b/galaxy/wrapper/bigwigCompare.xml @@ -1,4 +1,4 @@ - + normalizes and compares two bigWig files to obtain the ratio, log2ratio or difference between them bigwigCompare diff --git a/galaxy/wrapper/computeGCBias.xml b/galaxy/wrapper/computeGCBias.xml index 922c05af10..03f245fcc8 100644 --- a/galaxy/wrapper/computeGCBias.xml +++ b/galaxy/wrapper/computeGCBias.xml @@ -1,4 +1,4 @@ - + Determine the GC bias of your sequenced reads computeGCBias diff --git a/galaxy/wrapper/computeMatrix.xml b/galaxy/wrapper/computeMatrix.xml index 19d1f92cae..9f7b6f8179 100644 --- a/galaxy/wrapper/computeMatrix.xml +++ b/galaxy/wrapper/computeMatrix.xml @@ -1,4 +1,4 @@ - + prepares data for plotting a heatmap or a profile of given regions computeMatrix diff --git a/galaxy/wrapper/computeMatrixOperations.xml b/galaxy/wrapper/computeMatrixOperations.xml index 2d996e910e..7bcdd1b0aa 100755 --- a/galaxy/wrapper/computeMatrixOperations.xml +++ b/galaxy/wrapper/computeMatrixOperations.xml @@ -1,4 +1,4 @@ - + Modify or combine the output of computeMatrix in a variety of ways. computeMatrixOperations diff --git a/galaxy/wrapper/correctGCBias.xml b/galaxy/wrapper/correctGCBias.xml index d9b718020d..a971d35e48 100644 --- a/galaxy/wrapper/correctGCBias.xml +++ b/galaxy/wrapper/correctGCBias.xml @@ -1,4 +1,4 @@ - + uses the output from computeGCBias to generate GC-corrected BAM/CRAM files correctGCBias diff --git a/galaxy/wrapper/deepTools_macros.xml b/galaxy/wrapper/deepTools_macros.xml index 70e8bd808a..13cfeb1189 100755 --- a/galaxy/wrapper/deepTools_macros.xml +++ b/galaxy/wrapper/deepTools_macros.xml @@ -1,10 +1,10 @@ --numberOfProcessors "\${GALAXY_SLOTS:-4}" - 3.5.1.0 + 3.5.2 - deeptools + deeptools samtools diff --git a/galaxy/wrapper/estimateReadFiltering.xml b/galaxy/wrapper/estimateReadFiltering.xml index abccbf04c1..5dc91dddd8 100644 --- a/galaxy/wrapper/estimateReadFiltering.xml +++ b/galaxy/wrapper/estimateReadFiltering.xml @@ -1,4 +1,4 @@ - + estimates the number of reads that would be filtered given certain criteria estimateReadFiltering diff --git a/galaxy/wrapper/multiBamSummary.xml b/galaxy/wrapper/multiBamSummary.xml index 808d43a6d5..22c22573a1 100644 --- a/galaxy/wrapper/multiBamSummary.xml +++ b/galaxy/wrapper/multiBamSummary.xml @@ -1,4 +1,4 @@ - + calculates average read coverages for a list of two or more BAM/CRAM files multiBamSummary diff --git a/galaxy/wrapper/multiBigwigSummary.xml b/galaxy/wrapper/multiBigwigSummary.xml index 40e1cb3b63..6a1ea8ab02 100644 --- a/galaxy/wrapper/multiBigwigSummary.xml +++ b/galaxy/wrapper/multiBigwigSummary.xml @@ -1,4 +1,4 @@ - + calculates average scores for a list of two or more bigwig files multiBigwigSummary diff --git a/galaxy/wrapper/plotCorrelation.xml b/galaxy/wrapper/plotCorrelation.xml index e09c2a0310..c13c3e80cd 100644 --- a/galaxy/wrapper/plotCorrelation.xml +++ b/galaxy/wrapper/plotCorrelation.xml @@ -1,4 +1,4 @@ - + Create a heatmap or scatterplot of correlation scores between different samples plotCorrelation diff --git a/galaxy/wrapper/plotCoverage.xml b/galaxy/wrapper/plotCoverage.xml index 1be8c35ba9..0af6df298f 100644 --- a/galaxy/wrapper/plotCoverage.xml +++ b/galaxy/wrapper/plotCoverage.xml @@ -1,4 +1,4 @@ - + assesses the sequencing depth of BAM/CRAM files plotCoverage diff --git a/galaxy/wrapper/plotEnrichment.xml b/galaxy/wrapper/plotEnrichment.xml index f77b86eb11..b772e124be 100644 --- a/galaxy/wrapper/plotEnrichment.xml +++ b/galaxy/wrapper/plotEnrichment.xml @@ -1,4 +1,4 @@ - + plots read/fragment coverage over sets of regions plotEnrichment diff --git a/galaxy/wrapper/plotFingerprint.xml b/galaxy/wrapper/plotFingerprint.xml index a340e3e632..5ceba0a179 100644 --- a/galaxy/wrapper/plotFingerprint.xml +++ b/galaxy/wrapper/plotFingerprint.xml @@ -1,4 +1,4 @@ - + plots profiles of BAM files; useful for assessing ChIP signal strength plotFingerprint diff --git a/galaxy/wrapper/plotHeatmap.xml b/galaxy/wrapper/plotHeatmap.xml index 98ddc1c5b3..77edcb150a 100644 --- a/galaxy/wrapper/plotHeatmap.xml +++ b/galaxy/wrapper/plotHeatmap.xml @@ -1,4 +1,4 @@ - + creates a heatmap for score distributions across genomic regions plotHeatmap diff --git a/galaxy/wrapper/plotPCA.xml b/galaxy/wrapper/plotPCA.xml index a7bf1c4c5a..4a1de17ff9 100644 --- a/galaxy/wrapper/plotPCA.xml +++ b/galaxy/wrapper/plotPCA.xml @@ -1,4 +1,4 @@ - + Generate principal component analysis (PCA) plots from multiBamSummary or multiBigwigSummary output plotPCA diff --git a/galaxy/wrapper/plotProfiler.xml b/galaxy/wrapper/plotProfiler.xml index de064131c9..c9b10daa28 100644 --- a/galaxy/wrapper/plotProfiler.xml +++ b/galaxy/wrapper/plotProfiler.xml @@ -1,4 +1,4 @@ - + creates a profile plot for score distributions across genomic regions From dd04af41372397af467ba67ce5a599826ec066d3 Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Thu, 1 Jun 2023 10:08:39 +0200 Subject: [PATCH 3/4] macrofy the profile version --- galaxy/wrapper/alignmentSieve.xml | 2 +- galaxy/wrapper/bamCompare.xml | 2 +- galaxy/wrapper/bamCoverage.xml | 2 +- galaxy/wrapper/bamPEFragmentSize.xml | 2 +- galaxy/wrapper/bigwigAverage.xml | 2 +- galaxy/wrapper/bigwigCompare.xml | 2 +- galaxy/wrapper/computeGCBias.xml | 2 +- galaxy/wrapper/computeMatrix.xml | 2 +- galaxy/wrapper/computeMatrixOperations.xml | 2 +- galaxy/wrapper/correctGCBias.xml | 2 +- galaxy/wrapper/deepTools_macros.xml | 1 + galaxy/wrapper/estimateReadFiltering.xml | 2 +- galaxy/wrapper/multiBamSummary.xml | 2 +- galaxy/wrapper/multiBigwigSummary.xml | 2 +- galaxy/wrapper/plotCorrelation.xml | 2 +- galaxy/wrapper/plotCoverage.xml | 2 +- galaxy/wrapper/plotEnrichment.xml | 2 +- galaxy/wrapper/plotFingerprint.xml | 2 +- galaxy/wrapper/plotHeatmap.xml | 2 +- galaxy/wrapper/plotPCA.xml | 2 +- galaxy/wrapper/plotProfiler.xml | 2 +- 21 files changed, 21 insertions(+), 20 deletions(-) diff --git a/galaxy/wrapper/alignmentSieve.xml b/galaxy/wrapper/alignmentSieve.xml index cbc2e8eae6..f893d24c3f 100644 --- a/galaxy/wrapper/alignmentSieve.xml +++ b/galaxy/wrapper/alignmentSieve.xml @@ -1,4 +1,4 @@ - + Filter BAM/CRAM files according to specified parameters alignmentSieve diff --git a/galaxy/wrapper/bamCompare.xml b/galaxy/wrapper/bamCompare.xml index 239fe7adab..604774d6c1 100644 --- a/galaxy/wrapper/bamCompare.xml +++ b/galaxy/wrapper/bamCompare.xml @@ -1,4 +1,4 @@ - + normalizes and compares two BAM or CRAM files to obtain the ratio, log2ratio or difference between them bamCompare diff --git a/galaxy/wrapper/bamCoverage.xml b/galaxy/wrapper/bamCoverage.xml index e19759833c..8150bfdc61 100644 --- a/galaxy/wrapper/bamCoverage.xml +++ b/galaxy/wrapper/bamCoverage.xml @@ -1,4 +1,4 @@ - + generates a coverage bigWig file from a given BAM or CRAM file bamCoverage diff --git a/galaxy/wrapper/bamPEFragmentSize.xml b/galaxy/wrapper/bamPEFragmentSize.xml index a4c29ccc2b..1566654091 100644 --- a/galaxy/wrapper/bamPEFragmentSize.xml +++ b/galaxy/wrapper/bamPEFragmentSize.xml @@ -1,4 +1,4 @@ - + Estimate the predominant cDNA fragment length from paired-end sequenced BAM/CRAM files bamPEFragmentSize diff --git a/galaxy/wrapper/bigwigAverage.xml b/galaxy/wrapper/bigwigAverage.xml index 5588c05277..ffb5536a4e 100644 --- a/galaxy/wrapper/bigwigAverage.xml +++ b/galaxy/wrapper/bigwigAverage.xml @@ -1,4 +1,4 @@ - + normalizes and average multiple bigWig files bigwigAverage diff --git a/galaxy/wrapper/bigwigCompare.xml b/galaxy/wrapper/bigwigCompare.xml index bb158458ca..914b05c602 100644 --- a/galaxy/wrapper/bigwigCompare.xml +++ b/galaxy/wrapper/bigwigCompare.xml @@ -1,4 +1,4 @@ - + normalizes and compares two bigWig files to obtain the ratio, log2ratio or difference between them bigwigCompare diff --git a/galaxy/wrapper/computeGCBias.xml b/galaxy/wrapper/computeGCBias.xml index 03f245fcc8..fc99e02de6 100644 --- a/galaxy/wrapper/computeGCBias.xml +++ b/galaxy/wrapper/computeGCBias.xml @@ -1,4 +1,4 @@ - + Determine the GC bias of your sequenced reads computeGCBias diff --git a/galaxy/wrapper/computeMatrix.xml b/galaxy/wrapper/computeMatrix.xml index 9f7b6f8179..d6a82f7908 100644 --- a/galaxy/wrapper/computeMatrix.xml +++ b/galaxy/wrapper/computeMatrix.xml @@ -1,4 +1,4 @@ - + prepares data for plotting a heatmap or a profile of given regions computeMatrix diff --git a/galaxy/wrapper/computeMatrixOperations.xml b/galaxy/wrapper/computeMatrixOperations.xml index 7bcdd1b0aa..9366508610 100755 --- a/galaxy/wrapper/computeMatrixOperations.xml +++ b/galaxy/wrapper/computeMatrixOperations.xml @@ -1,4 +1,4 @@ - + Modify or combine the output of computeMatrix in a variety of ways. computeMatrixOperations diff --git a/galaxy/wrapper/correctGCBias.xml b/galaxy/wrapper/correctGCBias.xml index a971d35e48..4d55b6c0fa 100644 --- a/galaxy/wrapper/correctGCBias.xml +++ b/galaxy/wrapper/correctGCBias.xml @@ -1,4 +1,4 @@ - + uses the output from computeGCBias to generate GC-corrected BAM/CRAM files correctGCBias diff --git a/galaxy/wrapper/deepTools_macros.xml b/galaxy/wrapper/deepTools_macros.xml index 13cfeb1189..0f16a03e02 100755 --- a/galaxy/wrapper/deepTools_macros.xml +++ b/galaxy/wrapper/deepTools_macros.xml @@ -2,6 +2,7 @@ --numberOfProcessors "\${GALAXY_SLOTS:-4}" 3.5.2 + 20.01 deeptools diff --git a/galaxy/wrapper/estimateReadFiltering.xml b/galaxy/wrapper/estimateReadFiltering.xml index 5dc91dddd8..925e8d0368 100644 --- a/galaxy/wrapper/estimateReadFiltering.xml +++ b/galaxy/wrapper/estimateReadFiltering.xml @@ -1,4 +1,4 @@ - + estimates the number of reads that would be filtered given certain criteria estimateReadFiltering diff --git a/galaxy/wrapper/multiBamSummary.xml b/galaxy/wrapper/multiBamSummary.xml index 22c22573a1..dc1a504c40 100644 --- a/galaxy/wrapper/multiBamSummary.xml +++ b/galaxy/wrapper/multiBamSummary.xml @@ -1,4 +1,4 @@ - + calculates average read coverages for a list of two or more BAM/CRAM files multiBamSummary diff --git a/galaxy/wrapper/multiBigwigSummary.xml b/galaxy/wrapper/multiBigwigSummary.xml index 6a1ea8ab02..cbcdde3a0c 100644 --- a/galaxy/wrapper/multiBigwigSummary.xml +++ b/galaxy/wrapper/multiBigwigSummary.xml @@ -1,4 +1,4 @@ - + calculates average scores for a list of two or more bigwig files multiBigwigSummary diff --git a/galaxy/wrapper/plotCorrelation.xml b/galaxy/wrapper/plotCorrelation.xml index c13c3e80cd..d8c606401e 100644 --- a/galaxy/wrapper/plotCorrelation.xml +++ b/galaxy/wrapper/plotCorrelation.xml @@ -1,4 +1,4 @@ - + Create a heatmap or scatterplot of correlation scores between different samples plotCorrelation diff --git a/galaxy/wrapper/plotCoverage.xml b/galaxy/wrapper/plotCoverage.xml index 0af6df298f..6b50af26cb 100644 --- a/galaxy/wrapper/plotCoverage.xml +++ b/galaxy/wrapper/plotCoverage.xml @@ -1,4 +1,4 @@ - + assesses the sequencing depth of BAM/CRAM files plotCoverage diff --git a/galaxy/wrapper/plotEnrichment.xml b/galaxy/wrapper/plotEnrichment.xml index b772e124be..1e34adc96a 100644 --- a/galaxy/wrapper/plotEnrichment.xml +++ b/galaxy/wrapper/plotEnrichment.xml @@ -1,4 +1,4 @@ - + plots read/fragment coverage over sets of regions plotEnrichment diff --git a/galaxy/wrapper/plotFingerprint.xml b/galaxy/wrapper/plotFingerprint.xml index 5ceba0a179..dea1ccb9ec 100644 --- a/galaxy/wrapper/plotFingerprint.xml +++ b/galaxy/wrapper/plotFingerprint.xml @@ -1,4 +1,4 @@ - + plots profiles of BAM files; useful for assessing ChIP signal strength plotFingerprint diff --git a/galaxy/wrapper/plotHeatmap.xml b/galaxy/wrapper/plotHeatmap.xml index 77edcb150a..79141cfc58 100644 --- a/galaxy/wrapper/plotHeatmap.xml +++ b/galaxy/wrapper/plotHeatmap.xml @@ -1,4 +1,4 @@ - + creates a heatmap for score distributions across genomic regions plotHeatmap diff --git a/galaxy/wrapper/plotPCA.xml b/galaxy/wrapper/plotPCA.xml index 4a1de17ff9..27b781f84b 100644 --- a/galaxy/wrapper/plotPCA.xml +++ b/galaxy/wrapper/plotPCA.xml @@ -1,4 +1,4 @@ - + Generate principal component analysis (PCA) plots from multiBamSummary or multiBigwigSummary output plotPCA diff --git a/galaxy/wrapper/plotProfiler.xml b/galaxy/wrapper/plotProfiler.xml index c9b10daa28..cdccb81558 100644 --- a/galaxy/wrapper/plotProfiler.xml +++ b/galaxy/wrapper/plotProfiler.xml @@ -1,4 +1,4 @@ - + creates a profile plot for score distributions across genomic regions From d8ebbb9efe1f9157e4dec6b65d87417c9e522881 Mon Sep 17 00:00:00 2001 From: Chang Y Date: Sat, 3 Jun 2023 21:01:19 -0500 Subject: [PATCH 4/4] Update countReadsPerBin.py --- deeptools/countReadsPerBin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deeptools/countReadsPerBin.py b/deeptools/countReadsPerBin.py index 1e6c78293b..37883cc539 100644 --- a/deeptools/countReadsPerBin.py +++ b/deeptools/countReadsPerBin.py @@ -899,7 +899,7 @@ def get_fragment_from_read(self, read): fragmentStart = int(fragmentCenter - read.infer_query_length(always=False) / 2) fragmentEnd = fragmentStart + read.infer_query_length(always=False) - assert fragmentStart < fragmentEnd, "fragment start greater than fragment" \ + assert fragmentStart <= fragmentEnd, "fragment start greater than fragment" \ "end for read {}".format(read.query_name) return [(fragmentStart, fragmentEnd)]