[med-svn] [Git][med-team/python-deeptools][upstream] New upstream version 3.4.2

Steffen Möller gitlab at salsa.debian.org
Wed Apr 8 11:27:04 BST 2020



Steffen Möller pushed to branch upstream at Debian Med / python-deeptools


Commits:
7fef8d99 by Steffen Moeller at 2020-04-08T12:16:18+02:00
New upstream version 3.4.2
- - - - -


12 changed files:

- .github/workflows/test.yml
- CHANGES.txt
- azure-pipelines.yml
- deeptools/_version.py
- deeptools/bamPEFragmentSize.py
- deeptools/correlation.py
- deeptools/parserCommon.py
- deeptools/plotHeatmap.py
- deeptools/writeBedGraph_bam_and_bw.py
- galaxy/wrapper/deepTools_macros.xml
- galaxy/wrapper/plotCoverage.xml
- galaxy/wrapper/plotHeatmap.xml


Changes:

=====================================
.github/workflows/test.yml
=====================================
@@ -32,6 +32,7 @@ jobs:
     - uses: "dpryan79/github-actions/@master"
     - name: Test deepTools
       run: |
+
         source activate foo
         nosetests --with-doctest -sv deeptools
   planemo:


=====================================
CHANGES.txt
=====================================
@@ -1,3 +1,17 @@
+3.4.2
+
+ * Programmed around a bug in matplotlib that prevented the plotCorrelation scatter plot from working. See https://bioinformatics.stackexchange.com/questions/12830/plot-correlation-between-several-bam-files/12831
+
+3.4.1
+
+ * Prevented temporary bedGraph files from being written to (possibly small) shared-memory drives even when TMPDIR is set to somewhere else. Now shared memory is only used if requested by setting TMPDIR (or other appropriate environment variables) to `/dev/shm`.
+ * Fixed a bug in bamPEFragmentSize that caused incompatibility with newer matplotlib releases. (issue #928)
+
+3.4.0
+
+ * Fixed a bug in one of the Galaxy wrappers.
+ * Added the `--lineAtTickMarks` option to `plotHeatmap` so that there are dashed vertical lines for each tick mark in the plot. (issue #924)
+
 3.3.2
 
  * Fixed --yAxisLabel in plotProfile (issue #889)


=====================================
azure-pipelines.yml
=====================================
@@ -17,19 +17,20 @@ jobs:
     displayName: Add conda to PATH
   - template: .azure-pipelines/test-template.yml
 
-- job: 'OSX'
-  pool:
-    vmImage: 'macOS-10.13'
-  strategy:
-    matrix:
-      Python37:
-        python.version: '3.7'
-    maxParallel: 1
-
-  steps:
-  - bash: echo "##vso[task.prependpath]$CONDA/bin"
-    displayName: Add conda to PATH
-  - template: .azure-pipelines/test-template.yml
+#Fails frequently due to CI issues
+#- job: 'OSX'
+#  pool:
+#    vmImage: 'macOS-10.14'
+#  strategy:
+#    matrix:
+#      Python37:
+#        python.version: '3.7'
+#    maxParallel: 1
+#
+#  steps:
+#  - bash: echo "##vso[task.prependpath]$CONDA/bin"
+#    displayName: Add conda to PATH
+#  - template: .azure-pipelines/test-template.yml
 
 - job: 'galaxy'
   dependsOn: 'Linux'


=====================================
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.3.2'
+__version__ = '3.4.2'


=====================================
deeptools/bamPEFragmentSize.py
=====================================
@@ -119,7 +119,7 @@ def getDensity(lengths, minVal, maxVal):
     This is essentially computing what hist() in matplotlib is doing and returning the results.
     This then allows us to free up the memory consumed by each sample rather than returning it all back to main() for plotting.
     """
-    n, bins, patches = plt.hist(lengths, bins=100, range=(minVal, maxVal), normed=True)
+    n, bins, patches = plt.hist(lengths, bins=100, range=(minVal, maxVal), density=True)
     plt.clf()
     return (n, bins)
 


=====================================
deeptools/correlation.py
=====================================
@@ -527,9 +527,9 @@ class Correlation:
             else:
                 ax.set_xticklabels([])
 
-            ax.hist2d(vector2, vector1, bins=200, cmin=0.1)
             ax.set_xlim(min_xvalue, max_xvalue)
             ax.set_ylim(min_yvalue, max_yvalue)
+            ax.hist2d(vector2, vector1, bins=200, cmin=0.1)
 
         plt.savefig(plot_filename, format=image_format)
         plt.close()


=====================================
deeptools/parserCommon.py
=====================================
@@ -611,6 +611,12 @@ def heatmapperOptionalArgs(mode=['heatmap', 'profile'][0]):
                               'example: --sortUsingSamples 1 3',
                               type=int, nargs='+')
 
+        optional.add_argument('--linesAtTickMarks',
+                              help='Draw dashed lines from all tick marks through the heatmap. '
+                              'This is then similar to the dashed line draw at region bounds '
+                              'when using a reference point and --sortUsing region_length',
+                              action='store_true')
+
         optional.add_argument('--clusterUsingSamples',
                               help='List of sample numbers (order as in '
                               'matrix), that are used for clustering by '


=====================================
deeptools/plotHeatmap.py
=====================================
@@ -389,6 +389,7 @@ def plotMatrix(hm, outFileName,
                heatmapWidth=7.5,
                perGroup=False, whatToShow='plot, heatmap and colorbar',
                plot_type='lines',
+               linesAtTickMarks=False,
                image_format=None,
                legend_location='upper-left',
                box_around_heatmaps=True,
@@ -539,7 +540,7 @@ def plotMatrix(hm, outFileName,
                         _len *= 0.5
                         _reg_len.append((hm.parameters['upstream'][idx] + _len) / hm.parameters['bin size'][idx])
                     elif hm.parameters['ref point'][idx] == 'TES':
-                        _reg_len.append((hm.parameters['downstream'][idx] - _len) / hm.parameters['bin size'][idx])
+                        _reg_len.append((hm.parameters['upstream'][idx] - _len) / hm.parameters['bin size'][idx])
                 foo.append(_reg_len)
             regions_length_in_bins[idx] = foo
 
@@ -659,6 +660,18 @@ def plotMatrix(hm, outFileName,
             elif not perGroup and sample == 0:
                 ax.axes.set_ylabel(sub_matrix['group'])
 
+            # Plot vertical lines at tick marks if desired
+            if linesAtTickMarks:
+                xticks_heat, xtickslabel_heat = hm.getTicks(sample)
+                xticks_heat = [x + 0.5 for x in xticks_heat]  # There's an offset of 0.5 compared to the profile plot
+                if np.ceil(max(xticks_heat)) != float(sub_matrix['matrix'].shape[1]):
+                    tickscale = float(sub_matrix['matrix'].shape[1]) / max(xticks_heat)
+                    xticks_heat_use = [x * tickscale for x in xticks_heat]
+                else:
+                    xticks_heat_use = xticks_heat
+                for x in xticks_heat_use:
+                    ax.axvline(x=x, color='black', linewidth=0.5, dashes=(3, 2))
+
             # add labels to last block in a column
             if (perGroup and sample == numsamples - 1) or \
                (not perGroup and group_idx == numgroups - 1):
@@ -845,6 +858,7 @@ def main(args=None):
                args.heatmapWidth,
                args.perGroup,
                args.whatToShow,
+               linesAtTickMarks=args.linesAtTickMarks,
                plot_type=args.plotType,
                image_format=args.plotFileFormat,
                legend_location=args.legendLocation,


=====================================
deeptools/writeBedGraph_bam_and_bw.py
=====================================
@@ -76,12 +76,7 @@ def writeBedGraph_worker(
                     tileSize, missingDataAsZero))
             bigwigHandle.close()
 
-    # is /dev/shm available?
-    # working in this directory speeds the process
-    try:
-        _file = tempfile.NamedTemporaryFile(dir="/dev/shm", delete=False)
-    except OSError:
-        _file = tempfile.NamedTemporaryFile(delete=False)
+    _file = tempfile.NamedTemporaryFile(delete=False)
 
     previousValue = None
     lengthCoverage = len(coverage[0])


=====================================
galaxy/wrapper/deepTools_macros.xml
=====================================
@@ -1,10 +1,10 @@
 <macros>
 
     <token name="@THREADS@">--numberOfProcessors "\${GALAXY_SLOTS:-4}"</token>
-    <token name="@WRAPPER_VERSION@">3.3.2.0</token>
+    <token name="@WRAPPER_VERSION@">3.4.2.0</token>
     <xml name="requirements">
         <requirements>
-            <requirement type="package" version="3.3.2">deeptools</requirement>
+            <requirement type="package" version="3.4.2">deeptools</requirement>
             <requirement type="package" version="1.9">samtools</requirement>
         </requirements>
         <expand macro="stdio" />


=====================================
galaxy/wrapper/plotCoverage.xml
=====================================
@@ -26,7 +26,7 @@
             #end if
 
             #if ' '.join(map(str, $BED)) != 'None':
-                #set bedFileLList=[]
+                #set bedFileList=[]
                 #for $f in $BED:
                     #silent $bedFileList.append("'%s'" % $f)
                 #end for
@@ -101,11 +101,8 @@
                 <expand macro="blacklist" />
             </when>
         </conditional>
-
         <expand macro="input_image_file_format" />
         <param argument="--outRawCounts" type="boolean" label="Save raw counts (coverages) to a file" help=""/>
-
-
     </inputs>
     <outputs>
         <expand macro="output_image_file_format_not_nested" />


=====================================
galaxy/wrapper/plotHeatmap.xml
=====================================
@@ -34,6 +34,10 @@
                     --sortRegions '$advancedOpt.sortRegions'
                 #end if
 
+                #if $advancedOpt.linesAtTickMarks:
+                    --linesAtTickMarks
+                #end if
+
                 #if $advancedOpt.sortUsing:
                     --sortUsing '$advancedOpt.sortUsing'
                 #end if
@@ -130,6 +134,8 @@
             <when value="yes">
                 <expand macro="sortRegions" />
                 <expand macro="sortUsing" />
+                <param argument="--linesAtTickMarks" type="boolean" truevalue="--linesAtTickMarks" falsevalue=""
+                    label="Draw dashed lines in heatmap above all tick marks?" />
                 <param argument="--averageTypeSummaryPlot" type="select"
                     label="Type of statistic that should be plotted in the summary image above the heatmap"
                     help="">



View it on GitLab: https://salsa.debian.org/med-team/python-deeptools/-/commit/7fef8d996fc172611f17a915e8a19efaa420978e

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-deeptools/-/commit/7fef8d996fc172611f17a915e8a19efaa420978e
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200408/64089680/attachment-0001.html>


More information about the debian-med-commit mailing list