Skip to content

Commit

Permalink
Update DNAscope LongRead pipeline to use the new scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
DonFreed committed Nov 29, 2024
1 parent 7511aac commit 9ef39b7
Show file tree
Hide file tree
Showing 3 changed files with 331 additions and 108 deletions.
23 changes: 10 additions & 13 deletions sentieon_cli/command_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,19 @@
logger = get_logger(__name__)


def cmd_fai_to_bed(
fai: pathlib.Path,
bed: pathlib.Path,
) -> str:
cmd = ["awk", "-v", "OFS=\t", "{print $1,0,$2}", str(fai)]
return shlex.join(cmd) + " > " + shlex.quote(str(bed))


def cmd_bedtools_subtract(
regions_bed: typing.Optional[pathlib.Path],
regions_bed: pathlib.Path,
phased_bed: pathlib.Path,
unphased_bed: pathlib.Path,
tmp_dir: pathlib.Path,
reference: pathlib.Path,
dry_run: bool,
):
if regions_bed is None:
# set region to the full genome
regions_bed = tmp_dir.joinpath("reference.bed")
if not dry_run:
with open(regions_bed, "wt", encoding="utf-8") as f:
for line in open(name(reference) + ".fai", encoding="utf-8"):
toks = line.strip().split("\t")
f.write(f"{toks[0]}\t0\t{toks[1]}\n")
) -> str:
cmd = [
"bedtools",
"subtract",
Expand Down
5 changes: 4 additions & 1 deletion sentieon_cli/dnascope.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ def check_shm(
)
total_input_size += total

shm_free = shutil.disk_usage("/dev/shm").free
try:
shm_free = shutil.disk_usage("/dev/shm").free
except Exception:
return None
total_mem = total_memory()

if (
Expand Down
Loading

0 comments on commit 9ef39b7

Please sign in to comment.