Skip to content

Commit

Permalink
Merge pull request #315 from deeptools/develop
Browse files Browse the repository at this point in the history
Release 3.6
  • Loading branch information
lldelisle authored Nov 12, 2020
2 parents 1c6b592 + 5f0353b commit ce2ec50
Show file tree
Hide file tree
Showing 154 changed files with 1,207 additions and 403 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ lib64
pip-log.txt

# Unit test / coverage reports
.coverage
.coverage*
.tox
nosetests.xml
htmlcov
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ deploy:
python:
- 3.6
- 3.7
#- 3.8
- 3.8
env:
- TRAVIS_PYTHON_VERSION=3.6
- TRAVIS_PYTHON_VERSION=3.7
#- TRAVIS_PYTHON_VERSION=3.8
- TRAVIS_PYTHON_VERSION=3.8

os:
- linux
Expand Down Expand Up @@ -58,7 +58,7 @@ before_install:
- conda update -q conda
- conda info -a
install:
- conda install --yes -c bioconda -c conda-forge python=$TRAVIS_PYTHON_VERSION --file requirements.txt
- conda install --yes -c bioconda -c conda-forge python=$TRAVIS_PYTHON_VERSION --file requirements_travis.txt
- conda install --yes -c conda-forge -c bioconda pytest nose ghostscript pathlib
- python setup.py install
script:
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ are highly customizable. Currently, it is possible to plot:
* links (represented as arcs)
* Hi-C matrices

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)):

![pyGenomeTracks](./docs/content/images/graphicalabstract.png)

pyGenomeTracks can make plots with or without Hi-C data. The following is an example output of
pyGenomeTracks from [Ramírez et al. 2017](https://www.nature.com/articles/s41467-017-02525-w)

Expand Down Expand Up @@ -99,6 +103,8 @@ optional arguments:
case, multiple files will be created using a prefix
the value of --outFileName
--width WIDTH figure width in centimeters (default is 40)
--plotWidth PLOTWIDTH
width in centimeters of the plotting (central) part
--height HEIGHT Figure height in centimeters. If not given, the figure
height is computed based on the heights of the tracks.
If given, the track height are proportionally scaled
Expand Down Expand Up @@ -129,10 +135,13 @@ optional arguments:

Citation
---------
If you use pyGenomeTracks in your analysis, you can cite the following paper :
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
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
# For plotTracks in utilities
'numpy',
'tqdm',
'intervaltree']
'intervaltree',
'pybedtools']

for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()
Expand Down
2 changes: 2 additions & 0 deletions docs/content/all_default_properties_rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ show_masked_bins
scale_factor 1
x_center not set
size not set
scalebar_start_position not set
scalebar_end_position not set
============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= =============================


Expand Down
4 changes: 3 additions & 1 deletion docs/content/citation.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Citation
========

If you use pyGenomeTracks in your analysis, you can cite the following paper :
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.
Binary file added docs/content/images/graphicalabstract.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/content/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Python dependencies:
* pyBigWig >= 0.3.16
* hicmatrix >= 15
* pysam >= 0.14
* matplotlib == 3.1.1
* matplotlib >=3.1.1,<=3.3.2
* gffutils >= 0.9
* pybedtools >= 0.8.1
* tqdm >= 4.20
Expand Down
1 change: 1 addition & 0 deletions docs/content/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Releases
.. toctree::
:maxdepth: 1

releases/3.6
releases/3.5.1
releases/3.5
releases/3.4
Expand Down
34 changes: 34 additions & 0 deletions docs/content/releases/3.6.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
3.6
===


Enhancements:
^^^^^^^^^^^^^

- A new parameter for pyGenomeTracks allow to fix the width of the central part: ``--plotWidth``

- For scale bars, you can now define the position using 2 parameters among ``x_center``, ``size``, ``scalebar_start_position`` and ``scalebar_end_position``.


Python dependency with conda:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Using conda which is the way we recommand installation it is now possible to use Python 3.8.

Relax version control on matplotlib:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Any version of matplotlib from 3.1.1 to 3.3.2 is now accepted.

Bugfixes:
^^^^^^^^^

- When the ``--fontSize`` parameter was used it happened that the colorbar labels were not corresponding to the colorbar ticks. This bug has been fixed.

- The colormap ``pink`` was not working because it was both the name of a color and a colormap. This bug has been fixed.

- When setting ``min_value``, ``max_value``, if the track was empty these values were ignored. This bug has been fixed.

- When using ``operation`` in bedgraph with a ``second_file``, BEDTools is now used to intersect the second file. ``use_middle`` is now taken into account on the second file.

