Skip to content

Commit

Permalink
fix: handle refgenconf write lock error
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin-s-h committed Mar 28, 2023
1 parent d0dcc61 commit 4d3758c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions bio/refgenie/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,25 @@

import os
import refgenconf
from refgenconf.exceptions import RefgenconfError

genome = snakemake.params.genome
asset = snakemake.params.asset
tag = snakemake.params.tag

conf_path = os.environ["REFGENIE"]

rgc = refgenconf.RefGenConf(conf_path, writable=False)

# BUG If there are multiple concurrent refgenie commands, this will fail due to
# unable to acquire lock of the config file.
try:
rgc = refgenconf.RefGenConf(conf_path, writable=True)
except RefgenconfError:
# If read lock timeout, attempt to skip the read lock
rgc = refgenconf.RefGenConf(conf_path,
writable=True,
skip_read_lock=True,
genome_exact=False)
# pull asset if necessary
# BUG Times out when pulling large assets
gat, archive_data, server_url = rgc.pull(genome, asset, tag, force=False, force_large=True)

for seek_key, out in snakemake.output.items():
Expand Down

0 comments on commit 4d3758c

Please sign in to comment.