- fixed bug where rBlast temporary files were left inside working dir… - #59
- fixed bug where rBlast temporary files were left inside working dir…#59kaozkai wants to merge 2 commits into
Conversation
…ectory - included test case
Walkthrough
ChangesBLAST temporary-file cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@R/blast_utils.R`:
- Around line 57-63: Update get_score_pair() in R/blast_utils.R to create a
per-call sandbox for its FASTA and BLAST database artifacts, register top-level
on.exit() cleanup, and stop writing tmp.fasta or db/tmp in the caller’s working
directory; extend tests/testthat/test-cdr3_na.R at lines 37-40 to run this path
in an isolated working directory and recursively verify no artifacts remain.
In `@tests/testthat/test-cdr3_na.R`:
- Around line 37-40: Update the cleanup assertion in test-cdr3_na.R to execute
within a fresh temporary working directory, isolating it from pre-existing
files, and make list.files scan recursively so nested rBlast artifacts are
detected. Preserve the existing BLAST-extension filter while asserting that no
matching files remain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b9d348dd-59ec-4990-b8f4-ade6dd40dda5
📒 Files selected for processing (2)
R/blast_utils.Rtests/testthat/test-cdr3_na.R
- removed unnecessary unlink calls
Bug description
When running ClustIRR::clustirr(), multiple database index files (.pdb, .phd, .phi, .phr, .pin, .pog, .pot, .psq, .ptf, .pto) are left behind in the user's current working directory ( getwd() ).
Supposed cause of bug
This is caused by the BLAST calling logic in blast_utils.R using basename(), which causes unlink to fail somehow.
Proposed solution
Create sandbox folders to manage tmp files and on.exit() logic to clean them up.
Summary by CodeRabbit
Bug Fixes
Tests
ClustIRRdataset.