- Different handling of string evaluation of color, colormap and operation.
2 changes: 1 addition & 1 deletion docs/content/tracks/auto/bedgraph_matrix_options_text.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type = lines
# the default color map is viridis
# If you want your own colormap you can put the values of the color you want
# For example, colormap = ['blue', 'yellow', 'red']
# or colormap = ['white', (1, 0.88, 2./3), (1, 0.74, 0.25), (1, 0.5, 0), (1, 0.19, 0), (0.74, 0, 0), (0.35, 0, 0)]
# or colormap = ['white', (1, 0.88, .66), (1, 0.74, 0.25), (1, 0.5, 0), (1, 0.19, 0), (0.74, 0, 0), (0.35, 0, 0)]
#colormap = Reds
# pos_score_in_bin means 'position of score with respect to bin start and end'
# if the lines option is used, the y values can be put at the
Expand Down
2 changes: 1 addition & 1 deletion docs/content/tracks/auto/hic_matrix_options_text.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# the default color map is RdYlBu_r (_r) stands for reverse
# If you want your own colormap you can put the values of the color you want
# For example, colormap = ['blue', 'yellow', 'red']
# or colormap = ['white', (1, 0.88, 2./3), (1, 0.74, 0.25), (1, 0.5, 0), (1, 0.19, 0), (0.74, 0, 0), (0.35, 0, 0)]
# or colormap = ['white', (1, 0.88, .66), (1, 0.74, 0.25), (1, 0.5, 0), (1, 0.19, 0), (0.74, 0, 0), (0.35, 0, 0)]
#colormap = RdYlBu_r
# depth is the maximum distance that should be plotted.
# If it is more than 125% of the plotted region, it will
Expand Down
4 changes: 4 additions & 0 deletions docs/content/tracks/auto/scalebar_deduced_from_code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ Optional:

- **size**: by default this option is not set but you can also put: any integer above 0

- **scalebar_start_position**: by default this option is not set but you can also put: any integer above 0

- **scalebar_end_position**: by default this option is not set but you can also put: any integer above 0

13 changes: 11 additions & 2 deletions docs/content/tracks/auto/scalebar_options_text.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,23 @@ color = black
# alpha = 0.5
# line width:
# line_width = 0.5
# To set the position and the size of the scale bar
# 4 parameters can be set:
# x_center, scalebar_start_position, scalebar_end_position, size
# scalebar_start_position need to be smaller than x_center smaller than scalebar_end_position
# x_center: coordinate where the scale bar should be plotted (center)
# if not set it will be in the middle of the plotted area
# if not set and cannot be deduce from other parameters
# it will be in the middle of the plotted area
#x_center = 3100000
# size: in bp the length of the scale bar
# if not set it will be like in UCSC:
# if not set and cannot be deduced from other parameters
# it will be like in UCSC:
# the higher number that begins with 1, 2 or 5 followed by 0s
# that is less than half the plotted area
#size = 100000
# Another example:
#scalebar_start_position = 2900000
#scalebar_end_position = 3100000
# where: where the size of the scale bar should
# appear among left, right, top, bottom
# default is left
Expand Down
4 changes: 2 additions & 2 deletions docs/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ are highly customizable. Currently, it is possible to plot:
- links
- Hi-C matrices

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>`_):

.. image:: content/images/graphicalabstract.png

pyGenomeTracks can make plots with or without Hi-C data. The following is an example output of
pyGenomeTracks from `Ramírez et al. 2017 <https://www.nature.com/articles/s41467-017-02525-w>`_.

Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channels:
- conda-forge
dependencies:
- numpy >=1.16
- matplotlib =3.1.1
- matplotlib >=3.1.1,<=3.2.2
- intervaltree >=2.1.0
- pybigwig >=0.3.16
- future >=0.17.0
Expand Down
2 changes: 1 addition & 1 deletion pygenometracks/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# This file is originally generated from Git information by running 'setup.py
# version'. Distribution tarballs contain a pre-generated copy of this file.

__version__ = '3.5.1'
__version__ = '3.6'
22 changes: 15 additions & 7 deletions pygenometracks/plotTracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,12 @@
def parse_arguments(args=None):
parser = argparse.ArgumentParser(
description='Plots genomic tracks on specified region(s). '
'Citation : Ramirez et al. High-resolution TADs reveal DNA '
'Citations :\nRamirez et al. High-resolution TADs reveal DNA '
'sequences underlying genome organization in flies. '
'Nature Communications (2018) doi:10.1038/s41467-017-02525-w',
'Nature Communications (2018) doi:10.1038/s41467-017-02525-w\n'
'Lopez-Delisle et al. pyGenomeTracks: reproducible'
' plots for multivariate genomic datasets. '
'Bioinformatics (2020) doi:10.1093/bioinformatics/btaa692',
usage="%(prog)s --tracks tracks.ini --region chr1:1000000-4000000 -o image.png")

parser.add_argument('--tracks',
Expand All @@ -179,10 +182,15 @@ def parse_arguments(args=None):
type=argparse.FileType('r')
)

parser.add_argument('--width',
help=f'figure width in centimeters (default is {DEFAULT_FIGURE_WIDTH})',
type=float,
default=DEFAULT_FIGURE_WIDTH)
width_group = parser.add_mutually_exclusive_group()
width_group.add_argument('--width',
help=f'figure width in centimeters (default is {DEFAULT_FIGURE_WIDTH})',
type=float,
default=DEFAULT_FIGURE_WIDTH)
width_group.add_argument('--plotWidth',
help='width in centimeters of the plotting (central) part',
type=float,
default=None)

parser.add_argument('--height',
help='Figure height in centimeters. If not given, the figure height is computed '
Expand Down Expand Up @@ -310,7 +318,7 @@ def main(args=None):
trp = PlotTracks(args.tracks.name, args.width, fig_height=args.height,
fontsize=args.fontSize, dpi=args.dpi,
track_label_width=args.trackLabelFraction,
plot_regions=regions)
plot_regions=regions, plot_width=args.plotWidth)

# Plot them
if args.BED:
Expand Down
10 changes: 10 additions & 0 deletions pygenometracks/tests/generateAllOutput.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ bin/pgt --tracks ./pygenometracks/tests/test_data/operation_bdg.ini --region X:2
bin/pgt --tracks ./pygenometracks/tests/test_data/bedgraph_withNA.ini --region X:2700000-3100000 --trackLabelFraction 0.2 --dpi 130 -o ./pygenometracks/tests/test_data/master_bedgraph_withNA.png
bin/pgt --tracks ./pygenometracks/tests/test_data/bedgraph_negative.ini --region X:2700000-3100000 --trackLabelFraction 0.2 --dpi 130 -o ./pygenometracks/tests/test_data/master_negative.png
bin/pgt --tracks ./pygenometracks/tests/test_data/bedgraph_end_not_covered.ini --region chr7:100-400 --trackLabelFraction 0.2 --dpi 130 -o ./pygenometracks/tests/test_data/master_bedgraph_end_not_covered.png
bin/pgt --tracks ./pygenometracks/tests/test_data/bedgraph_useMid_op.ini --region chr2:74000000-74800000 --trackLabelFraction 0.2 --dpi 130 -o ./pygenometracks/tests/test_data/master_bedgraph_useMid_op.png

# test bigWigTrack:
bin/pgt --tracks ./pygenometracks/tests/test_data/bigwig.ini --region X:2700000-3100000 --trackLabelFraction 0.2 --dpi 130 -o ./pygenometracks/tests/test_data/master_bigwig.png
Expand All @@ -45,6 +46,10 @@ bin/pgt --tracks ./pygenometracks/tests/test_data/operation.ini --region fakeChr
bin/pgt --tracks ./pygenometracks/tests/test_data/grid.ini --region X:2700000-3100000 --trackLabelFraction 0.2 --dpi 130 -o ./pygenometracks/tests/test_data/master_grid.png
bin/pgt --tracks ./pygenometracks/tests/test_data/example_bigwig.ini --region X:2,500,000-3,000,000 -o ./pygenometracks/tests/test_data/master_example_bigwig.png
bin/pgt --tracks ./pygenometracks/tests/test_data/example_op.ini --region 2L:0-1000 -o ./pygenometracks/tests/test_data/master_operation_2L.png
bin/pgt --tracks ./pygenometracks/tests/test_data/example_bigwig.ini --region X:2,500,000-3,000,000 --width 12 -o ./pygenometracks/tests/test_data/master_example_bigwig_width12.png
bin/pgt --tracks ./pygenometracks/tests/test_data/example_bigwig.ini --region X:2,500,000-3,000,000 --plotWidth 12 -o ./pygenometracks/tests/test_data/master_example_bigwig_plotwidth12.png
bin/pgt --tracks ./pygenometracks/tests/test_data/example_bigwig.ini --region X:2,500,000-3,000,000 --plotWidth 12 --trackLabelFraction 0.5 -o ./pygenometracks/tests/test_data/master_example_bigwig_plotwidth12Lab0.5.png
bin/pgt --tracks ./pygenometracks/tests/test_data/example_op2.ini --region X:2700000-3100000 --trackLabelFraction 0.2 --dpi 130 -o ./pygenometracks/tests/test_data/master_operation_scien.png

