Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed IgBLAST startup error handling. No longer hangs. #4

Merged
merged 1 commit into from
Oct 24, 2024
Merged
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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ run_igblast(
"data/Macaca_mulatta_J.fasta",
"data/rhesus_monkey_gl.aux",
"ERR4238106.tsv",
additional_params = Dict("organism" => "rhesus_monkey", "ig_seqtype" => "ig")
additional_params = Dict("organism" => "rhesus_monkey", "ig_seqtype" => "Ig")
)
```

21 changes: 11 additions & 10 deletions src/run.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
run_igblast(
igblast_type::Type{T},
query_file::String,
v_database::String,
d_database::String,
query_file::String,
v_database::String,
d_database::String,
j_database::String,
aux_file::String,
output_file::String,
@@ -39,9 +39,9 @@ run_igblast(IgBLASTn, "query.fasta", "V.fasta", "D.fasta", "J.fasta", "aux.txt",
"""
function run_igblast(
igblast_type::Type{T},
query_file::String,
v_database::String,
d_database::String,
query_file::String,
v_database::String,
d_database::String,
j_database::String,
aux_file::String,
output_file::String,
@@ -138,7 +138,9 @@ function run_igblast(
end
end

process = run(cmd, wait=false)
out = IOBuffer()
err = IOBuffer()
process = run(pipeline(cmd, stdout=out, stderr=err), wait=false)

while process_running(process)
if isready(done_channel)
@@ -154,9 +156,8 @@ function run_igblast(
end

if !success(process)
error_output = read(stderr, String)
@error "IgBLAST failed to run successfully" error_output
error("IgBLAST execution failed. Check the error message above.")
error_output = String(take!(err))
error("$(error_output)\nIgBLAST execution failed. Check the error message above.")
end

@info "IgBLAST analysis completed. Output saved to $output_file"