Skip to content

Commit

Permalink
Merge pull request #1356 from deeptools/develop
Browse files Browse the repository at this point in the history
Develop - 3.5.6
  • Loading branch information
WardDeb authored Jan 20, 2025
2 parents c24522b + a29bd29 commit ea0f68b
Show file tree
Hide file tree
Showing 17 changed files with 88 additions and 115 deletions.
20 changes: 0 additions & 20 deletions .github/test_and_build.yml

This file was deleted.

40 changes: 10 additions & 30 deletions .github/workflows/planemo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ name: Planemo
on: [push, pull_request]

env:
GALAXY_BRANCH: release_23.1
GALAXY_BRANCH: release_24.1

defaults:
run:
shell: bash -l {0}

# setup micromamba doesn't work as galaxy setup by planemo requires conda.
# installing conda over into micromamba built env screws up the PATH
# setup-miniconda + changing over to libmamba to solve is the easiest workaround

jobs:
planemo_test:
name: Planemo test
Expand All @@ -20,56 +16,40 @@ jobs:
matrix:
chunk: [1, 2, 3]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-activate-base: true
- name: setup env
python-version: "3.12"
- name: get samtools
run: |
conda env list
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
conda env create -f .github/test_and_build.yml -n test_and_build
conda install -c conda-forge -c bioconda samtools
- name: pip install
run: |
conda activate test_and_build
pip install .
pip install .[actions]
- name: planemo
run: |
conda activate test_and_build
./.planemo.sh ${{ matrix.chunk }} ${{ env.GALAXY_BRANCH }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: 'Tool test output ${{ matrix.chunk }}'
path: upload
planemo_combine_outputs:
name: Combine chunked test results
needs: planemo_test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.11']
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
path: artifacts
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache .cache/pip
uses: actions/cache@v3
id: cache-pip
with:
path: ~/.cache/pip
key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ env.GALAXY_BRANCH }}
- name: Combine outputs
uses: galaxyproject/planemo-ci-action@v1
id: combine
with:
mode: combine
html-report: true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: 'All tool test results'
path: upload
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,19 @@ jobs:
name: upload to pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@main
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
environment-file: .github/test_and_build.yml
cache-downloads: true
environment-name: test_and_build
python-version: '3.12'
cache: 'pip'
- name: build
run: |
micromamba activate test_and_build
pip install .[actions]
rm -f dist/*
python -m build
- name: upload
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
micromamba activate test_and_build
twine upload dist/*
39 changes: 16 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
if: github.base_ref == 'master'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check path
run: find /home/runner/work/deepTools/deepTools -name "pyproject.toml"
- name: Get Version of Deeptools
Expand Down Expand Up @@ -40,30 +40,26 @@ jobs:
name: Test on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@main
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
environment-file: .github/test_and_build.yml
cache-downloads: true
environment-name: test_and_build
python-version: '3.12'
cache: 'pip'
- name: pip install
run: |
micromamba activate test_and_build
pip install .
pip install .[actions]
- name: PEP8
run: |
micromamba activate test_and_build
flake8 . --exclude=.venv,.build,build --ignore=E501,F403,E402,F999,F405,E722,W504,W605
- name: Test deepTools
run: |
micromamba activate test_and_build
pytest -v
- name: make an artifact
run: |
micromamba activate test_and_build
rm -f dist/*
python -m build
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: "distfiles"
path: "dist"
Expand All @@ -73,14 +69,14 @@ jobs:
needs: build-linux
strategy:
matrix:
python-version: ['3.8','3.9','3.10', '3.11', '3.12']
python-version: ['3.9','3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: "distfiles"
path: ~/dist/
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand All @@ -96,17 +92,14 @@ jobs:
name: Test on OSX
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@main
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
environment-file: .github/test_and_build.yml
cache-downloads: true
environment-name: test_and_build
python-version: '3.12'
cache: 'pip'
- name: pip install
run: |
micromamba activate test_and_build
pip install .
pip install .[actions]
- name: Test deepTools
run: |
micromamba activate test_and_build
pytest -v
3 changes: 1 addition & 2 deletions deeptools/bigwigAverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ def parse_arguments(args=None):

def getType(fname):
"""
Tries to determine if a file is a wiggle file a bigWig file.
Returns 'wiggle' if the file name ends with .wig, otherwise 'bigwig'
Tries to determine if a file is a wiggle, a bedgraph, or a bigWig file.
"""
if fname.endswith(".wig") or fname.endswith(".wiggle"):
return "wiggle"
Expand Down
3 changes: 1 addition & 2 deletions deeptools/bigwigCompare.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ def parse_arguments(args=None):

def getType(fname):
"""
Tries to determine if a file is a wiggle file or a bigWig file.
Returns 'wiggle' if the file name ends with .wig, otherwise 'bigwig'
Tries to determine if a file is a wiggle, a bedgraph or a bigWig.
"""
if fname.endswith(".wig") or fname.endswith(".wiggle"):
return "wiggle"
Expand Down
8 changes: 8 additions & 0 deletions deeptools/computeMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,14 @@ def process_args(args=None):
if args.quiet is True:
args.verbose = False

# Ensure before and after region length is positive
if args.beforeRegionStartLength < 0:
print(f"beforeRegionStartLength changed from {args.beforeRegionStartLength} into {abs(args.beforeRegionStartLength)}")
args.beforeRegionStartLength = abs(args.beforeRegionStartLength)
if args.afterRegionStartLength < 0:
print(f"afterRegionStartLength changed from {args.afterRegionStartLength} into {abs(args.afterRegionStartLength)}")
args.afterRegionStartLength = abs(args.afterRegionStartLength)

if args.command == 'scale-regions':
args.nanAfterEnd = False
args.referencePoint = None
Expand Down
2 changes: 1 addition & 1 deletion deeptools/computeMatrixOperations.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def cbindMatrices(hm, args):
# Add on additional NA initialized columns
ncol = hm.matrix.matrix.shape[1]
hm.matrix.matrix = np.hstack((hm.matrix.matrix, np.empty(hm2.matrix.matrix.shape)))
hm.matrix.matrix[:, ncol:] = np.NAN
hm.matrix.matrix[:, ncol:] = np.nan

# Update the values
for idx2, group in enumerate(hm2.parameters["group_labels"]):
Expand Down
2 changes: 1 addition & 1 deletion deeptools/heatmapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def compute_sub_matrix_worker(self, chrom, start, end, score_file_list, paramete

# create an empty matrix to store the values
sub_matrix = np.zeros((len(regions), matrix_cols))
sub_matrix[:] = np.NAN
sub_matrix[:] = np.nan

j = 0
sub_regions = []
Expand Down
2 changes: 1 addition & 1 deletion deeptools/multiBigwigSummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def parse_arguments(args=None):
conflict_handler='resolve')

parser.add_argument('--version', action='version',
version='multiBigwigSummary {}'.format(version('deeptools')))
version='%(prog)s {}'.format(version('deeptools')))
subparsers = parser.add_subparsers(
title="commands",
dest='command',
Expand Down
2 changes: 1 addition & 1 deletion deeptools/plotCoverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def parse_arguments(args=None):
'help: plotCoverage -h / plotCoverage --help\n')

parser.add_argument('--version', action='version',
version='plotCoverage {}'.format(version('deeptools')))
version='%(prog)s {}'.format(version('deeptools')))

return parser

Expand Down
10 changes: 5 additions & 5 deletions deeptools/plotFingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ def getCHANCE(args, idx, mat):
"""
# Get the index of the reference sample
if args.JSDsample not in args.bamfiles:
return [np.NAN, np.NAN, np.NAN]
return [np.nan, np.nan, np.nan]
refIdx = args.bamfiles.index(args.JSDsample)
if refIdx == idx:
return [np.NAN, np.NAN, np.NAN]
return [np.nan, np.nan, np.nan]

subMatrix = np.copy(mat[:, [idx, refIdx]])
subMatrix[np.isnan(subMatrix)] = 0
Expand Down Expand Up @@ -272,10 +272,10 @@ def getJSD(args, idx, mat):

# Get the index of the reference sample
if args.JSDsample not in args.bamfiles:
return np.NAN
return np.nan
refIdx = args.bamfiles.index(args.JSDsample)
if refIdx == idx:
return np.NAN
return np.nan

# These will hold the coverage histograms
chip = np.zeros(MAXLEN, dtype=int)
Expand Down Expand Up @@ -339,7 +339,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 np.NAN
return np.nan

# Compute the JSD from the PMFs
M = (PMFinput + PMFchip) / 2.0
Expand Down
32 changes: 17 additions & 15 deletions docs/content/feature/effectiveGenomeSize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ The effective genome size for a number of genomes using this method is given bel
+---------------+------------------+
|GRCm38 | 2652783500 |
+---------------+------------------+
|GRCm39 | 2654621783 |
+---------------+------------------+
|dm3 | 162367812 |
+---------------+------------------+
|dm6 | 142573017 |
Expand All @@ -44,18 +46,18 @@ These are then based on the read length.
We can approximate these values for various read lengths using the `khmer program <https://khmer.readthedocs.io/en/latest/>`__ program and ``unique-kmers.py`` in particular.
A table of effective genome sizes given a read length using this method is provided below:

+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|Read length | GRCh37 | GRCh38 | T2T/CHM13CAT_v2 | GRCm37 | GRCm38 | dm3 | dm6 | GRCz10 | GRCz11 | WBcel235 | TAIR10 |
+=================+=================+=================+=================+=================+=================+=================+=================+=================+=================+=================+=================+
|50 | 2685511454 | 2701495711 | 2725240337 | 2304947876 | 2308125299 | 130428510 | 125464678 | 1195445541 | 1197575653 | 95159402 | 114339094 |
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|75 | 2736124898 | 2747877702 | 2786136059 | 2404646149 | 2407883243 | 135004387 | 127324557 | 1251132611 | 1250812288 | 96945370 | 115317469 |
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|100 | 2776919708 | 2805636231 | 2814334875 | 2462480910 | 2467481008 | 139647132 | 129789773 | 1280188944 | 1280354977 | 98259898 | 118459858 |
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|150 | 2827436883 | 2862010428 | 2931551487 | 2489384085 | 2494787038 | 144307658 | 129940985 | 1312207019 | 1311832909 | 98721103 | 118504138 |
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|200 | 2855463800 | 2887553103 | 2936403235 | 2513019076 | 2520868989 | 148523810 | 132508963 | 1321355041 | 1322366338 | 98672558 | 117723393 |
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|250 | 2855044784 | 2898802627 | 2960856300 | 2528988583 | 2538590322 | 151901455 | 132900923 | 1339205109 | 1342093482 | 101271756 | 119585546 |
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|Read length | GRCh37 | GRCh38 | T2T/CHM13CAT_v2 | GRCm37 | GRCm38 | GRCm39 | dm3 | dm6 | GRCz10 | GRCz11 | WBcel235 | TAIR10 |
+=================+=================+=================+=================+=================+=================+=================+=================+=================+=================+=================+=================+=================+
|50 | 2685511454 | 2701495711 | 2725240337 | 2304947876 | 2308125299 | 2309746861 | 130428510 | 125464678 | 1195445541 | 1197575653 | 95159402 | 114339094 |
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|75 | 2736124898 | 2747877702 | 2786136059 | 2404646149 | 2407883243 | 2410055689 | 135004387 | 127324557 | 1251132611 | 1250812288 | 96945370 | 115317469 |
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|100 | 2776919708 | 2805636231 | 2814334875 | 2462480910 | 2467481008 | 2468088461 | 139647132 | 129789773 | 1280188944 | 1280354977 | 98259898 | 118459858 |
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|150 | 2827436883 | 2862010428 | 2931551487 | 2489384085 | 2494787038 | 2495461690 | 144307658 | 129940985 | 1312207019 | 1311832909 | 98721103 | 118504138 |
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|200 | 2855463800 | 2887553103 | 2936403235 | 2513019076 | 2520868989 | 2521902382 | 148523810 | 132508963 | 1321355041 | 1322366338 | 98672558 | 117723393 |
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|250 | 2855044784 | 2898802627 | 2960856300 | 2528988583 | 2538590322 | 2538633971 | 151901455 | 132900923 | 1339205109 | 1342093482 | 101271756 | 119585546 |
+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
9 changes: 8 additions & 1 deletion docs/content/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ The recommended way to install deepTools (including its requirements) is via `mi

.. code:: bash
$ conda install -c bioconda deeptools
$ conda install -c conda-forge -c bioconda deeptools
Note that for ARM architecture (e.g. M1 on OSX) you could go via the pip installation (see below), or install via the osx-64 env:

.. code:: bash
$ CONDA_SUBDIR=osx-64 conda create -c conda-forge -c bioconda -n deeptools deeptools
Command line installation using ``pip``
---------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/content/tools/plotFingerprint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ It determines how well the signal in the ChIP-seq sample can be differentiated f
For factors that will enrich well-defined, rather narrow regions (e.g. transcription factors such as p300), the resulting plot can be used to assess the strength of a ChIP, but the broader the enrichments are to be expected, the less clear the plot will be.
Vice versa, if you do not know what kind of signal to expect, the fingerprint plot will give you a straight-forward indication of how careful you will have to be during your downstream analyses to separate biological noise from meaningful signal.

Similar to ``multiBamSummary``, ``plotFingerprint`` randomly samples genome regions (bins) of a specified length and sums the per-base coverage in indexed [BAM][] (or bigWig) files that overlap with those regions.
Similar to ``multiBamSummary``, ``plotFingerprint`` randomly samples genome regions (bins) of a specified length and sums the per-base coverage in indexed BAM files that overlap with those regions.
These values are then sorted according to their rank and the cumulative sum of read counts is plotted.


Expand Down
Loading

0 comments on commit ea0f68b

Please sign in to comment.