Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ALLCools/count_matrix/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,15 @@ def _count_single_region_set(allc_table, region_config, obs_dim, region_dim):

total_data = []
for sample, allc_path in allc_table.items():
with pysam.TabixFile(allc_path) as allc:
try:
allc = pysam.TabixFile(allc_path)
except OSError:
local_tabix = "./" + pathlib.Path(allc_path).name + ".tbi"
local_compressed = pysam.tabix_index(
filename=allc_path, index=local_tabix, seq_col=0, start_col=1, end_col=1
)
allc = pysam.TabixFile(filename=local_compressed, index=local_tabix)
with allc:
region_ids = []
sample_data = []
region_chunks = pd.read_csv(region_config["regions"], index_col=0, chunksize=1000)
Expand Down