# test_epilogosTrack:
bin/pgt --tracks ./pygenometracks/tests/test_data/epilogos.ini --region X:3100000-3150000 --trackLabelFraction 0.2 --dpi 130 -o ./pygenometracks/tests/test_data/master_epilogos.png
Expand All @@ -65,6 +70,7 @@ bin/pgt --tracks ./pygenometracks/tests/test_data/browser_tracks_hic_one_interac
bin/pgt --tracks ./pygenometracks/tests/test_data/browser_tracks_hic_one_interaction_cool.ini --region chrY:0-1000000 --trackLabelFraction 0.23 --width 38 -o ./pygenometracks/tests/test_data/master_plot_hic_one_interaction_withRegion_chrY-0-1000000.png
bin/pgt --tracks ./pygenometracks/tests/test_data/browser_tracks_hic_one_interaction_diag_h5.ini --region chrY:0-1000000 --trackLabelFraction 0.23 --width 38 -o ./pygenometracks/tests/test_data/master_plot_hic_one_interaction_diag_chrY-0-1000000.png
bin/pgt --tracks ./pygenometracks/tests/test_data/browser_tracks_hic_small_test_3.ini --region chr1:0-200000 --trackLabelFraction 0.23 --width 38 --dpi 130 -o ./pygenometracks/tests/test_data/master_hic_small_test_3.png
bin/pgt --tracks ./pygenometracks/tests/test_data/browser_tracks_hic_force_scale.ini --region X:2500000-3500000 --trackLabelFraction 0.23 --width 38 --dpi 130 --fontSize 16 -o ./pygenometracks/tests/test_data/master_plot_hic_force_scale.png

# test_logScale:
bin/pgt --tracks ./pygenometracks/tests/test_data/log1p.ini --region X:2700000-3100000 --trackLabelFraction 0.2 --dpi 130 -o ./pygenometracks/tests/test_data/master_log1p.png
Expand Down Expand Up @@ -106,3 +112,7 @@ bin/pgt --tracks ./pygenometracks/tests/test_data/arcs_no_score.ini --region X:3
# tests scaleBar
bin/pgt --tracks pygenometracks/tests/test_data/scale_bar.ini --region X:3200000-3300000 --trackLabelFraction 0.2 --width 38 --dpi 130 -o pygenometracks/tests/test_data/master_scale_bar_zoom.png
bin/pgt --tracks pygenometracks/tests/test_data/scale_bar.ini --region X:3000000-3300000 --trackLabelFraction 0.2 --width 38 --dpi 130 -o pygenometracks/tests/test_data/master_scale_bar.png
bin/pgt --tracks pygenometracks/tests/test_data/scale_bar_startend.ini --region X:3000000-3600000 --trackLabelFraction 0.2 --width 38 --dpi 130 -o pygenometracks/tests/test_data/master_scale_bar_startend.png
bin/pgt --tracks pygenometracks/tests/test_data/scale_bar_startend.ini --region X:3000000-3600000 --trackLabelFraction 0.2 --width 38 --dpi 130 --decreasingXAxis -o pygenometracks/tests/test_data/master_scale_bar_startend_dec.png
bin/pgt --tracks pygenometracks/tests/test_data/scale_bar_startend.ini --region X:2000000000-2500000000 --trackLabelFraction 0.2 --width 38 --dpi 130 -o pygenometracks/tests/test_data/master_scale_bar_startend_outside.png
bin/pgt --tracks pygenometracks/tests/test_data/scale_bar_startend.ini --region X:3199500-3201000 --trackLabelFraction 0.2 --width 38 --dpi 130 -o pygenometracks/tests/test_data/master_scale_bar_startend_superzoom.png
4 changes: 2 additions & 2 deletions pygenometracks/tests/test_bedGraphMatrixTrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
[test bedgraph matrix]
file = tad_separation_score.bm.gz
title = bedgraph matrix (file type is tabix) colormap = Reds
title = bedgraph matrix (file type is tabix) colormap = pink
height = 5
colormap = Reds
colormap = pink
file_type = bedgraph_matrix
[spacer]
Expand Down
Loading

0 comments on commit ce2ec50

Please sign in to comment.