Skip to content

Commit

Permalink
Merge pull request #386 from deeptools/develop
Browse files Browse the repository at this point in the history
Release 3.7
  • Loading branch information
lldelisle authored Mar 22, 2022
2 parents 488a6d3 + b832a7b commit c42e74e
Show file tree
Hide file tree
Showing 210 changed files with 25,607 additions and 922 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# yaml file to configure readthedocs build
python:
version: 3.6
version: 3.7
setup_py_install: true
pip_install: False
65 changes: 0 additions & 65 deletions .travis.yml

This file was deleted.

67 changes: 43 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[![PyPI Version](https://img.shields.io/pypi/v/pyGenomeTracks.svg?style=plastic)](https://pypi.org/project/pyGenomeTracks/) [![bioconda-badge](https://img.shields.io/conda/vn/bioconda/pyGenomeTracks.svg?style=plastic)](https://anaconda.org/bioconda/pygenometracks)
[![bioconda-badge](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=plastic)](http://bioconda.github.io)
[![Build Status](https://travis-ci.org/deeptools/pyGenomeTracks.svg?branch=master)](https://travis-ci.org/deeptools/pyGenomeTracks)
[![Build Status on Azure](https://dev.azure.com/wolffj/pyGenomeTracks/_apis/build/status/deeptools.pyGenomeTracks?branchName=master)](https://dev.azure.com/wolffj/pyGenomeTracks/_build/latest?definitionId=2&branchName=master)
![Coverage](./docs/coverage.svg)
[![European Galaxy server](https://img.shields.io/badge/usegalaxy-.eu-brightgreen?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAASCAYAAABB7B6eAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsTAAALEwEAmpwYAAACC2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENv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KihmaDacU2GiR0Ohcc4cZ+Kq3AjlEnEeRSazLs6/9b/kh4eTC+hngE3QQD7Yyclxsrf3cpxsPXn+cFdenF9aqlBXMXaDiEyfyfawBz2RqC/O9WF1ysacOpytlUSoqNrtfbS642+4D4CS9V3xb4u8P/ACI4O810efRu6KsC0QnjHJGaq4IOGUjWTo/YDZDB3xSIxcGyNlWcTucb4T3in/3IaueNrZyX0lGOrWndstOr+w21UlVFokILjJLFhPukbVY8OmwNQ3nZgNJNmKDccusSb4UIe+gtkI+9/bSLJDjqn763f5CQ5TLApmICkqwR0QnUPKZFIUnoozWcQuRbC0Km02knj0tPYx63furGs3x/iPnz83zJDVNtdP3QAAAABJRU5ErkJggg==)](https://usegalaxy.eu/root?tool_id=pygenomeTracks)


pyGenomeTracks
==============

Expand All @@ -17,10 +16,13 @@ are highly customizable. Currently, it is possible to plot:
* bigwig
* bed/gtf (many options)
* bedgraph
* bedgraph matrices (like TAD-separation scores)
* epilogos
* narrow peaks
* links (represented as arcs)
* Hi-C matrices
* links (represented as arcs, triangles or squares)
* Hi-C matrices (as triangle or squares)
* fasta
* maf (multiple alignment format)

Here is a scheme which describe how pyGenomeTracks is working (graphical abstract of [Lopez-Delisle et al. 2020](https://doi.org/10.1093/bioinformatics/btaa692)):

Expand All @@ -33,60 +35,76 @@ pyGenomeTracks from [Ramírez et al. 2017](https://www.nature.com/articles/s4146

Table of content
----------------
* [Installation](#installation)
* [Usage](#usage)
* [Citation](#citation)
* [Documentation](#documentation)
* [External users](#external-users)


* [Installation](#installation)
* [Usage](#usage)
* [Citation](#citation)
* [Documentation](#documentation)
* [External users](#external-users)

Installation
------------
pyGenomeTracks works with python >=3.6.

pyGenomeTracks works with python >=3.7.

The recommended way to install pyGenomeTracks is via conda

```bash
$ conda create -n pygenometracks -c bioconda -c conda-forge pygenometracks python=3.7
conda create -n pygenometracks -c bioconda -c conda-forge pygenometracks python=3.7
```

To get a specific version, one can specify it. For example:

```bash
$ conda create -n pygenometracks -c bioconda -c conda-forge pygenometracks=3.5 python=3.7
conda create -n pygenometracks -c bioconda -c conda-forge pygenometracks=3.5 python=3.7
```

Also, pyGenomeTracks can be installed using pip
However, we noticed that conda installation can be quite slow so using mamba can help.
You first need to create the environment and install mamba:

```bash
$ pip install pyGenomeTracks
conda create -n pygenometracks -c bioconda -c conda-forge mamba python=3.7
```

Since version 3.5, pyGenomeTracks uses BEDTools, don't forget to install it or load it into your environment
Then activate the environment and install pygenometracks with mamba:

```bash
conda activate pygenometracks
mamba install -c defaults -c bioconda -c conda-forge pygenometracks
```

If the latest version wants to be installed use:
or if you want a specific version:

```bash
$ pip install git+https://github.com/deeptools/pyGenomeTracks.git
conda create -n pygenometracks -c bioconda -c conda-forge mamba python=3.7
conda activate pygenometracks
mamba install -c defaults -c bioconda -c conda-forge pygenometracks=3.5
```

Also, pyGenomeTracks can be installed using pip

```bash
pip install pyGenomeTracks
```

Since version 3.5, pyGenomeTracks uses BEDTools, don't forget to install it or load it into your environment.

Usage
-----

To run pyGenomeTracks a configuration file describing the tracks is required. The easiest way to create this file is using the program `make_tracks_file` which creates a configuration file with
defaults that can be easily changed. The format is:

```bash
$ make_tracks_file --trackFiles <file1.bed> <file2.bw> ... -o tracks.ini
make_tracks_file --trackFiles <file1.bed> <file2.bw> ... -o tracks.ini
```

`make_tracks_file` uses the file ending to guess the file type.

Then, a region can be plotted using:

```bash
$ pyGenomeTracks --tracks tracks.ini --region chr2:10,000,000-11,000,000 --outFileName nice_image.pdf
pyGenomeTracks --tracks tracks.ini --region chr2:10,000,000-11,000,000 --outFileName nice_image.pdf
```

The ending `--outFileName` defines the image format. If `.pdf` is used, then the resulting image is a pdf. The options are pdf, png and svg.
Expand All @@ -102,8 +120,9 @@ optional arguments:
--region REGION Region to plot, the format is chr:start-end
--BED BED Instead of a region, a file containing the regions to
plot, in BED format, can be given. If this is the
case, multiple files will be created using a prefix
the value of --outFileName
case, multiple files will be created. It will use the
value of --outFileName as a template and put the
coordinates between the file name and the extension.
--width WIDTH figure width in centimeters (default is 40)
--plotWidth PLOTWIDTH
width in centimeters of the plotting (central) part
Expand Down Expand Up @@ -136,14 +155,14 @@ optional arguments:
<!--- End of possible arguments of pgt -->

Citation
---------
--------

If you use pyGenomeTracks in your analysis, you can cite the following papers:

Fidel Ramírez, Vivek Bhardwaj, Laura Arrigoni, Kin Chung Lam, Björn A. Grüning, José Villaveces, Bianca Habermann, Asifa Akhtar & Thomas Manke. High-resolution TADs reveal DNA sequences underlying genome organization in flies. Nature Communications (2018) [doi:10.1038/s41467-017-02525-w](https://www.nature.com/articles/s41467-017-02525-w)

Lopez-Delisle L, Rabbani L, Wolff J, Bhardwaj V, Backofen R, Grüning B, Ramírez F, Manke T. pyGenomeTracks: reproducible plots for multivariate genomic data sets. Bioinformatics. 2020 Aug 3:btaa692. [doi: 10.1093/bioinformatics/btaa692](https://doi.org/10.1093/bioinformatics/btaa692). Epub ahead of print. PMID: 32745185.


Documentation
-------------

Expand Down
118 changes: 118 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
pr:
autoCancel: true

stages:
- stage: test
jobs:
- job: Linux
timeoutInMinutes: 0
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python37LowMatplotlib:
python.version: '3.7'
matplotlib.version: '3.1.1'
Python37HighMatplotlib:
python.version: '3.7'
matplotlib.version: '3.5.1'
Python38LowMatplotlib:
python.version: '3.8'
matplotlib.version: '3.1.1'
Python38HighMatplotlib:
python.version: '3.8'
matplotlib.version: '3.5.1'
Python39HighMatplotlib:
python.version: '3.9'
matplotlib.version: '3.5.1'

steps:
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
hash -r
displayName: Add conda to PATH
- bash: |
conda config --set always_yes yes --set changeps1 no
conda info -a
cat requirements_CI.txt | awk -v v=$(matplotlib.version) '{if($0~/matplotlib/){$0="matplotlib =="v}; print}' > requirements_CI_updated.txt
conda create -n pygenometracks --yes -c conda-forge -c bioconda python=$(python.version) mamba
source activate pygenometracks
mamba install --yes -c defaults -c conda-forge -c bioconda --file requirements_CI_updated.txt
python setup.py install
displayName: installing dependencies
- script: |
source activate pygenometracks
flake8 . --exclude=.venv,.build,build --ignore=E501,F403,E402,F999,F405,E712,W503
displayName: linting
- script: |
source activate pygenometracks
py.test pygenometracks --doctest-modules -n 4
displayName: pytest
- job: OSX
timeoutInMinutes: 0
pool:
vmImage: 'macOS-11'
strategy:
matrix:
Python37LowMatplotlib:
python.version: '3.7'
matplotlib.version: '3.1.1'
Python37HighMatplotlib:
python.version: '3.7'
matplotlib.version: '3.5.1'
Python38LowMatplotlib:
python.version: '3.8'
matplotlib.version: '3.1.1'
Python38HighMatplotlib:
python.version: '3.8'
matplotlib.version: '3.5.1'
Python39HighMatplotlib:
python.version: '3.9'
matplotlib.version: '3.5.1'

steps:
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
hash -r
displayName: Add conda to PATH
# On Hosted macOS, the agent user doesn't have ownership of Miniconda's installation directory/
# We need to take ownership if we want to update conda or install packages globally
- bash: sudo chown -R $USER $CONDA
displayName: Take ownership of conda installation
- bash: |
conda config --set always_yes yes --set changeps1 no
conda info -a
cat requirements_CI.txt | awk -v v=$(matplotlib.version) '{if($0~/matplotlib/){$0="matplotlib =="v}; print}' > requirements_CI_updated.txt
conda create -n pygenometracks --yes -c conda-forge -c bioconda python=$(python.version) mamba
source activate pygenometracks
mamba install --yes -c defaults -c conda-forge -c bioconda --file requirements_CI_updated.txt
python setup.py install
displayName: installing dependencies
- script: |
source activate pygenometracks
flake8 . --exclude=.venv,.build,build --ignore=E501,F403,E402,F999,F405,E712,W503
displayName: linting
- script: |
source activate pygenometracks
py.test pygenometracks --doctest-modules -n 4
displayName: pytest
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/master') }}:
- stage: Deploy
dependsOn: [test]
condition: succeeded()
jobs:
- job: pypi
pool:
vmImage: 'Ubuntu-latest'
container: python:3.8
steps:
- script: |
python setup.py sdist bdist_wheel
python -m pip install --user --upgrade twine
python -m twine upload -r pypi dist/*
env:
TWINE_USERNAME: lldelisle
TWINE_PASSWORD: $(TWINE_LUCILLE_PASSWORD)
displayName: 'Push to Python Package Index'
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@
MOCK_MODULES = ['pygenometracks.tracksClass', # (required for both)
# For plotTracks in plotTracks
'matplotlib',
'matplotlib.pyplot',
# For plotTracks in utilities
'matplotlib.ticker',
'numpy',
'tqdm',
'pyfaidx',
'intervaltree',
'pybedtools']

Expand Down Expand Up @@ -70,7 +73,7 @@ def get_version():
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinxarg.ext']
extensions = ['sphinx_rtd_theme', 'sphinxarg.ext']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
Loading

0 comments on commit c42e74e

Please sign in to comment.