Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions singlem/pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ def finish_sra_extraction_processes(sra_extraction_processes, sra_extraction_com
"STDERR was: %s" % (
cmd, p.returncode, p.stderr.read()))

diamond_version = extern.run("diamond --version").strip()
logging.info("DIAMOND version: %s", diamond_version)
Comment on lines +389 to +390

Choose a reason for hiding this comment

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

P2 Badge Guard DIAMOND version check to preserve SRA cleanup

If diamond --version fails (e.g., DIAMOND missing or misconfigured) and input_sra_files was used, the exception now happens before the existing try/except block that logs the DIAMOND failure and calls finish_sra_extraction_processes. That means the kingfisher extraction processes started above can be left running or blocked on their FIFOs with no cleanup, which didn’t occur before this change. This only shows up when SRA input is active and the version check errors, but in that case it can leak subprocesses and leave temp resources behind.

Useful? React with 👍 / 👎.

logging.info("Filtering sequence files through DIAMOND blastx")
try:
(diamond_forward_search_results, diamond_reverse_search_results) = DiamondSpkgSearcher(
Expand Down
4 changes: 3 additions & 1 deletion test/test_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ def test_fast_protein_package_prefilter(self):

cmd = "%s pipe --sequences %s --otu-table /dev/stdout --assignment-method diamond --singlem-packages %s" % (
path_to_script, n.name, os.path.join(path_to_data,'4.11.22seqs.gpkg.spkg'))
result = subprocess.run(cmd, shell=True, check=True, text=True, capture_output=True)
self.assertEqualOtuTable(
list([line.split("\t") for line in expected]),
extern.run(cmd).replace(os.path.basename(n.name).replace('.fa',''),''))
result.stdout.replace(os.path.basename(n.name).replace('.fa',''),''))
self.assertIn("DIAMOND version:", result.stderr)

def test_zstd_forward_input(self):
expected = [
Expand Down
Loading