diff --git a/.gitignore b/.gitignore index b23f4a22..d18424e8 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ lib64 pip-log.txt # Unit test / coverage reports -.coverage +.coverage* .tox nosetests.xml htmlcov diff --git a/README.md b/README.md index 38466932..242d1236 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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 ------------- diff --git a/docs/conf.py b/docs/conf.py index f4c90384..25ed1624 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -29,7 +29,8 @@ # For plotTracks in utilities 'numpy', 'tqdm', - 'intervaltree'] + 'intervaltree', + 'pybedtools'] for mod_name in MOCK_MODULES: sys.modules[mod_name] = Mock() diff --git a/docs/content/all_default_properties_rst.txt b/docs/content/all_default_properties_rst.txt index 81e0a467..4c284438 100644 --- a/docs/content/all_default_properties_rst.txt +++ b/docs/content/all_default_properties_rst.txt @@ -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 ============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= ============================= diff --git a/docs/content/citation.rst b/docs/content/citation.rst index b94ebc8b..93f592f5 100644 --- a/docs/content/citation.rst +++ b/docs/content/citation.rst @@ -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 `_. + +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 `_. Epub ahead of print. PMID: 32745185. diff --git a/docs/content/images/graphicalabstract.png b/docs/content/images/graphicalabstract.png new file mode 100644 index 00000000..260dbfd4 Binary files /dev/null and b/docs/content/images/graphicalabstract.png differ diff --git a/docs/content/installation.rst b/docs/content/installation.rst index 283df5f7..3815d8dd 100644 --- a/docs/content/installation.rst +++ b/docs/content/installation.rst @@ -18,7 +18,7 @@ Python dependencies: * pyBigWig >= 0.3.16 * hicmatrix >= 15 * pysam >= 0.14 -* matplotlib >=3.1.1,<=3.2.2 +* matplotlib >=3.1.1,<=3.3.2 * gffutils >= 0.9 * pybedtools >= 0.8.1 * tqdm >= 4.20 diff --git a/docs/content/releases.rst b/docs/content/releases.rst index f7bc8877..8ac73f59 100644 --- a/docs/content/releases.rst +++ b/docs/content/releases.rst @@ -4,6 +4,7 @@ Releases .. toctree:: :maxdepth: 1 + releases/3.6 releases/3.5.1 releases/3.5 releases/3.4 diff --git a/docs/content/releases/3.6.rst b/docs/content/releases/3.6.rst new file mode 100644 index 00000000..6614efd2 --- /dev/null +++ b/docs/content/releases/3.6.rst @@ -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. diff --git a/docs/content/tracks/auto/bedgraph_matrix_options_text.txt b/docs/content/tracks/auto/bedgraph_matrix_options_text.txt index d8d2f32f..58369425 100644 --- a/docs/content/tracks/auto/bedgraph_matrix_options_text.txt +++ b/docs/content/tracks/auto/bedgraph_matrix_options_text.txt @@ -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 diff --git a/docs/content/tracks/auto/hic_matrix_options_text.txt b/docs/content/tracks/auto/hic_matrix_options_text.txt index 45ab861e..d575476d 100644 --- a/docs/content/tracks/auto/hic_matrix_options_text.txt +++ b/docs/content/tracks/auto/hic_matrix_options_text.txt @@ -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 diff --git a/docs/content/tracks/auto/scalebar_deduced_from_code.txt b/docs/content/tracks/auto/scalebar_deduced_from_code.txt index eb4a8acb..e234032b 100644 --- a/docs/content/tracks/auto/scalebar_deduced_from_code.txt +++ b/docs/content/tracks/auto/scalebar_deduced_from_code.txt @@ -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 + diff --git a/docs/content/tracks/auto/scalebar_options_text.txt b/docs/content/tracks/auto/scalebar_options_text.txt index 20cec025..d903a4c3 100644 --- a/docs/content/tracks/auto/scalebar_options_text.txt +++ b/docs/content/tracks/auto/scalebar_options_text.txt @@ -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 diff --git a/docs/index.rst b/docs/index.rst index 4bda07bc..cc8a05b6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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 `_): + +.. 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 `_. diff --git a/pygenometracks/_version.py b/pygenometracks/_version.py index 2c9603d5..cf7203b6 100644 --- a/pygenometracks/_version.py +++ b/pygenometracks/_version.py @@ -2,4 +2,4 @@ # This file is originally generated from Git information by running 'setup.py # version'. Distribution tarballs contain a pre-generated copy of this file. -__version__ = '3.5.1' +__version__ = '3.6' diff --git a/pygenometracks/plotTracks.py b/pygenometracks/plotTracks.py index 30abf9b5..d9308875 100644 --- a/pygenometracks/plotTracks.py +++ b/pygenometracks/plotTracks.py @@ -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', diff --git a/setup.py b/setup.py index 154479a0..382492bd 100644 --- a/setup.py +++ b/setup.py @@ -106,8 +106,7 @@ def checkProgramIsInstalled(self, program, args, where_to_download, setup( name='pyGenomeTracks', version=get_version(), - author='Fidel Ramírez, Vivek Bhardwaj, Joachim Wolf, Björn Grüning', - author_email='deeptools@googlegroups.com', + author='Lucille Lopez-Delisle, Leily Rabbani, Joachim Wolf, Björn Grüning', packages=find_packages(exclude=['tests']), scripts=['bin/make_tracks_file', 'bin/pgt', 'bin/pyGenomeTracks'], include_package_data=True,