annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/pybedtools/paths.py @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
rev   line source
jpayne@68 1 """
jpayne@68 2 Module for handling paths.
jpayne@68 3
jpayne@68 4 This is kept separate from helpers module in order to avoid circular imports in
jpayne@68 5 setting the bedtools path.
jpayne@68 6 """
jpayne@68 7
jpayne@68 8 import pybedtools
jpayne@68 9 from pybedtools import bedtool
jpayne@68 10 from . import settings
jpayne@68 11 from importlib import reload
jpayne@68 12
jpayne@68 13
jpayne@68 14 def _set_bedtools_path(path=""):
jpayne@68 15 old_path = settings._bedtools_path
jpayne@68 16 settings._bedtools_path = path
jpayne@68 17 if old_path != path:
jpayne@68 18 reload(bedtool)
jpayne@68 19 reload(pybedtools)
jpayne@68 20 return True
jpayne@68 21
jpayne@68 22
jpayne@68 23 def _get_bedtools_path():
jpayne@68 24 return settings._bedtools_path
jpayne@68 25
jpayne@68 26
jpayne@68 27 def _set_R_path(path=""):
jpayne@68 28 settings._R_path = path