I am using the ´FASTX` package to stream over a large fasta file but am getting a no method matching error:
ERROR: LoadError: TaskFailedException
Stacktrace:
[1] wait
@ ./task.jl:334 [inlined]
[2] threading_run(func::Function)
@ Base.Threads ./threadingconstructs.jl:38
[3] macro expansion
@ ./threadingconstructs.jl:97 [inlined]
[4] top-level scope
@ /home/projects/ku_00014/people/robmur/scripts/metagenome/resampling/resampling.jl:38
nested task error: MethodError: no method matching length(::FASTX.FASTA.Reader{TranscodingStreams.NoopStream{IOStream}})
Closest candidates are:
length(::Union{Base.KeySet, Base.ValueIterator}) at /services/tools/julia/1.7.0-rc3/share/julia/base/abstractdict.jl:58
length(::Union{LinearAlgebra.Adjoint{T, S}, LinearAlgebra.Transpose{T, S}} where {T, S}) at /services/tools/julia/1.7.0-rc3/share/julia/stdlib/v1.7/LinearAlgebra/src/adjtrans.jl:171
length(::Union{DataStructures.OrderedRobinDict, DataStructures.RobinDict}) at ~/.julia/packages/DataStructures/nBjdy/src/ordered_robin_dict.jl:86
...
Stacktrace:
[1] (::var"#2#threadsfor_fun#11"{FASTX.FASTA.Writer{TranscodingStreams.NoopStream{IOStream}}, Vector{String15}, FASTX.FASTA.Reader{TranscodingStreams.NoopStream{IOStream}}})(onethread::Bool)
@ Main ./threadingconstructs.jl:53
[2] (::var"#2#threadsfor_fun#11"{FASTX.FASTA.Writer{TranscodingStreams.NoopStream{IOStream}}, Vector{String15}, FASTX.FASTA.Reader{TranscodingStreams.NoopStream{IOStream}}})()
@ Main ./threadingconstructs.jl:52
in expression starting at /home/projects/ku_00014/people/robmur/scripts/metagenome/resampling/resampling.jl:14
This started to occur after after I switched from a gzipped to an ungizziped fasta but I am unsure f that is the cause of the error. I am running the package as follows:
reader = FASTA.Reader(open("some/file/path/megahit_final_assembly_500bp_filterd.fasta"))
writer = open(FASTA.Writer, "some/file/path/500bp_filter_samples/"*sample)
println("writing to file")
@threads for record in reader
if FASTA.identifier(record) in passContig
write(writer, record)
end
end
close(reader)
EDIT: I just tried with a gzip and I get the same error.