Skip to content

Commit 1a63791

Browse files
committed
NaN supports are allowed in pileup with warning, no crash. Cache for test data download fixed. metavariable TRACK_PATH for call-compartments added.
1 parent 9db5c23 commit 1a63791

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

cooltools/cli/call_compartments.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"--reference-track",
2020
help="Reference track for orienting and ranking eigenvectors",
2121
type=TabularFilePath(exists=True, default_column_index=3),
22+
metavar="TRACK_PATH"
2223
)
2324
@click.option(
2425
"--contact-type",

cooltools/lib/common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,15 @@ def download_file(url, local_filename=None):
119119

120120
data_home = get_data_home(data_home)
121121

122-
assert len(keys)>0 # Checking that test data file is parsed sucessfully
122+
assert len(keys)>0 # Checking that test data file is parsed successfully
123+
downloaded = '' # Empty string that will be returned if the request was empty
123124
for key, url, local_filename in available_datasets:
124125
if not key in keys:
125126
continue
126127

127128
file_path = os.path.join(data_home, local_filename)
128129
if cache and os.path.exists(file_path):
130+
downloaded = file_path
129131
continue
130132
elif cache:
131133
print("Test dataset {} (file {}) is not in the cache directory {}".format(key, local_filename, data_home))

cooltools/snipping.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ def _pileup(data_select, data_snip, arg):
140140
support, feature_group = arg
141141
# check if support region is on- or off-diagonal
142142
if len(support) == 2:
143-
region1, region2 = map(bioframe.parse_region_string, support)
143+
region1, region2 = map(bioframe.region.parse_region_string, support)
144144
else:
145-
region1 = region2 = bioframe.parse_region_string(support)
145+
region1 = region2 = bioframe.region.parse_region_string(support)
146146

147147
# check if features are on- or off-diagonal
148148
if "start" in feature_group:
@@ -184,9 +184,7 @@ def pileup(features, data_select, data_snip, map=map):
184184
185185
"""
186186
if features.region.isnull().any():
187-
raise ValueError(
188-
"Drop features with no region assignment before calling pileup!"
189-
)
187+
print("Some features do not have regions assigned! Some snips will be empty.")
190188

191189
features = features.copy()
192190
features["_rank"] = range(len(features))

0 commit comments

Comments
 (0)