Skip to content

Conversation

@tomdrever
Copy link
Contributor

Initial steps to improve error surfacing in the DSA step

…, after every interval dsa step. Also switch to f-strings for readability
commands[i] = (cmd, )

with open(f"{tmpDir}/dsa/{i+1}.dsa.cmd", "w") as cmd_file:
cmd_file.write(cmd.replace(';', ';\n\n'))
Copy link

@FMakosza FMakosza Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be cleaner to build cmd as a list of strings, then use "\n".join(cmd)? Semicolons may appear in filenames (which may warrant quoting all the path parameters!) and, while it isn't an issue in this script, they're also part of the awk syntax.
E.g.,

cmd.append(f"bgzip -f -l 2 \"{tmpDir}/dsa/{i+1}.dsa.bed\";\nsleep 2;\nbgzip -t \"{tmpDir}/dsa/{i+1}.dsa.bed.gz\";")
cmd.append(f"touch \"{tmpDir}/dsa/{i+1}.done\";")
[...]
cmd_file.write("\n".join(cmd))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants