Skip to content

Commit

Permalink
Make ray-core an optional dependency in meta.yaml and provide details…
Browse files Browse the repository at this point in the history
… on this in docs
  • Loading branch information
tomazou-lab committed Sep 22, 2021
1 parent fe76e4d commit bb0b334
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
5 changes: 3 additions & 2 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,21 @@ requirements:
- deeptools >=3.5.0
- lmfit >=1.0.1
- matplotlib-base ==3.1.1
- modin[ray] # [linux]
- modin ==0.8.2
- numpy >=1.19.5
- pandas >=1.1.4
- joblib >=1.0.0
- pybedtools >=0.8.1
- pybigwig >=0.3.17
- ray-core ==1.1.0 # [linux]
- scikit-learn >=0.24.0
- scipy >=1.6.0
- swifter >=1.0.6
- parallel
- seaborn ==0.11.2
- pysam ==0.16.0.1
run_constrained:
- ray-core ==1.1.0
- ray ==1.1.0

test:
commands:
Expand Down
11 changes: 9 additions & 2 deletions docs/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,22 @@ LIQUORICE in its own conda environment to keep dependencies clean:

.. code-block:: bash
# to install
conda create -e LIQUORICE -c bioconda LIQUORICE
# to install on Linux
conda create -e LIQUORICE -c bioconda -c conda-forge LIQUORICE ray-core
# to install on macOS
# conda create -e LIQUORICE -c bioconda -c conda-forge LIQUORICE ray-core
# to activate the environment
conda activate LIQUORICE # or: 'source activate LIQUORICE' for older conda versions
# to run
LIQUORICE <flags and arguments>
'ray-core' is an optional dependency of LIQUORICE that helps it run faster on multiple cores. It is not possible to
install it via conda on macOS, so installing it can either be skipped (find details about an alternative parallelization
approach :ref:`here <parallelization>`) or it can be installed as described `here <https://docs.ray.io/en/latest/installation.html>`
(e.g. `pip install -U ray==1.1.0`). LIQUORICE has been tested for ray version 1.1.0.

Citation
========
Expand Down
1 change: 1 addition & 0 deletions docs/source/liquorice_commandline_tool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ If `\-\-all_bins_same_size` is specified, `LIQUORICE` does the following:
Also here, we have decided to set the former option as default because it yielded somewhat better results for our own samples.
We do note, however, that differences in bin-size might introduce some slight biases in the coverage profile. While we have nevertheless found that this option works well for us, we do encourage you to try both options for your own cohort.

.. _parallelization:

Parallelization
***************
Expand Down
6 changes: 3 additions & 3 deletions liquorice/LIQUORICE.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,17 +302,17 @@ def main():
f" used for parallel processing ({len_path_to_tmpdir_in_bytes} bytes observed, "
f"{maxlen_tmp_dir_path_in_bytes} bytes allowed). "
f"Will attempt to use ray's default, '/tmp', instead.")
ray.init(num_cpus=args.n_cpus)
ray.init(num_cpus=args.n_cpus,include_dashboard=False)
else:
ray.init(num_cpus=args.n_cpus,_temp_dir=args.tmpdir)
ray.init(num_cpus=args.n_cpus,_temp_dir=args.tmpdir,include_dashboard=False)
else:
logging.warning(f"Failed to initialize ray with the specified tmpdir '{args.tmpdir}' and "
f"num_cpus {args.n_cpus}."
f" This happens if the ray version is lower than 1.1.0. Setup will be done by modin "
f"instead, but this can mean the tmpdir will not be respected.")
n_cpus_workflows=args.n_cpus
except ModuleNotFoundError:
os.environ["MODIN_ENGINE"] = "dask"
#os.environ["MODIN_ENGINE"] = "dask"
if args.n_cpus>1:
logging.warning("Could not import ray library - this happens if running on macOS. Parallelization is "
"therefore only "
Expand Down

0 comments on commit bb0b334

Please sign in to comment.