Failure in running samtools within Julia
1
0
Entering edit mode
4.7 years ago

Probably this is not the best forum for this question, but perhaps somebody is using bionformatic tools usually run in bash using Julia.

I would like to extract some portions of an aligned file using samtools and launch samtools via Julia. The command to run bash in Julia is run(<command>). Pretty easy. It can also take variables passed as run(<command> $<var>).

So I created these variables:

julia> r_file
"A3-T_F-AlnSrtDed.bam"
julia> r_locus
"chr1:254748988-254749089"

then run with

julia> query = run(`samtools view -h -q 10 -f67 -F1408 $r_file $r_locus`)
[E::hts_open_format] Failed to open file A3-T_F-AlnSrtDed.bam
samtools view: failed to open "A3-T_F-AlnSrtDed.bam" for reading: No such file or directory
ERROR: failed process: Process(`samtools view -h -q 10 -f67 -F1408 A3-T_F-AlnSrtDed.bam chr1:254748988-254749089`, ProcessExited(1)) [1]
Stacktrace:
 [1] pipeline_error at ./process.jl:705 [inlined]
 [2] #run#503(::Bool, ::Function, ::Cmd) at ./process.jl:663
 [3] run(::Cmd) at ./process.jl:661
 [4] top-level scope at none:0

Did anybody experience this sort of errors? What was the fix?

Thank you

samtools julia language bash • 765 views
ADD COMMENT
1
Entering edit mode
4.7 years ago

OK, sort it: it was a misspelling in the file's name. The command does run as expected. case closed.

ADD COMMENT

Login before adding your answer.

Traffic: 2672 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6