Skip to content

Commit

Permalink
Merge pull request #283 from deeptools/updateDocBEDTools
Browse files Browse the repository at this point in the history
Update doc BEDTools
  • Loading branch information
lldelisle authored Oct 7, 2020
2 parents 8a2630b + ae923af commit 536c485
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 13 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ Also, pyGenomeTracks can be installed using pip
$ pip install pyGenomeTracks
```

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


If the latest version wants to be installed use:

```bash
Expand Down
10 changes: 10 additions & 0 deletions docs/content/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ when you were providing ``cool`` file from `cooler balance <https://cooler.readt
If you want to keep the old scale you need to downgrade to HiCMatrix version 12 but version 13 also correct some bugs so we advice
to change your ``max_value`` in your parameter file to adjust to the new scale.

No output generated with version 3.5 installed with pip
-------------------------------------------------------
If you used pyGenomeTracks version 3.5 and the last line you get is:

.. code:: bash
INFO:pygenometracks.tracksClass:initialize x. [xxxxx]
It is highly probable that BEDTools is not installed or not loaded in your environment.

My Hi-C plot looks like no correction was applied when using cool matrix
------------------------------------------------------------------------
pyGenomeTracks is using `HiCMatrix <https://github.com/deeptools/HiCMatrix>`_ to read the matrix from ``cool`` format.
Expand Down
26 changes: 18 additions & 8 deletions docs/content/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,22 @@ Remember -- pyGenomeTracks is available for **command line usage** as well as fo
Requirements
-------------

* Python >=3.6
Python dependencies:

* Python >= 3.6
* numpy >= 1.16
* intervaltree >=2.1.0
* pyBigWig >= 0.3.4
* hicmatrix >= 0.14
* pysam >= 0.8
* matplotlib >= 3.1.1
* gffutils >=0.9
* intervaltree >= 2.1.0
* pyBigWig >= 0.3.16
* hicmatrix >= 15
* pysam >= 0.14
* matplotlib == 3.1.1
* gffutils >= 0.9
* pybedtools >= 0.8.1
* tqdm >= 4.20

External dependencies:

* BEDTools

Command line installation using ``conda``
-----------------------------------------
Expand All @@ -44,6 +52,8 @@ Install pyGenomeTracks using the following command:

All python requirements should be automatically installed.

Since version 3.5, pyGenomeTracks require BEDTools, do not forget to install it or load it into your environment.

If you need to specify a specific path for the installation of the tools, make use of `pip install`'s numerous options:

.. code:: bash
Expand All @@ -55,7 +65,7 @@ Command line installation without ``pip``

You are highly recommended to use `conda install` rather than the following complicated steps.

1. Install the requirements listed above in the "requirements" section. This is done automatically by `pip`.
1. Install the requirements listed above in the "requirements" section. This is done automatically by `pip` (except BEDTools).

2. Download source code
::
Expand Down
8 changes: 8 additions & 0 deletions pygenometracks/tests/test_bedGraphTrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,14 @@ def test_plot_bedgraph_tracks_rasterize():
ini_file = os.path.join(ROOT, "bedgraph_useMid.ini")
region = "chr2:73,800,000-75,744,000"
expected_file = os.path.join(ROOT, 'master_bedgraph_useMid.pdf')
# matplotlib compare on pdf will create a png next to it.
# To avoid issues related to write in test_data folder
# We copy the expected file into a temporary place
new_expected_file = NamedTemporaryFile(suffix='.pdf',
prefix='pyGenomeTracks_test_',
delete=False)
os.system(f'cp {expected_file} {new_expected_file.name}')
expected_file = new_expected_file.name
args = f"--tracks {ini_file} --region {region} "\
"--trackLabelFraction 0.2 --width 38 --dpi 130 "\
f"--outFileName {outfile.name}".split()
Expand Down
21 changes: 16 additions & 5 deletions pygenometracks/tests/test_hiCMatrixTracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,19 @@ def test_plot_tracks_with_hic_rasterize_height_2chr():
output_file = outfile.name[:-4] + '_' + region_str + extension
expected_file = os.path.join(ROOT, 'master_plot_hic_rasterize_height_'
+ region_str + extension)
# matplotlib compare on pdf will create a png next to it.
# To avoid issues related to write in test_data folder
# We copy the expected file into a temporary place
new_expected_file = NamedTemporaryFile(suffix='.pdf',
prefix='pyGenomeTracks_test_',
delete=False)
os.system(f'cp {expected_file} {new_expected_file.name}')
expected_file = new_expected_file.name
res = compare_images(expected_file,
output_file, tolerance)
assert res is None, res

os.remove(output_file)
if extension == '.pdf':
os.remove(expected_file.replace(extension, '_pdf.png'))


def test_plot_tracks_with_hic_rasterize_height_2chr_individual():
Expand All @@ -485,15 +491,20 @@ def test_plot_tracks_with_hic_rasterize_height_2chr_individual():
delete=False)
expected_file = os.path.join(ROOT, 'master_plot_hic_rasterize_height_'
+ region.replace(':', '-') + extension)

# matplotlib compare on pdf will create a png next to it.
# To avoid issues related to write in test_data folder
# We copy the expected file into a temporary place
new_expected_file = NamedTemporaryFile(suffix='.pdf',
prefix='pyGenomeTracks_test_',
delete=False)
os.system(f'cp {expected_file} {new_expected_file.name}')
expected_file = new_expected_file.name
args = f"--tracks {ini_file} --region {region} "\
"--trackLabelFraction 0.23 --width 38 --dpi 10 "\
f"--outFileName {outfile.name}".split()
pygenometracks.plotTracks.main(args)
res = compare_images(expected_file,
outfile.name, tolerance)
if extension == '.pdf':
os.remove(expected_file.replace(extension, '_pdf.png'))
assert res is None, res


Expand Down

0 comments on commit 536c485

Please sign in to comment.