Showing preview only (8,354K chars total). Download the full file or copy to clipboard to get everything.
Repository: deeptools/deepTools
Branch: master
Commit: ea0f68bb4a15
Files: 325
Total size: 7.9 MB
Directory structure:
gitextract_fn4npz16/
├── .github/
│ ├── CONTRIBUTING.md
│ ├── ISSUE_TEMPLATE.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ └── workflows/
│ ├── planemo.yml
│ ├── pypi.yml
│ └── test.yml
├── .gitignore
├── .planemo.sh
├── .readthedocs.yaml
├── CHANGES.txt
├── LICENSE.txt
├── MANIFEST.in
├── README.md
├── README.rst
├── deeptools/
│ ├── SES_scaleFactor.py
│ ├── __init__.py
│ ├── alignmentSieve.py
│ ├── bamCompare.py
│ ├── bamCoverage.py
│ ├── bamHandler.py
│ ├── bamPEFragmentSize.py
│ ├── bigwigAverage.py
│ ├── bigwigCompare.py
│ ├── cm.py
│ ├── computeGCBias.py
│ ├── computeMatrix.py
│ ├── computeMatrixOperations.py
│ ├── correctGCBias.py
│ ├── correlation.py
│ ├── correlation_heatmap.py
│ ├── countReadsPerBin.py
│ ├── deeptools_list_tools.py
│ ├── estimateReadFiltering.py
│ ├── estimateScaleFactor.py
│ ├── getFragmentAndReadSize.py
│ ├── getRatio.py
│ ├── getScaleFactor.py
│ ├── getScorePerBigWigBin.py
│ ├── heatmapper.py
│ ├── heatmapper_utilities.py
│ ├── mapReduce.py
│ ├── misc.py
│ ├── multiBamSummary.py
│ ├── multiBigwigSummary.py
│ ├── parserCommon.py
│ ├── plotCorrelation.py
│ ├── plotCoverage.py
│ ├── plotEnrichment.py
│ ├── plotFingerprint.py
│ ├── plotHeatmap.py
│ ├── plotPCA.py
│ ├── plotProfile.py
│ ├── sumCoveragePerBin.py
│ ├── test/
│ │ ├── __init__.py
│ │ ├── skiptest_heatmapper_images.py
│ │ ├── test_bamCoverage_and_bamCompare.py
│ │ ├── test_bigwigAverage.py
│ │ ├── test_bigwigCompare_and_multiBigwigSummary.py
│ │ ├── test_computeMatrixOperations.py
│ │ ├── test_corrGC/
│ │ │ ├── R_gc
│ │ │ ├── R_gc_paired.txt
│ │ │ ├── extra_sampling.bed
│ │ │ ├── filter_out.bed
│ │ │ ├── frequencies_data.txt
│ │ │ ├── mappability.bg
│ │ │ ├── mappability.bw
│ │ │ ├── paired.bam
│ │ │ ├── paired.bam.bai
│ │ │ ├── sequence.2bit
│ │ │ ├── sequence.fa
│ │ │ ├── sequence.fa.fai
│ │ │ ├── sizes
│ │ │ ├── test.bam
│ │ │ ├── test.bam.bai
│ │ │ ├── test.sam
│ │ │ ├── test_paired.bam
│ │ │ ├── test_paired.bam.bai
│ │ │ └── test_paired.sam
│ │ ├── test_countReadsPerBin.py
│ │ ├── test_data/
│ │ │ ├── computeMatrixOperations.bed
│ │ │ ├── make_test_data.sh
│ │ │ ├── test.bed3
│ │ │ ├── test.gtf
│ │ │ ├── test1.bam
│ │ │ ├── test1.bam.bai
│ │ │ ├── test1.bg
│ │ │ ├── test1.bw.bw
│ │ │ ├── test1.cram
│ │ │ ├── test1.cram.crai
│ │ │ ├── test1.fa
│ │ │ ├── test1.fa.fai
│ │ │ ├── test1.sam
│ │ │ ├── test2.bam
│ │ │ ├── test2.bam.bai
│ │ │ ├── test2.bg
│ │ │ ├── test2.cram
│ │ │ ├── test2.cram.crai
│ │ │ ├── test2.sam
│ │ │ ├── testA.bam
│ │ │ ├── testA.bam.bai
│ │ │ ├── testA.bw
│ │ │ ├── testA.cram
│ │ │ ├── testA.cram.crai
│ │ │ ├── testA.fa
│ │ │ ├── testA.fa.fai
│ │ │ ├── testA.sam
│ │ │ ├── testA_offset-1.bw
│ │ │ ├── testA_offset1.bw
│ │ │ ├── testA_offset1_10.bw
│ │ │ ├── testA_offset20_-4.bw
│ │ │ ├── testA_skipNAs.bw
│ │ │ ├── testB.bam
│ │ │ ├── testB.bam.bai
│ │ │ ├── testB.bw
│ │ │ ├── testB.cram
│ │ │ ├── testB.cram.crai
│ │ │ ├── testB.fa
│ │ │ ├── testB.fa.fai
│ │ │ ├── testB.sam
│ │ │ ├── testB_skipNAs.bw
│ │ │ ├── test_filtering.bam
│ │ │ ├── test_filtering.bam.bai
│ │ │ ├── test_filtering.blacklist.bed
│ │ │ ├── test_filtering.cram
│ │ │ ├── test_filtering.cram.crai
│ │ │ ├── test_filtering.fa
│ │ │ ├── test_filtering.fa.fai
│ │ │ ├── test_filtering2.bam
│ │ │ ├── test_filtering2.bam.bai
│ │ │ ├── test_filtering2.cram
│ │ │ ├── test_filtering2.cram.crai
│ │ │ ├── test_paired.bam
│ │ │ ├── test_paired.bam.bai
│ │ │ ├── test_paired.sam
│ │ │ ├── test_paired2.bam
│ │ │ ├── test_paired2.bam.bai
│ │ │ ├── test_paired2.bw
│ │ │ ├── test_paired2.cram
│ │ │ ├── test_paired2.cram.crai
│ │ │ ├── test_paired2.fa
│ │ │ ├── test_paired2.fa.fai
│ │ │ ├── test_paired2.sam
│ │ │ ├── test_proper_pair_filtering.bam
│ │ │ └── test_proper_pair_filtering.bam.bai
│ │ ├── test_heatmapper/
│ │ │ ├── group1.bed
│ │ │ ├── group2.bed
│ │ │ ├── make_test_data.sh
│ │ │ ├── master.mat
│ │ │ ├── master.tab
│ │ │ ├── master_TES.mat
│ │ │ ├── master_center.mat
│ │ │ ├── master_extend_beyond_chr_size.mat
│ │ │ ├── master_gtf.mat
│ │ │ ├── master_metagene.mat
│ │ │ ├── master_multi.mat
│ │ │ ├── master_multibed.mat
│ │ │ ├── master_nan_to_zero.mat
│ │ │ ├── master_scale_reg.mat
│ │ │ ├── master_unscaled.mat
│ │ │ ├── out.bed
│ │ │ ├── test.bed
│ │ │ ├── test.bg
│ │ │ ├── test.bw
│ │ │ ├── test.sizes
│ │ │ ├── test2.bed
│ │ │ ├── unscaled.bed
│ │ │ └── unscaled.bigWig
│ │ ├── test_heatmapper.py
│ │ ├── test_multiBamSummary.py
│ │ ├── test_plotCoverage/
│ │ │ ├── make_test_files.sh
│ │ │ └── outRawCounts_default.tabular
│ │ ├── test_plotCoverage.py
│ │ ├── test_readFiltering.py
│ │ ├── test_tools.py
│ │ └── test_writeBedGraph.py
│ ├── utilities.py
│ ├── writeBedGraph.py
│ └── writeBedGraph_bam_and_bw.py
├── docs/
│ ├── Makefile
│ ├── _static/
│ │ ├── welcome_base.css
│ │ ├── welcome_owl.carousel.css
│ │ └── welcome_owl.carousel.theme.css
│ ├── conf.py
│ ├── content/
│ │ ├── about.rst
│ │ ├── advanced_features.rst
│ │ ├── api.rst
│ │ ├── changelog.rst
│ │ ├── example_api_tutorial.rst
│ │ ├── example_gallery.rst
│ │ ├── example_step_by_step.rst
│ │ ├── example_usage.rst
│ │ ├── feature/
│ │ │ ├── blacklist.rst
│ │ │ ├── effectiveGenomeSize.rst
│ │ │ ├── metagene.rst
│ │ │ ├── plotFingerprint_QC_metrics.rst
│ │ │ ├── plotly.rst
│ │ │ ├── read_extension.rst
│ │ │ ├── read_offsets.rst
│ │ │ └── unscaled_regions.rst
│ │ ├── help_faq.rst
│ │ ├── help_faq_galaxy.rst
│ │ ├── help_galaxy_dataup.rst
│ │ ├── help_galaxy_deeptools.rst
│ │ ├── help_galaxy_intro.rst
│ │ ├── help_glossary.rst
│ │ ├── installation.rst
│ │ ├── list_of_tools.rst
│ │ └── tools/
│ │ ├── alignmentSieve.rst
│ │ ├── bamCompare.rst
│ │ ├── bamCoverage.rst
│ │ ├── bamPEFragmentSize.rst
│ │ ├── bigwigAverage.rst
│ │ ├── bigwigCompare.rst
│ │ ├── computeGCBias.rst
│ │ ├── computeMatrix.rst
│ │ ├── computeMatrixOperations.rst
│ │ ├── correctGCBias.rst
│ │ ├── estimateReadFiltering.rst
│ │ ├── multiBamSummary.rst
│ │ ├── multiBigwigSummary.rst
│ │ ├── plotCorrelation.rst
│ │ ├── plotCoverage.rst
│ │ ├── plotEnrichment.rst
│ │ ├── plotFingerprint.rst
│ │ ├── plotHeatmap.rst
│ │ ├── plotPCA.rst
│ │ └── plotProfile.rst
│ ├── images/
│ │ └── gallery/
│ │ └── Whyte_TypicalEnhancers_ESC.bed
│ ├── index.rst
│ ├── requirements.txt
│ └── source/
│ ├── _templates/
│ │ └── layout.html
│ ├── deeptools.rst
│ └── modules.rst
├── galaxy/
│ ├── workflows/
│ │ ├── 1_BAM_file_TO_Heatmap_of_read_coverages.ga
│ │ ├── 2_BAM_files_TO_clustered_Heatmap_of_read_coverages.ga
│ │ ├── Add_chr_to_first_column_of_a_6_columns_BED_file.ga
│ │ ├── Clustered_heatmap_of_signals_around_the_TSSs__1_bigWig_TO_heatmap.ga
│ │ ├── Compute_and_correct_GC_bias.ga
│ │ ├── Remove_chr_from_the_beginning_of_genomic_interval_files.ga
│ │ ├── readme.rst
│ │ └── repository_dependencies.xml
│ └── wrapper/
│ ├── .shed.yml
│ ├── alignmentSieve.xml
│ ├── bamCompare.xml
│ ├── bamCoverage.xml
│ ├── bamPEFragmentSize.xml
│ ├── bigwigAverage.xml
│ ├── bigwigCompare.xml
│ ├── computeGCBias.xml
│ ├── computeMatrix.xml
│ ├── computeMatrixOperations.xml
│ ├── correctGCBias.xml
│ ├── deepTools_macros.xml
│ ├── estimateReadFiltering.xml
│ ├── multiBamSummary.xml
│ ├── multiBigwigSummary.xml
│ ├── plotCorrelation.xml
│ ├── plotCoverage.xml
│ ├── plotEnrichment.xml
│ ├── plotFingerprint.xml
│ ├── plotHeatmap.xml
│ ├── plotPCA.xml
│ ├── plotProfiler.xml
│ ├── test-data/
│ │ ├── alignmentSieve.bam
│ │ ├── alignmentSieve.bed
│ │ ├── alignmentSieve.txt
│ │ ├── alignmentSieve2.bam
│ │ ├── alignmentSieve3.bam
│ │ ├── bamCompare_result1.bg
│ │ ├── bamCompare_result2.bw
│ │ ├── bamCoverage_result1.bw
│ │ ├── bamCoverage_result2.bw
│ │ ├── bamCoverage_result3.bg
│ │ ├── bamCoverage_result4.bg
│ │ ├── bamCoverage_result4.bw
│ │ ├── bamCoverage_result5.bw
│ │ ├── bamCoverage_result6.bw
│ │ ├── bamPEFragmentSize_lengths1.txt
│ │ ├── bamPEFragmentSize_result1.txt
│ │ ├── bamPEFragmentSize_table1.txt
│ │ ├── bigwigAverage2.bw
│ │ ├── bigwigCompare_result1.bw
│ │ ├── bigwigCompare_result2.bg
│ │ ├── bowtie2 test1.bam
│ │ ├── computeGCBias_result1.tabular
│ │ ├── computeMatrix1.bed
│ │ ├── computeMatrix2.bed
│ │ ├── computeMatrix2.bw
│ │ ├── computeMatrixOperations.txt
│ │ ├── correctGCBias_result1.bam
│ │ ├── estimateReadFiltering.txt
│ │ ├── heatmapper_result2.tabular
│ │ ├── multiBamSummary_regions.bed
│ │ ├── multiBamSummary_result1.npz
│ │ ├── multiBamSummary_result2.npz
│ │ ├── multiBamSummary_result2b.npz
│ │ ├── multiBigwigSummary_result1.npz
│ │ ├── multiBigwigSummary_result2.npz
│ │ ├── multiBigwigSummary_result2.tabular
│ │ ├── paired_chr2L.bam
│ │ ├── paired_chr2L.cram
│ │ ├── phiX.2bit
│ │ ├── phiX.bam
│ │ ├── phiX.bam.bai
│ │ ├── phiX.fasta
│ │ ├── plotCorrelation_result1.tabular
│ │ ├── plotCoverage.metrics
│ │ ├── plotCoverage_result1.tabular
│ │ ├── plotEnrichment_output.txt
│ │ ├── plotFingerprint_quality_metrics.tabular
│ │ ├── plotFingerprint_result2.tabular
│ │ ├── plotPCA_result2.tabular
│ │ ├── profiler_result2.tabular
│ │ ├── sequence.2bit
│ │ ├── test.bw
│ │ ├── test_compated.bw
│ │ └── test_half.bw
│ ├── tool-data/
│ │ ├── deepTools_seqs.loc.sample
│ │ └── lastz_seqs.loc.sample
│ └── tool_data_table_conf.xml.sample
├── gallery/
│ └── Whyte_TypicalEnhancers_ESC.bed
├── pyproject.toml
└── scripts/
├── convertChromsBigWig.py
├── mappabilityBigWig_to_unmappableBed.sh
└── split_bed_into_multiple_files.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/CONTRIBUTING.md
================================================
# Contributing
**Welcome to deepTools GitHub repository! Please check the following instructions
for contributing to the repository :**
## Adding features or fixing bugs
* Fork the repo
* Check out a feature or bug branch the you want to work on (for adding new
features, use the develop branch)
* Add your changes
* Update README when needed
* Submit a pull request to upstream repo
* Add description of your changes
* Ensure tests are passing
* Ensure branch is mergable
## Testing
* Please make sure that github actions are passing
================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
**Welcome to deepTools GitHub repository! Before opening the issue please check
that the following requirements are met :**
- [ ] Search whether this issue (or a similar issue) has been solved before
using the search tab above. Link the previous issue if appropriate below.
- [ ] Paste your deepTools version (`deeptools --version`) and your python
version (`python --version`) below.
- [ ] Paste the full deepTools command that produces the issue below
(ignore if you simply spotted the issue in the code/documentation).
- [ ] Paste the output printed on screen from the command that produces the issue
below (ignore if you simply spotted the issue in the code/documentation).
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
**Welcome to deepTools GitHub repository! Please check the following regarding
your pull request :**
- [ ] Does the PR contain new feature?
- [ ] Does the PR contain bugfix?
- [ ] Does the PR contain documentation changes?
- [ ] Does the PR contain changes to the galaxy wrapper?
================================================
FILE: .github/workflows/planemo.yml
================================================
name: Planemo
on: [push, pull_request]
env:
GALAXY_BRANCH: release_24.1
defaults:
run:
shell: bash -l {0}
jobs:
planemo_test:
name: Planemo test
runs-on: ubuntu-latest
strategy:
matrix:
chunk: [1, 2, 3]
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-activate-base: true
python-version: "3.12"
- name: get samtools
run: |
conda install -c conda-forge -c bioconda samtools
- name: pip install
run: |
pip install .[actions]
- name: planemo
run: |
./.planemo.sh ${{ matrix.chunk }} ${{ env.GALAXY_BRANCH }}
- 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
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Combine outputs
uses: galaxyproject/planemo-ci-action@v1
id: combine
with:
mode: combine
html-report: true
- uses: actions/upload-artifact@v4
with:
name: 'All tool test results'
path: upload
- name: Check outputs
uses: galaxyproject/planemo-ci-action@v1
id: check
with:
mode: check
================================================
FILE: .github/workflows/pypi.yml
================================================
name: pypi
on:
create:
tags:
- '*'
defaults:
run:
shell: bash -l {0}
jobs:
pypi:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
name: upload to pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: build
run: |
pip install .[actions]
rm -f dist/*
python -m build
- name: upload
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
twine upload dist/*
================================================
FILE: .github/workflows/test.yml
================================================
name: Test
on: [push, pull_request]
defaults:
run:
shell: bash -l {0}
jobs:
check_versions_matches:
name: Check deeptools version matches galaxy tools
runs-on: ubuntu-latest
if: github.base_ref == 'master'
steps:
- uses: actions/checkout@v4
- name: Check path
run: find /home/runner/work/deepTools/deepTools -name "pyproject.toml"
- name: Get Version of Deeptools
run: echo "deeptools_version=$(grep "version" /home/runner/work/deepTools/deepTools/pyproject.toml | awk '{print substr($NF, 2, length($NF) - 2)}')" >> $GITHUB_ENV
- name: Get Version of Galaxy tools
run: echo "galaxy_deeptools_version=$(grep "token.*TOOL_VERSION" /home/runner/work/deepTools/deepTools/galaxy/wrapper/deepTools_macros.xml | awk -F '>|<' '{print $3}')" >> $GITHUB_ENV
- name: Versions
run: |
echo deeptools version=${deeptools_version}
echo deeptools version in galaxy=${galaxy_deeptools_version}
- name: Fail PR if versions not matching
run: |
if [ -z $galaxy_deeptools_version ]; then
echo "galaxy_deeptools_version not defined change the github action"
exit 1
fi
if [ -z $deeptools_version ]; then
echo "deeptools_version not defined change the github action"
exit 1
fi
if [ "$galaxy_deeptools_version" != "$deeptools_version" ]; then
echo "versions do not match"
exit 1
fi
build-linux:
name: Test on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: pip install
run: |
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: |
pytest -v
- name: make an artifact
run: |
rm -f dist/*
python -m build
- uses: actions/upload-artifact@v4
with:
name: "distfiles"
path: "dist"
test-wheels:
name: test wheel
runs-on: ubuntu-latest
needs: build-linux
strategy:
matrix:
python-version: ['3.9','3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: "distfiles"
path: ~/dist/
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: install wheel
run: |
pip install ~/dist/*whl
deeptools -h
- name: pytest
run: |
pip install pytest
pytest -v
build-osx:
name: Test on OSX
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: pip install
run: |
pip install .[actions]
- name: Test deepTools
run: |
pytest -v
================================================
FILE: .gitignore
================================================
*.tar.gz
*.py[cod]
# C extensions
*.so
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
var
sdist
develop-eggs
.installed.cfg
lib
lib64
__pycache__
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
nosetests.xml
# Translations
*.mo
# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# sphinx build folder
_build
_modules
_sources
# Ignore all emacs backup files
*~
#ignore pycharm
.idea
#os X
.DS_Store
._.DS_Store
# Planemo
tool_test*
================================================
FILE: .planemo.sh
================================================
#!/bin/bash
# Some versions of planemo don't handle symlinks
unlink galaxy/wrapper/test-data/test.bw
cp deeptools/test/test_heatmapper/test.bw galaxy/wrapper/test-data/test.bw
if [[ $1 == "1" ]] ; then
wrappers="galaxy/wrapper/alignmentSieve.xml \
galaxy/wrapper/bamCompare.xml \
galaxy/wrapper/bamCoverage.xml \
galaxy/wrapper/bamPEFragmentSize.xml \
galaxy/wrapper/bigwigCompare.xml \
galaxy/wrapper/bigwigAverage.xml \
galaxy/wrapper/computeGCBias.xml"
elif [[ $1 == "2" ]] ; then
wrappers="galaxy/wrapper/computeMatrix.xml \
galaxy/wrapper/computeMatrixOperations.xml \
galaxy/wrapper/correctGCBias.xml \
galaxy/wrapper/estimateReadFiltering.xml \
galaxy/wrapper/multiBamSummary.xml \
galaxy/wrapper/multiBigwigSummary.xml"
else
wrappers="galaxy/wrapper/plotCorrelation.xml \
galaxy/wrapper/plotCoverage.xml \
galaxy/wrapper/plotEnrichment.xml \
galaxy/wrapper/plotFingerprint.xml \
galaxy/wrapper/plotHeatmap.xml \
galaxy/wrapper/plotPCA.xml \
galaxy/wrapper/plotProfiler.xml"
fi
planemo --version
planemo lint ${wrappers}
planemo test --no_dependency_resolution --galaxy_branch $2 --install_galaxy ${wrappers} 2>&1
mkdir upload
mv tool_test_output* upload/
================================================
FILE: .readthedocs.yaml
================================================
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.12"
sphinx:
configuration: docs/conf.py
python:
install:
- method: pip
path: .
- requirements: docs/requirements.txt
================================================
FILE: CHANGES.txt
================================================
3.5.5
* drop support for python 3.7
* doc fixes (argparse properly displayed, minor changes in installation instructions)
* deepblue support stops
* initiate deprecation of tight_layout in plotheatmap, in favor of constrained_layout. Minor changes in paddings, etc can occur (but for the better).
* documentation changes to improve ESS tab, table constraints have been lifted & sphinx_rtd_theme to v2.0.0
* upload artifact in gh test runner pinned to 3
* Try to get the number of processors from sched_getaffinity, to avoid using to many in job submissions for example. #1199
* Fix typo in estimateScaleFactor that fixes broken argparsing. #1286
3.5.4
* error handling and cases for bwAverage with >2 samples
* Tick.label deprecation for mpl 3.8
* minimal mpl version is 3.5
* cicd update for pypi push
3.5.3
* requirement cap for matplotlib lifted (changes in plotting can occur)
* nose has been deprecated in favor of pytests
* pytests run with python 3.7 - 3.11
* toml file for installation, requirements, versioning and executables
* planemo tests updated to galaxy 23.1
* custom github action runner deprecated
* deprecation of np types for builtin types
* stricter label checks and validator in galaxy
3.5.2
* new subcommand: Bigwig average #1169
* dendogram of plotCorrelation now matches each cell correctly
* Fix label options
* add pool
* several other bugs fixed: #1159, #1185, #1172, #1181, #1183
* Fix galaxy tests, separate planemo and update pypi push only on tag releases
* upload artifact
* allow 1 or 2 lines diff for bowtie2 program
* change github action to get artifacts
* fix plotPCA
* try to fix old samtools installed
* add forgotten channels
* default chunklength increased for alignmentSieve
* chunklength in alignmentSieve is a CLI argument now
* suppress lack of index warnings from pysam
* fixedStep in bedGraph output to avoid merging bins with equal values
3.5.1
* cmp usage is updated to fit the recent mpl updates.
* The requirements.txt is updated.
* "NA" occurences in plotFingerprint.py have been replaced by numpy.NAN (PR #1002)
* computeMatrixOperations.xml is fixed (brought up in #1003)
* plotly error is fixed. (issue #1013)
* relase version is updated in planemo.sh
* fixed galaxy tests
* A bug is taken care of in computeMatrixOperations.py / dataRange
* in plotProfile.py legen location is changed from auto to best (issue #1042)
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().
* Added the missing argument (--clusterUsingSamples) to plotProfile.
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)
* Fixed a small X-axis tick offset issue. This caused the location of tick marks in profile plots to be shifted to the left by 0.5 to 1 bin. This was generally not notable, only really appearing when very few bins (e.g., 4) were used. The issue was mostly that the end tick would appear after the end of the plot, since its coordinate was the end of the bin. (issue #888)
* multiBamSummary and multiBigwigSummary no longer exclude small bins at the end of genomic chunks. multiBamSummary now has a `--genomicChunkSize` option in case users need to control the size of the genome used for multiprocessing for consistency. (issue #887)
* Added 4 new colormaps, which were copied from the seaborn project (issue #879). These are: rocket, mako, vlag, and icefire.
* Fixed an issue in the Galaxy wrapper of plotCorrelation where the X and Y.
* Fixed an issue with the `--Offset` option, where a single negative value wouldn't include only a single position, but rather that base through the end of the read. (stems from issue #902)
* Clustered output from plotHeatmap and plotProfile now allow computing the silhouette score of each row. This is printed in the returned BED file as the last column.
3.3.1
* Fixed `--plotNumbers` not working in `plotCorrelation`. This was issue #838.
* Fixed compatibility with matplotlib 3 and restrict to at least that version.
* The Y-axis labels should once again appear in both plotHeatmap and plotProfile (issue #844). This was related to the previous point.
* Testing is no longer performed with python 2.7, which will reach end of life in a couple months.
* Various documentation updates (issues #868, #867 and #851).
* Increased support for BED files with track header lines (issue #866).
3.3.0
* `plotCoverage` now has a `--BED` option, to restrict plots and output to apply to a specific set of regions given by a BED or GTF file or files (issue #829).
* `plotCoverage` now has a `--DepthSummary` option, which produces a summary similar to GATK's DepthOfCoverage (issue #828).
* `plotCoverage` is now able to compute coverage metrics for arbitrary coverage thresholds using multiples of the `-ct` option (e.g., `-ct 0 -ct 10 -ct 20 -ct 30`).
3.2.1
* Changed a bug in `estimateReadFiltering` where the estimated number of filtered reads was typically too low.
* Made an internal change that should drastically reduce the memory requirements of many tools. This slightly increases run time, but as the resulting resource usage is much more attractive this is judged worthwhile.
* An informative error message is now produced with `bamCoverage` if RPGC normalization is requested but no effective genome size is provided (issue #815).
* Fixes some issues with y-axis scaling (issue #822)
3.2.0
* Added access in the Galaxy wrapper to the `--labels` option in most tools (issue #738)
* Added the `std` plot type to plotProfile in Galaxy (issue #782)
* `bamCompare` now has a `--skipZeroOverZero` option to allow skipping bins where both input files lack coverage (issue #785)
* `bamCompare` and `bigwigCompare` can now take two pseudocounts, in case you want a different value for the numerator and the denominator (issue #784)
* `multiBamSummary` now has a `--scaleFactors` option, which computes scale factors in the same manner as DESeq2 to a file. Note that the produced scaling factors are meant to be used with `bamCoverage`. If you want to use them directly in DESeq2 (or a similar package) you will need to invert them (take 1/scale factor). (issue #800)
* Fixed an issue with large numbers of samples and small genome sizes sometimes causing nothing to be processed. (issue #801)
3.1.3
* Added the `--legendLocation` option in the Galaxy wrappers for plotProfile and plotHeatmap
* More thoroughly checked that output files can be written (issue #764).
* `bamCompare` and `bigwigCompare` can now take two pseudocounts, in case you want a different value for the numerator and the denominator (issue #784)
3.1.2
* Added a `--markers` option to `plotPCA`, courtesy of @sklasfeld.
* `computeMatrixOperations rbind` now properly supports multiple region groups (issue #742)
* Fixed the usage of `--xRange` and `--yRange` with `plotCorrelation` (issue #709)
3.1.1
* Fixed the `--outFileNameData` option in `plotProfile` when `computeMatrix reference-point --referencePoint center` was used. This caused an error previously. (issue #727)
* RPGC normalization and the `--scaleFactor` option in `bamCoverage` are no longer mutually exclusive.
* Increased the default plot width in plotPCA (issue #738)
3.1.0
* The `--centerReads` option in `bamCoverage` is now compatible with `--Offset` (previously `--centerReads` was silently ignored if `--Offset` was specified). (issue #693)
* `bamCoverage` and `bamCompare` now have an `--exactScaling` option. Instead of using a random sample of alignment to compute the scaling factor, this causes all reads in the file to be used. This is significantly slower, but helpful in situations where reads that should be excluded clump together on the genome (i.e., when sampling based on location is likely to be inaccurate).
* `plotCorrelation --whatToPlot scatterplot` now has `--xRange` and `--yRange` options rather than just `--maxRange`. (issue #709)
* `computeMatrixOperations` can now be used to change sample and group names.
* `computeMatrixOperations` can now filter rows by minimum and/or maximum value.
* `--maxThreshold` and `--minThreshold` are now more consistently honoured. (#702)
* Fixed region handling when using files on deepBlue (#700)
* Using `--normalizeUsing RPGC` with `bamCompare` will now result in a fatal error, rather than a simple warning and the settings being changed under the hood. (#718)
* Related to the last point, setting `--normalizeUsing` to anything other than `None` will result in an error unless `--scaleFactorsMethod None` is also used. This is to prevent people from accidentally getting unintended normalization.
* bamPEFragmentSize no longer exploids its memory use with multiple large BAM/CRAM files (#720). Many other tools will also benefit from this change.
3.0.2
* Fixed an issue regarding under sampling alignments in some cases with computing scaling factors. This was issue #690. The resolution isn't perfect, it's hard to know how many reads really need to be sampled for things like RNA-seq.
* `computeMatrix` now has a `--verbose` option. Setting this will drastically increase the verbosity of the messages sent to the screen. Only do this for debugging. `--quiet` will disable this completely (as well as all other messages printed to screen).
* Fixed handling of `--sortUsing region_length` in `plotHeatmap`. This now works properly for `--referencePoint center` and `--referencePoint TES`, where in the latter case the dashed line is drawn at the region start. The documentation has been updated to mention this. (issue #671)
* The reference point label specified by `computeMatrix reference-point` is now respected by plotHeatmap and plotProfile. So if you used `computeMatrix reference-point --referencePointLabel center` then 'center' will now appear as the tick label in your heatmaps and profiles automatically. (issues #606 and #683)
* Enabled using regions with a `.` in the chromosome name in the Galaxy wrappers (issue #692)
3.0.1
* Fixed the `--perGroup` option in plotProfile and plotHeatmap when multiple groups were being used. In version 3.0.0, this would typically cause an error and deepTools to crash. (issue #673)
* Fixed a few issues with the Galaxy wrappers. Thanks to Ralf Gilsbach, Claudia Keller, and @bgruening (e.g., issue #678)
3.0.0
* plotCorrelation` now has `--log1p` and `--maxRange` options if a scatter plot is produced. `--log1p` plots the natural log of the values (plus 1). `--maxRange` sets the maximum X and Y axis ranges. If they would normally be below this value then they are left unchanged. (issue #536)
* The PCA plot now includes "% of var. explained" in the top axis labels. (issue #547)
* `plotProfile` and `plotHeatmap` now have a `--labelRotation` option that can rotate the X-axis labels. This is one of the more common requests for customization. For further customization, please modify your .matplotlibrc file or save as a PDF and modify further in Illustrator or a similar program. (issue #537)
* The `--ignoreDuplicates` algorithm has been updated to better handle paired-end reads. (issue #524)
* Added the `estimateReadFiltering` tool to estimate how many reads would be filtered from a BAM file or files if a variety of desired filtering criterion are applied (issue #518).
* Rewrote the bigWig creation functions so there are no longer steps involving creating a single large bedGraph and then sorting it. That was a hold-over from previous versions that used UCSC tools. This was issue #546. This also means that there are no longer any required external programs (previously, only `sort` was required).
* `plotPCA` can now be run on the transposed matrix, as is typically done with RNAseq data (e.g., with deepTools). Further, matplotlib is now no longer used for computing the PCA, but rather an SVD is performed and the results directly used. The options `--transpose` and `--ntop` were also added. The former computes the PCA of the transposed matrix and the latter specifies how many of the most variable rows in the matrix to use. By default, the 1000 most variable features are used. In the (now optional) plot, the `--PCs` option can now be used to specify which principal components to plot. Finally, the unbiased standard deviation is used in the out, as is done by `prcomp()` in R. This was issue #496.
* Symbol colors for `plotPCA` can now be specified. (issue #560)
* `plotFingerprint` always returns the synthetic JSD, even if no `--JSDsample` is specified. (issue #564)
* `plotEnrichment` will only read in annotation files a single time rather than in each thread. This prevents terrible performance when using many tens of millions of BED/GTF regions at the expense of a slight memory increase. (issue #530)
* Fixed a small bug generally affecting `plotFingerprint` where BAM files without an index were processed as bigWig files, resulting in a confusing error message (issue #574). Thanks to Sitanshu Gakkhar for poiting this out!
* `bamPEFragmentSize` now has `--table` and `--outRawFragmentLengths` options. The former option will output the read/fragment metrics to a file in tabular format (in addition to the previous information written to the screen). The latter option will write the raw read/fragment counts to a tsv file. The format of the file is a line with "#bamPEFragmentSize", followed by a header line of "Size\tOccurences\tSample", which should facilitate processing in things like R. (issue #572)
* `bamPEFragmentSize` will now plot the read length distribution for single-end BAM files. Note that if you mix single and paired-end files that the resulting plots may be difficult to interpret.
* The various plot commands do not actually have to plot anything, instead they can optionally only print their raw metrics or other text output. This is mostly useful with large numbers of input files, since the resulting plots can become quickly crowded. (issue #5719
* Expanded the metrics output by `bamPEFragmentSize` such that it now fully replaces Picard CollectInsertSizeMetrics (issue #577).
* "plotly" is now available as an output image format for all tools. Note that this is not really an image format, but rather an interactive webpage that you can open in your browser. The resulting webpages can be VERY large (especially for `plotHeatmap`), so please keep that in mind. Further, plotly does not currently have the capabilities to support all of deepTools' features, so note that some options will be ignored. For privacy reasons, all plotly files are saved locally and not uploaded to the public plot.ly site. You can click on the "Export to plot.ly" link on the bottom right of plotly output if you would like to modify the resulting files.
* `bamCoverage` no longer prints `normalization: depth` be default, but rather a more accurate message indicating that the scaling is performed according to the percentage of alignments kept after filtering. This was originally added in #366 (issue #590).
* The output of `plotFingerprint --outRawCounts` now has a header line to facilitate identification by MultiQC.
* `plotPCA` now has a `--log2` option, which log2 transforms the data before computing the PCA. Note that 0.01 is added to all values to 0 doesn't become -infinity.
* `computeGCBias` no longer requires a fragment length for paired-end datasets. This was apparently always meant to be the case anyway. (issue #595)
* `computeMatrixOperations sort` can now properly perform filtering of individual regions, as was originally intended (issue #594)
* `plotCoverage --outRawCounts` now has another line it its header, which is meant to aid MultiQC.
* There is no longer a configuration file. The default number of threads for all tools is 1. See issue #613.
* `bamCoverage` and `bamCompare` have rewritten normalization functions. They have both added CPM and BPM normalization and, importantly, filtering is now done **before** computing scaling factors. A few of the options associated with this (e.g., `--normalizeUsingRPKM`) have been replaced with the `--normalizeUsing` option. This behavior represents a break from that seen in earlier versions but should be easier to follow and more in line with what users expect is happening. The syntax for normalization has been reworked multiple times (see #629).
* Fixed issue #631
* `computeMatrix` now repeats labels for each column in a plot. This is convenient if you later want to merge reference-point and scale-regions runs and still have correct tick marks and labels in plotHeatmap/plotProfile (issue #614). Note that the output of computeMatrix and computeMatrixOperations can not be used with older versions of deepTools (but output from previous versions can still be used).
* `plotHeatmap --sortRegions` now has a `keep` option. This is identical to `--sortRegions no`, but may be clearer (issue #621)
* `plotPCA --outFileNameData` and `plotCorrelation --outFileCorMatrix` now produce files with a single comment line (i.e., '#plotPCA --outFileNameData' and '#plotCorrelation --outFileCorMatrix'). These can then be more easily parsed by programs like MultiQC.
* All functions that accept file labels (e.g., via a `--samplesLabel` option) now also have a `--smartLabels` option. This will result in labels comprised of the file name, after stripping any path and the file extension. (issue #627)
* The `-o` option can now be universally used to indicate the file to save a tool's primary output. Previously, some tools use `-o`, some used `-out` and still others used things like `-hist` or `-freq`. This caused annoyance due to having to always remember the appropriate switch. Hopefully standardizing to `-o` will alleviate this. (issue #640)
* Using a --blackListFileName with overlapping regions will typically now cause the various deepTools programs to stop. This is to ensure that resulting scale factors are correct (issue #649)
* `bamCoverage` is a bit more efficient with small BAM files now due to underlying algorithmic changes. Relatedely, bamCoverage will skip some unnecessary estimation steps if you are not filtering reads, further speeding processing a bit. (issue #662)
* Added support for CRAM files. This requires pysam > 0.13.0 (issue #619).
2.5.7
* Fixed a small bug that caused computation to stop. This was related to a change made for release 2.5.5.
2.5.6
* Fixed a bug where deepTools in python3 can't handle npz file labels created under python 2.
2.5.5
* Updated blacklist handling such that an error is thrown on overlapping regions.
2.5.4
* Fixed issue #612, which only occurs when unaligned reads have a position assigned to them.
* Ticks in the profile plot at the top of the output of `plotHeatmap` should now always line up properly. (issue #616)
2.5.3
* Fixed a bug in `plotEnrichment`, the `--keepExons` option with a BED12 file would cause an error. (issue #559)
* `bamCoverage` now doesn't cause and error to be thrown by `sort` in there are "/spaces in quoted path/". (issue #558)
2.5.2
* Fixed a bug in `bamCoverage` that can cause crashes when python3 is used.
* Fixed a bug in the multiBigwigSummary Galaxy wrapper.
* A more reasonable exit code (not 0) is now returned if there's a mismatch in the label and file number.
* `plotFingerprint` no longer tries to use illegal line designators (issue #538)
* Various documentation fixes
2.5.1
* Added universal new line support to deeptoolsintervals (issue #506).
* Fixed a few issues with correctGCBias under python 3.5 (thanks to @drakeeee)
* Setting `--minThreshold 0.0` or `--maxThreshold 0.0` now works properly. Previously, setting either of these to 0 was ignored. (issue #516)
* You can now specify the plot width and height in `plotPCA` and `plotCorrelation` (heatmap only) with the `--plotWidth` and `--plotHeight` parameters. (issue #507)
* plotCoverage no longer clips the top off of plots. Further, you can now set the plot width and height with `--plotWidth` and `--plotHeight`. (issue #508)
* In bamCoverage, specifying `--filterRNAstrand` no longer results in `--extendReads` being ignored. (issue #520)
* `plotFingerprint` and `plotEnrichment` no longer require producing a plot, which is useful if you only need QC metrics and are using a LOT of samples (such that matplotlib would crash anyway). This hasn't been implemented in Galaxy, but can if people would like it. (issues #519 and #526)
* `computeMatrix` now accepts a `--samplesLabel` option, which is useful in those cases when you aren't immediately running `plotHeatmap` and don't have terribly descriptive file names (issue #523)
* If you use `plotFingerprint` with the `--JSDsample` option and forget to list that file under `--bamfiles` it will be added automatically and the file name added to the labels if needed (issue #527)
* Various Galaxy wrapper fixes
2.5.0
* Fix a bug where using regions with the same name in multiple BED files in computeMatrix caused downstream problems in plotHeatmap/plotProfile (issue #477).
* If computeMatrix/plotHeatmap/plotProfile is asked to sort the output matrix, it now does so by ignoring NaN values. Previously, any row with an NaN was placed at the top of the output (issue #447).
* Fixed issue #471
* Various Galaxy wrapper fixes
* There is now a `--rowCenter` option in `plotPCA`, which can be used to make each row of the matrix used in the PCA to have a mean of 0. This can be useful in cases where there's extreme region-based depth variation that is shared between all samples. This was issue #477.
* The --Offset option is now available in `plotEnrichment`. This was issue #481.
* The maximum coverage allowed while calculating the Jensen-Shannon distance in `plotFingerprint` has been increased to 2 million and an informational message containing the number of bins above this value is printed to the standard output.
* `bamCoverage` now respects the `--scaleFactor` argument even if not other normalization is performed (issue #482).
* The `--minFragmentLength` and `--maxFragmentLength` options now respect single-end reads. For SE reads, these parameters refer to the number of aligned bases (i.e., splicing is ignored). This was issue #489.
* `--yMin` and `--yMax` can now be lists of values in `plotHeatmap`. This was issue #487. Note that the plots are not perfectly aligned if you do this.
2.4.3
* Fixed incorrect label ordering in the `plotCorrelation` command with the `--outFileCorMatrix` options.
* Fixed bug #491, which involved python 3 and bamCoverage.
2.4.2
* Fixed an issue where `computeMatrix reference-point --referencePoint center` would break if 1-base regions were used. This was bug #456.
* `plotCorrelation` with `--outFileCorMatrix` now works with `--labels` again (thanks to @sklasfeld for supplying the patch).
* `bigwigCompare` and `bamCompare` can now return the average (mean) of two input files (issue #467).
2.4.1
* Setting --zMin to the same value as --zMax, whether intentionally or because the --zMax value computed by deepTools happens to be now larger than the desired value, will result in the maximum value in the dataset being used (internally, --zMax gets set to None).
* Scale factor is now set to 1 in bamCoverage if no normalization is used. The fact that this wasn't being done previously was a bug.
* Fixed a bug (#451) affecting BED files with a `deepTools_group` column that caused a problem with `--sortRegions keep` in computeMatrix.
* Fixed a bug where some matrices produced with `computeMatrixOperations cbind` would result in the right-most samples sometimes getting squished due to having ticks outside of their graph bounds. Ticks are now scaled if they don't match the data range (issue #452).
* In plotFingerprint, the number of reads per-bin are no longer used. Instead, the sum of the per-base coverage (or signal if bigWig input is used) is used. This leads to more similar metrics produced by us and others regarding things like Jensen-Shannon metrics. For those just interested in the plots, there's little effective change here.
2.4.0
* The --Offset option to bamCoverage can now take two values, which can be used to specify a range within each alignment of bases to use. As an example, `--Offset 5 -1` will use ignore the first 4 bases of an alignment (accounting for orientation) and use only the 5th through last base. This can be useful for things like ATACseq (see #370).
* Read extension can now be used in conjunction with --Offset in bamCoverage.
* plotFingerprint can now output quality metrics, including the Jensen-Shannon distance if a reference sample is specified (see #328). Additionally, various statistics from CHANCE can be produced.
* Switched from using the 'twobitreader' python module to our new custom 'py2bit' module for accessing 2bit files. This fixes the performance regression seen in computeGCBias starting in version 2.3.0 (#383).
* `bigwigCompare`, `computeMatrix`, and `multiBigwigSummary` can read signal files hosted on [deepBlue](http://deepblue.mpi-inf.mpg.de/).
* Fixed a minor bug in `deeptools`, where the `--version` option was ignored (see #404).
* Text in SVG and PDF files is now actual text and not a path (see #403).
* The `--maxFragmentLength` option in bamCoverage now alters the `maxPairedFragmentLength` that is otherwise hard-coded (see #410).
* Added the `computeMatrixOperations` tools, which can be used to sort/reorder/subset/filter/combine the output of `computeMatrix`.
* `computeMatrix --sortRegions` has a new `keep` option, which is the default. This mimics the behavior in deepTools prior to 2.3.0 where the output order matched the input order. This is, of course, a bit slower, so if the order doesn't matter then use `no`.
* Fixed issue #435, where `plotHeatmap --sortRegions region_length` would crash with an error.
* Output bedGraph files are now sorted (#439).
* Values stored in bedGraph files (and therefore placed into bigWig files) now use python's "general" format with 6 digits of precision. This tends to produce slightly larger files, but with less loss for values near 0 (see #438).
* Corrected how computeGCBias determines the lambda parameter, which should only really affect very atypical experiments (i.e., correctGCBias would have crashed is this greatly affected you).
2.3.6
* multiBamSummary will now not automatically append .npz to the output file name if it's not present. This was bug #436
* Fixed a bug with plotHeatmap where --yMin and --yMax didn't work
2.3.5
* Various Galaxy wrapper fixes (e.g., issue #415 and #417)
* Fixed issue #413, wherein the --nanAfterEnd option sometimes causes computeMatrix to throw an error.
* Fixed issue #416, wherein --outRawCounts in multiBamSummary and multiBigwigSummary would cause an error if python3 was being used.
2.3.4
* Fixed bug #405, which dealt with the SES normalization in bamCompare (it was producing an error and terminating the program).
* Fixed bug #407, which dealt with multiBamSummary or multiBigwigSummary bins and saving the raw data. This was causing an error and the program to terminate.
2.3.3
* Fixed a bug wherein proper pairs where being incorrectly called improper pairs, thereby causing slightly incorrect read extension.
2.3.2
* The deeptoolsinterval module was modified to speed up plotEnrichment, which was taking forever to finish.
2.3.1
* This release has no real code changes, the 2.3.0 release on pypi was missing files.
2.3.0
* Modified how normalization is done when filtering is used. Previously, the filtering wasn't taken into account when computing the total number of alignments. That is now being done. Note that this uses sampling and will try to sample at least 100000 alignments and see what fraction of them are filtered. The total number of aligned reads is then scaled accordingly (#309).
* Modified how normalization is done when a blacklist is used. Previously, the number of alignments overlapping a blacklisted region was subtracted from the total number of alignments in the file. This decreased things a bit too much, since only alignments falling completely within a blacklisted region are actually excluded completely (#312).
* BED12 and GTF files can now be used as input (issue #71). Additionally, multiBamSummary, multiBigwigSummary and computeMatrix now have a --metagene option, which allows summarization over concatenated exons, rather than include introns as well (this has always been the default). This was issue #76.
* Read extension is handled more accurately, such that if a read originates outside of a bin or BED/GTF region that it will typically be included if the --extendReads option is used and the extension would put it in a given bin/region.
* deepTools now uses a custom interval-tree implementation that allows including metadata, such as gene/transcript IDs, along with intervals. For those interested, the code for this available separately (https://github.com/dpryan79/deeptools_intervals) with the original C-only implementation here: https://github.com/dpryan79/libGTF.
* The API for the countReadsPerBin, getScorePerBigWigBin, and mapReduce modules has changed slightly (this was needed to support the --metagene option). Anyone using these in their own programs is encouraged to look at the modified API before upgrading.
* Added the `plotEnrichment` function (this was issue #329).
* There is now a `subsetMatrix` script available that can be used to subset the output of computeMatrix. This is useful for preparing plots that only contain a subset of samples/region groups. Note that this isn't installed by default.
* The Galaxy wrappers were updated to include the ability to exclude blacklisted regions.
* Most functions (both at the command line and within Galaxy) that process BAM files can now filter by fragment length (--minFragmentLength and --maxFragmentLength). By default there's no filtering performed. The primary purpose of this is to facilitate ATACseq analysis, where fragment length determines whether one is processing mono-/di-/poly-nucleosome fragments. This was issue #336.
* bamPEFragmentSize now has --logScale and --maxFragmentLength options, which allow you to plot frequencies on the log scale and set the max plotted fragment length, respectively. This was issue #337.
* --blackListFileName now accepts multiple files.
* bamPEFragmentSize now supports multiple input files.
* If the sequence has been removed from BAM files, SE reads no longer cause an error in bamCoverage if --normalizeTo1x is specified. In general, the code that looks at read length now checks the CIGAR string if there's no sequence available in a BAM file (for both PE and SE datasets). This was issue #369.
* bamCoverage now respects the --filterRNAstrand option when computing scaling factors. This was issue #353.
* computeMatrix and plotHeatmap can now sort using only a subset of samples
* There is now an --Offset option to bamCoverage, which allows having the signal at a single base. This is useful for things like RiboSeq or GROseq, where the goal is to get focal peaks at single bases/codons/etc.
* The --MNase option to `bamCoverage` now respects --minFragmentLength and --maxFragmentLength, with defaults set to 130 and 200.
2.2.4
* Fix the incorrectly oriented dendrogram in plotCorrelation (issue #350). Relatedly, we're bumping the minimum version of scipy required to one where this is correct.
2.2.3
* Fixed issue #334, where computeGCBias wasn't properly handling the black list option.
2.2.2
* Fixed labels when hierarchical clustering is used (they were off by one previously).
* Fixed a bug wherein bamCompare couldn't work with a blacklist
* Fixed yet another change in pysam, though at least in this case is was fixing a previous problem
2.2.1
* Fixed a bug introduced in version 2.2.0 wherein sometimes a pre-2.2.0 produced matrix file could no longer be used with plotHeatmap or plotProfile (this only happened when --outFileNameData was then used).
* Finally suppressed all of the runtime warnings that numpy likes to randomly throw.
* Worked around an undocumented change in pysam-0.9.0 that tended to break things.
2.2.0
* plotFingerprint now iterates through line styles as well as colors. This allows up to 35 samples per plot without repeating (not that that many would ever be recommended). This was issue #80.
* Fixed a number of Galaxy wrappers, which were rendered incorrectly due to including a section title of "Background".
* A number of image file handles were previously not explicitly closed, which caused occasional completion of a plot* program but without the files actually being there. This only happened on some NFS mount points.
* The Galaxy wrappers now support the `--outFileNameData` option on plotProfile and plotHeatmap.
* Added support for blacklist regions. These can be supplied as a BED file and the regions will largely be skipped in processing (they'll also be ignored during normalization). This is very useful to skip regions known to attract excess signal. This was issue #101.
* Modified plotPCA to include the actual eigenvalues rather than rescaled ones. Also, plotPCA can now output the underlying values (issue #231).
* Regions within each feature body can now be unscaled when using `computeMatrix`. Thus, if you're interested in unscaled signal around the TSS/TES then you can now use the `--unscaled5prime` and `--unscaled3prime` options. This was issue #108.
* bamCoverage now has a `--filterRNAstrand` option, that will produce coverage for only a single strand. Note that the strand referred to is the DNA strand and not sense/anti-sense.
* Issues with plotHeatmap x-axis labels were fixed (issue #301).
2.1.1
* Fixed a how the --hclust option was handled in plotHeatmap/plotProfile. This gets around a quirk in scipy.
* A bug involving processing comment lines in BED files was corrected (issue #288)
* The Galaxy wrappers are now automatically tested with each modification.
* plotCoverage and plotFingerprint in Galaxy now accept 1 or more BAM files rather than at least 2 files.
2.1.0
* Updates to many of the Galaxy wrappers and associated documentation.
* A bug was fixed in how chromosome names were dealt with in bigWig files. If you ever received errors due to illegal intervals then that should now be fixed. This was issue #250
* plotProfile now has an --outFileNameData option for saving the underlying data in a text format.
* correctGCBias ensures that the resulting BAM file will pass picard/HTSJDK's validation if the input file did (issue #248)
* The default bin size was changed to 10, which is typically a bit more useful
* The --regionsLabel option to plotProfile and plotHeatmap now accepts a space-separated list, in line with --samplesLabel
* BAM files that have had their sequences stripped no longer cause an error
* bamPEFragmentSize now has -bs and -n options to allow adjusting the number of alignments sampled. Note that the default value is auto-adjusted if the sampling is too sparse.
* bamPEFragmentSize now accepts single-end files.
* The --hclust option to plotProfile and plotHeatmap continues even if one of the groups is too small for plotting (matplotlib will produce a warning that you can ignore). This was issue #280.
2.0.1
* A critical bug that prevented plotPCA from running was fixed.
* multiBamCoverage was renamed to multiBamSummary, to be in better alignment with multiBigwigSummary.
* computeGCBias and correctGCBias are now more tolerant of chromosome name mismatches.
* multiBigwigSummary and multiBamSummary can accept a single bigWig/BAM input file, though one should use the
--outRawCounts argument.
2.0.0
* Documentation improved and migrated to http://deeptools.readthedocs.org The API to use deepTools modules is now
part of the documentation and includes a tutorial.
* Allow multiple bigwig files in computeMatrix that can be clustered together
* computeMatrix now accepts multiple bed files. Each bed file is considered as a group. Labels are automatically
added based on the file names.
* When computing read coverage now splited reads are understood. This is convenient for computing the
coverage of for RNA-seq data.
* New quality control tool 'plotCoverage' to plot the coverage over base pairs for multiple samples
* renaming of --missingDataAsZero to --skipNonCovered regions for clarity in bamCoverage and bamCompare
* New analysis tool plotPCA that visualizes the results from principal component analysis
* New option in bamCoverage `--MNase` that will compute the read coverage only considering 2 base pairs at the
center of the fragment.
* Make read extension optional. Remove the need to specify a default fragment length for most of the tools. Now, when
read extension is enabled and the bam files contain paired en data, the mean fragment length is automatically
calculated by sampling the read pairs in the bam file. The --doNotExtendPairedEnds and --fragmentLentgh parameters
are no longer used and the new --extendReads parameter was added.
* Dramatically improved bigwig related tools by using the new pyBigWig module. Eliminated the requirement for the
UCSC program `bigWigInfo`
* renamed heatmapper to plotHeatmap and profiler to plotProfile
* added hierarchical clustering, besides k-means to plotProfile and plotHeatmap
* improved plotting features for plotProfile when using 'overlapped_lines' and 'heatmap' plot types
* Resolved an error introduced by numpy version 1.10 in computeMatrix
* plotting of correlations (from bamCorrelate or bigwigCorrelate) was separated from the computation of the
underlying data. A new tool, plotCorrelation was added. This tool can plot correlations as heatmaps or as scatter
plots and includes options to adjust a large array of visual features.
* Fixed issue with bed intervals in bigwigCorrelate and bamCorrelate and a user specified region.
* Correlation coefficients can be computed even if the data contains NaNs
* Allow computeMatrix to read files with DOS newline characters
* Added option --skipChromosomes to bigwigCorrelate, for example to skip all 'random' chromosomes. bigwigCorrelate
now also considers chromosomes as identical when their names between samples differ with the prefix 'chr'. E.g.
chr1 vs. 1
* For bamCoverage and bamCompare, behaviour of scaleFactor was updated such that now, if given in combination
with the normalization options (normalize to 1x or normalize using RPKM) the given scaleFactor
will multiply the scale factor computed for the normalization methods.
* Fixed problem with read pairs labelled as proper pairs by the aligner but that were actually not proper pairs, for
example because the mates did not face each other. deepTools adds further checks to determine if a read pair is a
proper pair.
* Added titles to QC plots (#74)
* Added --samFlagInclude and --samFlagExclude parameters. This is useful to for example only include forward reads
* In deeptools2 most of the core code was rewriting to facilitate API usage and for optimization.
================================================
FILE: LICENSE.txt
================================================
The file deeptools/cm.py is licensed under the BSD license, see a copy in that file. The remainder of the code is licensed under the MIT license:
Copyright 2019 Max Planck Institute for Immunobiology and Epigenetics
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: MANIFEST.in
================================================
include *.txt
include README.md
exclude examples/*
exclude deepTools.egg-info/*
include scripts/*
exclude deeptools/test/*
exclude galaxy/*
exclude gallery/*
================================================
FILE: README.md
================================================
# deepTools
[](http://deeptools.readthedocs.org/)
[](https://pypi.org/project/deepTools/)
[](http://bioconda.github.io/recipes/deeptools/README.html)
[](https://usegalaxy.eu/root?tool_id=deeptools_compute_matrix)

## User-friendly tools for exploring deep-sequencing data
deepTools addresses the challenge of handling the large amounts of data that are now routinely generated from DNA sequencing centers. deepTools contains useful modules to process the mapped reads data for multiple quality checks, creating **normalized coverage files** in standard bedGraph and bigWig file formats, that allow comparison between different files (for example, treatment and control). Finally, using such normalized and standardized files, deepTools can create many publication-ready **visualizations** to identify enrichments and for functional annotations of the genome.
For support or questions please post to [Biostars](http://biostars.org). For bug reports and feature requests please open an issue [on github](http://github.com/deeptools/deeptools).
### Citation:
Ramírez F, Ryan DP, Grüning B, Bhardwaj V, Kilpert F, Richter AS, Heyne S, Dündar F, Manke T. [deepTools2: a next generation web server for deep-sequencing data analysis.](https://nar.oxfordjournals.org/content/early/2016/04/12/nar.gkw257.abstract) Nucleic Acids Research. 2016 Apr 13:gkw257.
### Documentation:
Our [documentation](http://deeptools.readthedocs.org/) contains more details on the [individual tool scopes and usages](http://deeptools.readthedocs.org/en/latest/content/list_of_tools.html) and an [introduction to our deepTools Galaxy web server](http://deeptools.readthedocs.org/en/latest/content/help_galaxy_intro.html) including [step-by-step protocols](http://deeptools.readthedocs.org/en/latest/content/example_usage.html).
>Please see also the [FAQ](http://deeptools.readthedocs.org/en/latest/content/help_faq.html), which we update regularly.
Our [Gallery](http://deeptools.readthedocs.org/en/latest/content/example_gallery.html) may give you some more ideas about the scope of deepTools.
>For more specific **troubleshooting, feedback, and tool suggestions**, please post [to Biostars](http://biostars.org).
-------------------------------------------------------------------------------------------------------------------
### Installation
deepTools are available for:
* Command line usage (via pip / conda / github)
* Integration into Galaxy servers (via toolshed/API/web-browser)
There are many easy ways to install deepTools. More details can be found [here](https://deeptools.readthedocs.io/en/latest/content/installation.html).
In Brief:
**Install through pypi**
$ pip install deeptools
**Install via conda**
$ conda install -c bioconda deeptools
**Install by cloning the repository**
$ git clone https://github.com/deeptools/deepTools
$ cd deepTools
$ pip install .
<a name="galaxy"/></a>
### Galaxy Installation
deepTools can be easily integrated into [Galaxy](http://galaxyproject.org). Please see the [installation instructions in our documentation](http://deeptools.readthedocs.io/en/latest/content/installation.html#galaxy-installation) for further details.
**Note:** From version 2.3 onwards, deepTools support **python3**.
------------------------------------
This tool suite is developed by the [Bioinformatics Facility](http://www1.ie-freiburg.mpg.de/bioinformaticsfac) at the [Max Planck Institute for Immunobiology and Epigenetics, Freiburg](http://www1.ie-freiburg.mpg.de/).
[Documentation](http://deeptools.readthedocs.org/en/latest/index.html) | [deepTools Galaxy](http://deeptools.ie-freiburg.mpg.de) | [FAQ](http://deeptools.readthedocs.org/en/latest/content/help_faq.html)
================================================
FILE: README.rst
================================================
======================================================================
deepTools
======================================================================
User-friendly tools for exploring deep-sequencing data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
deepTools addresses the challenge of handling the large amounts of data
that are now routinely generated from DNA sequencing centers. deepTools
contains useful modules to process the mapped reads data for multiple
quality checks, creating **normalized coverage files** in standard
bedGraph and bigWig file formats, that allow comparison between
different files (for example, treatment and control). Finally, using
such normalized and standardized files, deepTools can create many
publication-ready **visualizations** to identify enrichments and for
functional annotations of the genome.
For support or questions please make a post on `Biostars <http://biostars.org>`__. For feature requests, please open an issue on `github <http://github.com/deeptools/deeptools>`__.
For further documentation, please see our `read the docs page <http://deeptools.readthedocs.org/>`__.
Citation:
^^^^^^^^^
Ramírez F, Ryan DP, Grüning B, Bhardwaj V, Kilpert F, Richter AS, Heyne
S, Dündar F, Manke T. `deepTools2: a next generation web server for
deep-sequencing data
analysis. <https://nar.oxfordjournals.org/content/early/2016/04/12/nar.gkw257.abstract>`__
Nucleic Acids Research. 2016 Apr 13:gkw257.
================================================
FILE: deeptools/SES_scaleFactor.py
================================================
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import numpy as np
# own packages
from deeptools import bamHandler
import deeptools.countReadsPerBin as countR
old_settings = np.seterr(all='ignore')
debug = 0
def estimateScaleFactor(bamFilesList, binLength, numberOfSamples,
normalizationLength,
avg_method='median', blackListFileName=None, numberOfProcessors=1,
verbose=False, chrsToSkip=[], mappingStatsList=[]):
r"""
Subdivides the genome into chunks to be analyzed in parallel
using several processors. The code handles the creation of
workers that compute fragment counts (coverage) for different
regions and then collect and integrates the results.
Parameters
----------
bamFilesList : list
list of bam files to normalize
binLength : int
the window size in bp, where reads are going to be
counted.
numberOfSamples : int
number of sites to sample from the genome. For more info see
the documentation of the CountReadsPerBin class
normalizationLength : int
length, in bp, to normalize the data.
For a value of 1, on average
1 read per base pair is found
avg_method : str
defines how the different values are to be summarized.
The options are 'mean' and 'median'
chrsToSkip : list
name of the chromosomes to be excluded from the
scale estimation. Usually the chrX is included.
blackListFileName : str
BED file containing blacklisted regions
mappingStatsList : list
List of the number of mapped reads per file
Returns
-------
dict
Dictionary with the following keys::
'size_factors'
'size_factors_based_on_mapped_reads'
'size_factors_SES'
'size_factors_based_on_mean'
'size_factors_based_on_median'
'mean'
'meanSES'
'median'
'reads_per_bin'
'std'
'sites_sampled'
Examples
--------
>>> test = Tester()
>>> bin_length = 50
>>> num_samples = 4
>>> _dict = estimateScaleFactor([test.bamFile1, test.bamFile2], bin_length, num_samples, 1)
>>> _dict['size_factors']
array([1. , 0.5])
>>> _dict['size_factors_based_on_mean']
array([1. , 0.5])
"""
assert len(bamFilesList) == 2, "SES scale factors are only defined for 2 files"
if len(mappingStatsList) == len(bamFilesList):
mappedReads = mappingStatsList
else:
mappedReads = []
for fname in bamFilesList:
mappedReads.append(bamHandler.openBam(fname, returnStats=True, nThreads=numberOfProcessors)[1])
sizeFactorBasedOnMappedReads = np.array(mappedReads, dtype='float64')
sizeFactorBasedOnMappedReads = sizeFactorBasedOnMappedReads.min() / sizeFactorBasedOnMappedReads
cr = countR.CountReadsPerBin(bamFilesList,
binLength=binLength,
numberOfSamples=numberOfSamples,
extendReads=False,
blackListFileName=blackListFileName,
numberOfProcessors=numberOfProcessors,
verbose=verbose,
chrsToSkip=chrsToSkip)
try:
num_reads_per_bin = cr.run()
except Exception as detail:
exit("*ERROR*: {}".format(detail))
sitesSampled = len(num_reads_per_bin)
# the transpose is taken to easily iterate by columns which are now
# converted to rows
num_reads_per_bin = num_reads_per_bin.transpose()
# size factors based on order statistics
# see Signal extraction scaling (SES) method in: Diaz et al (2012)
# Normalization, bias correction, and peak calling for ChIP-seq.
# Statistical applications in genetics and molecular biology, 11(3).
# using the same names as in Diaz paper
# p refers to ChIP, q to input
p = np.sort(num_reads_per_bin[0, :]).cumsum()
q = np.sort(num_reads_per_bin[1, :]).cumsum()
# p[-1] and q[-1] are the maximum values in the arrays.
# both p and q are normalized by this value
diff = np.abs(p / p[-1] - q / q[-1])
# get the lowest rank for wich the difference is the maximum
maxIndex = np.flatnonzero(diff == diff.max())[0]
# Take a lower rank to move to a region with probably
# less peaks and more background.
maxIndex = int(maxIndex * 0.8)
while maxIndex < len(p):
# in rare cases the maxIndex maps to a zero value.
# In such cases, the next index is used until
# a non zero value appears.
cumSum = np.array([float(p[maxIndex]), float(q[maxIndex])])
if cumSum.min() > 0:
break
maxIndex += 1
meanSES = [np.mean(np.sort(num_reads_per_bin[0, :])[:maxIndex]),
np.mean(np.sort(num_reads_per_bin[1, :])[:maxIndex])]
# the maxIndex may be too close to the the signal regions
# so i take a more conservative approach by taking a close number
sizeFactorsSES = cumSum.min() / cumSum
median = np.median(num_reads_per_bin, axis=1)
# consider only those read numbers that are below the 90
# percentile to stimate the
# mean and std
mean = []
std = []
for values in num_reads_per_bin:
maxNumReads = (np.percentile(values, 90))
if maxNumReads == 0:
maxNumReads = (np.percentile(values, 99))
if maxNumReads == 0:
print("all genomic regions sampled from one ")
"of the bam files have no reads.\n"
values = values[values <= maxNumReads]
mean.append(np.mean(values))
std.append(np.std(values))
mean = np.array(mean)
readsPerBin = mean if avg_method == 'mean' else median
if min(median) == 0:
idx_zero = [ix + 1 for ix, value in enumerate(median) if value == 0]
exit("\n*ERROR*: The median coverage computed is zero for sample(s) #{}\n"
"Try selecting a larger sample size or a region with coverage\n".format(idx_zero))
sizeFactor = sizeFactorsSES
return {'size_factors': sizeFactor,
'size_factors_based_on_mapped_reads': sizeFactorBasedOnMappedReads,
'size_factors_SES': sizeFactorsSES,
'size_factors_based_on_mean': mean.min() / mean,
'size_factors_based_on_median': median.min() / median,
'mean': mean,
'meanSES': meanSES,
'median': median,
'reads_per_bin': readsPerBin,
'std': std,
'sites_sampled': sitesSampled}
class Tester(object):
def __init__(self):
self.root = os.path.dirname(os.path.abspath(__file__)) + "/test/test_data/"
self.bamFile1 = self.root + "testA.bam"
self.bamFile2 = self.root + "testB.bam"
global debug
debug = 0
self.chrom = '3R'
================================================
FILE: deeptools/__init__.py
================================================
================================================
FILE: deeptools/alignmentSieve.py
================================================
#!/usr/bin/env python
import argparse
import pysam
import os
import sys
from deeptools import parserCommon
from deeptools.bamHandler import openBam
from deeptools.mapReduce import mapReduce
from deeptools.utilities import getTLen, smartLabels, getTempFileName
from importlib.metadata import version
def parseArguments():
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description="This tool filters alignments in a BAM/CRAM file according the the specified parameters. It can optionally output to BEDPE format.",
usage='alignmentSieve -b sample1.bam -o sample1.filtered.bam --minMappingQuality 10 --filterMetrics log.txt\n'
'help: alignmentSieve -h / alignmentSieve --help')
required = parser.add_argument_group('Required arguments')
required.add_argument('--bam', '-b',
metavar='FILE1',
help='An indexed BAM file.',
required=True)
required.add_argument('--outFile', '-o',
help='The file to write results to. These are the alignments or fragments that pass the filtering criteria.')
general = parser.add_argument_group('General arguments')
general.add_argument('--numberOfProcessors', '-p',
help='Number of processors to use. Type "max/2" to '
'use half the maximum number of processors or "max" '
'to use all available processors. (Default: %(default)s)',
metavar="INT",
type=parserCommon.numberOfProcessors,
default=1,
required=False)
general.add_argument('--filterMetrics',
metavar="FILE.log",
help="The number of entries in total and filtered are saved to this file")
general.add_argument('--filteredOutReads',
metavar="filtered.bam",
help="If desired, all reads NOT passing the filtering criteria can be written to this file.")
general.add_argument('--label', '-l',
metavar='sample1',
help='User defined label instead of the default label '
'(file name).')
general.add_argument('--smartLabels',
action='store_true',
help='Instead of manually specifying a labels for the input '
'file, this causes deepTools to use the file name '
'after removing the path and extension.')
general.add_argument('--verbose', '-v',
help='Set to see processing messages.',
action='store_true')
general.add_argument('--version', action='version',
version='%(prog)s {}'.format(version('deeptools')))
general.add_argument('--shift',
nargs='+',
type=int,
help='Shift the left and right end of a read (for BAM files) or a fragment (for BED files). A positive value shift an end to the right (on the + strand) and a negative value shifts a fragment to the left. Either 2 or 4 integers can be provided. For example, "2 -3" will shift the left-most fragment end two bases to the right and the right-most end 3 bases to the left. If 4 integers are provided, then the first and last two refer to fragments whose read 1 is on the left or right, respectively. Consequently, it is possible to take strand into consideration for strand-specific protocols. A fragment whose length falls below 1 due to shifting will not be written to the output. See the online documentation for graphical examples. Note that non-properly-paired reads will be filtered.')
general.add_argument('--ATACshift',
action='store_true',
help='Shift the produced BAM file or BEDPE regions as commonly done for ATAC-seq. This is equivalent to --shift 4 -5 5 -4.')
general.add_argument('--genomeChunkLength',
type=int,
default=int(1e6),
help='Size of the genome (in bps) to be processed per thread. (Default: %(default)s)')
output = parser.add_argument_group('Output arguments')
output.add_argument('--BED',
action='store_true',
help='Instead of producing BAM files, write output in BEDPE format (as defined by MACS2). Note that only reads/fragments passing filtering criterion are written in BEDPE format.')
filtering = parser.add_argument_group('Optional arguments')
filtering.add_argument('--filterRNAstrand',
help='Selects RNA-seq reads (single-end or paired-end) in '
'the given strand. (Default: %(default)s)',
choices=['forward', 'reverse'],
default=None)
filtering.add_argument('--ignoreDuplicates',
help='If set, reads that have the same orientation '
'and start position will be considered only '
'once. If reads are paired, the mate\'s position '
'also has to coincide to ignore a read.',
action='store_true')
filtering.add_argument('--minMappingQuality',
metavar='INT',
help='If set, only reads that have a mapping '
'quality score of at least this are '
'considered.',
type=int)
filtering.add_argument('--samFlagInclude',
help='Include reads based on the SAM flag. For example, '
'to get only reads that are the first mate, use a flag of 64. '
'This is useful to count properly paired reads only once, '
'as otherwise the second mate will be also considered for the '
'coverage.',
metavar='INT',
default=None,
type=int,
required=False)
filtering.add_argument('--samFlagExclude',
help='Exclude reads based on the SAM flag. For example, '
'to get only reads that map to the forward strand, use '
'--samFlagExclude 16, where 16 is the SAM flag for reads '
'that map to the reverse strand.',
metavar='INT',
default=None,
type=int,
required=False)
filtering.add_argument('--blackListFileName', '-bl',
help="A BED or GTF file containing regions that should be excluded from all analyses. Currently this works by rejecting genomic chunks that happen to overlap an entry. Consequently, for BAM files, if a read partially overlaps a blacklisted region or a fragment spans over it, then the read/fragment might still be considered. Please note that you should adjust the effective genome size, if relevant.",
metavar="BED file",
nargs="+",
required=False)
filtering.add_argument('--minFragmentLength',
help='The minimum fragment length needed for read/pair '
'inclusion. This option is primarily useful '
'in ATACseq experiments, for filtering mono- or '
'di-nucleosome fragments. (Default: %(default)s)',
metavar='INT',
default=0,
type=int,
required=False)
filtering.add_argument('--maxFragmentLength',
help='The maximum fragment length needed for read/pair '
'inclusion. A value of 0 indicates no limit. (Default: %(default)s)',
metavar='INT',
default=0,
type=int,
required=False)
return parser
def shiftRead(b, chromDict, args):
if not b.is_proper_pair:
return None
tLen = getTLen(b, notAbs=True)
start = b.pos
end = start + b.query_alignment_end
if b.is_reverse and not b.is_read2:
end -= args.shift[2]
deltaTLen = args.shift[3] - args.shift[2]
elif b.is_reverse and b.is_read2:
end += args.shift[1]
deltaTLen = args.shift[1] - args.shift[0]
elif not b.is_reverse and not b.is_read2:
start += args.shift[0]
deltaTLen = args.shift[1] - args.shift[0]
else:
start -= args.shift[3]
deltaTLen = args.shift[3] - args.shift[2]
# Sanity check
if end - start < 1:
if b.is_reverse:
start = end - 1
else:
end = start + 1
if start < 0:
start = 0
if end > chromDict[b.reference_name]:
end = chromDict[b.reference_name]
if end - start < 1:
return None
# create a new read
b2 = pysam.AlignedSegment()
b2.query_name = b.query_name
b2.flag = b.flag
b2.reference_id = b.reference_id
b2.reference_start = start
b2.mapping_quality = b.mapping_quality
b2.cigar = ((0, end - start),) # Returned cigar is only matches
if tLen < 0:
b2.template_length = tLen - deltaTLen
else:
b2.template_length = tLen + deltaTLen
b2.next_reference_id = b.next_reference_id
b2.next_reference_start = b.next_reference_start
if b.is_proper_pair:
if b2.is_read2 and b2.is_reverse:
b2.next_reference_start += args.shift[0]
elif not b2.is_read2 and b2.is_reverse:
b2.next_reference_start -= args.shift[3]
return b2
def filterWorker(arglist):
chrom, start, end, args, chromDict = arglist
fh = openBam(args.bam)
mode = 'wb'
oname = getTempFileName(suffix='.bam')
if args.filteredOutReads:
onameFiltered = getTempFileName(suffix='.bam')
else:
onameFiltered = None
ofh = pysam.AlignmentFile(oname, mode=mode, template=fh)
if onameFiltered:
ofiltered = pysam.AlignmentFile(onameFiltered, mode=mode, template=fh)
else:
ofiltered = None
prev_pos = set()
lpos = None
nFiltered = 0
total = 0
for read in fh.fetch(chrom, start, end):
if read.pos < start:
# ensure that we never double count (in case distanceBetweenBins == 0)
continue
total += 1
if read.flag & 4:
# Ignore unmapped reads, they were counted already
nFiltered += 1
if ofiltered:
ofiltered.write(read)
continue
if args.minMappingQuality and read.mapq < args.minMappingQuality:
nFiltered += 1
if ofiltered:
ofiltered.write(read)
continue
if args.samFlagInclude and read.flag & args.samFlagInclude != args.samFlagInclude:
nFiltered += 1
if ofiltered:
ofiltered.write(read)
continue
if args.samFlagExclude and read.flag & args.samFlagExclude != 0:
nFiltered += 1
if ofiltered:
ofiltered.write(read)
continue
tLen = getTLen(read)
if args.minFragmentLength > 0 and tLen < args.minFragmentLength:
nFiltered += 1
if ofiltered:
ofiltered.write(read)
continue
if args.maxFragmentLength > 0 and tLen > args.maxFragmentLength:
nFiltered += 1
if ofiltered:
ofiltered.write(read)
continue
if args.ignoreDuplicates:
# Assuming more or less concordant reads, use the fragment bounds, otherwise the start positions
if tLen >= 0:
s = read.pos
e = s + tLen
else:
s = read.pnext
e = s - tLen
if read.reference_id != read.next_reference_id:
e = read.pnext
if lpos is not None and lpos == read.reference_start \
and (s, e, read.next_reference_id, read.is_reverse) in prev_pos:
nFiltered += 1
if ofiltered:
ofiltered.write(read)
continue
if lpos != read.reference_start:
prev_pos.clear()
lpos = read.reference_start
prev_pos.add((s, e, read.next_reference_id, read.is_reverse))
# filterRNAstrand
if args.filterRNAstrand:
if read.is_paired:
if args.filterRNAstrand == 'forward':
if read.flag & 144 == 128 or read.flag & 96 == 64:
pass
else:
nFiltered += 1
if ofiltered:
ofiltered.write(read)
continue
elif args.filterRNAstrand == 'reverse':
if read.flag & 144 == 144 or read.flag & 96 == 96:
pass
else:
nFiltered += 1
if ofiltered:
ofiltered.write(read)
continue
else:
if args.filterRNAstrand == 'forward':
if read.flag & 16 == 16:
pass
else:
nFiltered += 1
if ofiltered:
ofiltered.write(read)
continue
elif args.filterRNAstrand == 'reverse':
if read.flag & 16 == 0:
pass
else:
nFiltered += 1
if ofiltered:
ofiltered.write(read)
continue
if args.shift:
read = shiftRead(read, chromDict, args)
if not read:
continue
# Read survived filtering
ofh.write(read)
# The results from the workers will get sorted, so get the TID
tid = fh.get_tid(chrom)
ofh.close()
if ofiltered:
ofiltered.close()
fh.close()
return tid, start, total, nFiltered, oname, onameFiltered
def convertBED(oname, tmpFiles, chromDict):
"""
Stores results in BEDPE format, which is:
chromosome frag_leftend frag_rightend
The fragment ends can be shifted
"""
ofile = open(oname, "w")
for tmpFile in tmpFiles:
# Setting verbosity to avoid lack of index error/warning
pysam.set_verbosity(0)
fh = pysam.AlignmentFile(tmpFile)
# Reset verbosity
pysam.set_verbosity(3)
for b in fh.fetch(until_eof=True):
tLen = getTLen(b, notAbs=True)
if tLen > 0:
start = b.pos
end = start + tLen
if end > chromDict[b.reference_name]:
end = chromDict[b.reference_name]
if end - start < 1:
continue
ofile.write("{}\t{}\t{}\n".format(b.reference_name, start, end))
fh.close()
os.unlink(tmpFile)
ofile.close()
def main(args=None):
args = parseArguments().parse_args(args)
if args.shift:
if len(args.shift) not in [2, 4]:
sys.exit("The --shift option can accept either 2 or 4 values only.")
if len(args.shift) == 2:
args.shift.extend([-args.shift[1], -args.shift[0]])
elif args.ATACshift:
args.shift = [4, -5, 5, -4]
bam, mapped, unmapped, stats = openBam(args.bam, returnStats=True, nThreads=args.numberOfProcessors)
total = mapped + unmapped
chrom_sizes = [(x, y) for x, y in zip(bam.references, bam.lengths)]
chromDict = {x: y for x, y in zip(bam.references, bam.lengths)}
# Filter, writing the results to a bunch of temporary files
res = mapReduce([args, chromDict],
filterWorker,
chrom_sizes,
blackListFileName=args.blackListFileName,
numberOfProcessors=args.numberOfProcessors,
genomeChunkLength=args.genomeChunkLength,
verbose=args.verbose)
res = sorted(res) # The temp files are now in order for concatenation
nFiltered = sum([x[3] for x in res])
totalSeen = sum([x[2] for x in res]) # The * contig isn't queried
tmpFiles = [x[4] for x in res]
if not args.BED:
arguments = ["-o", args.outFile]
arguments.extend(tmpFiles) # [..., *someList] isn't available in python 2.7
pysam.samtools.cat(*arguments)
for tmpFile in tmpFiles:
os.unlink(tmpFile)
else:
convertBED(args.outFile, tmpFiles, chromDict)
if args.filteredOutReads:
tmpFiles = [x[5] for x in res]
if not args.BED:
arguments = ["-o", args.filteredOutReads]
arguments.extend(tmpFiles) # [..., *someList] isn't available in python 2.7
pysam.samtools.cat(*arguments)
for tmpFile in tmpFiles:
os.unlink(tmpFile)
else:
convertBED(args.outFile, tmpFiles, chromDict, args)
if args.filterMetrics:
sampleName = args.bam
if args.label:
sampleName = args.label
if args.smartLabels:
sampleName = smartLabels([args.bam])[0]
of = open(args.filterMetrics, "w")
of.write("#bamFilterReads --filterMetrics\n")
of.write("#File\tReads Remaining\tTotal Initial Reads\n")
of.write("{}\t{}\t{}\n".format(sampleName, totalSeen - nFiltered, total))
of.close()
return 0
================================================
FILE: deeptools/bamCompare.py
================================================
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse # to parse command line arguments
import numpy as np
import sys
# my packages
from deeptools import writeBedGraph
from deeptools.SES_scaleFactor import estimateScaleFactor
from deeptools import parserCommon
from deeptools import bamHandler
from deeptools.getRatio import getRatio
from deeptools.getScaleFactor import get_num_kept_reads
from deeptools.getScaleFactor import get_scale_factor
debug = 0
old_settings = np.seterr(all='ignore')
def parseArguments():
parentParser = parserCommon.getParentArgParse()
bamParser = parserCommon.read_options()
normalizationParser = parserCommon.normalization_options()
requiredArgs = getRequiredArgs()
optionalArgs = getOptionalArgs()
outputParser = parserCommon.output()
parser = argparse.ArgumentParser(
parents=[requiredArgs, outputParser, optionalArgs,
parentParser, normalizationParser, bamParser],
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description='This tool compares two BAM files based on the number of '
'mapped reads. To compare the BAM files, the genome is partitioned '
'into bins of equal size, then the number of reads found in each bin'
' is counted per file, and finally a summary value is '
'reported. This value can be the ratio of the number of reads per '
'bin, the log2 of the ratio, or the difference. This tool can '
'normalize the number of reads in each BAM file using the SES method '
'proposed by Diaz et al. (2012) "Normalization, bias correction, and '
'peak calling for ChIP-seq". Statistical Applications in Genetics '
'and Molecular Biology, 11(3). Normalization based on read counts '
'is also available. The output is either a bedgraph or bigWig file '
'containing the bin location and the resulting comparison value. '
'Note that *each end* in a pair (for paired-end reads) is treated '
'independently. If this is undesirable, then use the --samFlagInclude '
'or --samFlagExclude options.',
usage='bamCompare -b1 treatment.bam -b2 control.bam -o log2ratio.bw\n'
'help: bamCompare -h / bamCompare --help',
add_help=False)
return parser
def getRequiredArgs():
parser = argparse.ArgumentParser(add_help=False)
required = parser.add_argument_group('Required arguments')
# define the arguments
required.add_argument('--bamfile1', '-b1',
metavar='BAM file',
help='Sorted BAM file 1. Usually the BAM file '
'for the treatment.',
required=True)
required.add_argument('--bamfile2', '-b2',
metavar='BAM file',
help='Sorted BAM file 2. Usually the BAM '
'file for the control.',
required=True)
return parser
def getOptionalArgs():
parser = argparse.ArgumentParser(add_help=False)
optional = parser.add_argument_group('Optional arguments')
optional.add_argument("--help", "-h", action="help",
help="show this help message and exit")
optional.add_argument('--scaleFactorsMethod',
help='Method to use to scale the samples. '
'If a method is specified, then it will be used to compensate '
'for sequencing depth differences between the samples. '
'As an alternative, this can be set to None and an option from '
'--normalizeUsing <method> can be used. (Default: %(default)s)',
choices=['readCount', 'SES', 'None'],
default='readCount')
optional.add_argument('--sampleLength', '-l',
help='*Only relevant when SES is chosen for the '
'scaleFactorsMethod.* To compute the SES, specify '
'the length (in bases) of the regions (see --numberOfSamples) '
'that will be randomly sampled to calculate the scaling factors. '
'If you do not have a good sequencing depth for '
'your samples consider increasing the sampling '
'regions\' size to minimize the probability '
'that zero-coverage regions are used. (Default: %(default)s)',
default=1000,
type=int)
optional.add_argument('--numberOfSamples', '-n',
help='*Only relevant when SES is chosen for the '
'scaleFactorsMethod.* Number of samplings taken '
'from the genome to compute the scaling factors. (Default: %(default)s)',
default=1e5,
type=int)
optional.add_argument('--scaleFactors',
help='Set this parameter manually to avoid the computation of '
'scaleFactors. The format is scaleFactor1:scaleFactor2.'
'For example, --scaleFactor 0.7:1 will cause the first BAM file to'
'be multiplied by 0.7, while not scaling '
'the second BAM file (multiplication with 1).',
default=None,
required=False)
optional.add_argument('--operation',
help='The default is to output the log2 ratio of the '
'two samples. The reciprocal ratio returns the '
'the negative of the inverse of the ratio '
'if the ratio is less than 0. The resulting '
'values are interpreted as negative fold changes. '
'Instead of performing a computation using both files, the scaled signal can '
'alternatively be output for the first or second file using '
'the \'--operation first\' or \'--operation second\'. (Default: %(default)s)',
default='log2',
choices=['log2', 'ratio', 'subtract', 'add', 'mean',
'reciprocal_ratio', 'first', 'second'],
required=False)
optional.add_argument('--pseudocount',
help='A small number to avoid x/0. Only useful '
'together with --operation log2 or --operation ratio. '
'You can specify different values as pseudocounts for '
'the numerator and the denominator by providing two '
'values (the first value is used as the numerator '
'pseudocount and the second the denominator pseudocount). (Default: %(default)s)',
default=[1],
type=float,
nargs='+',
action=parserCommon.requiredLength(1, 2),
required=False)
optional.add_argument('--skipZeroOverZero',
help='Skip bins where BOTH BAM files lack coverage. '
'This is determined BEFORE any applicable pseudocount '
'is added.',
action='store_true')
return parser
def process_args(args=None):
args = parseArguments().parse_args(args)
if args.smoothLength and args.smoothLength <= args.binSize:
print("Warning: the smooth length given ({}) is smaller than the bin "
"size ({}).\n\n No smoothing will be "
"done".format(args.smoothLength,
args.binSize))
args.smoothLength = None
if not args.ignoreForNormalization:
args.ignoreForNormalization = []
if not isinstance(args.pseudocount, list):
args.pseudocount = [args.pseudocount]
if len(args.pseudocount) == 1:
args.pseudocount *= 2
return args
# get_scale_factors function is used for scaling in bamCompare
# while get_scale_factor is used for depth normalization
def get_scale_factors(args, statsList, mappedList):
if args.scaleFactors:
scale_factors = list(map(float, args.scaleFactors.split(":")))
elif args.scaleFactorsMethod == 'SES':
scalefactors_dict = estimateScaleFactor(
[args.bamfile1, args.bamfile2],
args.sampleLength, args.numberOfSamples,
1,
mappingStatsList=mappedList,
blackListFileName=args.blackListFileName,
numberOfProcessors=args.numberOfProcessors,
verbose=args.verbose,
chrsToSkip=args.ignoreForNormalization)
scale_factors = scalefactors_dict['size_factors']
if args.verbose:
print("Size factors using SES: {}".format(scale_factors))
print("%s regions of size %s where used " %
(scalefactors_dict['sites_sampled'],
args.sampleLength))
print("ignoring filtering/blacklists, size factors if the number of mapped "
"reads would have been used:")
print(tuple(
float(min(mappedList)) / np.array(mappedList)))
elif args.scaleFactorsMethod == 'readCount':
# change the scaleFactor to 1.0
args.scaleFactor = 1.0
# get num of kept reads for bam file 1
args.bam = args.bamfile1
bam1_mapped, _ = get_num_kept_reads(args, statsList[0])
# get num of kept reads for bam file 2
args.bam = args.bamfile2
bam2_mapped, _ = get_num_kept_reads(args, statsList[1])
mapped_reads = [bam1_mapped, bam2_mapped]
# new scale_factors (relative to min of two bams)
scale_factors = float(min(bam1_mapped, bam2_mapped)) / np.array(mapped_reads)
if args.verbose:
print("Size factors using total number "
"of mapped reads: {}".format(scale_factors))
elif args.scaleFactorsMethod == 'None':
scale_factors = None
return scale_factors
def main(args=None):
"""
The algorithm is composed of two steps.
1. Per-sample scaling / depth Normalization:
+ If scaling is used (using the SES or read counts method), appropriate scaling
factors are determined to account for sequencing depth differences.
+ Optionally scaling can be turned off and individual samples could be depth normalized using
RPKM, BPM or CPM methods
2. Ratio calculation between two bam files:
+ The genome is transversed and computing
the log ratio/ratio/difference etc. for bins of fixed width
given by the user.
"""
args = process_args(args)
if args.normalizeUsing == "RPGC":
sys.exit("RPGC normalization (--normalizeUsing RPGC) is not supported with bamCompare!")
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 `--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)
bam1.close()
bam2, mapped2, unmapped2, stats2 = bamHandler.openBam(args.bamfile2, returnStats=True, nThreads=args.numberOfProcessors)
bam2.close()
scale_factors = get_scale_factors(args, [stats1, stats2], [mapped1, mapped2])
if scale_factors is None:
# check whether one of the depth norm methods are selected
if args.normalizeUsing is not None:
args.scaleFactor = 1.0
# if a normalization is required then compute the scale factors
args.bam = args.bamfile1
scale_factor_bam1 = get_scale_factor(args, stats1)
args.bam = args.bamfile2
scale_factor_bam2 = get_scale_factor(args, stats2)
scale_factors = [scale_factor_bam1, scale_factor_bam2]
else:
scale_factors = [1, 1]
if args.verbose:
print("Individual scale factors are {0}".format(scale_factors))
# the getRatio function is called and receives
# the func_args per each tile that is considered
FUNC = getRatio
func_args = {'valueType': args.operation,
'scaleFactors': scale_factors,
'pseudocount': args.pseudocount
}
wr = writeBedGraph.WriteBedGraph([args.bamfile1, args.bamfile2], args.binSize, 0,
stepSize=args.binSize,
region=args.region,
numberOfProcessors=args.numberOfProcessors,
extendReads=args.extendReads,
blackListFileName=args.blackListFileName,
minMappingQuality=args.minMappingQuality,
ignoreDuplicates=args.ignoreDuplicates,
center_read=args.centerReads,
zerosToNans=args.skipNonCoveredRegions,
skipZeroOverZero=args.skipZeroOverZero,
samFlag_include=args.samFlagInclude,
samFlag_exclude=args.samFlagExclude,
minFragmentLength=args.minFragmentLength,
maxFragmentLength=args.maxFragmentLength,
chrsToSkip=args.ignoreForNormalization,
verbose=args.verbose
)
wr.run(FUNC, func_args, args.outFileName, blackListFileName=args.blackListFileName, format=args.outFileFormat, smoothLength=args.smoothLength)
if __name__ == "__main__":
main()
================================================
FILE: deeptools/bamCoverage.py
================================================
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# own tools
import argparse
import sys
import numpy as np
from deeptools import writeBedGraph # This should be made directly into a bigWig
from deeptools import parserCommon
from deeptools.getScaleFactor import get_scale_factor
from deeptools.bamHandler import openBam
debug = 0
def parseArguments():
parentParser = parserCommon.getParentArgParse()
bamParser = parserCommon.read_options()
normalizationParser = parserCommon.normalization_options()
requiredArgs = get_required_args()
optionalArgs = get_optional_args()
outputParser = parserCommon.output()
parser = \
argparse.ArgumentParser(
parents=[requiredArgs, outputParser, optionalArgs,
parentParser, normalizationParser, bamParser],
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description='This tool takes an alignment of reads or fragments '
'as input (BAM file) and generates a coverage track (bigWig or '
'bedGraph) as output. '
'The coverage is calculated as the number of reads per bin, '
'where bins are short consecutive counting windows of a defined '
'size. It is possible to extended the length of the reads '
'to better reflect the actual fragment length. *bamCoverage* '
'offers normalization by scaling factor, Reads Per Kilobase per '
'Million mapped reads (RPKM), counts per million (CPM), bins per '
'million mapped reads (BPM) and 1x depth (reads per genome '
'coverage, RPGC).\n',
usage='bamCoverage -b reads.bam -o coverage.bw\n'
'help: bamCoverage -h / bamCoverage --help',
add_help=False)
return parser
def get_required_args():
parser = argparse.ArgumentParser(add_help=False)
required = parser.add_argument_group('Required arguments')
# define the arguments
required.add_argument('--bam', '-b',
help='BAM file to process',
metavar='BAM file',
required=True)
return parser
def get_optional_args():
parser = argparse.ArgumentParser(add_help=False)
optional = parser.add_argument_group('Optional arguments')
optional.add_argument("--help", "-h", action="help",
help="show this help message and exit")
optional.add_argument('--scaleFactor',
help='The computed scaling factor (or 1, if not applicable) will '
'be multiplied by this. (Default: %(default)s)',
default=1.0,
type=float,
required=False)
optional.add_argument('--MNase',
help='Determine nucleosome positions from MNase-seq data. '
'Only 3 nucleotides at the center of each fragment are counted. '
'The fragment ends are defined by the two mate reads. Only fragment lengths'
'between 130 - 200 bp are considered to avoid dinucleosomes or other artifacts. '
'By default, any fragments smaller or larger than this are ignored. To '
'over-ride this, use the --minFragmentLength and --maxFragmentLength options, '
'which will default to 130 and 200 if not otherwise specified in the presence '
'of --MNase. *NOTE*: Requires paired-end data. A bin size of 1 is recommended.',
action='store_true')
optional.add_argument('--Offset',
help='Uses this offset inside of each read as the signal. This is useful in '
'cases like RiboSeq or GROseq, where the signal is 12, 15 or 0 bases past the '
'start of the read. This can be paired with the --filterRNAstrand option. '
'Note that negative values indicate offsets from the end of each read. A value '
'of 1 indicates the first base of the alignment (taking alignment orientation '
'into account). Likewise, a value of -1 is the last base of the alignment. An '
'offset of 0 is not permitted. If two values are specified, then they will be '
'used to specify a range of positions. Note that specifying something like '
'--Offset 5 -1 will result in the 5th through last position being used, which '
'is equivalent to trimming 4 bases from the 5-prime end of alignments. Note '
'that if you specify --centerReads, the centering will be performed before the '
'offset.',
metavar='INT',
type=int,
nargs='+',
required=False)
optional.add_argument('--filterRNAstrand',
help='Selects RNA-seq reads (single-end or paired-end) originating from genes '
'on the given strand. This option assumes a standard dUTP-based library '
'preparation (that is, --filterRNAstrand=forward keeps minus-strand reads, '
'which originally came from genes on the forward strand using a dUTP-based '
'method). Consider using --samExcludeFlag instead for filtering by strand in '
'other contexts.',
choices=['forward', 'reverse'],
default=None)
return parser
def scaleFactor(string):
try:
scalefactor1, scalefactor2 = string.split(":")
scalefactors = (float(scalefactor1), float(scalefactor2))
except:
raise argparse.ArgumentTypeError(
"Format of scaleFactors is factor1:factor2. "
"The value given ( {} ) is not valid".format(string))
return scalefactors
def process_args(args=None):
args = parseArguments().parse_args(args)
if args.smoothLength and args.smoothLength <= args.binSize:
print("Warning: the smooth length given ({}) is smaller than the bin "
"size ({}).\n\n No smoothing will be done".format(args.smoothLength, args.binSize))
args.smoothLength = None
if not args.ignoreForNormalization:
args.ignoreForNormalization = []
return args
def main(args=None):
args = process_args(args)
global debug
if args.verbose:
sys.stderr.write("Specified --scaleFactor: {}\n".format(args.scaleFactor))
debug = 1
else:
debug = 0
if args.normalizeUsing == 'None':
args.normalizeUsing = None # For the sake of sanity
elif args.normalizeUsing == 'RPGC' and not args.effectiveGenomeSize:
sys.exit("RPGC normalization requires an --effectiveGenomeSize!\n")
if args.normalizeUsing:
# if a normalization is required then compute the scale factors
bam, mapped, unmapped, stats = openBam(args.bam, returnStats=True, nThreads=args.numberOfProcessors)
bam.close()
scale_factor = get_scale_factor(args, stats)
else:
scale_factor = args.scaleFactor
func_args = {'scaleFactor': scale_factor}
# This fixes issue #520, where --extendReads wasn't honored if --filterRNAstrand was used
if args.filterRNAstrand and not args.Offset:
args.Offset = [1, -1]
if args.MNase:
# check that library is paired end
# using getFragmentAndReadSize
from deeptools.getFragmentAndReadSize import get_read_and_fragment_length
frag_len_dict, read_len_dict = get_read_and_fragment_length(args.bam,
return_lengths=False,
blackListFileName=args.blackListFileName,
numberOfProcessors=args.numberOfProcessors,
verbose=args.verbose)
if frag_len_dict is None:
sys.exit("*Error*: For the --MNAse function a paired end library is required. ")
# Set some default fragment length bounds
if args.minFragmentLength == 0:
args.minFragmentLength = 130
if args.maxFragmentLength == 0:
args.maxFragmentLength = 200
wr = CenterFragment([args.bam],
binLength=args.binSize,
stepSize=args.binSize,
region=args.region,
blackListFileName=args.blackListFileName,
numberOfProcessors=args.numberOfProcessors,
extendReads=args.extendReads,
minMappingQuality=args.minMappingQuality,
ignoreDuplicates=args.ignoreDuplicates,
center_read=args.centerReads,
zerosToNans=args.skipNonCoveredRegions,
samFlag_include=args.samFlagInclude,
samFlag_exclude=args.samFlagExclude,
minFragmentLength=args.minFragmentLength,
maxFragmentLength=args.maxFragmentLength,
chrsToSkip=args.ignoreForNormalization,
verbose=args.verbose,
)
elif args.Offset:
if len(args.Offset) > 1:
if args.Offset[0] == 0:
sys.exit("*Error*: An offset of 0 isn't allowed, since offsets are 1-based positions inside each alignment.")
if args.Offset[1] > 0 and args.Offset[1] < args.Offset[0]:
sys.exir("'Error*: The right side bound is less than the left-side bound. This is inappropriate.")
else:
if args.Offset[0] == 0:
sys.exit("*Error*: An offset of 0 isn't allowed, since offsets are 1-based positions inside each alignment.")
wr = OffsetFragment([args.bam],
binLength=args.binSize,
stepSize=args.binSize,
region=args.region,
numberOfProcessors=args.numberOfProcessors,
extendReads=args.extendReads,
minMappingQuality=args.minMappingQuality,
ignoreDuplicates=args.ignoreDuplicates,
center_read=args.centerReads,
zerosToNans=args.skipNonCoveredRegions,
samFlag_include=args.samFlagInclude,
samFlag_exclude=args.samFlagExclude,
minFragmentLength=args.minFragmentLength,
maxFragmentLength=args.maxFragmentLength,
chrsToSkip=args.ignoreForNormalization,
verbose=args.verbose)
wr.filter_strand = args.filterRNAstrand
wr.Offset = args.Offset
else:
wr = writeBedGraph.WriteBedGraph([args.bam],
binLength=args.binSize,
stepSize=args.binSize,
region=args.region,
blackListFileName=args.blackListFileName,
numberOfProcessors=args.numberOfProcessors,
extendReads=args.extendReads,
minMappingQuality=args.minMappingQuality,
ignoreDuplicates=args.ignoreDuplicates,
center_read=args.centerReads,
zerosToNans=args.skipNonCoveredRegions,
samFlag_include=args.samFlagInclude,
samFlag_exclude=args.samFlagExclude,
minFragmentLength=args.minFragmentLength,
maxFragmentLength=args.maxFragmentLength,
chrsToSkip=args.ignoreForNormalization,
verbose=args.verbose,
)
wr.run(writeBedGraph.scaleCoverage, func_args, args.outFileName,
blackListFileName=args.blackListFileName,
format=args.outFileFormat, smoothLength=args.smoothLength)
class OffsetFragment(writeBedGraph.WriteBedGraph):
"""
Class to redefine the get_fragment_from_read for the --Offset case
"""
def filterStrand(self, read, rv):
"""
A generic read filtering function that gets used by everything in this class.
rv is returned if the strand is correct, otherwise [(None, None)]
"""
# Filter by RNA strand, if desired
if read.is_paired:
if self.filter_strand == 'forward':
if read.flag & 144 == 128 or read.flag & 96 == 64:
return rv
elif self.filter_strand == 'reverse':
if read.flag & 144 == 144 or read.flag & 96 == 96:
return rv
else:
return rv
else:
if self.filter_strand == 'forward':
if read.flag & 16 == 16:
return rv
elif self.filter_strand == 'reverse':
if read.flag & 16 == 0:
return rv
else:
return rv
return [(None, None)]
def get_fragment_from_read_list(self, read, offset):
"""
Return the range of exons from the 0th through 1st bases, inclusive. Positions are 1-based
"""
rv = [(None, None)]
blocks = read.get_blocks()
blockLen = sum([x[1] - x[0] for x in blocks])
if self.defaultFragmentLength != 'read length':
if self.is_proper_pair(read, self.maxPairedFragmentLength):
if read.is_reverse:
foo = (read.next_reference_start, read.reference_start)
if foo[0] < foo[1]:
blocks.insert(0, foo)
else:
foo = (read.reference_end, read.reference_end + abs(read.template_length) - read.infer_query_length())
if foo[0] < foo[1]:
blocks.append(foo)
# Extend using the default fragment length
else:
if read.is_reverse:
foo = (read.reference_start - self.defaultFragmentLength + read.infer_query_length(), read.reference_start)
if foo[0] < 0:
foo = (0, foo[1])
if foo[0] < foo[1]:
blocks.insert(0, foo)
else:
foo = (read.reference_end, read.reference_end + self.defaultFragmentLength - read.infer_query_length())
if foo[0] < foo[1]:
blocks.append(foo)
stretch = []
# For the sake of simplicity, convert [(10, 20), (30, 40)] to [10, 11, 12, 13, ..., 40]
# Then subset accordingly
for block in blocks:
stretch.extend(range(block[0], block[1]))
if read.is_reverse:
stretch = stretch[::-1]
# Handle --centerReads
if self.center_read:
_ = (len(stretch) - blockLen) // 2
stretch = stretch[_:_ + blockLen]
# Subset by --Offset
try:
foo = stretch[offset[0]:offset[1]]
except:
return rv
if len(foo) == 0:
return rv
if read.is_reverse:
foo = foo[::-1]
# Convert the stretch back to a list of tuples
foo = np.array(foo)
d = foo[1:] - foo[:-1]
idx = np.argwhere(d > 1).flatten().tolist() # This now holds the interval bounds as a list
idx.append(-1)
last = 0
rv = []
for i in idx:
rv.append((foo[last].astype("int"), foo[i].astype("int") + 1))
last = i + 1
# Handle strand filtering, if needed
return self.filterStrand(read, rv)
def get_fragment_from_read(self, read):
"""
This is mostly a wrapper for self.get_fragment_from_read_list(),
which needs a list and for the offsets to be tweaked by 1.
"""
offset = [x for x in self.Offset]
if len(offset) > 1:
if offset[0] > 0:
offset[0] -= 1
if offset[1] < 0:
offset[1] += 1
else:
if offset[0] > 0:
offset[0] -= 1
offset = [offset[0], offset[0] + 1]
else:
if offset[0] < -1:
offset = [offset[0], offset[0] + 1]
else:
offset = [offset[0], None]
if offset[1] == 0:
# -1 gets switched to 0, which screws things up
offset = (offset[0], None)
return self.get_fragment_from_read_list(read, offset)
class CenterFragment(writeBedGraph.WriteBedGraph):
"""
Class to redefine the get_fragment_from_read for the --MNase case
The coverage of the fragment is defined as the 2 or 3 basepairs at the
center of the fragment length.
"""
def get_fragment_from_read(self, read):
"""
Takes a proper pair fragment of high quality and limited
to a certain length and outputs the center
"""
fragment_start = fragment_end = None
# only paired forward reads are considered
# Fragments have already been filtered according to length
if read.is_proper_pair and not read.is_reverse and 1 < abs(read.tlen):
# distance between pairs is even return two bases at the center
if read.tlen % 2 == 0:
fragment_start = read.pos + read.tlen / 2 - 1
fragment_end = fragment_start + 2
# distance is odd return three bases at the center
else:
fragment_start = read.pos + read.tlen / 2 - 1
fragment_end = fragment_start + 3
return [(fragment_start, fragment_end)]
================================================
FILE: deeptools/bamHandler.py
================================================
import sys
import pysam
from deeptools.mapReduce import mapReduce
def countReadsInInterval(args):
chrom, start, end, fname, toEOF = args
bam = openBam(fname)
mapped = 0
unmapped = 0
for b in bam.fetch(chrom, start, end):
if chrom == "*":
unmapped += 1
continue
if b.pos < start:
continue
if not b.is_unmapped:
mapped += 1
else:
unmapped += 1
return mapped, unmapped, chrom
def getMappingStats(bam, nThreads):
"""
This is used for CRAM files, since idxstats() and .mapped/.unmapped are meaningless
This requires pysam > 0.13.0
"""
header = [(x, y) for x, y in zip(bam.references, bam.lengths)]
res = mapReduce([bam.filename, False], countReadsInInterval, header, numberOfProcessors=nThreads)
mapped = sum([x[0] for x in res])
unmapped = sum([x[1] for x in res])
stats = {x[0]: [0, 0] for x in header}
for r in res:
stats[r[2]][0] += r[0]
stats[r[2]][1] += r[1]
# We need to count the number of unmapped reads as well
unmapped += bam.count("*")
return mapped, unmapped, stats
def openBam(bamFile, returnStats=False, nThreads=1, minimalDecoding=True):
"""
A wrapper for opening BAM/CRAM files.
bamFile: str
A BAM/CRAM file name
returnStats: bool
Return a tuple of (file_handle, nMappedReads, nUnmappedReads, statsDict).
These additional values are needed by some downstream functions, since one
can't use file_handle.mapped on CRAM files (or idxstats())
nThreads: int
If returnStats is True, number of threads to use for computing statistics
minimalDecoding: Bool
For CRAM files, don't decode the read name, sequence, qual, or auxiliary tag fields (these aren't used by most functions).
Returns either the file handle or a tuple as described in returnStats
"""
format_options = ["required_fields=0x1FF"]
if sys.version_info.major >= 3:
format_options = [b"required_fields=0x1FF"]
if not minimalDecoding:
format_options = None
try:
bam = pysam.Samfile(bamFile, 'rb', format_options=format_options)
except IOError:
sys.exit("The file '{}' does not exist".format(bamFile))
except:
sys.exit("The file '{}' does not have BAM or CRAM format ".format(bamFile))
try:
assert bam.check_index() is not False
except:
sys.exit("'{}' does not appear to have an index. You MUST index the file first!".format(bamFile))
if bam.is_cram and returnStats:
mapped, unmapped, stats = getMappingStats(bam, nThreads)
elif bam.is_bam:
mapped = bam.mapped
unmapped = bam.unmapped
# Make the dictionary to hold the stats
if returnStats:
stats = {chrom.contig: [chrom.mapped, chrom.unmapped] for chrom in bam.get_index_statistics()}
if bam.is_bam or (bam.is_cram and returnStats):
if mapped == 0:
sys.stderr.write("WARNING! '{}' does not have any mapped reads. Please "
"check that the file is properly indexed and "
"that it contains mapped reads.\n".format(bamFile))
if returnStats:
return bam, mapped, unmapped, stats
else:
return bam
================================================
FILE: deeptools/bamPEFragmentSize.py
================================================
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import sys
import numpy as np
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['svg.fonttype'] = 'none'
from deeptools import cm # noqa: F401
import matplotlib.pyplot as plt
import plotly.offline as py
import plotly.graph_objs as go
# own tools
from deeptools.parserCommon import writableFile
from deeptools.getFragmentAndReadSize import get_read_and_fragment_length
from importlib.metadata import version
def parse_arguments():
parser = argparse.ArgumentParser(
description='This tool calculates the fragment sizes for read pairs given a BAM file from paired-end sequencing.'
'Several regions are sampled depending on the '
'size of the genome and number of processors to estimate the'
'summary statistics on the fragment lengths. '
'Properly paired reads are preferred for computation, i.e., '
'it will only use discordant pairs if no concordant alignments '
'overlap with a given region. '
'The default setting simply prints the summary statistics to the screen.',
usage='bamPEFragmentSize -b sample1.bam sample2.bam -o hist.png\n'
'help: bamPEFragmentSize -h / bamPEFragmentSize --help'
)
parser.add_argument('--bamfiles', '-b',
help='List of BAM files to process',
nargs='+',
metavar='bam files')
parser.add_argument('--histogram', '-hist', '-o',
help='Save a .png file with a histogram '
'of the fragment length distribution.',
metavar='FILE')
parser.add_argument('--plotFileFormat',
metavar='FILETYPE',
help='Image format type. If given, this option '
'overrides the image format based on the plotFile '
'ending. The available options are: png, '
'eps, pdf, svg and plotly.',
default=None,
choices=['png', 'pdf', 'svg', 'eps', 'plotly'])
parser.add_argument('--numberOfProcessors', '-p',
help='Number of processors to use. The default is '
'to use 1. (Default: %(default)s)',
metavar="INT",
type=int,
default=1,
required=False)
parser.add_argument('--samplesLabel',
help='Labels for the samples plotted. The '
'default is to use the file name of the '
'sample. The sample labels should be separated '
'by spaces and quoted if a label itself'
'contains a space E.g. --samplesLabel label-1 "label 2" ',
nargs='+')
parser.add_argument('--plotTitle', '-T',
help='Title of the plot, to be printed on top of '
'the generated image. Leave blank for no title. (Default: %(default)s)',
default='')
parser.add_argument('--maxFragmentLength',
help='The maximum fragment length in the histogram. A value of 0 (the default) indicates to use twice the mean fragment length. (Default: %(default)s)',
default=0,
type=int)
parser.add_argument('--logScale',
help='Plot on the log scale',
action='store_true')
parser.add_argument('--binSize', '-bs',
metavar='INT',
help='Length in bases of the window used to sample the genome. (Default: %(default)s)',
default=1000,
type=int)
parser.add_argument('--distanceBetweenBins', '-n',
metavar='INT',
help='To reduce the computation time, not every possible genomic '
'bin is sampled. This option allows you to set the distance '
'between bins actually sampled from. Larger numbers are sufficient '
'for high coverage samples, while smaller values are useful for '
'lower coverage samples. Note that if you specify a value that '
'results in too few (<1000) reads sampled, the value will be '
'decreased. (Default: %(default)s)',
default=1000000,
type=int)
parser.add_argument('--blackListFileName', '-bl',
help="A BED file containing regions that should be excluded from all analyses. Currently this works by rejecting genomic chunks that happen to overlap an entry. Consequently, for BAM files, if a read partially overlaps a blacklisted region or a fragment spans over it, then the read/fragment might still be considered.",
metavar="BED file",
required=False)
parser.add_argument('--table',
metavar='FILE',
help='In addition to printing read and fragment length metrics to the screen, write them to the given file in tabular format.',
required=False)
parser.add_argument('--outRawFragmentLengths',
metavar='FILE',
required=False,
type=writableFile,
help='Save the fragment (or read if the input is single-end) length and their associated number of occurrences to a tab-separated file. Columns are length, number of occurrences, and the sample label.')
parser.add_argument('--verbose',
help='Set if processing data messages are wanted.',
action='store_true',
required=False)
parser.add_argument('--version', action='version',
version='%(prog)s {}'.format(version('deeptools')))
return parser
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), density=True)
plt.clf()
return (n, bins)
def getFragSize(bam, args, idx, outRawFrags):
fragment_len_dict, read_len_dict = get_read_and_fragment_length(bam, return_lengths=True,
blackListFileName=args.blackListFileName,
numberOfProcessors=args.numberOfProcessors,
verbose=args.verbose,
binSize=args.binSize,
distanceBetweenBins=args.distanceBetweenBins)
if outRawFrags:
label = bam
if args.samplesLabel and idx < len(args.samplesLabel):
label = args.samplesLabel[idx]
if fragment_len_dict:
fragment_len_dict['lengths'] = [int(x) for x in fragment_len_dict['lengths']]
cnts = np.bincount(fragment_len_dict['lengths'], minlength=int(fragment_len_dict['max']) + 1)
else:
read_len_dict['lengths'] = [int(x) for x in read_len_dict['lengths']]
cnts = np.bincount(read_len_dict['lengths'], minlength=int(read_len_dict['max']) + 1)
for idx, v in enumerate(cnts):
if v > 0:
outRawFrags.write("{}\t{}\t{}\n".format(idx, v, label))
if args.samplesLabel and idx < len(args.samplesLabel):
print("\n\nSample label: {}".format(args.samplesLabel[idx]))
else:
print("\n\nBAM file : {}".format(bam))
if fragment_len_dict:
if fragment_len_dict['mean'] == 0:
print("No pairs were found. Is the data from a paired-end sequencing experiment?")
print("Sample size: {}\n".format(fragment_len_dict['sample_size']))
print("Fragment lengths:")
print("Min.: {}\n1st Qu.: {}\nMean: {}\nMedian: {}\n"
"3rd Qu.: {}\nMax.: {}\nStd: {}".format(fragment_len_dict['min'],
fragment_len_dict['qtile25'],
fragment_len_dict['mean'],
fragment_len_dict['median'],
fragment_len_dict['qtile75'],
fragment_len_dict['max'],
fragment_len_dict['std']))
print("MAD: {}\nLen. 10%: {}\nLen. 20%: {}\nLen. 30%: {}\nLen. 40%: {}\nLen. 60%: {}\nLen. 70%: {}\nLen. 80%: {}\nLen. 90%: {}\nLen. 99%: {}\n".format(fragment_len_dict['mad'],
fragment_len_dict['qtile10'],
fragment_len_dict['qtile20'],
fragment_len_dict['qtile30'],
fragment_len_dict['qtile40'],
fragment_len_dict['qtile60'],
fragment_len_dict['qtile70'],
fragment_len_dict['qtile80'],
fragment_len_dict['qtile90'],
fragment_len_dict['qtile99']))
else:
print("No pairs were found. Is the data from a paired-end sequencing experiment?")
print("\nRead lengths:")
print("Sample size: {}\n".format(read_len_dict['sample_size']))
print("Min.: {}\n1st Qu.: {}\nMean: {}\nMedian: {}\n"
"3rd Qu.: {}\nMax.: {}\nStd: {}".format(read_len_dict['min'],
read_len_dict['qtile25'],
read_len_dict['mean'],
read_len_dict['median'],
read_len_dict['qtile75'],
read_len_dict['max'],
read_len_dict['std']))
print("MAD: {}\nLen. 10%: {}\nLen. 20%: {}\nLen. 30%: {}\nLen. 40%: {}\nLen. 60%: {}\nLen. 70%: {}\nLen. 80%: {}\nLen. 90%: {}\nLen. 99%: {}\n".format(read_len_dict['mad'],
read_len_dict['qtile10'],
read_len_dict['qtile20'],
read_len_dict['qtile30'],
read_len_dict['qtile40'],
read_len_dict['qtile60'],
read_len_dict['qtile70'],
read_len_dict['qtile80'],
read_len_dict['qtile90'],
read_len_dict['qtile99']))
# The read and fragment lists will just eat up memory if not removed!
if args.histogram:
if fragment_len_dict:
maxVal = fragment_len_dict['mean'] * 2
minVal = fragment_len_dict['min']
else:
maxVal = read_len_dict['mean'] * 2
minVal = read_len_dict['min']
if args.maxFragmentLength > 0:
maxVal = args.maxFragmentLength
if fragment_len_dict:
fragment_len_dict['lengths'] = getDensity(fragment_len_dict['lengths'], minVal, maxVal)
if read_len_dict:
read_len_dict['lengths'] = getDensity(read_len_dict['lengths'], minVal, maxVal)
else:
if fragment_len_dict:
del fragment_len_dict['lengths']
if read_len_dict:
del read_len_dict['lengths']
return (fragment_len_dict, read_len_dict)
def printTable(args, fragDict, readDict):
"""
Print the read and fragment dictionary in more easily parsable tabular format to a file.
"""
of = open(args.table, "w")
of.write("\tFrag. Sampled")
of.write("\tFrag. Len. Min.\tFrag. Len. 1st. Qu.\tFrag. Len. Mean\tFrag. Len. Median\tFrag. Len. 3rd Qu.\tFrag. Len. Max\tFrag. Len. Std.")
of.write("\tFrag. Med. Abs. Dev.\tFrag. Len. 10%\tFrag. Len. 20%\tFrag. Len. 30%\tFrag. Len. 40%\tFrag. Len. 60%\tFrag. Len. 70%\tFrag. Len. 80%\tFrag. Len. 90%\tFrag. Len. 99%")
of.write("\tReads Sampled")
of.write("\tRead Len. Min.\tRead Len. 1st. Qu.\tRead Len. Mean\tRead Len. Median\tRead Len. 3rd Qu.\tRead Len. Max\tRead Len. Std.")
of.write("\tRead Med. Abs. Dev.\tRead Len. 10%\tRead Len. 20%\tRead Len. 30%\tRead Len. 40%\tRead Len. 60%\tRead Len. 70%\tRead Len. 80%\tRead Len. 90%\tRead Len. 99%\n")
for idx, bam in enumerate(args.bamfiles):
if args.samplesLabel and idx < len(args.samplesLabel):
of.write(args.samplesLabel[idx])
else:
of.write(bam)
if fragDict is not None and fragDict[bam] is not None:
d = fragDict[bam]
of.write("\t{}".format(d['sample_size']))
of.write("\t{}\t{}\t{}\t{}\t{}\t{}\t{}".format(d['min'],
d['qtile25'],
d['mean'],
d['median'],
d['qtile75'],
d['max'],
d['std']))
of.write("\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}".format(d['mad'],
d['qtile10'],
d['qtile20'],
d['qtile30'],
d['qtile40'],
d['qtile60'],
d['qtile70'],
d['qtile80'],
d['qtile90'],
d['qtile99']))
else:
of.write("\t0")
of.write("\t0\t0\t0\t0\t0\t0\t0")
of.write("\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0")
d = readDict[bam]
of.write("\t{}".format(d['sample_size']))
of.write("\t{}\t{}\t{}\t{}\t{}\t{}\t{}".format(d['min'],
d['qtile25'],
d['mean'],
d['median'],
d['qtile75'],
d['max'],
d['std']))
of.write("\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\n".format(d['mad'],
d['qtile10'],
d['qtile20'],
d['qtile30'],
d['qtile40'],
d['qtile60'],
d['qtile70'],
d['qtile80'],
d['qtile90'],
d['qtile99']))
of.close()
def main(args=None):
args = parse_arguments().parse_args(args)
if len(sys.argv) == 1:
parse_arguments().print_help()
sys.exit()
fraglengths = {}
readlengths = {}
of = None
if args.outRawFragmentLengths is not None:
of = open(args.outRawFragmentLengths, "w")
of.write("#bamPEFragmentSize\nSize\tOccurrences\tSample\n")
for idx, bam in enumerate(args.bamfiles):
f, r = getFragSize(bam, args, idx, of)
fraglengths[bam] = f
readlengths[bam] = r
if args.table is not None:
printTable(args, fraglengths, readlengths)
if args.histogram:
if args.samplesLabel:
if len(args.bamfiles) != len(args.samplesLabel):
sys.exit("The number of labels does not match the number of BAM files.")
else:
labels = args.samplesLabel
else:
labels = list(fraglengths.keys())
i = 0
data = []
for bam in fraglengths.keys():
d = fraglengths[bam]
if d is None:
d = readlengths[bam]
if args.maxFragmentLength > 0:
maxVal = args.maxFragmentLength
else:
maxVal = d['mean'] * 2
if args.plotFileFormat == 'plotly':
trace = go.Histogram(x=d['lengths'],
histnorm='probability',
opacity=0.5,
name=labels[i],
nbinsx=100,
xbins=dict(start=d['min'], end=maxVal))
data.append(trace)
else:
plt.bar(d['lengths'][1][:-1], height=d['lengths'][0],
width=d['lengths'][1][1:] - d['lengths'][1][:-1],
align='edge', log=args.logScale,
alpha=0.5, label=labels[i])
i += 1
if args.plotFileFormat == 'plotly':
fig = go.Figure()
fig.add_traces(data)
fig['layout']['yaxis1'].update(title='Frequency')
fig['layout']['xaxis1'].update(title='Fragment Length')
fig['layout'].update(title=args.plotTitle)
fig['layout'].update(showlegend=True)
if args.logScale:
fig['layout']['yaxis1'].update(type='log')
py.plot(fig, filename=args.histogram, auto_open=False)
else:
plt.xlabel('Fragment Length')
plt.ylabel('Frequency')
plt.legend(loc='upper right')
plt.title(args.plotTitle)
plt.savefig(args.histogram, bbox_inches=0, format=args.plotFileFormat)
plt.close()
if __name__ == "__main__":
main()
================================================
FILE: deeptools/bigwigAverage.py
================================================
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import sys
import numpy as np
from deeptools import parserCommon
from deeptools import writeBedGraph_bam_and_bw
debug = 0
def parse_arguments(args=None):
parentParser = parserCommon.getParentArgParse()
outputParser = parserCommon.output()
parser = argparse.ArgumentParser(
parents=[parentParser, outputParser],
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description='This tool average multiple bigWig files based on the number '
'of mapped reads. To average the bigWig files, the genome is '
'partitioned into bins of equal size, then the scores '
'in each bigwig file are computed per bin.'
'These scores are averaged and scaleFactors can be applied before the average.',
usage='bigwigAverage -b sample1.bw sample2.bw -o outfile.bw\n'
'help: bigwigAverage -h / bigwigAverage --help')
# define the arguments
parser.add_argument('--bigwigs', '-b',
metavar='Bigwig files',
help='Bigwig files separated by space.',
nargs='+',
required=True)
parser.add_argument('--scaleFactors',
help='Set this parameter to multipy the bigwig values '
'by a constant. The format is '
'scaleFactor1:scaleFactor2:scaleFactor3 etc. '
'For example 0.7:1 to scale the first bigwig file '
'by 0.7 while not scaling the second bigwig file',
default=None,
required=False)
parser.add_argument('--skipNonCoveredRegions', '--skipNAs',
help='This parameter determines if non-covered regions (regions without a score) '
'in the bigWig files should be skipped. The default is to treat those '
'regions as having a value of zero. '
'The decision to skip non-covered regions '
'depends on the interpretation of the data. Non-covered regions '
'in a bigWig file may represent repetitive regions that should '
'be skipped. Alternatively, the interpretation of non-covered regions as '
'zeros may be wrong and this option should be used ',
action='store_true')
return parser
def getType(fname):
"""
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"
elif fname.lower().endswith(".bedgraph") or fname.endswith(".bdg"):
return "bedgraph"
else:
return "bigwig"
def average(tileCoverage, args):
r"""
The mapreduce method calls this function
for each tile. The parameters (args) are fixed
in the main method.
>>> funcArgs= {'scaleFactors': (1,1)}
>>> average([1, 2], funcArgs)
1.5
>>> funcArgs= {'scaleFactors': (1,0.5)}
>>> average([1, 2], funcArgs)
1.0
>>> funcArgs= {'scaleFactors': (1,0.5,0.1,0.2)}
>>> average([1, 2, 3, 12], funcArgs)
1.175
>>> average([1, 2, 3, np.nan], funcArgs)
nan
"""
norm_values = [args['scaleFactors'][i] * cov for i, cov in enumerate(tileCoverage)]
return np.mean(norm_values)
def main(args=None):
args = parse_arguments().parse_args(args)
if len(sys.argv) == 1:
parse_arguments().print_help()
sys.exit()
nFiles = len(args.bigwigs)
if args.scaleFactors:
scaleFactors = [float(x) for x in args.scaleFactors.split(":")]
if len(scaleFactors) == 1:
scaleFactors = scaleFactors * nFiles
elif len(scaleFactors) != nFiles:
raise argparse.ArgumentTypeError(
"Format of scaleFactors is factor or factor1:factor2... as many as bigwig files. "
"There are {} bigwigs and {} factors."
"The value given ( {} ) is not valid".format(nFiles, len(scaleFactors), args.scaleFactors))
else:
scaleFactors = [1] * nFiles
# the average function is called and receives
# the function_args per each tile that is considered
FUNC = average
function_args = {'scaleFactors': scaleFactors}
writeBedGraph_bam_and_bw.writeBedGraph(
[(b, getType(b)) for b in args.bigwigs],
args.outFileName, 0, FUNC,
function_args, tileSize=args.binSize, region=args.region,
blackListFileName=args.blackListFileName,
verbose=args.verbose,
numberOfProcessors=args.numberOfProcessors,
skipZeroOverZero=False,
format=args.outFileFormat,
smoothLength=False,
missingDataAsZero=not args.skipNonCoveredRegions,
extendPairedEnds=False)
================================================
FILE: deeptools/bigwigCompare.py
================================================
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from deeptools import parserCommon
from deeptools.getRatio import getRatio
from deeptools import writeBedGraph_bam_and_bw
debug = 0
def parse_arguments(args=None):
parentParser = parserCommon.getParentArgParse()
outputParser = parserCommon.output()
parser = argparse.ArgumentParser(
parents=[parentParser, outputParser],
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description='This tool compares two bigWig files based on the number '
'of mapped reads. To compare the bigWig files, the genome is '
'partitioned into bins of equal size, then the number of reads found '
'in each BAM file are counted per bin and finally a summary '
'value is reported. This value can be the ratio of the number of reads'
'per bin, the log2 of the ratio, the sum or the difference.',
usage='bigwigCompare -b1 sample1.bw -b2 sample2.bw -o log2.bw\n'
'help: bigwigCompare -h / bigwigCompare --help')
# define the arguments
parser.add_argument('--bigwig1', '-b1',
metavar='Bigwig file',
help='Bigwig file 1. Usually the file for the '
'treatment.',
required=True)
parser.add_argument('--bigwig2', '-b2',
metavar='Bigwig file',
help='Bigwig file 2. Usually the file for the '
'control.',
required=True)
parser.add_argument('--scaleFactors',
help='Set this parameter to multipy the bigwig values '
'by a constant. The format is '
'scaleFactor1:scaleFactor2. '
'For example 0.7:1 to scale the first bigwig file '
'by 0.7 while not scaling the second bigwig file',
default=None,
required=False)
parser.add_argument('--pseudocount',
help='A small number to avoid x/0. Only useful '
'together with --operation log2 or --operation ratio. '
'You can specify different values as pseudocounts for '
'the numerator and the denominator by providing two '
'values (the first value is used as the numerator '
'pseudocount and the second the denominator pseudocount). (Default: %(default)s)',
default=1,
nargs='+',
action=parserCommon.requiredLength(1, 2),
type=float,
required=False)
parser.add_argument('--skipZeroOverZero',
help='Skip bins where BOTH BAM files lack coverage. '
'This is determined BEFORE any applicable pseudocount '
'is added.',
action='store_true')
parser.add_argument('--operation',
help='The default is to output the log2ratio of the '
'two samples. The reciprocal ratio returns the '
'the negative of the inverse of the ratio '
'if the ratio is less than 0. The resulting '
'values are interpreted as negative fold changes. '
'Instead of performing a '
'computation using both files, the scaled signal can '
'alternatively be output for the first or second file using '
'the \'--operation first\' or \'--operation second\' (Default: %(default)s)',
default='log2',
choices=['log2', 'ratio', 'subtract', 'add', 'mean',
'reciprocal_ratio', 'first', 'second'],
required=False)
parser.add_argument('--skipNonCoveredRegions', '--skipNAs',
help='This parameter determines if non-covered regions (regions without a score) '
'in the bigWig files should be skipped. The default is to treat those '
'regions as having a value of zero. '
'The decision to skip non-covered regions '
'depends on the interpretation of the data. Non-covered regions '
'in a bigWig file may represent repetitive regions that should '
'be skipped. Alternatively, the interpretation of non-covered regions as '
'zeros may be wrong and this option should be used ',
action='store_true')
parser.add_argument('--fixedStep',
help='Write out all bins (of size --binSize) '
'instead of merging neighbouring bins with equal values.',
action='store_true')
return parser
def getType(fname):
"""
Tries to determine if a file is a wiggle, a bedgraph or a bigWig.
"""
if fname.endswith(".wig") or fname.endswith(".wiggle"):
return "wiggle"
elif fname.endswith(".bedgraph"):
return "bedgraph"
else:
return "bigwig"
def main(args=None):
args = parse_arguments().parse_args(args)
if args.scaleFactors:
scaleFactors = [float(x) for x in args.scaleFactors.split(":")]
else:
scaleFactors = [1, 1]
if not isinstance(args.pseudocount, list):
args.pseudocount = [args.pseudocount]
if len(args.pseudocount) == 1:
args.pseudocount *= 2
# the getRatio function is called and receives
# the function_args per each tile that is considered
FUNC = getRatio
function_args = {'valueType': args.operation,
'scaleFactors': scaleFactors,
'pseudocount': args.pseudocount}
writeBedGraph_bam_and_bw.writeBedGraph(
[(args.bigwig1, getType(args.bigwig1)),
(args.bigwig2, getType(args.bigwig2))],
args.outFileName, 0, FUNC,
function_args, tileSize=args.binSize, region=args.region,
blackListFileName=args.blackListFileName,
verbose=args.verbose,
numberOfProcessors=args.numberOfProcessors,
skipZeroOverZero=args.skipZeroOverZero,
format=args.outFileFormat,
smoothLength=False,
missingDataAsZero=not args.skipNonCoveredRegions,
extendPairedEnds=False,
fixedStep=args.fixedStep)
================================================
FILE: deeptools/cm.py
================================================
#!/usr/bin/env python
# This file comes from the seaborn project and is under a BSD license:
# Copyright (c) 2012-2019, Michael L. Waskom
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the project nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from matplotlib import colors, colormaps as mpl_cm
_rocket_lut = [
[0.01060815, 0.01808215, 0.10018654],
[0.01428972, 0.02048237, 0.10374486],
[0.01831941, 0.0229766, 0.10738511],
[0.02275049, 0.02554464, 0.11108639],
[0.02759119, 0.02818316, 0.11483751],
[0.03285175, 0.03088792, 0.11863035],
[0.03853466, 0.03365771, 0.12245873],
[0.04447016, 0.03648425, 0.12631831],
[0.05032105, 0.03936808, 0.13020508],
[0.05611171, 0.04224835, 0.13411624],
[0.0618531, 0.04504866, 0.13804929],
[0.06755457, 0.04778179, 0.14200206],
[0.0732236, 0.05045047, 0.14597263],
[0.0788708, 0.05305461, 0.14995981],
[0.08450105, 0.05559631, 0.15396203],
[0.09011319, 0.05808059, 0.15797687],
[0.09572396, 0.06050127, 0.16200507],
[0.10132312, 0.06286782, 0.16604287],
[0.10692823, 0.06517224, 0.17009175],
[0.1125315, 0.06742194, 0.17414848],
[0.11813947, 0.06961499, 0.17821272],
[0.12375803, 0.07174938, 0.18228425],
[0.12938228, 0.07383015, 0.18636053],
[0.13501631, 0.07585609, 0.19044109],
[0.14066867, 0.0778224, 0.19452676],
[0.14633406, 0.07973393, 0.1986151],
[0.15201338, 0.08159108, 0.20270523],
[0.15770877, 0.08339312, 0.20679668],
[0.16342174, 0.0851396, 0.21088893],
[0.16915387, 0.08682996, 0.21498104],
[0.17489524, 0.08848235, 0.2190294],
[0.18065495, 0.09009031, 0.22303512],
[0.18643324, 0.09165431, 0.22699705],
[0.19223028, 0.09317479, 0.23091409],
[0.19804623, 0.09465217, 0.23478512],
[0.20388117, 0.09608689, 0.23860907],
[0.20973515, 0.09747934, 0.24238489],
[0.21560818, 0.09882993, 0.24611154],
[0.22150014, 0.10013944, 0.2497868],
[0.22741085, 0.10140876, 0.25340813],
[0.23334047, 0.10263737, 0.25697736],
[0.23928891, 0.10382562, 0.2604936],
[0.24525608, 0.10497384, 0.26395596],
[0.25124182, 0.10608236, 0.26736359],
[0.25724602, 0.10715148, 0.27071569],
[0.26326851, 0.1081815, 0.27401148],
[0.26930915, 0.1091727, 0.2772502],
[0.27536766, 0.11012568, 0.28043021],
[0.28144375, 0.11104133, 0.2835489],
[0.2875374, 0.11191896, 0.28660853],
[0.29364846, 0.11275876, 0.2896085],
[0.29977678, 0.11356089, 0.29254823],
[0.30592213, 0.11432553, 0.29542718],
[0.31208435, 0.11505284, 0.29824485],
[0.31826327, 0.1157429, 0.30100076],
[0.32445869, 0.11639585, 0.30369448],
[0.33067031, 0.11701189, 0.30632563],
[0.33689808, 0.11759095, 0.3088938],
[0.34314168, 0.11813362, 0.31139721],
[0.34940101, 0.11863987, 0.3138355],
[0.355676, 0.11910909, 0.31620996],
[0.36196644, 0.1195413, 0.31852037],
[0.36827206, 0.11993653, 0.32076656],
[0.37459292, 0.12029443, 0.32294825],
[0.38092887, 0.12061482, 0.32506528],
[0.38727975, 0.12089756, 0.3271175],
[0.39364518, 0.12114272, 0.32910494],
[0.40002537, 0.12134964, 0.33102734],
[0.40642019, 0.12151801, 0.33288464],
[0.41282936, 0.12164769, 0.33467689],
[0.41925278, 0.12173833, 0.33640407],
[0.42569057, 0.12178916, 0.33806605],
[0.43214263, 0.12179973, 0.33966284],
[0.43860848, 0.12177004, 0.34119475],
[0.44508855, 0.12169883, 0.34266151],
[0.45158266, 0.12158557, 0.34406324],
[0.45809049, 0.12142996, 0.34540024],
[0.46461238, 0.12123063, 0.34667231],
[0.47114798, 0.12098721, 0.34787978],
[0.47769736, 0.12069864, 0.34902273],
[0.48426077, 0.12036349, 0.35010104],
[0.49083761, 0.11998161, 0.35111537],
[0.49742847, 0.11955087, 0.35206533],
[0.50403286, 0.11907081, 0.35295152],
[0.51065109, 0.11853959, 0.35377385],
[0.51728314, 0.1179558, 0.35453252],
[0.52392883, 0.11731817, 0.35522789],
[0.53058853, 0.11662445, 0.35585982],
[0.53726173, 0.11587369, 0.35642903],
[0.54394898, 0.11506307, 0.35693521],
[0.5506426, 0.11420757, 0.35737863],
[0.55734473, 0.11330456, 0.35775059],
[0.56405586, 0.11235265, 0.35804813],
[0.57077365, 0.11135597, 0.35827146],
[0.5774991, 0.11031233, 0.35841679],
[0.58422945, 0.10922707, 0.35848469],
[0.59096382, 0.10810205, 0.35847347],
[0.59770215, 0.10693774, 0.35838029],
[0.60444226, 0.10573912, 0.35820487],
[0.61118304, 0.10450943, 0.35794557],
[0.61792306, 0.10325288, 0.35760108],
[0.62466162, 0.10197244, 0.35716891],
[0.63139686, 0.10067417, 0.35664819],
[0.63812122, 0.09938212, 0.35603757],
[0.64483795, 0.0980891, 0.35533555],
[0.65154562, 0.09680192, 0.35454107],
[0.65824241, 0.09552918, 0.3536529],
[0.66492652, 0.09428017, 0.3526697],
[0.67159578, 0.09306598, 0.35159077],
[0.67824099, 0.09192342, 0.3504148],
[0.684863, 0.09085633, 0.34914061],
[0.69146268, 0.0898675, 0.34776864],
[0.69803757, 0.08897226, 0.3462986],
[0.70457834, 0.0882129, 0.34473046],
[0.71108138, 0.08761223, 0.3430635],
[0.7175507, 0.08716212, 0.34129974],
[0.72398193, 0.08688725, 0.33943958],
[0.73035829, 0.0868623, 0.33748452],
[0.73669146, 0.08704683, 0.33543669],
[0.74297501, 0.08747196, 0.33329799],
[0.74919318, 0.08820542, 0.33107204],
[0.75535825, 0.08919792, 0.32876184],
[0.76145589, 0.09050716, 0.32637117],
[0.76748424, 0.09213602, 0.32390525],
[0.77344838, 0.09405684, 0.32136808],
[0.77932641, 0.09634794, 0.31876642],
[0.78513609, 0.09892473, 0.31610488],
[0.79085854, 0.10184672, 0.313391],
[0.7965014, 0.10506637, 0.31063031],
[0.80205987, 0.10858333, 0.30783],
[0.80752799, 0.11239964, 0.30499738],
[0.81291606, 0.11645784, 0.30213802],
[0.81820481, 0.12080606, 0.29926105],
[0.82341472, 0.12535343, 0.2963705],
[0.82852822, 0.13014118, 0.29347474],
[0.83355779, 0.13511035, 0.29057852],
[0.83850183, 0.14025098, 0.2876878],
[0.84335441, 0.14556683, 0.28480819],
[0.84813096, 0.15099892, 0.281943],
[0.85281737, 0.15657772, 0.27909826],
[0.85742602, 0.1622583, 0.27627462],
[0.86196552, 0.16801239, 0.27346473],
[0.86641628, 0.17387796, 0.27070818],
[0.87079129, 0.17982114, 0.26797378],
[0.87507281, 0.18587368, 0.26529697],
[0.87925878, 0.19203259, 0.26268136],
[0.8833417, 0.19830556, 0.26014181],
[0.88731387, 0.20469941, 0.25769539],
[0.89116859, 0.21121788, 0.2553592],
[0.89490337, 0.21785614, 0.25314362],
[0.8985026, 0.22463251, 0.25108745],
[0.90197527, 0.23152063, 0.24918223],
[0.90530097, 0.23854541, 0.24748098],
[0.90848638, 0.24568473, 0.24598324],
[0.911533, 0.25292623, 0.24470258],
[0.9144225, 0.26028902, 0.24369359],
[0.91717106, 0.26773821, 0.24294137],
[0.91978131, 0.27526191, 0.24245973],
[0.92223947, 0.28287251, 0.24229568],
[0.92456587, 0.29053388, 0.24242622],
[0.92676657, 0.29823282, 0.24285536],
[0.92882964, 0.30598085, 0.24362274],
[0.93078135, 0.31373977, 0.24468803],
[0.93262051, 0.3215093, 0.24606461],
[0.93435067, 0.32928362, 0.24775328],
[0.93599076, 0.33703942, 0.24972157],
[0.93752831, 0.34479177, 0.25199928],
[0.93899289, 0.35250734, 0.25452808],
[0.94036561, 0.36020899, 0.25734661],
[0.94167588, 0.36786594, 0.2603949],
[0.94291042, 0.37549479, 0.26369821],
[0.94408513, 0.3830811, 0.26722004],
[0.94520419, 0.39062329, 0.27094924],
[0.94625977, 0.39813168, 0.27489742],
[0.94727016, 0.4055909, 0.27902322],
[0.94823505, 0.41300424, 0.28332283],
[0.94914549, 0.42038251, 0.28780969],
[0.95001704, 0.42771398, 0.29244728],
[0.95085121, 0.43500005, 0.29722817],
[0.95165009, 0.44224144, 0.30214494],
[0.9524044, 0.44944853, 0.3072105],
[0.95312556, 0.45661389, 0.31239776],
[0.95381595, 0.46373781, 0.31769923],
[0.95447591, 0.47082238, 0.32310953],
[0.95510255, 0.47787236, 0.32862553],
[0.95569679, 0.48489115, 0.33421404],
[0.95626788, 0.49187351, 0.33985601],
[0.95681685, 0.49882008, 0.34555431],
[0.9573439, 0.50573243, 0.35130912],
[0.95784842, 0.51261283, 0.35711942],
[0.95833051, 0.51946267, 0.36298589],
[0.95879054, 0.52628305, 0.36890904],
[0.95922872, 0.53307513, 0.3748895],
[0.95964538, 0.53983991, 0.38092784],
[0.96004345, 0.54657593, 0.3870292],
[0.96042097, 0.55328624, 0.39319057],
[0.96077819, 0.55997184, 0.39941173],
[0.9611152, 0.5666337, 0.40569343],
[0.96143273, 0.57327231, 0.41203603],
[0.96173392, 0.57988594, 0.41844491],
[0.96201757, 0.58647675, 0.42491751],
[0.96228344, 0.59304598, 0.43145271],
[0.96253168, 0.5995944, 0.43805131],
[0.96276513, 0.60612062, 0.44471698],
[0.96298491, 0.6126247, 0.45145074],
[0.96318967, 0.61910879, 0.45824902],
[0.96337949, 0.6255736, 0.46511271],
[0.96355923, 0.63201624, 0.47204746],
[0.96372785, 0.63843852, 0.47905028],
[0.96388426, 0.64484214, 0.4861196],
[0.96403203, 0.65122535, 0.4932578],
[0.96417332, 0.65758729, 0.50046894],
[0.9643063, 0.66393045, 0.5077467],
[0.96443322, 0.67025402, 0.51509334],
[0.96455845, 0.67655564, 0.52251447],
[0.96467922, 0.68283846, 0.53000231],
[0.96479861, 0.68910113, 0.53756026],
[0.96492035, 0.69534192, 0.5451917],
[0.96504223, 0.7015636, 0.5528892],
[0.96516917, 0.70776351, 0.5606593],
[0.96530224, 0.71394212, 0.56849894],
[0.96544032, 0.72010124, 0.57640375],
[0.96559206, 0.72623592, 0.58438387],
[0.96575293, 0.73235058, 0.59242739],
[0.96592829, 0.73844258, 0.60053991],
[0.96612013, 0.74451182, 0.60871954],
[0.96632832, 0.75055966, 0.61696136],
[0.96656022, 0.75658231, 0.62527295],
[0.96681185, 0.76258381, 0.63364277],
[0.96709183, 0.76855969, 0.64207921],
[0.96739773, 0.77451297, 0.65057302],
[0.96773482, 0.78044149, 0.65912731],
[0.96810471, 0.78634563, 0.66773889],
[0.96850919, 0.79222565, 0.6764046],
[0.96893132, 0.79809112, 0.68512266],
[0.96935926, 0.80395415, 0.69383201],
[0.9698028, 0.80981139, 0.70252255],
[0.97025511, 0.81566605, 0.71120296],
[0.97071849, 0.82151775, 0.71987163],
[0.97120159, 0.82736371, 0.72851999],
[0.97169389, 0.83320847, 0.73716071],
[0.97220061, 0.83905052, 0.74578903],
[0.97272597, 0.84488881, 0.75440141],
[0.97327085, 0.85072354, 0.76299805],
[0.97383206, 0.85655639, 0.77158353],
[0.97441222, 0.86238689, 0.78015619],
[0.97501782, 0.86821321, 0.78871034],
[0.97564391, 0.87403763, 0.79725261],
[0.97628674, 0.87986189, 0.8057883],
[0.97696114, 0.88568129, 0.81430324],
[0.97765722, 0.89149971, 0.82280948],
[0.97837585, 0.89731727, 0.83130786],
[0.97912374, 0.90313207, 0.83979337],
[0.979891, 0.90894778, 0.84827858],
[0.98067764, 0.91476465, 0.85676611],
[0.98137749, 0.92061729, 0.86536915]
]
_mako_lut = [
[0.04503935, 0.01482344, 0.02092227],
[0.04933018, 0.01709292, 0.02535719],
[0.05356262, 0.01950702, 0.03018802],
[0.05774337, 0.02205989, 0.03545515],
[0.06188095, 0.02474764, 0.04115287],
[0.06598247, 0.0275665, 0.04691409],
[0.07005374, 0.03051278, 0.05264306],
[0.07409947, 0.03358324, 0.05834631],
[0.07812339, 0.03677446, 0.06403249],
[0.08212852, 0.0400833, 0.06970862],
[0.08611731, 0.04339148, 0.07538208],
[0.09009161, 0.04664706, 0.08105568],
[0.09405308, 0.04985685, 0.08673591],
[0.09800301, 0.05302279, 0.09242646],
[0.10194255, 0.05614641, 0.09813162],
[0.10587261, 0.05922941, 0.103854],
[0.1097942, 0.06227277, 0.10959847],
[0.11370826, 0.06527747, 0.11536893],
[0.11761516, 0.06824548, 0.12116393],
[0.12151575, 0.07117741, 0.12698763],
[0.12541095, 0.07407363, 0.1328442],
[0.12930083, 0.07693611, 0.13873064],
[0.13317849, 0.07976988, 0.14465095],
[0.13701138, 0.08259683, 0.15060265],
[0.14079223, 0.08542126, 0.15659379],
[0.14452486, 0.08824175, 0.16262484],
[0.14820351, 0.09106304, 0.16869476],
[0.15183185, 0.09388372, 0.17480366],
[0.15540398, 0.09670855, 0.18094993],
[0.15892417, 0.09953561, 0.18713384],
[0.16238588, 0.10236998, 0.19335329],
[0.16579435, 0.10520905, 0.19960847],
[0.16914226, 0.10805832, 0.20589698],
[0.17243586, 0.11091443, 0.21221911],
[0.17566717, 0.11378321, 0.21857219],
[0.17884322, 0.11666074, 0.2249565],
[0.18195582, 0.11955283, 0.23136943],
[0.18501213, 0.12245547, 0.23781116],
[0.18800459, 0.12537395, 0.24427914],
[0.19093944, 0.1283047, 0.25077369],
[0.19381092, 0.13125179, 0.25729255],
[0.19662307, 0.13421303, 0.26383543],
[0.19937337, 0.13719028, 0.27040111],
[0.20206187, 0.14018372, 0.27698891],
[0.20469116, 0.14319196, 0.28359861],
[0.20725547, 0.14621882, 0.29022775],
[0.20976258, 0.14925954, 0.29687795],
[0.21220409, 0.15231929, 0.30354703],
[0.21458611, 0.15539445, 0.31023563],
[0.21690827, 0.15848519, 0.31694355],
[0.21916481, 0.16159489, 0.32366939],
[0.2213631, 0.16471913, 0.33041431],
[0.22349947, 0.1678599, 0.33717781],
[0.2255714, 0.1710185, 0.34395925],
[0.22758415, 0.17419169, 0.35075983],
[0.22953569, 0.17738041, 0.35757941],
[0.23142077, 0.18058733, 0.3644173],
[0.2332454, 0.18380872, 0.37127514],
[0.2350092, 0.18704459, 0.3781528],
[0.23670785, 0.190297, 0.38504973],
[0.23834119, 0.19356547, 0.39196711],
[0.23991189, 0.19684817, 0.39890581],
[0.24141903, 0.20014508, 0.4058667],
[0.24286214, 0.20345642, 0.4128484],
[0.24423453, 0.20678459, 0.41985299],
[0.24554109, 0.21012669, 0.42688124],
[0.2467815, 0.21348266, 0.43393244],
[0.24795393, 0.21685249, 0.4410088],
[0.24905614, 0.22023618, 0.448113],
[0.25007383, 0.22365053, 0.45519562],
[0.25098926, 0.22710664, 0.46223892],
[0.25179696, 0.23060342, 0.46925447],
[0.25249346, 0.23414353, 0.47623196],
[0.25307401, 0.23772973, 0.48316271],
[0.25353152, 0.24136961, 0.49001976],
[0.25386167, 0.24506548, 0.49679407],
[0.25406082, 0.2488164, 0.50348932],
[0.25412435, 0.25262843, 0.51007843],
[0.25404842, 0.25650743, 0.51653282],
[0.25383134, 0.26044852, 0.52286845],
[0.2534705, 0.26446165, 0.52903422],
[0.25296722, 0.2685428, 0.53503572],
[0.2523226, 0.27269346, 0.54085315],
[0.25153974, 0.27691629, 0.54645752],
[0.25062402, 0.28120467, 0.55185939],
[0.24958205, 0.28556371, 0.55701246],
[0.24842386, 0.28998148, 0.56194601],
[0.24715928, 0.29446327, 0.56660884],
[0.24580099, 0.29899398, 0.57104399],
[0.24436202, 0.30357852, 0.57519929],
[0.24285591, 0.30819938, 0.57913247],
[0.24129828, 0.31286235, 0.58278615],
[0.23970131, 0.3175495, 0.5862272],
[0.23807973, 0.32226344, 0.58941872],
[0.23644557, 0.32699241, 0.59240198],
[0.2348113, 0.33173196, 0.59518282],
[0.23318874, 0.33648036, 0.59775543],
[0.2315855, 0.34122763, 0.60016456],
[0.23001121, 0.34597357, 0.60240251],
[0.2284748, 0.35071512, 0.6044784],
[0.22698081, 0.35544612, 0.60642528],
[0.22553305, 0.36016515, 0.60825252],
[0.22413977, 0.36487341, 0.60994938],
[0.22280246, 0.36956728, 0.61154118],
[0.22152555, 0.37424409, 0.61304472],
[0.22030752, 0.37890437, 0.61446646],
[0.2191538, 0.38354668, 0.61581561],
[0.21806257, 0.38817169, 0.61709794],
[0.21703799, 0.39277882, 0.61831922],
[0.21607792, 0.39736958, 0.61948028],
[0.21518463, 0.40194196, 0.62059763],
[0.21435467, 0.40649717, 0.62167507],
[0.21358663, 0.41103579, 0.62271724],
[0.21288172, 0.41555771, 0.62373011],
[0.21223835, 0.42006355, 0.62471794],
[0.21165312, 0.42455441, 0.62568371],
[0.21112526, 0.42903064, 0.6266318],
[0.21065161, 0.43349321, 0.62756504],
[0.21023306, 0.43794288, 0.62848279],
[0.20985996, 0.44238227, 0.62938329],
[0.20951045, 0.44680966, 0.63030696],
[0.20916709, 0.45122981, 0.63124483],
[0.20882976, 0.45564335, 0.63219599],
[0.20849798, 0.46005094, 0.63315928],
[0.20817199, 0.46445309, 0.63413391],
[0.20785149, 0.46885041, 0.63511876],
[0.20753716, 0.47324327, 0.63611321],
[0.20722876, 0.47763224, 0.63711608],
[0.20692679, 0.48201774, 0.63812656],
[0.20663156, 0.48640018, 0.63914367],
[0.20634336, 0.49078002, 0.64016638],
[0.20606303, 0.49515755, 0.6411939],
[0.20578999, 0.49953341, 0.64222457],
[0.20552612, 0.50390766, 0.64325811],
[0.20527189, 0.50828072, 0.64429331],
[0.20502868, 0.51265277, 0.64532947],
[0.20479718, 0.51702417, 0.64636539],
[0.20457804, 0.52139527, 0.64739979],
[0.20437304, 0.52576622, 0.64843198],
[0.20418396, 0.53013715, 0.64946117],
[0.20401238, 0.53450825, 0.65048638],
[0.20385896, 0.53887991, 0.65150606],
[0.20372653, 0.54325208, 0.65251978],
[0.20361709, 0.5476249, 0.6535266],
[0.20353258, 0.55199854, 0.65452542],
[0.20347472, 0.55637318, 0.655515],
[0.20344718, 0.56074869, 0.65649508],
[0.20345161, 0.56512531, 0.65746419],
[0.20349089, 0.56950304, 0.65842151],
[0.20356842, 0.57388184, 0.65936642],
[0.20368663, 0.57826181, 0.66029768],
[0.20384884, 0.58264293, 0.6612145],
[0.20405904, 0.58702506, 0.66211645],
[0.20431921, 0.59140842, 0.66300179],
[0.20463464, 0.59579264, 0.66387079],
[0.20500731, 0.60017798, 0.66472159],
[0.20544449, 0.60456387, 0.66555409],
[0.20596097, 0.60894927, 0.66636568],
[0.20654832, 0.61333521, 0.66715744],
[0.20721003, 0.61772167, 0.66792838],
[0.20795035, 0.62210845, 0.66867802],
[0.20877302, 0.62649546, 0.66940555],
[0.20968223, 0.63088252, 0.6701105],
[0.21068163, 0.63526951, 0.67079211],
[0.21177544, 0.63965621, 0.67145005],
[0.21298582, 0.64404072, 0.67208182],
[0.21430361, 0.64842404, 0.67268861],
[0.21572716, 0.65280655, 0.67326978],
[0.21726052, 0.65718791, 0.6738255],
[0.21890636, 0.66156803, 0.67435491],
[0.220668, 0.66594665, 0.67485792],
[0.22255447, 0.67032297, 0.67533374],
[0.22458372, 0.67469531, 0.67578061],
[0.22673713, 0.67906542, 0.67620044],
[0.22901625, 0.6834332, 0.67659251],
[0.23142316, 0.68779836, 0.67695703],
[0.23395924, 0.69216072, 0.67729378],
[0.23663857, 0.69651881, 0.67760151],
[0.23946645, 0.70087194, 0.67788018],
[0.24242624, 0.70522162, 0.67813088],
[0.24549008, 0.70957083, 0.67835215],
[0.24863372, 0.71392166, 0.67854868],
[0.25187832, 0.71827158, 0.67872193],
[0.25524083, 0.72261873, 0.67887024],
[0.25870947, 0.72696469, 0.67898912],
[0.26229238, 0.73130855, 0.67907645],
[0.26604085, 0.73564353, 0.67914062],
[0.26993099, 0.73997282, 0.67917264],
[0.27397488, 0.74429484, 0.67917096],
[0.27822463, 0.74860229, 0.67914468],
[0.28264201, 0.75290034, 0.67907959],
[0.2873016, 0.75717817, 0.67899164],
[0.29215894, 0.76144162, 0.67886578],
[0.29729823, 0.76567816, 0.67871894],
[0.30268199, 0.76989232, 0.67853896],
[0.30835665, 0.77407636, 0.67833512],
[0.31435139, 0.77822478, 0.67811118],
[0.3206671, 0.78233575, 0.67786729],
[0.32733158, 0.78640315, 0.67761027],
[0.33437168, 0.79042043, 0.67734882],
[0.34182112, 0.79437948, 0.67709394],
[0.34968889, 0.79827511, 0.67685638],
[0.35799244, 0.80210037, 0.67664969],
[0.36675371, 0.80584651, 0.67649539],
[0.3759816, 0.80950627, 0.67641393],
[0.38566792, 0.81307432, 0.67642947],
[0.39579804, 0.81654592, 0.67656899],
[0.40634556, 0.81991799, 0.67686215],
[0.41730243, 0.82318339, 0.67735255],
[0.4285828, 0.82635051, 0.6780564],
[0.44012728, 0.82942353, 0.67900049],
[0.45189421, 0.83240398, 0.68021733],
[0.46378379, 0.83530763, 0.6817062],
[0.47573199, 0.83814472, 0.68347352],
[0.48769865, 0.84092197, 0.68552698],
[0.49962354, 0.84365379, 0.68783929],
[0.5114027, 0.8463718, 0.69029789],
[0.52301693, 0.84908401, 0.69288545],
[0.53447549, 0.85179048, 0.69561066],
[0.54578602, 0.8544913, 0.69848331],
[0.55695565, 0.85718723, 0.70150427],
[0.56798832, 0.85987893, 0.70468261],
[0.57888639, 0.86256715, 0.70802931],
[0.5896541, 0.8652532, 0.71154204],
[0.60028928, 0.86793835, 0.71523675],
[0.61079441, 0.87062438, 0.71910895],
[0.62116633, 0.87331311, 0.72317003],
[0.63140509, 0.87600675, 0.72741689],
[0.64150735, 0.87870746, 0.73185717],
[0.65147219, 0.8814179, 0.73648495],
[0.66129632, 0.8841403, 0.74130658],
[0.67097934, 0.88687758, 0.74631123],
[0.68051833, 0.88963189, 0.75150483],
[0.68991419, 0.89240612, 0.75687187],
[0.69916533, 0.89520211, 0.76241714],
[0.70827373, 0.89802257, 0.76812286],
[0.71723995, 0.90086891, 0.77399039],
[0.72606665, 0.90374337, 0.7800041],
[0.73475675, 0.90664718, 0.78615802],
[0.74331358, 0.90958151, 0.79244474],
[0.75174143, 0.91254787, 0.79884925],
[0.76004473, 0.91554656, 0.80536823],
[0.76827704, 0.91856549, 0.81196513],
[0.77647029, 0.921603, 0.81855729],
[0.78462009, 0.92466151, 0.82514119],
[0.79273542, 0.92773848, 0.83172131],
[0.8008109, 0.93083672, 0.83829355],
[0.80885107, 0.93395528, 0.84485982],
[0.81685878, 0.9370938, 0.85142101],
[0.82483206, 0.94025378, 0.8579751],
[0.83277661, 0.94343371, 0.86452477],
[0.84069127, 0.94663473, 0.87106853],
[0.84857662, 0.9498573, 0.8776059],
[0.8564431, 0.95309792, 0.88414253],
[0.86429066, 0.95635719, 0.89067759],
[0.87218969, 0.95960708, 0.89725384]
]
_vlag_lut = [
[0.13850039, 0.41331206, 0.74052025],
[0.15077609, 0.41762684, 0.73970427],
[0.16235219, 0.4219191, 0.7389667],
[0.1733322, 0.42619024, 0.73832537],
[0.18382538, 0.43044226, 0.73776764],
[0.19394034, 0.4346772, 0.73725867],
[0.20367115, 0.43889576, 0.73685314],
[0.21313625, 0.44310003, 0.73648045],
[0.22231173, 0.44729079, 0.73619681],
[0.23125148, 0.45146945, 0.73597803],
[0.23998101, 0.45563715, 0.7358223],
[0.24853358, 0.45979489, 0.73571524],
[0.25691416, 0.4639437, 0.73566943],
[0.26513894, 0.46808455, 0.73568319],
[0.27322194, 0.47221835, 0.73575497],
[0.28117543, 0.47634598, 0.73588332],
[0.28901021, 0.48046826, 0.73606686],
[0.2967358, 0.48458597, 0.73630433],
[0.30436071, 0.48869986, 0.73659451],
[0.3118955, 0.49281055, 0.73693255],
[0.31935389, 0.49691847, 0.73730851],
[0.32672701, 0.5010247, 0.73774013],
[0.33402607, 0.50512971, 0.73821941],
[0.34125337, 0.50923419, 0.73874905],
[0.34840921, 0.51333892, 0.73933402],
[0.35551826, 0.51744353, 0.73994642],
[0.3625676, 0.52154929, 0.74060763],
[0.36956356, 0.52565656, 0.74131327],
[0.37649902, 0.52976642, 0.74207698],
[0.38340273, 0.53387791, 0.74286286],
[0.39025859, 0.53799253, 0.7436962],
[0.39706821, 0.54211081, 0.744578],
[0.40384046, 0.54623277, 0.74549872],
[0.41058241, 0.55035849, 0.74645094],
[0.41728385, 0.55448919, 0.74745174],
[0.42395178, 0.55862494, 0.74849357],
[0.4305964, 0.56276546, 0.74956387],
[0.4372044, 0.56691228, 0.75068412],
[0.4437909, 0.57106468, 0.75183427],
[0.45035117, 0.5752235, 0.75302312],
[0.45687824, 0.57938983, 0.75426297],
[0.46339713, 0.58356191, 0.75551816],
[0.46988778, 0.58774195, 0.75682037],
[0.47635605, 0.59192986, 0.75816245],
[0.48281101, 0.5961252, 0.75953212],
[0.4892374, 0.60032986, 0.76095418],
[0.49566225, 0.60454154, 0.76238852],
[0.50206137, 0.60876307, 0.76387371],
[0.50845128, 0.61299312, 0.76538551],
[0.5148258, 0.61723272, 0.76693475],
[0.52118385, 0.62148236, 0.76852436],
[0.52753571, 0.62574126, 0.77013939],
[0.53386831, 0.63001125, 0.77180152],
[0.54020159, 0.63429038, 0.7734803],
[0.54651272, 0.63858165, 0.77521306],
[0.55282975, 0.64288207, 0.77695608],
[0.55912585, 0.64719519, 0.77875327],
[0.56542599, 0.65151828, 0.78056551],
[0.57170924, 0.65585426, 0.78242747],
[0.57799572, 0.6602009, 0.78430751],
[0.58426817, 0.66456073, 0.78623458],
[0.590544, 0.66893178, 0.78818117],
[0.59680758, 0.67331643, 0.79017369],
[0.60307553, 0.67771273, 0.79218572],
[0.60934065, 0.68212194, 0.79422987],
[0.61559495, 0.68654548, 0.7963202],
[0.62185554, 0.69098125, 0.79842918],
[0.62810662, 0.69543176, 0.80058381],
[0.63436425, 0.69989499, 0.80275812],
[0.64061445, 0.70437326, 0.80497621],
[0.6468706, 0.70886488, 0.80721641],
[0.65312213, 0.7133717, 0.80949719],
[0.65937818, 0.71789261, 0.81180392],
[0.66563334, 0.72242871, 0.81414642],
[0.67189155, 0.72697967, 0.81651872],
[0.67815314, 0.73154569, 0.81892097],
[0.68441395, 0.73612771, 0.82136094],
[0.69068321, 0.74072452, 0.82382353],
[0.69694776, 0.7453385, 0.82633199],
[0.70322431, 0.74996721, 0.8288583],
[0.70949595, 0.75461368, 0.83143221],
[0.7157774, 0.75927574, 0.83402904],
[0.72206299, 0.76395461, 0.83665922],
[0.72835227, 0.76865061, 0.8393242],
[0.73465238, 0.7733628, 0.84201224],
[0.74094862, 0.77809393, 0.84474951],
[0.74725683, 0.78284158, 0.84750915],
[0.75357103, 0.78760701, 0.85030217],
[0.75988961, 0.79239077, 0.85313207],
[0.76621987, 0.79719185, 0.85598668],
[0.77255045, 0.8020125, 0.85888658],
[0.77889241, 0.80685102, 0.86181298],
[0.78524572, 0.81170768, 0.86476656],
[0.79159841, 0.81658489, 0.86776906],
[0.79796459, 0.82148036, 0.8707962],
[0.80434168, 0.82639479, 0.87385315],
[0.8107221, 0.83132983, 0.87695392],
[0.81711301, 0.8362844, 0.88008641],
[0.82351479, 0.84125863, 0.88325045],
[0.82992772, 0.84625263, 0.88644594],
[0.83634359, 0.85126806, 0.8896878],
[0.84277295, 0.85630293, 0.89295721],
[0.84921192, 0.86135782, 0.89626076],
[0.85566206, 0.866432, 0.89959467],
[0.86211514, 0.87152627, 0.90297183],
[0.86857483, 0.87663856, 0.90638248],
[0.87504231, 0.88176648, 0.90981938],
[0.88151194, 0.88690782, 0.91328493],
[0.88797938, 0.89205857, 0.91677544],
[0.89443865, 0.89721298, 0.9202854],
[0.90088204, 0.90236294, 0.92380601],
[0.90729768, 0.90749778, 0.92732797],
[0.91367037, 0.91260329, 0.93083814],
[0.91998105, 0.91766106, 0.93431861],
[0.92620596, 0.92264789, 0.93774647],
[0.93231683, 0.9275351, 0.94109192],
[0.93827772, 0.9322888, 0.94432312],
[0.94404755, 0.93686925, 0.94740137],
[0.94958284, 0.94123072, 0.95027696],
[0.95482682, 0.9453245, 0.95291103],
[0.9597248, 0.94909728, 0.95525103],
[0.96422552, 0.95249273, 0.95723271],
[0.96826161, 0.95545812, 0.95882188],
[0.97178458, 0.95793984, 0.95995705],
[0.97474105, 0.95989142, 0.96059997],
[0.97708604, 0.96127366, 0.96071853],
[0.97877855, 0.96205832, 0.96030095],
[0.97978484, 0.96222949, 0.95935496],
[0.9805997, 0.96155216, 0.95813083],
[0.98152619, 0.95993719, 0.95639322],
[0.9819726, 0.95766608, 0.95399269],
[0.98191855, 0.9547873, 0.95098107],
[0.98138514, 0.95134771, 0.94740644],
[0.98040845, 0.94739906, 0.94332125],
[0.97902107, 0.94300131, 0.93878672],
[0.97729348, 0.93820409, 0.93385135],
[0.9752533, 0.933073, 0.92858252],
[0.97297834, 0.92765261, 0.92302309],
[0.97049104, 0.92200317, 0.91723505],
[0.96784372, 0.91616744, 0.91126063],
[0.96507281, 0.91018664, 0.90514124],
[0.96222034, 0.90409203, 0.89890756],
[0.9593079, 0.89791478, 0.89259122],
[0.95635626, 0.89167908, 0.88621654],
[0.95338303, 0.88540373, 0.87980238],
[0.95040174, 0.87910333, 0.87336339],
[0.94742246, 0.87278899, 0.86691076],
[0.94445249, 0.86646893, 0.86045277],
[0.94150476, 0.86014606, 0.85399191],
[0.93857394, 0.85382798, 0.84753642],
[0.93566206, 0.84751766, 0.84108935],
[0.93277194, 0.8412164, 0.83465197],
[0.92990106, 0.83492672, 0.82822708],
[0.92704736, 0.82865028, 0.82181656],
[0.92422703, 0.82238092, 0.81541333],
[0.92142581, 0.81612448, 0.80902415],
[0.91864501, 0.80988032, 0.80264838],
[0.91587578, 0.80365187, 0.79629001],
[0.9131367, 0.79743115, 0.78994],
[0.91041602, 0.79122265, 0.78360361],
[0.90771071, 0.78502727, 0.77728196],
[0.90501581, 0.77884674, 0.7709771],
[0.90235365, 0.77267117, 0.76467793],
[0.8997019, 0.76650962, 0.75839484],
[0.89705346, 0.76036481, 0.752131],
[0.89444021, 0.75422253, 0.74587047],
[0.89183355, 0.74809474, 0.73962689],
[0.88923216, 0.74198168, 0.73340061],
[0.88665892, 0.73587283, 0.72717995],
[0.88408839, 0.72977904, 0.72097718],
[0.88153537, 0.72369332, 0.71478461],
[0.87899389, 0.7176179, 0.70860487],
[0.87645157, 0.71155805, 0.7024439],
[0.8739399, 0.70549893, 0.6962854],
[0.87142626, 0.6994551, 0.69014561],
[0.8689268, 0.69341868, 0.68401597],
[0.86643562, 0.687392, 0.67789917],
[0.86394434, 0.68137863, 0.67179927],
[0.86147586, 0.67536728, 0.665704],
[0.85899928, 0.66937226, 0.6596292],
[0.85654668, 0.66337773, 0.6535577],
[0.85408818, 0.65739772, 0.64750494],
[0.85164413, 0.65142189, 0.64145983],
[0.84920091, 0.6454565, 0.63542932],
[0.84676427, 0.63949827, 0.62941],
[0.84433231, 0.63354773, 0.62340261],
[0.84190106, 0.62760645, 0.61740899],
[0.83947935, 0.62166951, 0.61142404],
[0.8370538, 0.61574332, 0.60545478],
[0.83463975, 0.60981951, 0.59949247],
[0.83221877, 0.60390724, 0.593547],
[0.82980985, 0.59799607, 0.58760751],
[0.82740268, 0.59209095, 0.58167944],
[0.82498638, 0.5861973, 0.57576866],
[0.82258181, 0.5803034, 0.56986307],
[0.82016611, 0.57442123, 0.56397539],
[0.81776305, 0.56853725, 0.55809173],
[0.81534551, 0.56266602, 0.55222741],
[0.81294293, 0.55679056, 0.5463651],
[0.81052113, 0.55092973, 0.54052443],
[0.80811509, 0.54506305, 0.53468464],
[0.80568952, 0.53921036, 0.52886622],
[0.80327506, 0.53335335, 0.52305077],
[0.80084727, 0.52750583, 0.51725256],
[0.79842217, 0.5216578, 0.51146173],
[0.79599382, 0.51581223, 0.50568155],
[0.79355781, 0.50997127, 0.49991444],
[0.79112596, 0.50412707, 0.49415289],
[0.78867442, 0.49829386, 0.48841129],
[0.7862306, 0.49245398, 0.48267247],
[0.7837687, 0.48662309, 0.47695216],
[0.78130809, 0.4807883, 0.47123805],
[0.77884467, 0.47495151, 0.46553236],
[0.77636283, 0.46912235, 0.45984473],
[0.77388383, 0.46328617, 0.45416141],
[0.77138912, 0.45745466, 0.44849398],
[0.76888874, 0.45162042, 0.44283573],
[0.76638802, 0.44577901, 0.43718292],
[0.76386116, 0.43994762, 0.43155211],
[0.76133542, 0.43410655, 0.42592523],
[0.75880631, 0.42825801, 0.42030488],
[0.75624913, 0.42241905, 0.41470727],
[0.7536919, 0.41656866, 0.40911347],
[0.75112748, 0.41071104, 0.40352792],
[0.74854331, 0.40485474, 0.3979589],
[0.74594723, 0.39899309, 0.39240088],
[0.74334332, 0.39312199, 0.38685075],
[0.74073277, 0.38723941, 0.3813074],
[0.73809409, 0.38136133, 0.37578553],
[0.73544692, 0.37547129, 0.37027123],
[0.73278943, 0.36956954, 0.36476549],
[0.73011829, 0.36365761, 0.35927038],
[0.72743485, 0.35773314, 0.35378465],
[0.72472722, 0.35180504, 0.34831662],
[0.72200473, 0.34586421, 0.34285937],
[0.71927052, 0.33990649, 0.33741033],
[0.71652049, 0.33393396, 0.33197219],
[0.71375362, 0.32794602, 0.32654545],
[0.71096951, 0.32194148, 0.32113016],
[0.70816772, 0.31591904, 0.31572637],
[0.70534784, 0.30987734, 0.31033414],
[0.70250944, 0.30381489, 0.30495353],
[0.69965211, 0.2977301, 0.2995846],
[0.6967754, 0.29162126, 0.29422741],
[0.69388446, 0.28548074, 0.28887769],
[0.69097561, 0.2793096, 0.28353795],
[0.68803513, 0.27311993, 0.27821876],
[0.6850794, 0.26689144, 0.27290694],
[0.682108, 0.26062114, 0.26760246],
[0.67911013, 0.2543177, 0.26231367],
[0.67609393, 0.24796818, 0.25703372],
[0.67305921, 0.24156846, 0.25176238],
[0.67000176, 0.23511902, 0.24650278],
[0.66693423, 0.22859879, 0.24124404],
[0.6638441, 0.22201742, 0.2359961],
[0.66080672, 0.21526712, 0.23069468]
]
_icefire_lut = [
[0.73936227, 0.90443867, 0.85757238],
[0.72888063, 0.89639109, 0.85488394],
[0.71834255, 0.88842162, 0.8521605],
[0.70773866, 0.88052939, 0.849422],
[0.69706215, 0.87271313, 0.84668315],
[0.68629021, 0.86497329, 0.84398721],
[0.67543654, 0.85730617, 0.84130969],
[0.66448539, 0.84971123, 0.83868005],
[0.65342679, 0.84218728, 0.83611512],
[0.64231804, 0.83471867, 0.83358584],
[0.63117745, 0.827294, 0.83113431],
[0.62000484, 0.81991069, 0.82876741],
[0.60879435, 0.81256797, 0.82648905],
[0.59754118, 0.80526458, 0.82430414],
[0.58624247, 0.79799884, 0.82221573],
[0.57489525, 0.7907688, 0.82022901],
[0.56349779, 0.78357215, 0.81834861],
[0.55204294, 0.77640827, 0.81657563],
[0.54052516, 0.76927562, 0.81491462],
[0.52894085, 0.76217215, 0.81336913],
[0.51728854, 0.75509528, 0.81194156],
[0.50555676, 0.74804469, 0.81063503],
[0.49373871, 0.7410187, 0.80945242],
[0.48183174, 0.73401449, 0.80839675],
[0.46982587, 0.72703075, 0.80747097],
[0.45770893, 0.72006648, 0.80667756],
[0.44547249, 0.71311941, 0.80601991],
[0.43318643, 0.70617126, 0.80549278],
[0.42110294, 0.69916972, 0.80506683],
[0.40925101, 0.69211059, 0.80473246],
[0.3976693, 0.68498786, 0.80448272],
[0.38632002, 0.67781125, 0.80431024],
[0.37523981, 0.67057537, 0.80420832],
[0.36442578, 0.66328229, 0.80417474],
[0.35385939, 0.65593699, 0.80420591],
[0.34358916, 0.64853177, 0.8043],
[0.33355526, 0.64107876, 0.80445484],
[0.32383062, 0.63356578, 0.80467091],
[0.31434372, 0.62600624, 0.8049475],
[0.30516161, 0.618389, 0.80528692],
[0.29623491, 0.61072284, 0.80569021],
[0.28759072, 0.60300319, 0.80616055],
[0.27923924, 0.59522877, 0.80669803],
[0.27114651, 0.5874047, 0.80730545],
[0.26337153, 0.57952055, 0.80799113],
[0.25588696, 0.57157984, 0.80875922],
[0.248686, 0.56358255, 0.80961366],
[0.24180668, 0.55552289, 0.81055123],
[0.23526251, 0.54739477, 0.8115939],
[0.22921445, 0.53918506, 0.81267292],
[0.22397687, 0.53086094, 0.8137141],
[0.21977058, 0.52241482, 0.81457651],
[0.21658989, 0.51384321, 0.81528511],
[0.21452772, 0.50514155, 0.81577278],
[0.21372783, 0.49630865, 0.81589566],
[0.21409503, 0.48734861, 0.81566163],
[0.2157176, 0.47827123, 0.81487615],
[0.21842857, 0.46909168, 0.81351614],
[0.22211705, 0.45983212, 0.81146983],
[0.22665681, 0.45052233, 0.80860217],
[0.23176013, 0.44119137, 0.80494325],
[0.23727775, 0.43187704, 0.80038017],
[0.24298285, 0.42261123, 0.79493267],
[0.24865068, 0.41341842, 0.78869164],
[0.25423116, 0.40433127, 0.78155831],
[0.25950239, 0.39535521, 0.77376848],
[0.2644736, 0.38651212, 0.76524809],
[0.26901584, 0.37779582, 0.75621942],
[0.27318141, 0.36922056, 0.746605],
[0.27690355, 0.3607736, 0.73659374],
[0.28023585, 0.35244234, 0.72622103],
[0.28306009, 0.34438449, 0.71500731],
[0.28535896, 0.33660243, 0.70303975],
[0.28708711, 0.32912157, 0.69034504],
[0.28816354, 0.32200604, 0.67684067],
[0.28862749, 0.31519824, 0.66278813],
[0.28847904, 0.30869064, 0.6482815],
[0.28770912, 0.30250126, 0.63331265],
[0.28640325, 0.29655509, 0.61811374],
[0.28458943, 0.29082155, 0.60280913],
[0.28233561, 0.28527482, 0.58742866],
[0.27967038, 0.2798938, 0.57204225],
[0.27665361, 0.27465357, 0.55667809],
[0.27332564, 0.2695165, 0.54145387],
[0.26973851, 0.26447054, 0.52634916],
[0.2659204, 0.25949691, 0.511417],
[0.26190145, 0.25458123, 0.49668768],
[0.2577151, 0.24971691, 0.48214874],
[0.25337618, 0.24490494, 0.46778758],
[0.24890842, 0.24013332, 0.45363816],
[0.24433654, 0.23539226, 0.4397245],
[0.23967922, 0.23067729, 0.4260591],
[0.23495608, 0.22598894, 0.41262952],
[0.23018113, 0.22132414, 0.39945577],
[0.22534609, 0.21670847, 0.38645794],
[0.22048761, 0.21211723, 0.37372555],
[0.2156198, 0.20755389, 0.36125301],
[0.21074637, 0.20302717, 0.34903192],
[0.20586893, 0.19855368, 0.33701661],
[0.20101757, 0.19411573, 0.32529173],
[0.19619947, 0.18972425, 0.31383846],
[0.19140726, 0.18540157, 0.30260777],
[0.1866769, 0.1811332, 0.29166583],
[0.18201285, 0.17694992, 0.28088776],
[0.17745228, 0.17282141, 0.27044211],
[0.17300684, 0.16876921, 0.26024893],
[0.16868273, 0.16479861, 0.25034479],
[0.16448691, 0.16091728, 0.24075373],
[0.16043195, 0.15714351, 0.23141745],
[0.15652427, 0.15348248, 0.22238175],
[0.15277065, 0.14994111, 0.21368395],
[0.14918274, 0.14653431, 0.20529486],
[0.14577095, 0.14327403, 0.19720829],
[0.14254381, 0.14016944, 0.18944326],
[0.13951035, 0.13723063, 0.18201072],
[0.13667798, 0.13446606, 0.17493774],
[0.13405762, 0.13188822, 0.16820842],
[0.13165767, 0.12950667, 0.16183275],
[0.12948748, 0.12733187, 0.15580631],
[0.12755435, 0.1253723, 0.15014098],
[0.12586516, 0.12363617, 0.1448459],
[0.12442647, 0.12213143, 0.13992571],
[0.12324241, 0.12086419, 0.13539995],
[0.12232067, 0.11984278, 0.13124644],
[0.12166209, 0.11907077, 0.12749671],
[0.12126982, 0.11855309, 0.12415079],
[0.12114244, 0.11829179, 0.1212385],
[0.12127766, 0.11828837, 0.11878534],
[0.12284806, 0.1179729, 0.11772022],
[0.12619498, 0.11721796, 0.11770203],
[0.129968, 0.11663788, 0.11792377],
[0.13410011, 0.11625146, 0.11839138],
[0.13855459, 0.11606618, 0.11910584],
[0.14333775, 0.11607038, 0.1200606],
[0.148417, 0.11626929, 0.12125453],
[0.15377389, 0.11666192, 0.12268364],
[0.15941427, 0.11723486, 0.12433911],
[0.16533376, 0.11797856, 0.12621303],
[0.17152547, 0.11888403, 0.12829735],
[0.17797765, 0.11994436, 0.13058435],
[0.18468769, 0.12114722, 0.13306426],
[0.19165663, 0.12247737, 0.13572616],
[0.19884415, 0.12394381, 0.1385669],
[0.20627181, 0.12551883, 0.14157124],
[0.21394877, 0.12718055, 0.14472604],
[0.22184572, 0.12893119, 0.14802579],
[0.22994394, 0.13076731, 0.15146314],
[0.23823937, 0.13267611, 0.15502793],
[0.24676041, 0.13462172, 0.15870321],
[0.25546457, 0.13661751, 0.16248722],
[0.26433628, 0.13865956, 0.16637301],
[0.27341345, 0.14070412, 0.17034221],
[0.28264773, 0.14277192, 0.1743957],
[0.29202272, 0.14486161, 0.17852793],
[0.30159648, 0.14691224, 0.1827169],
[0.31129002, 0.14897583, 0.18695213],
[0.32111555, 0.15103351, 0.19119629],
[0.33107961, 0.1530674, 0.19543758],
[0.34119892, 0.15504762, 0.1996803],
[0.35142388, 0.15701131, 0.20389086],
[0.36178937, 0.1589124, 0.20807639],
[0.37229381, 0.16073993, 0.21223189],
[0.38288348, 0.16254006, 0.2163249],
[0.39359592, 0.16426336, 0.22036577],
[0.40444332, 0.16588767, 0.22434027],
[0.41537995, 0.16745325, 0.2282297],
[0.42640867, 0.16894939, 0.23202755],
[0.43754706, 0.17034847, 0.23572899],
[0.44878564, 0.1716535, 0.23932344],
[0.4601126, 0.17287365, 0.24278607],
[0.47151732, 0.17401641, 0.24610337],
[0.48300689, 0.17506676, 0.2492737],
[0.49458302, 0.17601892, 0.25227688],
[0.50623876, 0.17687777, 0.255096],
[0.5179623, 0.17765528, 0.2577162],
[0.52975234, 0.17835232, 0.2601134],
[0.54159776, 0.17898292, 0.26226847],
[0.55348804, 0.17956232, 0.26416003],
[0.56541729, 0.18010175, 0.26575971],
[0.57736669, 0.180631, 0.26704888],
[0.58932081, 0.18117827, 0.26800409],
[0.60127582, 0.18175888, 0.26858488],
[0.61319563, 0.1824336, 0.2687872],
[0.62506376, 0.18324015, 0.26858301],
[0.63681202, 0.18430173, 0.26795276],
[0.64842603, 0.18565472, 0.26689463],
[0.65988195, 0.18734638, 0.26543435],
[0.67111966, 0.18948885, 0.26357955],
[0.68209194, 0.19216636, 0.26137175],
[0.69281185, 0.19535326, 0.25887063],
[0.70335022, 0.19891271, 0.25617971],
[0.71375229, 0.20276438, 0.25331365],
[0.72401436, 0.20691287, 0.25027366],
[0.73407638, 0.21145051, 0.24710661],
[0.74396983, 0.21631913, 0.24380715],
[0.75361506, 0.22163653, 0.24043996],
[0.7630579, 0.22731637, 0.23700095],
[0.77222228, 0.23346231, 0.23356628],
[0.78115441, 0.23998404, 0.23013825],
[0.78979746, 0.24694858, 0.22678822],
[0.79819286, 0.25427223, 0.22352658],
[0.80630444, 0.26198807, 0.22040877],
[0.81417437, 0.27001406, 0.21744645],
[0.82177364, 0.27837336, 0.21468316],
[0.82915955, 0.28696963, 0.21210766],
[0.83628628, 0.2958499, 0.20977813],
[0.84322168, 0.30491136, 0.20766435],
[0.84995458, 0.31415945, 0.2057863],
[0.85648867, 0.32358058, 0.20415327],
[0.86286243, 0.33312058, 0.20274969],
[0.86908321, 0.34276705, 0.20157271],
[0.87512876, 0.3525416, 0.20064949],
[0.88100349, 0.36243385, 0.19999078],
[0.8866469, 0.37249496, 0.1997976],
[0.89203964, 0.38273475, 0.20013431],
[0.89713496, 0.39318156, 0.20121514],
[0.90195099, 0.40380687, 0.20301555],
[0.90648379, 0.41460191, 0.20558847],
[0.9106967, 0.42557857, 0.20918529],
[0.91463791, 0.43668557, 0.21367954],
[0.91830723, 0.44790913, 0.21916352],
[0.92171507, 0.45922856, 0.22568002],
[0.92491786, 0.4705936, 0.23308207],
[0.92790792, 0.48200153, 0.24145932],
[0.93073701, 0.49341219, 0.25065486],
[0.93343918, 0.5048017, 0.26056148],
[0.93602064, 0.51616486, 0.27118485],
[0.93850535, 0.52748892, 0.28242464],
[0.94092933, 0.53875462, 0.29416042],
[0.94330011, 0.5499628, 0.30634189],
[0.94563159, 0.56110987, 0.31891624],
[0.94792955, 0.57219822, 0.33184256],
[0.95020929, 0.5832232, 0.34508419],
[0.95247324, 0.59419035, 0.35859866],
[0.95471709, 0.60510869, 0.37236035],
[0.95698411, 0.61595766, 0.38629631],
[0.95923863, 0.62676473, 0.40043317],
[0.9615041, 0.6375203, 0.41474106],
[0.96371553, 0.64826619, 0.42928335],
[0.96591497, 0.65899621, 0.44380444],
[0.96809871, 0.66971662, 0.45830232],
[0.9702495, 0.6804394, 0.47280492],
[0.9723881, 0.69115622, 0.48729272],
[0.97450723, 0.70187358, 0.50178034],
[0.9766108, 0.712592, 0.51626837],
[0.97871716, 0.72330511, 0.53074053],
[0.98082222, 0.73401769, 0.54520694],
[0.9829001, 0.74474445, 0.5597019],
[0.98497466, 0.75547635, 0.57420239],
[0.98705581, 0.76621129, 0.58870185],
[0.98913325, 0.77695637, 0.60321626],
[0.99119918, 0.78771716, 0.61775821],
[0.9932672, 0.79848979, 0.63231691],
[0.99535958, 0.80926704, 0.64687278],
[0.99740544, 0.82008078, 0.66150571],
[0.9992197, 0.83100723, 0.6764127]
]
_luts = [_rocket_lut, _mako_lut, _vlag_lut, _icefire_lut]
_names = ["rocket", "mako", "vlag", "icefire"]
for _lut, _name in zip(_luts, _names):
_cmap = colors.ListedColormap(_lut, _name)
locals()[_name] = _cmap
_cmap_r = colors.ListedColormap(_lut[::-1], _name + "_r")
locals()[_name + "_r"] = _cmap_r
mpl_cm.register(_cmap, name=_name)
mpl_cm.register(_cmap_r, name=_name + "_r")
================================================
FILE: deeptools/c
gitextract_fn4npz16/
├── .github/
│ ├── CONTRIBUTING.md
│ ├── ISSUE_TEMPLATE.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ └── workflows/
│ ├── planemo.yml
│ ├── pypi.yml
│ └── test.yml
├── .gitignore
├── .planemo.sh
├── .readthedocs.yaml
├── CHANGES.txt
├── LICENSE.txt
├── MANIFEST.in
├── README.md
├── README.rst
├── deeptools/
│ ├── SES_scaleFactor.py
│ ├── __init__.py
│ ├── alignmentSieve.py
│ ├── bamCompare.py
│ ├── bamCoverage.py
│ ├── bamHandler.py
│ ├── bamPEFragmentSize.py
│ ├── bigwigAverage.py
│ ├── bigwigCompare.py
│ ├── cm.py
│ ├── computeGCBias.py
│ ├── computeMatrix.py
│ ├── computeMatrixOperations.py
│ ├── correctGCBias.py
│ ├── correlation.py
│ ├── correlation_heatmap.py
│ ├── countReadsPerBin.py
│ ├── deeptools_list_tools.py
│ ├── estimateReadFiltering.py
│ ├── estimateScaleFactor.py
│ ├── getFragmentAndReadSize.py
│ ├── getRatio.py
│ ├── getScaleFactor.py
│ ├── getScorePerBigWigBin.py
│ ├── heatmapper.py
│ ├── heatmapper_utilities.py
│ ├── mapReduce.py
│ ├── misc.py
│ ├── multiBamSummary.py
│ ├── multiBigwigSummary.py
│ ├── parserCommon.py
│ ├── plotCorrelation.py
│ ├── plotCoverage.py
│ ├── plotEnrichment.py
│ ├── plotFingerprint.py
│ ├── plotHeatmap.py
│ ├── plotPCA.py
│ ├── plotProfile.py
│ ├── sumCoveragePerBin.py
│ ├── test/
│ │ ├── __init__.py
│ │ ├── skiptest_heatmapper_images.py
│ │ ├── test_bamCoverage_and_bamCompare.py
│ │ ├── test_bigwigAverage.py
│ │ ├── test_bigwigCompare_and_multiBigwigSummary.py
│ │ ├── test_computeMatrixOperations.py
│ │ ├── test_corrGC/
│ │ │ ├── R_gc
│ │ │ ├── R_gc_paired.txt
│ │ │ ├── extra_sampling.bed
│ │ │ ├── filter_out.bed
│ │ │ ├── frequencies_data.txt
│ │ │ ├── mappability.bg
│ │ │ ├── mappability.bw
│ │ │ ├── paired.bam
│ │ │ ├── paired.bam.bai
│ │ │ ├── sequence.2bit
│ │ │ ├── sequence.fa
│ │ │ ├── sequence.fa.fai
│ │ │ ├── sizes
│ │ │ ├── test.bam
│ │ │ ├── test.bam.bai
│ │ │ ├── test.sam
│ │ │ ├── test_paired.bam
│ │ │ ├── test_paired.bam.bai
│ │ │ └── test_paired.sam
│ │ ├── test_countReadsPerBin.py
│ │ ├── test_data/
│ │ │ ├── computeMatrixOperations.bed
│ │ │ ├── make_test_data.sh
│ │ │ ├── test.bed3
│ │ │ ├── test.gtf
│ │ │ ├── test1.bam
│ │ │ ├── test1.bam.bai
│ │ │ ├── test1.bg
│ │ │ ├── test1.bw.bw
│ │ │ ├── test1.cram
│ │ │ ├── test1.cram.crai
│ │ │ ├── test1.fa
│ │ │ ├── test1.fa.fai
│ │ │ ├── test1.sam
│ │ │ ├── test2.bam
│ │ │ ├── test2.bam.bai
│ │ │ ├── test2.bg
│ │ │ ├── test2.cram
│ │ │ ├── test2.cram.crai
│ │ │ ├── test2.sam
│ │ │ ├── testA.bam
│ │ │ ├── testA.bam.bai
│ │ │ ├── testA.bw
│ │ │ ├── testA.cram
│ │ │ ├── testA.cram.crai
│ │ │ ├── testA.fa
│ │ │ ├── testA.fa.fai
│ │ │ ├── testA.sam
│ │ │ ├── testA_offset-1.bw
│ │ │ ├── testA_offset1.bw
│ │ │ ├── testA_offset1_10.bw
│ │ │ ├── testA_offset20_-4.bw
│ │ │ ├── testA_skipNAs.bw
│ │ │ ├── testB.bam
│ │ │ ├── testB.bam.bai
│ │ │ ├── testB.bw
│ │ │ ├── testB.cram
│ │ │ ├── testB.cram.crai
│ │ │ ├── testB.fa
│ │ │ ├── testB.fa.fai
│ │ │ ├── testB.sam
│ │ │ ├── testB_skipNAs.bw
│ │ │ ├── test_filtering.bam
│ │ │ ├── test_filtering.bam.bai
│ │ │ ├── test_filtering.blacklist.bed
│ │ │ ├── test_filtering.cram
│ │ │ ├── test_filtering.cram.crai
│ │ │ ├── test_filtering.fa
│ │ │ ├── test_filtering.fa.fai
│ │ │ ├── test_filtering2.bam
│ │ │ ├── test_filtering2.bam.bai
│ │ │ ├── test_filtering2.cram
│ │ │ ├── test_filtering2.cram.crai
│ │ │ ├── test_paired.bam
│ │ │ ├── test_paired.bam.bai
│ │ │ ├── test_paired.sam
│ │ │ ├── test_paired2.bam
│ │ │ ├── test_paired2.bam.bai
│ │ │ ├── test_paired2.bw
│ │ │ ├── test_paired2.cram
│ │ │ ├── test_paired2.cram.crai
│ │ │ ├── test_paired2.fa
│ │ │ ├── test_paired2.fa.fai
│ │ │ ├── test_paired2.sam
│ │ │ ├── test_proper_pair_filtering.bam
│ │ │ └── test_proper_pair_filtering.bam.bai
│ │ ├── test_heatmapper/
│ │ │ ├── group1.bed
│ │ │ ├── group2.bed
│ │ │ ├── make_test_data.sh
│ │ │ ├── master.mat
│ │ │ ├── master.tab
│ │ │ ├── master_TES.mat
│ │ │ ├── master_center.mat
│ │ │ ├── master_extend_beyond_chr_size.mat
│ │ │ ├── master_gtf.mat
│ │ │ ├── master_metagene.mat
│ │ │ ├── master_multi.mat
│ │ │ ├── master_multibed.mat
│ │ │ ├── master_nan_to_zero.mat
│ │ │ ├── master_scale_reg.mat
│ │ │ ├── master_unscaled.mat
│ │ │ ├── out.bed
│ │ │ ├── test.bed
│ │ │ ├── test.bg
│ │ │ ├── test.bw
│ │ │ ├── test.sizes
│ │ │ ├── test2.bed
│ │ │ ├── unscaled.bed
│ │ │ └── unscaled.bigWig
│ │ ├── test_heatmapper.py
│ │ ├── test_multiBamSummary.py
│ │ ├── test_plotCoverage/
│ │ │ ├── make_test_files.sh
│ │ │ └── outRawCounts_default.tabular
│ │ ├── test_plotCoverage.py
│ │ ├── test_readFiltering.py
│ │ ├── test_tools.py
│ │ └── test_writeBedGraph.py
│ ├── utilities.py
│ ├── writeBedGraph.py
│ └── writeBedGraph_bam_and_bw.py
├── docs/
│ ├── Makefile
│ ├── _static/
│ │ ├── welcome_base.css
│ │ ├── welcome_owl.carousel.css
│ │ └── welcome_owl.carousel.theme.css
│ ├── conf.py
│ ├── content/
│ │ ├── about.rst
│ │ ├── advanced_features.rst
│ │ ├── api.rst
│ │ ├── changelog.rst
│ │ ├── example_api_tutorial.rst
│ │ ├── example_gallery.rst
│ │ ├── example_step_by_step.rst
│ │ ├── example_usage.rst
│ │ ├── feature/
│ │ │ ├── blacklist.rst
│ │ │ ├── effectiveGenomeSize.rst
│ │ │ ├── metagene.rst
│ │ │ ├── plotFingerprint_QC_metrics.rst
│ │ │ ├── plotly.rst
│ │ │ ├── read_extension.rst
│ │ │ ├── read_offsets.rst
│ │ │ └── unscaled_regions.rst
│ │ ├── help_faq.rst
│ │ ├── help_faq_galaxy.rst
│ │ ├── help_galaxy_dataup.rst
│ │ ├── help_galaxy_deeptools.rst
│ │ ├── help_galaxy_intro.rst
│ │ ├── help_glossary.rst
│ │ ├── installation.rst
│ │ ├── list_of_tools.rst
│ │ └── tools/
│ │ ├── alignmentSieve.rst
│ │ ├── bamCompare.rst
│ │ ├── bamCoverage.rst
│ │ ├── bamPEFragmentSize.rst
│ │ ├── bigwigAverage.rst
│ │ ├── bigwigCompare.rst
│ │ ├── computeGCBias.rst
│ │ ├── computeMatrix.rst
│ │ ├── computeMatrixOperations.rst
│ │ ├── correctGCBias.rst
│ │ ├── estimateReadFiltering.rst
│ │ ├── multiBamSummary.rst
│ │ ├── multiBigwigSummary.rst
│ │ ├── plotCorrelation.rst
│ │ ├── plotCoverage.rst
│ │ ├── plotEnrichment.rst
│ │ ├── plotFingerprint.rst
│ │ ├── plotHeatmap.rst
│ │ ├── plotPCA.rst
│ │ └── plotProfile.rst
│ ├── images/
│ │ └── gallery/
│ │ └── Whyte_TypicalEnhancers_ESC.bed
│ ├── index.rst
│ ├── requirements.txt
│ └── source/
│ ├── _templates/
│ │ └── layout.html
│ ├── deeptools.rst
│ └── modules.rst
├── galaxy/
│ ├── workflows/
│ │ ├── 1_BAM_file_TO_Heatmap_of_read_coverages.ga
│ │ ├── 2_BAM_files_TO_clustered_Heatmap_of_read_coverages.ga
│ │ ├── Add_chr_to_first_column_of_a_6_columns_BED_file.ga
│ │ ├── Clustered_heatmap_of_signals_around_the_TSSs__1_bigWig_TO_heatmap.ga
│ │ ├── Compute_and_correct_GC_bias.ga
│ │ ├── Remove_chr_from_the_beginning_of_genomic_interval_files.ga
│ │ ├── readme.rst
│ │ └── repository_dependencies.xml
│ └── wrapper/
│ ├── .shed.yml
│ ├── alignmentSieve.xml
│ ├── bamCompare.xml
│ ├── bamCoverage.xml
│ ├── bamPEFragmentSize.xml
│ ├── bigwigAverage.xml
│ ├── bigwigCompare.xml
│ ├── computeGCBias.xml
│ ├── computeMatrix.xml
│ ├── computeMatrixOperations.xml
│ ├── correctGCBias.xml
│ ├── deepTools_macros.xml
│ ├── estimateReadFiltering.xml
│ ├── multiBamSummary.xml
│ ├── multiBigwigSummary.xml
│ ├── plotCorrelation.xml
│ ├── plotCoverage.xml
│ ├── plotEnrichment.xml
│ ├── plotFingerprint.xml
│ ├── plotHeatmap.xml
│ ├── plotPCA.xml
│ ├── plotProfiler.xml
│ ├── test-data/
│ │ ├── alignmentSieve.bam
│ │ ├── alignmentSieve.bed
│ │ ├── alignmentSieve.txt
│ │ ├── alignmentSieve2.bam
│ │ ├── alignmentSieve3.bam
│ │ ├── bamCompare_result1.bg
│ │ ├── bamCompare_result2.bw
│ │ ├── bamCoverage_result1.bw
│ │ ├── bamCoverage_result2.bw
│ │ ├── bamCoverage_result3.bg
│ │ ├── bamCoverage_result4.bg
│ │ ├── bamCoverage_result4.bw
│ │ ├── bamCoverage_result5.bw
│ │ ├── bamCoverage_result6.bw
│ │ ├── bamPEFragmentSize_lengths1.txt
│ │ ├── bamPEFragmentSize_result1.txt
│ │ ├── bamPEFragmentSize_table1.txt
│ │ ├── bigwigAverage2.bw
│ │ ├── bigwigCompare_result1.bw
│ │ ├── bigwigCompare_result2.bg
│ │ ├── bowtie2 test1.bam
│ │ ├── computeGCBias_result1.tabular
│ │ ├── computeMatrix1.bed
│ │ ├── computeMatrix2.bed
│ │ ├── computeMatrix2.bw
│ │ ├── computeMatrixOperations.txt
│ │ ├── correctGCBias_result1.bam
│ │ ├── estimateReadFiltering.txt
│ │ ├── heatmapper_result2.tabular
│ │ ├── multiBamSummary_regions.bed
│ │ ├── multiBamSummary_result1.npz
│ │ ├── multiBamSummary_result2.npz
│ │ ├── multiBamSummary_result2b.npz
│ │ ├── multiBigwigSummary_result1.npz
│ │ ├── multiBigwigSummary_result2.npz
│ │ ├── multiBigwigSummary_result2.tabular
│ │ ├── paired_chr2L.bam
│ │ ├── paired_chr2L.cram
│ │ ├── phiX.2bit
│ │ ├── phiX.bam
│ │ ├── phiX.bam.bai
│ │ ├── phiX.fasta
│ │ ├── plotCorrelation_result1.tabular
│ │ ├── plotCoverage.metrics
│ │ ├── plotCoverage_result1.tabular
│ │ ├── plotEnrichment_output.txt
│ │ ├── plotFingerprint_quality_metrics.tabular
│ │ ├── plotFingerprint_result2.tabular
│ │ ├── plotPCA_result2.tabular
│ │ ├── profiler_result2.tabular
│ │ ├── sequence.2bit
│ │ ├── test.bw
│ │ ├── test_compated.bw
│ │ └── test_half.bw
│ ├── tool-data/
│ │ ├── deepTools_seqs.loc.sample
│ │ └── lastz_seqs.loc.sample
│ └── tool_data_table_conf.xml.sample
├── gallery/
│ └── Whyte_TypicalEnhancers_ESC.bed
├── pyproject.toml
└── scripts/
├── convertChromsBigWig.py
├── mappabilityBigWig_to_unmappableBed.sh
└── split_bed_into_multiple_files.py
SYMBOL INDEX (420 symbols across 53 files)
FILE: deeptools/SES_scaleFactor.py
function estimateScaleFactor (line 15) | def estimateScaleFactor(bamFilesList, binLength, numberOfSamples,
class Tester (line 187) | class Tester(object):
method __init__ (line 189) | def __init__(self):
FILE: deeptools/alignmentSieve.py
function parseArguments (line 14) | def parseArguments():
function shiftRead (line 155) | def shiftRead(b, chromDict, args):
function filterWorker (line 210) | def filterWorker(arglist):
function convertBED (line 348) | def convertBED(oname, tmpFiles, chromDict):
function main (line 377) | def main(args=None):
FILE: deeptools/bamCompare.py
function parseArguments (line 20) | def parseArguments():
function getRequiredArgs (line 55) | def getRequiredArgs():
function getOptionalArgs (line 76) | def getOptionalArgs():
function process_args (line 157) | def process_args(args=None):
function get_scale_factors (line 182) | def get_scale_factors(args, statsList, mappedList):
function main (line 234) | def main(args=None):
FILE: deeptools/bamCoverage.py
function parseArguments (line 16) | def parseArguments():
function get_required_args (line 46) | def get_required_args():
function get_optional_args (line 60) | def get_optional_args():
function scaleFactor (line 117) | def scaleFactor(string):
function process_args (line 129) | def process_args(args=None):
function main (line 143) | def main(args=None):
class OffsetFragment (line 261) | class OffsetFragment(writeBedGraph.WriteBedGraph):
method filterStrand (line 265) | def filterStrand(self, read, rv):
method get_fragment_from_read_list (line 293) | def get_fragment_from_read_list(self, read, offset):
method get_fragment_from_read (line 363) | def get_fragment_from_read(self, read):
class CenterFragment (line 389) | class CenterFragment(writeBedGraph.WriteBedGraph):
method get_fragment_from_read (line 396) | def get_fragment_from_read(self, read):
FILE: deeptools/bamHandler.py
function countReadsInInterval (line 6) | def countReadsInInterval(args):
function getMappingStats (line 25) | def getMappingStats(bam, nThreads):
function openBam (line 47) | def openBam(bamFile, returnStats=False, nThreads=1, minimalDecoding=True):
FILE: deeptools/bamPEFragmentSize.py
function parse_arguments (line 24) | def parse_arguments():
function getDensity (line 120) | def getDensity(lengths, minVal, maxVal):
function getFragSize (line 130) | def getFragSize(bam, args, idx, outRawFrags):
function printTable (line 230) | def printTable(args, fragDict, readDict):
function main (line 293) | def main(args=None):
FILE: deeptools/bigwigAverage.py
function parse_arguments (line 12) | def parse_arguments(args=None):
function getType (line 56) | def getType(fname):
function average (line 68) | def average(tileCoverage, args):
function main (line 92) | def main(args=None):
FILE: deeptools/bigwigCompare.py
function parse_arguments (line 11) | def parse_arguments(args=None):
function getType (line 100) | def getType(fname):
function main (line 112) | def main(args=None):
FILE: deeptools/computeGCBias.py
function parse_arguments (line 23) | def parse_arguments(args=None):
function getRequiredArgs (line 42) | def getRequiredArgs():
function getPositionsToSample (line 139) | def getPositionsToSample(chrom, start, end, stepSize):
function countReadsPerGC_wrapper (line 194) | def countReadsPerGC_wrapper(args):
function countReadsPerGC_worker (line 198) | def countReadsPerGC_worker(chromNameBam,
function tabulateGCcontent_wrapper (line 234) | def tabulateGCcontent_wrapper(args):
function tabulateGCcontent_worker (line 238) | def tabulateGCcontent_worker(chromNameBam, start, end, stepSize,
function tabulateGCcontent (line 397) | def tabulateGCcontent(fragmentLength, chrNameBitToBam, stepSize,
function countReadsPerGC (line 456) | def countReadsPerGC(regionSize, chrNameBitToBam, stepSize,
function smooth (line 494) | def smooth(x, window_len=3):
function bin_by (line 515) | def bin_by(x, y, nbins=10):
function plotlyGCbias (line 536) | def plotlyGCbias(file_name, frequencies, reads_per_gc, region_size):
function plotGCbias (line 580) | def plotGCbias(file_name, frequencies, reads_per_gc, region_size, image_...
function main (line 640) | def main(args=None):
class Tester (line 730) | class Tester():
method __init__ (line 731) | def __init__(self):
method testTabulateGCcontentWorker (line 757) | def testTabulateGCcontentWorker(self):
method set_filter_out_file (line 766) | def set_filter_out_file(self):
method unset_filter_out_file (line 770) | def unset_filter_out_file(self):
method set_extra_sampling_file (line 774) | def set_extra_sampling_file(self):
method testTabulateGCcontent (line 778) | def testTabulateGCcontent(self):
method testCountReadsPerGC (line 788) | def testCountReadsPerGC(self):
FILE: deeptools/computeMatrix.py
function parse_arguments (line 13) | def parse_arguments(args=None):
function computeMatrixRequiredArgs (line 77) | def computeMatrixRequiredArgs(args=None):
function computeMatrixOutputArgs (line 101) | def computeMatrixOutputArgs(args=None):
function computeMatrixOptArgs (line 130) | def computeMatrixOptArgs(case=['scale-regions', 'reference-point'][0]):
function process_args (line 348) | def process_args(args=None):
function main (line 379) | def main(args=None):
FILE: deeptools/computeMatrixOperations.py
function parse_arguments (line 12) | def parse_arguments():
function bindArgs (line 146) | def bindArgs():
function infoArgs (line 162) | def infoArgs():
function relabelArgs (line 173) | def relabelArgs():
function subsetArgs (line 194) | def subsetArgs():
function filterStrandArgs (line 215) | def filterStrandArgs():
function filterValuesArgs (line 231) | def filterValuesArgs():
function sortArgs (line 253) | def sortArgs():
function printInfo (line 300) | def printInfo(matrix):
function printDataRange (line 314) | def printDataRange(matrix):
function relabelMatrix (line 330) | def relabelMatrix(matrix, args):
function getGroupBounds (line 344) | def getGroupBounds(args, matrix):
function getSampleBounds (line 363) | def getSampleBounds(args, matrix):
function subsetRegions (line 380) | def subsetRegions(hm, bounds):
function filterHeatmap (line 398) | def filterHeatmap(hm, args):
function filterHeatmapValues (line 422) | def filterHeatmapValues(hm, minVal, maxVal):
function insertMatrix (line 452) | def insertMatrix(hm, hm2, groupName):
function appendMatrix (line 480) | def appendMatrix(hm, hm2, groupName):
function rbindMatrices (line 498) | def rbindMatrices(hm, args):
function cbindMatrices (line 520) | def cbindMatrices(hm, args):
function loadBED (line 571) | def loadBED(line, fp, fname, labelColumn, labels, regions, defaultGroup):
function loadGTFtranscript (line 639) | def loadGTFtranscript(cols, label, defaultGroup, transcript_id_designator):
function loadGTF (line 654) | def loadGTF(line, fp, fname, labels, regions, transcriptID, transcript_i...
function sortMatrix (line 691) | def sortMatrix(hm, regionsFileName, transcriptID, transcript_id_designat...
function main (line 788) | def main(args=None):
FILE: deeptools/correctGCBias.py
function parse_arguments (line 26) | def parse_arguments(args=None):
function process_args (line 50) | def process_args(args=None):
function getRequiredArgs (line 56) | def getRequiredArgs():
function getReadGCcontent (line 116) | def getReadGCcontent(tbit, read, fragmentLength, chrNameBit):
function writeCorrected_wrapper (line 163) | def writeCorrected_wrapper(args):
function writeCorrected_worker (line 167) | def writeCorrected_worker(chrNameBam, chrNameBit, start, end, step):
function numCopiesOfRead (line 267) | def numCopiesOfRead(value):
function writeCorrectedSam_wrapper (line 287) | def writeCorrectedSam_wrapper(args):
function writeCorrectedSam_worker (line 291) | def writeCorrectedSam_worker(chrNameBam, chrNameBit, start, end,
function getFragmentFromRead (line 464) | def getFragmentFromRead(read, defaultFragmentLength, extendPairedEnds=Tr...
function run_shell_command (line 536) | def run_shell_command(command):
function main (line 552) | def main(args=None):
class Tester (line 681) | class Tester():
method __init__ (line 682) | def __init__(self):
method testWriteCorrectedChunk (line 705) | def testWriteCorrectedChunk(self):
method testWriteCorrectedSam (line 719) | def testWriteCorrectedSam(self):
method testWriteCorrectedSam_paired (line 732) | def testWriteCorrectedSam_paired(self):
FILE: deeptools/correlation.py
class Correlation (line 28) | class Correlation:
method __init__ (line 36) | def __init__(self, matrix_file,
method load_matrix (line 77) | def load_matrix(self, matrix_file):
method get_outlier_indices (line 102) | def get_outlier_indices(data, max_deviation=200):
method remove_outliers (line 131) | def remove_outliers(self, verbose=True):
method remove_rows_of_zeros (line 163) | def remove_rows_of_zeros(self):
method save_corr_matrix (line 170) | def save_corr_matrix(self, file_handle):
method compute_correlation (line 187) | def compute_correlation(self):
method plotly_correlation (line 239) | def plotly_correlation(self, corr_matrix, plot_filename, labels, plot_...
method plot_correlation (line 262) | def plot_correlation(self, plot_filename, plot_title='', vmax=None,
method plotly_scatter (line 375) | def plotly_scatter(self, plot_filename, corr_matrix, plot_title='', mi...
method plot_scatter (line 430) | def plot_scatter(self, plot_filename, plot_title='', image_format=None...
method plotly_pca (line 540) | def plotly_pca(self, plotFile, Wt, pvar, PCs, eigenvalues, cols, plotT...
method plot_pca (line 598) | def plot_pca(self, plot_filename=None, PCs=[1, 2], plot_title='', imag...
FILE: deeptools/correlation_heatmap.py
function plot_correlation (line 16) | def plot_correlation(corr_matrix, labels, plotFileName, vmax=None,
FILE: deeptools/countReadsPerBin.py
function countReadsInRegions_wrapper (line 19) | def countReadsInRegions_wrapper(args):
class CountReadsPerBin (line 31) | class CountReadsPerBin(object):
method __init__ (line 163) | def __init__(self, bamFilesList, binLength=50, numberOfSamples=None, n...
method get_chunk_length (line 270) | def get_chunk_length(self, bamFilesHandles, genomeSize, chromSizes, ch...
method run (line 311) | def run(self, allArgs=None):
method count_reads_in_region (line 400) | def count_reads_in_region(self, chrom, start, end, bed_regions_list=No...
method get_coverage_of_region (line 539) | def get_coverage_of_region(self, bamHandle, chrom, regions,
method getReadLength (line 723) | def getReadLength(self, read):
method is_proper_pair (line 727) | def is_proper_pair(read, maxPairedFragmentLength):
method get_fragment_from_read (line 788) | def get_fragment_from_read(self, read):
method getSmoothRange (line 906) | def getSmoothRange(self, tileIndex, tileSize, smoothRange, maxPosition):
function remove_row_of_zeros (line 964) | def remove_row_of_zeros(matrix):
function estimateSizeFactors (line 971) | def estimateSizeFactors(m):
class Tester (line 994) | class Tester(object):
method __init__ (line 996) | def __init__(self):
method getRead (line 1021) | def getRead(self, readType):
FILE: deeptools/deeptools_list_tools.py
function parse_arguments (line 9) | def parse_arguments(args=None):
function process_args (line 69) | def process_args(args=None):
function main (line 75) | def main(args=None):
FILE: deeptools/estimateReadFiltering.py
function parseArguments (line 11) | def parseArguments():
function getFiltered_worker (line 151) | def getFiltered_worker(arglist):
function main (line 258) | def main(args=None):
FILE: deeptools/estimateScaleFactor.py
function parseArguments (line 13) | def parseArguments(args=None):
function main (line 94) | def main(args=None):
FILE: deeptools/getFragmentAndReadSize.py
function getFragmentLength_wrapper (line 10) | def getFragmentLength_wrapper(args):
function getFragmentLength_worker (line 14) | def getFragmentLength_worker(chrom, start, end, bamFile, distanceBetween...
function get_read_and_fragment_length (line 59) | def get_read_and_fragment_length(bamFile, return_lengths=False, blackLis...
FILE: deeptools/getRatio.py
function compute_ratio (line 6) | def compute_ratio(value1, value2, args):
function getRatio (line 22) | def getRatio(tileCoverage, args):
FILE: deeptools/getScaleFactor.py
function getFractionKept_wrapper (line 13) | def getFractionKept_wrapper(args):
function getFractionKept_worker (line 17) | def getFractionKept_worker(chrom, start, end, bamFile, args, offset):
function fraction_kept (line 104) | def fraction_kept(args, stats):
function get_num_kept_reads (line 183) | def get_num_kept_reads(args, stats):
function get_scale_factor (line 213) | def get_scale_factor(args, stats):
FILE: deeptools/getScorePerBigWigBin.py
function countReadsInRegions_wrapper (line 16) | def countReadsInRegions_wrapper(args):
function countFragmentsInRegions_worker (line 21) | def countFragmentsInRegions_worker(chrom, start, end,
function getChromSizes (line 139) | def getChromSizes(bigwigFilesList):
function getScorePerBin (line 197) | def getScorePerBin(bigWigFiles, binLength,
class Tester (line 292) | class Tester(object):
method __init__ (line 294) | def __init__(self):
FILE: deeptools/heatmapper.py
function chopRegions (line 17) | def chopRegions(exonsInput, left=0, right=0):
function chopRegionsFromMiddle (line 68) | def chopRegionsFromMiddle(exonsInput, left=0, right=0):
function trimZones (line 143) | def trimZones(zones, maxLength, binSize, padRight):
function compute_sub_matrix_wrapper (line 173) | def compute_sub_matrix_wrapper(args):
class heatmapper (line 177) | class heatmapper(object):
method __init__ (line 183) | def __init__(self):
method getTicks (line 193) | def getTicks(self, idx):
method computeMatrix (line 200) | def computeMatrix(self, score_file_list, regions_file, parameters, bla...
method compute_sub_matrix_worker (line 354) | def compute_sub_matrix_worker(self, chrom, start, end, score_file_list...
method coverage_from_array (line 597) | def coverage_from_array(valuesArray, zones, binSize, avgType):
method change_chrom_names (line 636) | def change_chrom_names(chrom):
method coverage_from_big_wig (line 655) | def coverage_from_big_wig(bigwig, chrom, zones, binSize, avgType, nans...
method my_average (line 733) | def my_average(valuesArray, avgType='mean'):
method matrix_from_dict (line 745) | def matrix_from_dict(self, matrixDict, regionsDict, parameters):
method read_matrix_file (line 752) | def read_matrix_file(self, matrix_file):
method save_matrix (line 814) | def save_matrix(self, file_name):
method save_tabulated_values (line 874) | def save_tabulated_values(self, file_handle, reference_point_label='TS...
method save_matrix_values (line 963) | def save_matrix_values(self, file_name):
method save_BED (line 991) | def save_BED(self, file_handle):
method matrix_avg (line 1030) | def matrix_avg(matrix, avgType='mean'):
method get_individual_matrices (line 1034) | def get_individual_matrices(self, matrix):
method get_num_individual_matrix_cols (line 1048) | def get_num_individual_matrix_cols(self):
function computeSilhouetteScore (line 1062) | def computeSilhouetteScore(d, idx, labels):
class _matrix (line 1079) | class _matrix(object):
method __init__ (line 1093) | def __init__(self, regions, matrix, group_boundaries, sample_boundaries,
method get_matrix (line 1126) | def get_matrix(self, group, sample):
method get_num_samples (line 1147) | def get_num_samples(self):
method get_num_groups (line 1150) | def get_num_groups(self):
method set_group_labels (line 1153) | def set_group_labels(self, new_labels):
method set_sample_labels (line 1160) | def set_sample_labels(self, new_labels):
method set_sorting_method (line 1167) | def set_sorting_method(self, sort_method, sort_using):
method get_regions (line 1171) | def get_regions(self):
method sort_groups (line 1193) | def sort_groups(self, sort_using='mean', sort_method='no', sample_list...
method hmcluster (line 1252) | def hmcluster(self, k, evaluate_silhouette=True, method='kmeans', clus...
method computeSilhouette (line 1325) | def computeSilhouette(self, k):
method removeempty (line 1341) | def removeempty(self):
method flatten (line 1358) | def flatten(self):
FILE: deeptools/heatmapper_utilities.py
function plot_single (line 13) | def plot_single(ax, ma, average_type, color, label, plot_type='lines'):
function plotly_single (line 94) | def plotly_single(ma, average_type, color, label, plot_type='line'):
function getProfileTicks (line 124) | def getProfileTicks(hm, referencePointLabel, startLabel, endLabel, idx):
FILE: deeptools/mapReduce.py
function mapReduce (line 8) | def mapReduce(staticArgs, func, chromSize,
function getUserRegion (line 156) | def getUserRegion(chrom_sizes, region_string, max_chunk_size=1e6):
function blSubtract (line 239) | def blSubtract(t, chrom, chunk):
FILE: deeptools/multiBamSummary.py
function parse_arguments (line 16) | def parse_arguments(args=None):
function bamcorrelate_args (line 94) | def bamcorrelate_args(case='bins'):
function process_args (line 193) | def process_args(args=None):
function main (line 212) | def main(args=None):
FILE: deeptools/multiBigwigSummary.py
function parse_arguments (line 16) | def parse_arguments(args=None):
function process_args (line 94) | def process_args(args=None):
function multiBigwigSummaryArgs (line 117) | def multiBigwigSummaryArgs(case='bins'):
function main (line 207) | def main(args=None):
FILE: deeptools/parserCommon.py
function check_float_0_1 (line 7) | def check_float_0_1(value):
function check_list_of_comma_values (line 14) | def check_list_of_comma_values(value):
function output (line 25) | def output(args=None):
function read_options (line 42) | def read_options():
function gtf_options (line 141) | def gtf_options(suppress=False):
function normalization_options (line 203) | def normalization_options():
function getParentArgParse (line 292) | def getParentArgParse(args=None, binSize=True, blackList=True):
function numberOfProcessors (line 344) | def numberOfProcessors(string):
function genomicRegion (line 377) | def genomicRegion(string):
function writableFile (line 395) | def writableFile(string):
function heatmapperMatrixArgs (line 413) | def heatmapperMatrixArgs(args=None):
function heatmapperOutputArgs (line 431) | def heatmapperOutputArgs(args=None,
function heatmapperOptionalArgs (line 482) | def heatmapperOptionalArgs(mode=['heatmap', 'profile'][0]):
function requiredLength (line 870) | def requiredLength(minL, maxL):
FILE: deeptools/plotCorrelation.py
function parse_arguments (line 20) | def parse_arguments(args=None):
function plot_correlation_args (line 50) | def plot_correlation_args():
function scatterplot_options (line 133) | def scatterplot_options():
function heatmap_options (line 159) | def heatmap_options():
function main (line 204) | def main(args=None):
FILE: deeptools/plotCoverage.py
function parse_arguments (line 25) | def parse_arguments(args=None):
function process_args (line 58) | def process_args(args=None):
function required_args (line 72) | def required_args():
function main (line 173) | def main(args=None):
FILE: deeptools/plotEnrichment.py
function parse_arguments (line 30) | def parse_arguments(args=None):
function plot_enrichment_args (line 61) | def plot_enrichment_args():
function getBAMBlocks (line 203) | def getBAMBlocks(read, defaultFragmentLength, centerRead, offset=None):
function getEnrichment_worker (line 288) | def getEnrichment_worker(arglist):
function plotEnrichment (line 359) | def plotEnrichment(args, featureCounts, totalCounts, features):
function getChunkLength (line 455) | def getChunkLength(args, chromSize):
function main (line 492) | def main(args=None):
FILE: deeptools/plotFingerprint.py
function parse_arguments (line 28) | def parse_arguments(args=None):
function process_args (line 53) | def process_args(args=None):
function get_required_args (line 74) | def get_required_args():
function get_optional_args (line 87) | def get_optional_args():
function get_output_args (line 164) | def get_output_args():
function binRelEntropy (line 183) | def binRelEntropy(p, q):
function getCHANCE (line 196) | def getCHANCE(args, idx, mat):
function getSyntheticJSD (line 237) | def getSyntheticJSD(vec):
function getJSD (line 259) | def getJSD(args, idx, mat):
function getJSDcommon (line 307) | def getJSDcommon(chip, input):
function getExpected (line 351) | def getExpected(mu):
function main (line 367) | def main(args=None):
FILE: deeptools/plotHeatmap.py
function parse_arguments (line 34) | def parse_arguments(args=None):
function process_args (line 52) | def process_args(args=None):
function prepare_layout (line 65) | def prepare_layout(hm_matrix, heatmapsize, showSummaryPlot, showColorbar...
function addProfilePlot (line 121) | def addProfilePlot(hm, plt, fig, grids, iterNum, iterNum2, perGroup, ave...
function plotlyMatrix (line 206) | def plotlyMatrix(hm,
function plotMatrix (line 381) | def plotMatrix(hm, outFileName,
function mergeSmallGroups (line 772) | def mergeSmallGroups(matrixDict):
function main (line 808) | def main(args=None):
FILE: deeptools/plotPCA.py
function parse_arguments (line 16) | def parse_arguments(args=None):
function plotCorrelationArgs (line 38) | def plotCorrelationArgs():
function main (line 158) | def main(args=None):
FILE: deeptools/plotProfile.py
function parse_arguments (line 35) | def parse_arguments(args=None):
function process_args (line 55) | def process_args(args=None):
class Profile (line 90) | class Profile(object):
method __init__ (line 92) | def __init__(self, hm, out_file_name,
method getTicks (line 196) | def getTicks(self, idx):
method cm2inch (line 204) | def cm2inch(*tupl):
method plot_hexbin (line 211) | def plot_hexbin(self):
method plotly_hexbin (line 337) | def plotly_hexbin(self):
method plot_heatmap (line 463) | def plot_heatmap(self):
method plotly_heatmap (line 582) | def plotly_heatmap(self):
method plot_profile (line 677) | def plot_profile(self):
method plotly_profile (line 809) | def plotly_profile(self):
function main (line 911) | def main(args=None):
FILE: deeptools/sumCoveragePerBin.py
class SumCoveragePerBin (line 10) | class SumCoveragePerBin(countReadsPerBin.CountReadsPerBin):
method get_coverage_of_region (line 14) | def get_coverage_of_region(self, bamHandle, chrom, regions,
class Tester (line 217) | class Tester(object):
method __init__ (line 219) | def __init__(self):
FILE: deeptools/test/skiptest_heatmapper_images.py
function test_plotHeatmap_simple_plot (line 18) | def test_plotHeatmap_simple_plot():
function test_plotHeatmap_rename_labels (line 35) | def test_plotHeatmap_rename_labels():
function test_plotHeatmap_scale_regions (line 45) | def test_plotHeatmap_scale_regions():
function test_plotHeatmap_multi_bigwig_pergroup (line 54) | def test_plotHeatmap_multi_bigwig_pergroup():
function test_plotHeatmap_multiple_colors_muti_scales (line 64) | def test_plotHeatmap_multiple_colors_muti_scales():
function test_plotHeatmap_multiple_colormap_no_boxes (line 74) | def test_plotHeatmap_multiple_colormap_no_boxes():
function test_plotHeatmap_interpolation (line 84) | def test_plotHeatmap_interpolation():
function test_plotProfiler (line 94) | def test_plotProfiler():
function test_plotProfiler_heatmap (line 104) | def test_plotProfiler_heatmap():
function test_plotProfiler_overlapped_lines (line 113) | def test_plotProfiler_overlapped_lines():
function test_plotProfiler_multibigwig (line 123) | def test_plotProfiler_multibigwig():
function test_plotProfiler_multibigwig_pergroup (line 133) | def test_plotProfiler_multibigwig_pergroup():
FILE: deeptools/test/test_bamCoverage_and_bamCompare.py
function test_bam_coverage_arguments (line 35) | def test_bam_coverage_arguments():
function test_bam_coverage_extend (line 52) | def test_bam_coverage_extend():
function test_bam_coverage_extend_and_normalizeUsingRPGC (line 65) | def test_bam_coverage_extend_and_normalizeUsingRPGC():
function test_bam_coverage_skipnas (line 82) | def test_bam_coverage_skipnas():
function test_bam_coverage_filtering (line 96) | def test_bam_coverage_filtering():
function test_bam_compare_arguments (line 110) | def test_bam_compare_arguments():
function test_bam_compare_diff_files (line 130) | def test_bam_compare_diff_files():
function test_bam_compare_pseudocounts (line 148) | def test_bam_compare_pseudocounts():
function test_bam_compare_ZoverZ (line 165) | def test_bam_compare_ZoverZ():
function test_get_num_kept_reads (line 182) | def test_get_num_kept_reads():
function test_bam_compare_diff_files_skipnas (line 214) | def test_bam_compare_diff_files_skipnas():
function test_bam_compare_extend (line 234) | def test_bam_compare_extend():
function test_bam_compare_scale_factors_ratio (line 252) | def test_bam_compare_scale_factors_ratio():
function test_bam_compare_scale_factors_subtract (line 292) | def test_bam_compare_scale_factors_subtract():
function test_bam_coverage_filter_blacklist (line 334) | def test_bam_coverage_filter_blacklist():
function test_bam_coverage_offset1 (line 364) | def test_bam_coverage_offset1():
function test_bam_coverage_offset1_10 (line 382) | def test_bam_coverage_offset1_10():
function test_bam_coverage_offset_minus1 (line 400) | def test_bam_coverage_offset_minus1():
function test_bam_coverage_offset20_minus4 (line 418) | def test_bam_coverage_offset20_minus4():
function test_bam_compare_filter_blacklist (line 436) | def test_bam_compare_filter_blacklist():
FILE: deeptools/test/test_bigwigAverage.py
function test_bigwigAverage (line 37) | def test_bigwigAverage():
function test_bigwigAverage_skipnas (line 49) | def test_bigwigAverage_skipnas():
function test_bigwigAverageWithScale (line 62) | def test_bigwigAverageWithScale():
function test_bigwigAverageThree (line 74) | def test_bigwigAverageThree():
FILE: deeptools/test/test_bigwigCompare_and_multiBigwigSummary.py
function test_bigwigCompare (line 40) | def test_bigwigCompare():
function test_bigwigCompare_skipnas (line 52) | def test_bigwigCompare_skipnas():
function test_bigwigCompare_skipZeroOverZero (line 65) | def test_bigwigCompare_skipZeroOverZero():
function test_multiBigwigSummary (line 77) | def test_multiBigwigSummary():
function test_multiBigwigSummary_outrawcounts (line 92) | def test_multiBigwigSummary_outrawcounts():
function test_multiBigwigSummary_gtf (line 113) | def test_multiBigwigSummary_gtf():
function test_multiBigwigSummary_metagene (line 126) | def test_multiBigwigSummary_metagene():
FILE: deeptools/test/test_computeMatrixOperations.py
function getHeader (line 12) | def getHeader(fp):
class TestComputeMatrixOperations (line 20) | class TestComputeMatrixOperations(object):
method testSubset (line 27) | def testSubset(self):
method testRelabel (line 46) | def testRelabel(self):
method testfilterStrand (line 63) | def testfilterStrand(self):
method testrbind (line 95) | def testrbind(self):
method testrbind2 (line 113) | def testrbind2(self):
method testcbind (line 131) | def testcbind(self):
method testsort (line 149) | def testsort(self):
FILE: deeptools/test/test_countReadsPerBin.py
class TestCountReadsPerBin (line 13) | class TestCountReadsPerBin():
method ifiles (line 15) | def ifiles(self, ext='bam'):
method test_count_reads_in_region (line 45) | def test_count_reads_in_region(self, bc):
method test_count_reads_in_region_extension_1 (line 55) | def test_count_reads_in_region_extension_1(self, bc):
method test_count_reads_in_region_total (line 75) | def test_count_reads_in_region_total(self, bc):
method test_countReadsInRegions_min_mapping_quality (line 86) | def test_countReadsInRegions_min_mapping_quality(self, bc):
method test_count_reads_in_region_ignore_duplicates (line 96) | def test_count_reads_in_region_ignore_duplicates(self, bc):
method test_count_reads_in_region_ignore_bed_regions (line 106) | def test_count_reads_in_region_ignore_bed_regions(self, bc):
method test_get_coverage_of_region_sam_flag_include (line 116) | def test_get_coverage_of_region_sam_flag_include(self, bc):
method test_get_coverage_of_region_sam_flag_exclude (line 123) | def test_get_coverage_of_region_sam_flag_exclude(self, bc):
method test_get_coverage_of_region_large_bin (line 130) | def test_get_coverage_of_region_large_bin(self, bc):
method test_get_coverage_of_region_ignore_duplicates (line 138) | def test_get_coverage_of_region_ignore_duplicates(self, bc):
method test_get_coverage_of_region_split_read (line 156) | def test_get_coverage_of_region_split_read(self, bc):
method test_get_coverage_of_region_zeros_to_nan (line 180) | def test_get_coverage_of_region_zeros_to_nan(self, bc):
method test_bed_file (line 190) | def test_bed_file(self, bc):
FILE: deeptools/test/test_heatmapper.py
function cmpMatrices (line 15) | def cmpMatrices(f1, f2):
function test_computeMatrix_reference_point (line 51) | def test_computeMatrix_reference_point():
function test_computeMatrix_reference_point_center (line 60) | def test_computeMatrix_reference_point_center():
function test_computeMatrix_reference_point_tes (line 69) | def test_computeMatrix_reference_point_tes():
function test_computeMatrix_reference_point_missing_data_as_zero (line 78) | def test_computeMatrix_reference_point_missing_data_as_zero():
function test_computeMatrix_scale_regions (line 87) | def test_computeMatrix_scale_regions():
function test_computeMatrix_multiple_bed (line 97) | def test_computeMatrix_multiple_bed():
function test_computeMatrix_region_extend_over_chr_end (line 106) | def test_computeMatrix_region_extend_over_chr_end():
function test_computeMatrix_unscaled (line 115) | def test_computeMatrix_unscaled():
function test_computeMatrix_gtf (line 124) | def test_computeMatrix_gtf():
function test_computeMatrix_metagene (line 133) | def test_computeMatrix_metagene():
function test_chopRegions_body (line 142) | def test_chopRegions_body():
function test_chopRegions_TSS (line 168) | def test_chopRegions_TSS():
function test_chopRegions_TES (line 218) | def test_chopRegions_TES():
function test_chopRegionsFromMiddle (line 268) | def test_chopRegionsFromMiddle():
FILE: deeptools/test/test_multiBamSummary.py
function test_multiBamSummary_gtf (line 16) | def test_multiBamSummary_gtf():
function test_multiBamSummary_metagene (line 33) | def test_multiBamSummary_metagene():
function test_multiBamSummary_scalingFactors (line 50) | def test_multiBamSummary_scalingFactors():
FILE: deeptools/test/test_plotCoverage.py
function test_plotCoverage_default (line 16) | def test_plotCoverage_default():
FILE: deeptools/test/test_readFiltering.py
function test_estimate_read_filtering_minimal (line 15) | def test_estimate_read_filtering_minimal():
function test_estimate_read_filtering_params (line 36) | def test_estimate_read_filtering_params():
function test_sieve (line 57) | def test_sieve():
function test_sieve_BED (line 87) | def test_sieve_BED():
function test_sieve_BED_shift (line 129) | def test_sieve_BED_shift():
FILE: deeptools/test/test_tools.py
function test_tools (line 11) | def test_tools():
FILE: deeptools/test/test_writeBedGraph.py
class TestWriteBedGraph (line 8) | class TestWriteBedGraph():
method ifiles (line 9) | def ifiles(self, ext='bam'):
method test_writeBedGraph_worker (line 25) | def test_writeBedGraph_worker(self, bc):
method test_writeBedGraph_worker_zerotonan (line 38) | def test_writeBedGraph_worker_zerotonan(self, bc):
method test_writeBedGraph_worker_scaling (line 50) | def test_writeBedGraph_worker_scaling(self, bc):
method test_writeBedGraph_worker_ignore_duplicates (line 61) | def test_writeBedGraph_worker_ignore_duplicates(self, bc):
method test_writeBedGraph_worker_smoothing (line 79) | def test_writeBedGraph_worker_smoothing(self, bc):
method test_writeBedGraph_cigar (line 92) | def test_writeBedGraph_cigar(self, bc):
FILE: deeptools/utilities.py
function smartLabel (line 14) | def smartLabel(label):
function smartLabels (line 28) | def smartLabels(labels):
function convertCmap (line 32) | def convertCmap(c, vmin=0, vmax=1):
function getTLen (line 50) | def getTLen(read, notAbs=False):
function getGC_content (line 79) | def getGC_content(tb, chrom, fragStart, fragEnd, fraction=True):
function tbitToBamChrName (line 92) | def tbitToBamChrName(tbitNames, bamNames):
function getCommonChrNames (line 161) | def getCommonChrNames(bamFileHandles, verbose=True):
function copyFileInMemory (line 232) | def copyFileInMemory(filePath, suffix=''):
function getTempFileName (line 250) | def getTempFileName(suffix=''):
function gtfOptions (line 265) | def gtfOptions(allArgs=None):
function toString (line 282) | def toString(s):
function toBytes (line 297) | def toBytes(s):
function mungeChromosome (line 312) | def mungeChromosome(chrom, chromList):
function bam_total_reads (line 335) | def bam_total_reads(bam_handle, chroms_to_ignore, stats):
function bam_blacklisted_worker (line 346) | def bam_blacklisted_worker(args):
function bam_blacklisted_reads (line 359) | def bam_blacklisted_reads(bam_handle, chroms_to_ignore, blackListFileNam...
FILE: deeptools/writeBedGraph.py
function writeBedGraph_wrapper (line 18) | def writeBedGraph_wrapper(args):
class WriteBedGraph (line 30) | class WriteBedGraph(cr.CountReadsPerBin):
method run (line 93) | def run(self, func_to_call, func_args, out_file_name, blackListFileNam...
method writeBedGraph_worker (line 173) | def writeBedGraph_worker(self, chrom, start, end,
function bedGraphToBigWig (line 286) | def bedGraphToBigWig(chromSizes, bedGraphFiles, bigWigPath):
function getGenomeChunkLength (line 322) | def getGenomeChunkLength(bamHandles, tile_size, mappedList):
function scaleCoverage (line 343) | def scaleCoverage(tile_coverage, args):
function ratio (line 350) | def ratio(tile_coverage, args):
FILE: deeptools/writeBedGraph_bam_and_bw.py
function getCoverageFromBigwig (line 22) | def getCoverageFromBigwig(bigwigHandle, chrom, start, end, tileSize,
function writeBedGraph_wrapper (line 41) | def writeBedGraph_wrapper(args):
function writeBedGraph_worker (line 45) | def writeBedGraph_worker(
function writeBedGraph (line 145) | def writeBedGraph(
FILE: docs/conf.py
function get_version (line 84) | def get_version():
FILE: scripts/convertChromsBigWig.py
function parse_arguments (line 12) | def parse_arguments(defaults):
function get_chromosome_mapping (line 69) | def get_chromosome_mapping(genome="GRCm38", from_format="ensembl", to_fo...
function convert_bigwig (line 118) | def convert_bigwig(mapping_table, bw_in_filename, bw_out_filename, verbo...
function main (line 159) | def main(args=None):
Condensed preview — 325 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (8,717K chars).
[
{
"path": ".github/CONTRIBUTING.md",
"chars": 544,
"preview": "# Contributing\n\n**Welcome to deepTools GitHub repository! Please check the following instructions\nfor contributing to th"
},
{
"path": ".github/ISSUE_TEMPLATE.md",
"chars": 691,
"preview": "\n**Welcome to deepTools GitHub repository! Before opening the issue please check\nthat the following requirements are met"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 286,
"preview": "\n**Welcome to deepTools GitHub repository! Please check the following regarding\nyour pull request :**\n\n - [ ] Does the P"
},
{
"path": ".github/workflows/planemo.yml",
"chars": 1421,
"preview": "name: Planemo\non: [push, pull_request]\n\nenv:\n GALAXY_BRANCH: release_24.1\n\ndefaults:\n run:\n shell: bash -l {0}\n\njob"
},
{
"path": ".github/workflows/pypi.yml",
"chars": 616,
"preview": "name: pypi\n\non:\n create:\n tags:\n - '*'\n\ndefaults:\n run:\n shell: bash -l {0}\n\njobs:\n pypi:\n if: ${{ starts"
},
{
"path": ".github/workflows/test.yml",
"chars": 3118,
"preview": "name: Test\non: [push, pull_request]\n\ndefaults:\n run:\n shell: bash -l {0}\n\njobs:\n check_versions_matches:\n name: "
},
{
"path": ".gitignore",
"chars": 478,
"preview": "*.tar.gz\n*.py[cod]\n\n# C extensions\n*.so\n\n# Packages\n*.egg\n*.egg-info\ndist\nbuild\neggs\nparts\nvar\nsdist\ndevelop-eggs\n.insta"
},
{
"path": ".planemo.sh",
"chars": 1245,
"preview": "#!/bin/bash\n# Some versions of planemo don't handle symlinks\nunlink galaxy/wrapper/test-data/test.bw\ncp deeptools/test/t"
},
{
"path": ".readthedocs.yaml",
"chars": 193,
"preview": "version: 2\n\nbuild:\n os: ubuntu-22.04\n tools:\n python: \"3.12\"\n\nsphinx:\n configuration: docs/conf.py\n\npython:\n inst"
},
{
"path": "CHANGES.txt",
"chars": 40451,
"preview": "3.5.5\n* drop support for python 3.7\n* doc fixes (argparse properly displayed, minor changes in installation instructions"
},
{
"path": "LICENSE.txt",
"chars": 1241,
"preview": "The file deeptools/cm.py is licensed under the BSD license, see a copy in that file. The remainder of the code is licens"
},
{
"path": "MANIFEST.in",
"chars": 158,
"preview": "include *.txt\ninclude README.md\nexclude examples/*\nexclude deepTools.egg-info/*\ninclude scripts/*\nexclude deeptools/test"
},
{
"path": "README.md",
"chars": 5910,
"preview": "# deepTools\n[](http://deeptools.readthedocs.or"
},
{
"path": "README.rst",
"chars": 1454,
"preview": "======================================================================\ndeepTools\n======================================="
},
{
"path": "deeptools/SES_scaleFactor.py",
"chars": 7007,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport numpy as np\n\n# own packages\nfrom deeptools import bamHan"
},
{
"path": "deeptools/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "deeptools/alignmentSieve.py",
"chars": 18200,
"preview": "#!/usr/bin/env python\nimport argparse\nimport pysam\nimport os\nimport sys\n\nfrom deeptools import parserCommon\nfrom deeptoo"
},
{
"path": "deeptools/bamCompare.py",
"chars": 14290,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse # to parse command line arguments\nimport numpy as np\nimp"
},
{
"path": "deeptools/bamCoverage.py",
"chars": 18617,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# own tools\nimport argparse\nimport sys\nimport numpy as np\nfrom deeptools "
},
{
"path": "deeptools/bamHandler.py",
"chars": 3345,
"preview": "import sys\nimport pysam\nfrom deeptools.mapReduce import mapReduce\n\n\ndef countReadsInInterval(args):\n chrom, start, en"
},
{
"path": "deeptools/bamPEFragmentSize.py",
"chars": 21247,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse\nimport sys\nimport numpy as np\n\nimport matplotlib\nmatplotl"
},
{
"path": "deeptools/bigwigAverage.py",
"chars": 4908,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport argparse\nimport sys\nimport numpy as np\nfrom deeptools import parser"
},
{
"path": "deeptools/bigwigCompare.py",
"chars": 6614,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport argparse\nfrom deeptools import parserCommon\nfrom deeptools.getRatio"
},
{
"path": "deeptools/cm.py",
"chars": 44838,
"preview": "#!/usr/bin/env python\n\n# This file comes from the seaborn project and is under a BSD license:\n\n# Copyright (c) 2012-2019"
},
{
"path": "deeptools/computeGCBias.py",
"chars": 31006,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport time\n\nimport multiprocessing\nimport numpy as np\nimport argparse\nfr"
},
{
"path": "deeptools/computeMatrix.py",
"chars": 22446,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse\nimport sys\nfrom deeptools.parserCommon import writableFil"
},
{
"path": "deeptools/computeMatrixOperations.py",
"chars": 32110,
"preview": "#!/usr/bin/env python\nimport deeptools.heatmapper as heatmapper\nimport deeptoolsintervals.parse as dti\nimport numpy as n"
},
{
"path": "deeptools/correctGCBias.py",
"chars": 26158,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport shutil\nimport time\nimport subprocess\nimport sys\n\nimport "
},
{
"path": "deeptools/correlation.py",
"chars": 28078,
"preview": "import sys\nimport itertools\nimport copy\nimport numpy as np\nimport scipy.cluster.hierarchy as sch\nimport scipy.stats\nimpo"
},
{
"path": "deeptools/correlation_heatmap.py",
"chars": 3796,
"preview": "from matplotlib import use as mplt_use\nmplt_use('Agg')\nfrom deeptools import cm # noqa: F401\nimport matplotlib.pyplot a"
},
{
"path": "deeptools/countReadsPerBin.py",
"chars": 42159,
"preview": "import shutil\nimport os\nimport time\nimport sys\nimport multiprocessing\nimport numpy as np\n\n# deepTools packages\nimport de"
},
{
"path": "deeptools/deeptools_list_tools.py",
"chars": 3345,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse\nimport sys\nfrom importlib.metadata import version\n\n\ndef p"
},
{
"path": "deeptools/estimateReadFiltering.py",
"chars": 16606,
"preview": "#!/usr/bin/env python\nimport argparse\nimport sys\n\nfrom deeptools import parserCommon, bamHandler, utilities\nfrom deeptoo"
},
{
"path": "deeptools/estimateScaleFactor.py",
"chars": 4782,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse\nimport sys\n\nfrom deeptools.SES_scaleFactor import estimat"
},
{
"path": "deeptools/getFragmentAndReadSize.py",
"chars": 7011,
"preview": "import numpy as np\n\n# own tools\nfrom deeptools import bamHandler\nfrom deeptools import mapReduce\n\nold_settings = np.sete"
},
{
"path": "deeptools/getRatio.py",
"chars": 2326,
"preview": "import numpy as np\n\nold_settings = np.seterr(all='ignore')\n\n\ndef compute_ratio(value1, value2, args):\n value1 = value"
},
{
"path": "deeptools/getScaleFactor.py",
"chars": 12772,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport deeptools.mapReduce as mapReduce\nfrom deeptools"
},
{
"path": "deeptools/getScorePerBigWigBin.py",
"chars": 11967,
"preview": "import pyBigWig\nimport numpy as np\nimport os\nimport sys\nimport shutil\nimport warnings\n\n# deepTools packages\nimport deept"
},
{
"path": "deeptools/heatmapper.py",
"chars": 58987,
"preview": "import sys\nimport gzip\nfrom collections import OrderedDict\nimport numpy as np\nfrom copy import deepcopy\n\nimport pyBigWig"
},
{
"path": "deeptools/heatmapper_utilities.py",
"chars": 7169,
"preview": "import numpy as np\nimport matplotlib\nmatplotlib.use('Agg')\nmatplotlib.rcParams['pdf.fonttype'] = 42\nmatplotlib.rcParams["
},
{
"path": "deeptools/mapReduce.py",
"chars": 9786,
"preview": "import multiprocessing\nfrom deeptoolsintervals import GTF\nimport random\n\ndebug = 0\n\n\ndef mapReduce(staticArgs, func, chr"
},
{
"path": "deeptools/misc.py",
"chars": 597,
"preview": "import os\n\n# This should force numpy to run single threaded. See issue #697\n# This module MUST be imported before numpy\n"
},
{
"path": "deeptools/multiBamSummary.py",
"chars": 11899,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport argparse\nimport numpy as np\n\nimport deeptools"
},
{
"path": "deeptools/multiBigwigSummary.py",
"chars": 11291,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport sys\nimport argparse\nimport os.path\nimport numpy as np\nfrom deeptoo"
},
{
"path": "deeptools/parserCommon.py",
"chars": 43744,
"preview": "import argparse\nimport os\nfrom importlib.metadata import version\nimport multiprocessing\n\n\ndef check_float_0_1(value):\n "
},
{
"path": "deeptools/plotCorrelation.py",
"chars": 10984,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport sys\nimport argparse\nimport numpy as np\nimport matplotlib\nmatplotli"
},
{
"path": "deeptools/plotCoverage.py",
"chars": 16329,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport argparse\nimport numpy as np\n\nimport matplotli"
},
{
"path": "deeptools/plotEnrichment.py",
"chars": 25244,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport sys\nimport argparse\nimport numpy as np\nimport matplotlib\nmatplotli"
},
{
"path": "deeptools/plotFingerprint.py",
"chars": 19876,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport argparse\nimport sys\nimport matplotlib\nmatplotli"
},
{
"path": "deeptools/plotHeatmap.py",
"chars": 37144,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import division\n\nimport argparse\nfrom collections import O"
},
{
"path": "deeptools/plotPCA.py",
"chars": 9427,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport sys\nimport argparse\nimport matplotlib\nmatplotlib.use('Agg')\nmatplo"
},
{
"path": "deeptools/plotProfile.py",
"chars": 39224,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nimport sys\n\nimport argparse\nimport numpy as np\nfrom math import ceil\nimp"
},
{
"path": "deeptools/sumCoveragePerBin.py",
"chars": 9899,
"preview": "import numpy as np\nimport multiprocessing\nimport time\n\nfrom deeptools import countReadsPerBin\nfrom deeptools.utilities i"
},
{
"path": "deeptools/test/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "deeptools/test/skiptest_heatmapper_images.py",
"chars": 5917,
"preview": "import os\nimport matplotlib\nmatplotlib.use('Agg')\nfrom matplotlib.testing.compare import compare_images\nfrom tempfile im"
},
{
"path": "deeptools/test/test_bamCoverage_and_bamCompare.py",
"chars": 17582,
"preview": "import deeptools.bamCoverage as bam_cov\nimport deeptools.bamCompare as bam_comp\nimport deeptools.getScaleFactor as gs\nim"
},
{
"path": "deeptools/test/test_bigwigAverage.py",
"chars": 2864,
"preview": "import deeptools.bigwigAverage as bwAve\n\nimport os.path\nfrom os import unlink\n\nROOT = os.path.dirname(os.path.abspath(__"
},
{
"path": "deeptools/test/test_bigwigCompare_and_multiBigwigSummary.py",
"chars": 4603,
"preview": "import deeptools.bigwigCompare as bwComp\nimport deeptools.multiBigwigSummary as bwCorr\nimport numpy as np\nimport numpy.t"
},
{
"path": "deeptools/test/test_computeMatrixOperations.py",
"chars": 12233,
"preview": "# from unittest import TestCase\n\nimport deeptools.computeMatrixOperations as cmo\nimport os\nimport hashlib\nimport gzip\nim"
},
{
"path": "deeptools/test/test_corrGC/R_gc",
"chars": 5025,
"preview": "1.000000000000000000e+00\n1.000000000000000000e+00\n1.000000000000000000e+00\n1.000000000000000000e+00\n1.000000000000000000"
},
{
"path": "deeptools/test/test_corrGC/R_gc_paired.txt",
"chars": 7525,
"preview": "1.000000000000000000e+00\n1.000000000000000000e+00\n1.000000000000000000e+00\n1.000000000000000000e+00\n1.000000000000000000"
},
{
"path": "deeptools/test/test_corrGC/extra_sampling.bed",
"chars": 17,
"preview": "chr2L\t1\t4\tIn1\t0\t+"
},
{
"path": "deeptools/test/test_corrGC/filter_out.bed",
"chars": 19,
"preview": "chr2L\t4\t8\tOUT1\t0\t+\n"
},
{
"path": "deeptools/test/test_corrGC/frequencies_data.txt",
"chars": 825,
"preview": "0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+00\n3.000000000000000000e+00 2.500000000000000000"
},
{
"path": "deeptools/test/test_corrGC/mappability.bg",
"chars": 49,
"preview": "chr2L\t0\t100\t1\nchr2L\t100\t110\t0.5\nchr2L\t110\t1000\t1\n"
},
{
"path": "deeptools/test/test_corrGC/sequence.fa",
"chars": 1027,
"preview": ">chr2L\nGAGTATCAGGAAGACCCAGAAATGTTGCTTGACCTCATGAATCGTATTGC\nCAAGGGATACCAAAATAACCCTGATCTACGACTGACTTGGTTGGAAAATA\nTGGCTAAAAAA"
},
{
"path": "deeptools/test/test_corrGC/sequence.fa.fai",
"chars": 19,
"preview": "chr2L\t1000\t7\t50\t51\n"
},
{
"path": "deeptools/test/test_corrGC/sizes",
"chars": 12,
"preview": "chr2L\t1000\n\n"
},
{
"path": "deeptools/test/test_corrGC/test.sam",
"chars": 38480,
"preview": "@HD\tVN:1.0\tSO:unsorted\n@SQ\tSN:2L\tLN:23011544\nDD61XKN1:97:COBJ7ACXX:6:1304:14465:187787\t0\t2L\t2\t255\t51M\t*\t0\t0\tAGTATCAGGAAG"
},
{
"path": "deeptools/test/test_corrGC/test_paired.sam",
"chars": 8184,
"preview": "@HD\tVN:1.0\tSO:unsorted\n@SQ\tSN:chr2\tLN:5010000\nHWUSI-EAS616:7:89:1518:3543#0\t99\tchr2\t5000027\t255\t36M\t=\t5000355\t364\tTGTAAC"
},
{
"path": "deeptools/test/test_countReadsPerBin.py",
"chars": 8401,
"preview": "# from unittest import TestCase\n\nimport deeptools.countReadsPerBin as cr\nimport numpy as np\nimport numpy.testing as nt\ni"
},
{
"path": "deeptools/test/test_data/computeMatrixOperations.bed",
"chars": 23701,
"preview": "6\t85676989,85677423,85677794,85677953,85678135\t85677191,85677492,85677875,85678032,85678736\tENST00000369605\t.\t-\n2\t132147"
},
{
"path": "deeptools/test/test_data/make_test_data.sh",
"chars": 110,
"preview": "bamCoverage -b testA.bam -o testA_skipNAs.bw --skipNAs\nbamCoverage -b testB.bam -o testB_skipNAs.bw --skipNAs\n"
},
{
"path": "deeptools/test/test_data/test.bed3",
"chars": 40,
"preview": "chr1\t1\t10\nchr2\t1\t10\nchr2\t5\t15\nchr2\t20\t30"
},
{
"path": "deeptools/test/test_data/test.gtf",
"chars": 642,
"preview": "3R\tdeepTools\tgene\t1\t1000\t.\t.\t0\tgene_id \"example\";\n3R\tdeepTools\ttranscript\t1\t1000\t.\t+\t0\tgene_id example; transcript_id \"f"
},
{
"path": "deeptools/test/test_data/test1.bg",
"chars": 659,
"preview": "3R\t0\t25\t0.76\n3R\t25\t50\t1.00\n3R\t50\t75\t0.32\n3R\t75\t100\t1.92\n3R\t100\t125\t3.28\n3R\t125\t150\t2.92\n3R\t150\t175\t7.88\n3R\t175\t200\t18.96"
},
{
"path": "deeptools/test/test_data/test1.fa",
"chars": 1529,
"preview": ">3R\nGAATTCTCTCTTGTTGTAGTCTCTTGACAAAATGCAATGGTCAGGTAGCGTTGTTCTAAA\nCTCAAGATTTAAAGGTGAATAGTCCTGTAAGCCCTATAAACATATGTACATAGGT"
},
{
"path": "deeptools/test/test_data/test1.fa.fai",
"chars": 16,
"preview": "3R\t1500\t4\t60\t61\n"
},
{
"path": "deeptools/test/test_data/test1.sam",
"chars": 27743,
"preview": "@HD\tVN:1.0\tSO:unsorted\n@SQ\tSN:3R\tLN:1500\tM5:9bad144b81e5e7369a164895691b3e73\tUR:./test1.fa\nDD61XKN1:101:D0EKPACXX:2:2103"
},
{
"path": "deeptools/test/test_data/test2.bg",
"chars": 688,
"preview": "3R\t0\t25\t1.68\n3R\t25\t50\t2.00\n3R\t50\t75\t0.40\n3R\t75\t100\t2.04\n3R\t100\t125\t5.44\n3R\t125\t150\t8.48\n3R\t150\t175\t13.48\n3R\t175\t200\t21.6"
},
{
"path": "deeptools/test/test_data/test2.sam",
"chars": 37180,
"preview": "@HD\tVN:1.0\tSO:unsorted\n@SQ\tSN:3R\tLN:1500\tM5:9bad144b81e5e7369a164895691b3e73\tUR:./test1.fa\nDD61XKN1:101:D0EKPACXX:1:1307"
},
{
"path": "deeptools/test/test_data/testA.fa",
"chars": 423,
"preview": ">3R\nGAATTCTCTCTTGTTGTAGTCTCTTGACAAAATGCAATGGTCAGGTAGCGTTGTTCTAAA\nCTCAAGATTTAAAGGTGAATAGTCCTGTAAGCCCTATAAACATATGTACATAGGT"
},
{
"path": "deeptools/test/test_data/testA.fa.fai",
"chars": 39,
"preview": "3R\t200\t4\t60\t61\nchr_cigar\t200\t219\t60\t61\n"
},
{
"path": "deeptools/test/test_data/testA.sam",
"chars": 936,
"preview": "@HD\tVN:1.0\tSO:unsorted\n@SQ\tSN:3R\tLN:200\tM5:a3becd17b758c9026ef5df3b781407b8\tUR:./testA.fa\n@SQ\tSN:chr_cigar\tLN:200\tM5:a3b"
},
{
"path": "deeptools/test/test_data/testB.fa",
"chars": 208,
"preview": ">3R\nGAATTCTCTCTTGTTGTAGTCTCTTGACAAAATGCAATGGTCAGGTAGCGTTGTTCTAAA\nCTCAAGATTTAAAGGTGAATAGTCCTGTAAGCCCTATAAACATATGTACATAGGT"
},
{
"path": "deeptools/test/test_data/testB.fa.fai",
"chars": 15,
"preview": "3R\t200\t4\t60\t61\n"
},
{
"path": "deeptools/test/test_data/testB.sam",
"chars": 1145,
"preview": "@HD\tVN:1.0\tSO:unsorted\n@SQ\tSN:3R\tLN:200\tM5:a3becd17b758c9026ef5df3b781407b8\tUR:./testB.fa\nDD61XKN1:101:D0EKPACXX:1:1108:"
},
{
"path": "deeptools/test/test_data/test_filtering.blacklist.bed",
"chars": 11,
"preview": "3R\t800\t900\n"
},
{
"path": "deeptools/test/test_data/test_filtering.fa",
"chars": 1529,
"preview": ">3R\nGAATTCTCTCTTGTTGTAGTCTCTTGACAAAATGCAATGGTCAGGTAGCGTTGTTCTAAA\nCTCAAGATTTAAAGGTGAATAGTCCTGTAAGCCCTATAAACATATGTACATAGGT"
},
{
"path": "deeptools/test/test_data/test_filtering.fa.fai",
"chars": 16,
"preview": "3R\t1500\t4\t60\t61\n"
},
{
"path": "deeptools/test/test_data/test_paired.sam",
"chars": 8184,
"preview": "@HD\tVN:1.0\tSO:unsorted\n@SQ\tSN:chr2\tLN:5010000\nHWUSI-EAS616:7:89:1518:3543#0\t99\tchr2\t5000027\t255\t36M\t=\t5000355\t364\tTGTAAC"
},
{
"path": "deeptools/test/test_data/test_paired2.fa",
"chars": 5093506,
"preview": ">chr2\nNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN\nNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN"
},
{
"path": "deeptools/test/test_data/test_paired2.fa.fai",
"chars": 21,
"preview": "chr2\t5010000\t6\t60\t61\n"
},
{
"path": "deeptools/test/test_data/test_paired2.sam",
"chars": 7909,
"preview": "@HD\tVN:1.0\tSO:unsorted\n@SQ\tSN:chr2\tLN:5010000\tM5:5c3b7fcdfff29abcc880fdec2817dd6b\tUR:./test_paired2.fa\nHWUSI-EAS616:7:89"
},
{
"path": "deeptools/test/test_heatmapper/group1.bed",
"chars": 66,
"preview": "ch1\t100\t150\tCG11023\t0\t+\nch2\t150\t175\tcda5\t0\t-\nch3\t100\t125\tcda8\t0\t+\n"
},
{
"path": "deeptools/test/test_heatmapper/group2.bed",
"chars": 62,
"preview": "ch1\t75\t125\tC11023\t0\t+\nch2\t125\t150\tca5\t0\t-\nch3\t75\t100\tca8\t0\t+\n\n"
},
{
"path": "deeptools/test/test_heatmapper/make_test_data.sh",
"chars": 2815,
"preview": "computeMatrix reference-point -a 100 -b 100 -S test.bw -R test2.bed -o master.mat.gz -bs 1 -p 1\n# unzip but keep origina"
},
{
"path": "deeptools/test/test_heatmapper/master.mat",
"chars": 11155,
"preview": "@{\"verbose\":false,\"scale\":1,\"skip zeros\":false,\"nan after end\":false,\"sort using\":\"mean\",\"unscaled 5 prime\":[0],\"body\":["
},
{
"path": "deeptools/test/test_heatmapper/master.tab",
"chars": 6742,
"preview": "#bin No.\tGroup 1 mean\t std\tGroup 2\n-100\t0.0\t0.0\t0.0\t0.0\t\n-99\t0.0\t0.0\t0.0\t0.0\t\n-98\t0.0\t0.0\t0.0\t0.0\t\n-97\t0.0\t0.0\t0.0\t0.0\t\n"
},
{
"path": "deeptools/test/test_heatmapper/master_TES.mat",
"chars": 11405,
"preview": "@{\"verbose\":false,\"scale\":1,\"skip zeros\":false,\"nan after end\":false,\"sort using\":\"mean\",\"unscaled 5 prime\":[0],\"body\":["
},
{
"path": "deeptools/test/test_heatmapper/master_center.mat",
"chars": 11343,
"preview": "@{\"verbose\":false,\"scale\":1,\"skip zeros\":false,\"nan after end\":false,\"sort using\":\"mean\",\"unscaled 5 prime\":[0],\"body\":["
},
{
"path": "deeptools/test/test_heatmapper/master_extend_beyond_chr_size.mat",
"chars": 25636,
"preview": "@{\"verbose\":false,\"scale\":1,\"skip zeros\":false,\"nan after end\":false,\"sort using\":\"mean\",\"unscaled 5 prime\":[0],\"body\":["
},
{
"path": "deeptools/test/test_heatmapper/master_gtf.mat",
"chars": 3432,
"preview": "@{\"verbose\":false,\"scale\":1,\"skip zeros\":false,\"nan after end\":false,\"sort using\":\"mean\",\"unscaled 5 prime\":[20],\"body\":"
},
{
"path": "deeptools/test/test_heatmapper/master_metagene.mat",
"chars": 3444,
"preview": "@{\"verbose\":false,\"scale\":1,\"skip zeros\":false,\"nan after end\":false,\"sort using\":\"mean\",\"unscaled 5 prime\":[20],\"body\":"
},
{
"path": "deeptools/test/test_heatmapper/master_multi.mat",
"chars": 42844,
"preview": "@{\"verbose\":true,\"scale\":1,\"skip zeros\":false,\"nan after end\":false,\"sort using\":\"mean\",\"unscaled 5 prime\":[0],\"body\":[0"
},
{
"path": "deeptools/test/test_heatmapper/master_multibed.mat",
"chars": 11161,
"preview": "@{\"verbose\":false,\"scale\":1,\"skip zeros\":false,\"nan after end\":false,\"sort using\":\"mean\",\"unscaled 5 prime\":[0],\"body\":["
},
{
"path": "deeptools/test/test_heatmapper/master_nan_to_zero.mat",
"chars": 11404,
"preview": "@{\"verbose\":false,\"scale\":1,\"skip zeros\":false,\"nan after end\":false,\"sort using\":\"mean\",\"unscaled 5 prime\":[0],\"body\":["
},
{
"path": "deeptools/test/test_heatmapper/master_scale_reg.mat",
"chars": 16556,
"preview": "@{\"verbose\":false,\"scale\":1,\"skip zeros\":false,\"nan after end\":false,\"sort using\":\"mean\",\"unscaled 5 prime\":[0],\"body\":["
},
{
"path": "deeptools/test/test_heatmapper/master_unscaled.mat",
"chars": 2266,
"preview": "@{\"verbose\":false,\"scale\":1,\"skip zeros\":false,\"nan after end\":false,\"sort using\":\"mean\",\"unscaled 5 prime\":[100],\"body\""
},
{
"path": "deeptools/test/test_heatmapper/out.bed",
"chars": 66,
"preview": "ch3\t100\t125\tcda8\t0\t+\nch1\t100\t150\tCG11023\t0\t+\nch2\t150\t175\tcda5\t0\t-\n"
},
{
"path": "deeptools/test/test_heatmapper/test.bed",
"chars": 66,
"preview": "ch1\t100\t150\tCG11023\t0\t+\nch2\t150\t175\tcda5\t0\t-\nch3\t100\t125\tcda8\t0\t+\n"
},
{
"path": "deeptools/test/test_heatmapper/test.bg",
"chars": 648,
"preview": "ch1\t0\t25\t0\nch1\t25\t50\t0\nch1\t50\t75\t0\nch1\t75\t100\t0\nch1\t100\t125\t2\nch1\t125\t150\t0\nch1\t150\t175\t0\nch1\t175\t200\t0\nch1\t200\t225\t0\nch"
},
{
"path": "deeptools/test/test_heatmapper/test.sizes",
"chars": 24,
"preview": "ch1\t400\nch2\t400\nch3\t400\n"
},
{
"path": "deeptools/test/test_heatmapper/test2.bed",
"chars": 145,
"preview": "ch1\t100\t150\tCG11023\t0\t+\nch2\t150\t175\tcda5\t0\t-\nch3\t100\t125\tcda8\t0\t+\n#Group 1\nch1\t75\t125\tC11023\t0\t+\nch2\t125\t150\tca5\t0\t-\nch3"
},
{
"path": "deeptools/test/test_heatmapper/unscaled.bed",
"chars": 19,
"preview": "1\t500\t1650\tfoo\t.\t.\n"
},
{
"path": "deeptools/test/test_heatmapper.py",
"chars": 12550,
"preview": "import os\nimport sys\n\nimport deeptools.computeMatrix\nimport deeptools.plotHeatmap\nimport deeptools.plotProfile\nimport de"
},
{
"path": "deeptools/test/test_multiBamSummary.py",
"chars": 1945,
"preview": "import deeptools.multiBamSummary as mbs\nimport numpy as np\nimport numpy.testing as nt\n\nimport os.path\nfrom os import unl"
},
{
"path": "deeptools/test/test_plotCoverage/make_test_files.sh",
"chars": 172,
"preview": "plotCoverage --bamfiles ../test_data/test1.bam ../test_data/test2.bam --plotFile plotCoverage_default.png --plotFileFor"
},
{
"path": "deeptools/test/test_plotCoverage/outRawCounts_default.tabular",
"chars": 30104,
"preview": "#plotCoverage --outRawCounts\n#'chr'\t'start'\t'end'\t'test1.bam'\t'test2.bam'\n3R\t0\t1\t0.0\t0.0\n3R\t1\t2\t0.0\t0.0\n3R\t2\t3\t0.0\t1.0\n3"
},
{
"path": "deeptools/test/test_plotCoverage.py",
"chars": 1215,
"preview": "import os\nimport filecmp\nfrom matplotlib.testing.compare import compare_images\nfrom tempfile import NamedTemporaryFile\ni"
},
{
"path": "deeptools/test/test_readFiltering.py",
"chars": 6229,
"preview": "import deeptools.estimateReadFiltering as est\nimport deeptools.alignmentSieve as sieve\nimport os.path\nfrom os import unl"
},
{
"path": "deeptools/test/test_tools.py",
"chars": 838,
"preview": "from subprocess import PIPE, run\nimport os\ntry:\n import tomllib\nexcept ModuleNotFoundError:\n import tomli as tomll"
},
{
"path": "deeptools/test/test_writeBedGraph.py",
"chars": 4462,
"preview": "import os\nimport pytest\nimport deeptools.writeBedGraph as wr\nfrom deeptools.writeBedGraph import scaleCoverage\n\n\n@pytest"
},
{
"path": "deeptools/utilities.py",
"chars": 14161,
"preview": "import sys\nimport os\nfrom deeptoolsintervals import GTF\nfrom deeptools.bamHandler import openBam\nimport matplotlib as mp"
},
{
"path": "deeptools/writeBedGraph.py",
"chars": 13223,
"preview": "import os\nimport sys\nimport shutil\nimport numpy as np\nimport pyBigWig\n\n# own modules\nfrom deeptools import mapReduce\nfro"
},
{
"path": "deeptools/writeBedGraph_bam_and_bw.py",
"chars": 9255,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport shutil\nimport tempfile\nimport numpy as np\nimport sys\n\n# "
},
{
"path": "docs/Makefile",
"chars": 7421,
"preview": "# Makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS =\nSPHINXBUILD "
},
{
"path": "docs/_static/welcome_base.css",
"chars": 280420,
"preview": "/*! normalize.css v2.1.0 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup"
},
{
"path": "docs/_static/welcome_owl.carousel.css",
"chars": 4614,
"preview": "/* \n * Owl Carousel - Animate Plugin\n */\n.owl-carousel .animated {\n -webkit-animation-duration: 1000ms;\n animation-du"
},
{
"path": "docs/_static/welcome_owl.carousel.theme.css",
"chars": 1055,
"preview": ".owl-theme .owl-controls{margin-top:10px;text-align:center;-webkit-tap-highlight-color:transparent}.owl-theme .owl-contr"
},
{
"path": "docs/conf.py",
"chars": 11119,
"preview": "# -*- coding: utf-8 -*-\n#\n# deepTools documentation build configuration file, created by\n# sphinx-quickstart on Wed Mar "
},
{
"path": "docs/content/about.rst",
"chars": 1220,
"preview": "About\n======\n\nPlease cite deepTools as follows:\n\n Ramírez, Fidel, Devon P. Ryan, Björn Grüning, Vivek Bhardwaj, Fabia"
},
{
"path": "docs/content/advanced_features.rst",
"chars": 439,
"preview": "Advanced features\n=================\n\nSome of the features of deepTools are not self-explanatory. Below, we provide links"
},
{
"path": "docs/content/api.rst",
"chars": 713,
"preview": "deepTools API\n=============\n\ndeepTools consists of several command line and Galaxy wrappers for summarizing\nthe informat"
},
{
"path": "docs/content/changelog.rst",
"chars": 5333,
"preview": "Changes in deepTools2.0\n========================\n\n.. contents:: \n :local:\n\nMajor changes\n-------------\n\n.. note:: The"
},
{
"path": "docs/content/example_api_tutorial.rst",
"chars": 10540,
"preview": ".. _api:\n\ndeepTools API example\n=====================\n\nThe following is a short overview of the most useful methods and "
},
{
"path": "docs/content/example_gallery.rst",
"chars": 13190,
"preview": "Gallery of deepTools plots\n===========================\n\n.. contents:: Published example plots\n :local:\n\t\nWe're trying"
},
{
"path": "docs/content/example_step_by_step.rst",
"chars": 9445,
"preview": "Step-by-step protocols\n========================\n\nThis section should give you an overview of how to do many common tasks"
},
{
"path": "docs/content/example_usage.rst",
"chars": 4836,
"preview": "Example usage\n=============\n\n.. contents:: \n :local:\n.. toctree::\n :maxdepth: 1\n\n example_step_by_step\n example"
},
{
"path": "docs/content/feature/blacklist.rst",
"chars": 2257,
"preview": "Blacklist Regions\n=================\n\nThere are many sources of bias in ChIPseq experiments. Among the most prevalent of "
},
{
"path": "docs/content/feature/effectiveGenomeSize.rst",
"chars": 5636,
"preview": "Effective Genome Size\n=====================\n\nA number of tools can accept an \"effective genome size\". This is defined as"
},
{
"path": "docs/content/feature/metagene.rst",
"chars": 1131,
"preview": "Metagene analyses\n=================\n\nBy default, `computeMatrix` uses the signal over entire contiguous regions (e.g., t"
},
{
"path": "docs/content/feature/plotFingerprint_QC_metrics.rst",
"chars": 6480,
"preview": "plotFingerprint QC metrics\n==========================\n\nAs of version 2.4.0, plotFingerprint can optionally output a numb"
},
{
"path": "docs/content/feature/plotly.rst",
"chars": 1024,
"preview": "Plotly\n======\n\n`Plotly <http://plot.ly>`__ is a tool for interactive visualization of datasets that deepTools has suppor"
},
{
"path": "docs/content/feature/read_extension.rst",
"chars": 2285,
"preview": "Read extension\n==============\n\nIn the majority of NGS experiment, DNA (or RNA) is fragmented into small stretches and on"
},
{
"path": "docs/content/feature/read_offsets.rst",
"chars": 998,
"preview": "Offsetting signal to a given position\n=====================================\n\nA growing number of experiment types need t"
},
{
"path": "docs/content/feature/unscaled_regions.rst",
"chars": 959,
"preview": "Unscaled regions\n================\n\nSome experiments aim to quantify the distribution of pausing of factors, such as PolI"
},
{
"path": "docs/content/help_faq.rst",
"chars": 18118,
"preview": "General FAQ\n===========\n\n.. tip:: For support or questions please post to `Biostars <http://biostars.org>`__. For bug re"
},
{
"path": "docs/content/help_faq_galaxy.rst",
"chars": 9540,
"preview": "Galaxy-related FAQ\n===================\n\n.. contents:: \n :local:\n\nI've reached my quota - what can I do to save some s"
},
{
"path": "docs/content/help_galaxy_dataup.rst",
"chars": 7480,
"preview": "Data import into Galaxy\n-------------------------\n\nThere are three main ways to populate your Galaxy history with data\nf"
},
{
"path": "docs/content/help_galaxy_deeptools.rst",
"chars": 8607,
"preview": "Which tools can I find in the deepTools Galaxy?\n-----------------------------------------------\n\nAs mentioned before, ea"
},
{
"path": "docs/content/help_galaxy_intro.rst",
"chars": 8460,
"preview": "Using deepTools within Galaxy \r\n================================\r\n\r\n`Galaxy <http://galaxyproject.org/>`_ is a tremend"
},
{
"path": "docs/content/help_glossary.rst",
"chars": 13913,
"preview": "Glossary of NGS terms\n=====================\n\nLike most specialized fields, next-generation sequencing has inspired many "
},
{
"path": "docs/content/installation.rst",
"chars": 2680,
"preview": "Installation\n=============\n\nRemember -- deepTools are available for **command line usage** as well as for\n**integration "
},
{
"path": "docs/content/list_of_tools.rst",
"chars": 13549,
"preview": "The tools\n=========\n\n.. contents:: \n :local:\n\n+-------------------------------------+------------------+-------------"
},
{
"path": "docs/content/tools/alignmentSieve.rst",
"chars": 3341,
"preview": "alignmentSieve\n==============\n\n.. contents:: \n :local:\n\n.. argparse::\n :ref: deeptools.alignmentSieve.parseArgument"
},
{
"path": "docs/content/tools/bamCompare.rst",
"chars": 1074,
"preview": "bamCompare\n===========\n\n``bamCompare`` can be used to generate a :ref:`bigWig` or :ref:`bedGraph` file based on **two BA"
},
{
"path": "docs/content/tools/bamCoverage.rst",
"chars": 6883,
"preview": "bamCoverage\n===========\n\n.. contents::\n :local:\n\n.. image:: ../../images/norm_IGVsnapshot_indFiles.png\n\nIf you are no"
},
{
"path": "docs/content/tools/bamPEFragmentSize.rst",
"chars": 2368,
"preview": "bamPEFragmentSize\n=================\n\n.. argparse::\n :ref: deeptools.bamPEFragmentSize.parse_arguments\n :prog: bamPEF"
},
{
"path": "docs/content/tools/bigwigAverage.rst",
"chars": 131,
"preview": "bigwigAverage\n=============\n\n.. argparse::\n :ref: deeptools.bigwigAverage.parse_arguments\n :prog: bigwigAverage\n :"
},
{
"path": "docs/content/tools/bigwigCompare.rst",
"chars": 131,
"preview": "bigwigCompare\n=============\n\n.. argparse::\n :ref: deeptools.bigwigCompare.parse_arguments\n :prog: bigwigCompare\n :"
},
{
"path": "docs/content/tools/computeGCBias.rst",
"chars": 5343,
"preview": "computeGCBias\n=============\n\n.. contents:: \n :local:\n\n.. argparse::\n :ref: deeptools.computeGCBias.parse_arguments\n"
},
{
"path": "docs/content/tools/computeMatrix.rst",
"chars": 7045,
"preview": "computeMatrix\n=============\n\n.. contents:: \n :local:\n\n.. argparse::\n :ref: deeptools.computeMatrix.parse_arguments\n"
},
{
"path": "docs/content/tools/computeMatrixOperations.rst",
"chars": 5884,
"preview": "computeMatrixOperations\n=======================\n\n.. contents:: \n :local:\n\n.. argparse::\n :ref: deeptools.computeMat"
},
{
"path": "docs/content/tools/correctGCBias.rst",
"chars": 1136,
"preview": "correctGCBias\n=============\n\n.. hint:: For background information about the GC bias assessment and correction, see :doc:"
},
{
"path": "docs/content/tools/estimateReadFiltering.rst",
"chars": 2369,
"preview": "estimateReadFiltering\n=====================\n\n.. contents:: \n :local:\n\n.. argparse::\n :ref: deeptools.estimateReadFi"
},
{
"path": "docs/content/tools/multiBamSummary.rst",
"chars": 1355,
"preview": "multiBamSummary\n================\n\n.. contents:: \n :local:\n\n.. argparse::\n :ref: deeptools.multiBamSummary.parse_arg"
},
{
"path": "docs/content/tools/multiBigwigSummary.rst",
"chars": 3041,
"preview": "multiBigwigSummary\n==================\n\n.. contents:: \n :local:\n\n.. argparse::\n :ref: deeptools.multiBigwigSummary.p"
},
{
"path": "docs/content/tools/plotCorrelation.rst",
"chars": 5316,
"preview": "plotCorrelation\n===============\n\n.. contents:: \n :local:\n\n.. argparse::\n :ref: deeptools.plotCorrelation.parse_argu"
},
{
"path": "docs/content/tools/plotCoverage.rst",
"chars": 2166,
"preview": "plotCoverage\n============\n\n.. contents:: \n :local:\n\n.. argparse::\n :ref: deeptools.plotCoverage.parse_arguments\n "
},
{
"path": "docs/content/tools/plotEnrichment.rst",
"chars": 1342,
"preview": "plotEnrichment\n==============\n\n.. contents:: \n :local:\n\n.. argparse::\n :ref: deeptools.plotEnrichment.parse_argumen"
},
{
"path": "docs/content/tools/plotFingerprint.rst",
"chars": 4144,
"preview": "plotFingerprint\n===============\n\nThis quality control will most likely be of interest for you if you are dealing with Ch"
},
{
"path": "docs/content/tools/plotHeatmap.rst",
"chars": 5416,
"preview": "plotHeatmap\n===========\n\n.. contents:: \n :local:\n\n.. argparse::\n :ref: deeptools.plotHeatmap.parse_arguments\n :pr"
},
{
"path": "docs/content/tools/plotPCA.rst",
"chars": 1779,
"preview": "plotPCA\n=======\n\n.. contents:: \n :local:\n\n.. argparse::\n :ref: deeptools.plotPCA.parse_arguments\n :prog: plotPCA\n"
},
{
"path": "docs/content/tools/plotProfile.rst",
"chars": 3816,
"preview": "plotProfile\n===========\n\n.. argparse::\n :ref: deeptools.plotProfile.parse_arguments\n :prog: plotProfile\n :nodefaul"
},
{
"path": "docs/images/gallery/Whyte_TypicalEnhancers_ESC.bed",
"chars": 286473,
"preview": "chr1\t3052873\t3053282\tNO\t0\nchr1\t3472669\t3473522\tNO\t34.6318\nchr1\t3638904\t3639380\tNO\t12.7092\nchr1\t3904119\t3904709\tNO\t0\nchr1"
},
{
"path": "docs/index.rst",
"chars": 2890,
"preview": "=====================================================\ndeepTools: *tools for exploring deep sequencing data*\n============"
},
{
"path": "docs/requirements.txt",
"chars": 72,
"preview": "sphinx==7.2.6\nmock==5.1.0\nsphinx_rtd_theme==2.0.0\nsphinx-argparse==0.4.0"
},
{
"path": "docs/source/_templates/layout.html",
"chars": 222,
"preview": "{% extends \"!layout.html\" %}\n{% set script_files = script_files + [\"_static/welcome_owl.carousel.min.js\"] %}\n{% set css_"
},
{
"path": "docs/source/deeptools.rst",
"chars": 2658,
"preview": "deeptools package modules\n=========================\n\n\ndeeptools.SES_scaleFactor module\n--------------------------------\n"
},
{
"path": "docs/source/modules.rst",
"chars": 64,
"preview": "deeptools\n=========\n\n.. toctree::\n :maxdepth: 4\n\n deeptools\n"
},
{
"path": "galaxy/workflows/1_BAM_file_TO_Heatmap_of_read_coverages.ga",
"chars": 12321,
"preview": "{\n \"a_galaxy_workflow\": \"true\", \n \"annotation\": \"\", \n \"format-version\": \"0.1\", \n \"name\": \"1 BAM file -->(clu"
},
{
"path": "galaxy/workflows/2_BAM_files_TO_clustered_Heatmap_of_read_coverages.ga",
"chars": 13466,
"preview": "{\n \"a_galaxy_workflow\": \"true\", \n \"annotation\": \"\", \n \"format-version\": \"0.1\", \n \"name\": \"2 BAM files -->(cl"
},
{
"path": "galaxy/workflows/Add_chr_to_first_column_of_a_6_columns_BED_file.ga",
"chars": 5139,
"preview": "{\n \"a_galaxy_workflow\": \"true\", \n \"annotation\": \"\", \n \"format-version\": \"0.1\", \n \"name\": \"Add 'chr' to first"
},
{
"path": "galaxy/workflows/Clustered_heatmap_of_signals_around_the_TSSs__1_bigWig_TO_heatmap.ga",
"chars": 9463,
"preview": "{\n \"a_galaxy_workflow\": \"true\", \n \"annotation\": \"\", \n \"format-version\": \"0.1\", \n \"name\": \"Clustered heatmap "
},
{
"path": "galaxy/workflows/Compute_and_correct_GC_bias.ga",
"chars": 6198,
"preview": "{\n \"a_galaxy_workflow\": \"true\", \n \"annotation\": \"\", \n \"format-version\": \"0.1\", \n \"name\": \"Compute and correc"
},
{
"path": "galaxy/workflows/Remove_chr_from_the_beginning_of_genomic_interval_files.ga",
"chars": 2305,
"preview": "{\n \"a_galaxy_workflow\": \"true\", \n \"annotation\": \"\", \n \"format-version\": \"0.1\", \n \"name\": \"Remove 'chr' from "
},
{
"path": "galaxy/workflows/readme.rst",
"chars": 917,
"preview": "This package contains a collection of Galaxy workflows utilising deepTools.\n\nSee http://www.galaxyproject.org for inform"
},
{
"path": "galaxy/workflows/repository_dependencies.xml",
"chars": 172,
"preview": "<?xml version=\"1.0\"?>\n<repositories description=\"These workflows requires the deepTools repository.\">\n <repository na"
},
{
"path": "galaxy/wrapper/.shed.yml",
"chars": 2719,
"preview": "categories:\n- ChIP-seq\n- Convert Formats\n- Sequence Analysis\n- Visualization\ndescription: \"deepTools: User-friendly tool"
},
{
"path": "galaxy/wrapper/alignmentSieve.xml",
"chars": 9725,
"preview": "<tool id=\"deeptools_alignmentsieve\" name=\"alignmentsieve\" version=\"@TOOL_VERSION@+galaxy0\" profile=\"@GALAXY_VERSION@\">\n "
},
{
"path": "galaxy/wrapper/bamCompare.xml",
"chars": 12367,
"preview": "<tool id=\"deeptools_bam_compare\" name=\"bamCompare\" version=\"@TOOL_VERSION@+galaxy0\" profile=\"@GALAXY_VERSION@\">\n <des"
},
{
"path": "galaxy/wrapper/bamCoverage.xml",
"chars": 15027,
"preview": "<tool id=\"deeptools_bam_coverage\" name=\"bamCoverage\" version=\"@TOOL_VERSION@+galaxy0\" profile=\"@GALAXY_VERSION@\">\n <d"
},
{
"path": "galaxy/wrapper/bamPEFragmentSize.xml",
"chars": 8547,
"preview": "<tool id=\"deeptools_bam_pe_fragmentsize\" name=\"bamPEFragmentSize\" version=\"@TOOL_VERSION@+galaxy0\" profile=\"@GALAXY_VERS"
},
{
"path": "galaxy/wrapper/bigwigAverage.xml",
"chars": 4917,
"preview": "<tool id=\"deeptools_bigwig_average\" name=\"bigwigAverage\" version=\"@TOOL_VERSION@+galaxy0\" profile=\"@GALAXY_VERSION@\">\n "
},
{
"path": "galaxy/wrapper/bigwigCompare.xml",
"chars": 6912,
"preview": "<tool id=\"deeptools_bigwig_compare\" name=\"bigwigCompare\" version=\"@TOOL_VERSION@+galaxy0\" profile=\"@GALAXY_VERSION@\">\n "
},
{
"path": "galaxy/wrapper/computeGCBias.xml",
"chars": 9894,
"preview": "<tool id=\"deeptools_compute_gc_bias\" name=\"computeGCBias\" version=\"@TOOL_VERSION@+galaxy0\" profile=\"@GALAXY_VERSION@\">\n "
},
{
"path": "galaxy/wrapper/computeMatrix.xml",
"chars": 17914,
"preview": "<tool id=\"deeptools_compute_matrix\" name=\"computeMatrix\" version=\"@TOOL_VERSION@+galaxy0\" profile=\"@GALAXY_VERSION@\">\n "
},
{
"path": "galaxy/wrapper/computeMatrixOperations.xml",
"chars": 13764,
"preview": "<tool id=\"deeptools_compute_matrix_operations\" name=\"computeMatrixOperations\" version=\"@TOOL_VERSION@+galaxy0\" profile=\""
},
{
"path": "galaxy/wrapper/correctGCBias.xml",
"chars": 3695,
"preview": "<tool id=\"deeptools_correct_gc_bias\" name=\"correctGCBias\" version=\"@TOOL_VERSION@+galaxy0\" profile=\"@GALAXY_VERSION@\">\n "
}
]
// ... and 125 more files (download for full content)
About this extraction
This page contains the full source code of the deeptools/deepTools GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 325 files (7.9 MB), approximately 2.1M tokens, and a symbol index with 420 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.