IGS/FADU

ERROR: LoadError: MethodError: no method matching overlapchunks

Closed this issue · 4 comments

Hi,

Thanks for developing FADU!
I processed transcriptomic data of some isolates by following the steps in /FADU/benchmark_scripts/. My align and sort steps are as follows:

SMP="sample1"
hisat2-build $ref_genome $ref_index
hisat2 -p 8 -x $ref_index-1 $fq1 -2 $fq2 | samtools view -bhSo ${SMP}.genome.bam
samtools sort $SMP -@ 2 -o ${SMP}.genome.sortedbyposition.bam
samtools index ${SMP}.genome.sortedbyposition.bam -@ 2
##until now, there was no error in log
julia /share/software/FADU/fadu.jl -g XX.gbk.gff -b ${SMP}.genome.sortedbyposition.bam -o ${DIR_OUT}/${SMP}_fadu_output

In total, I have 40 samples subjected to the above processing. 35 of them finished with no errors, but 5 of them report the following errors when doing counts

ERROR: LoadError: MethodError: no method matching overlapchunks(::Indexes.BGZFIndex, ::Nothing, ::UnitRange{Int64})
Closest candidates are:
  overlapchunks(::Indexes.BGZFIndex, !Matched::Integer, ::UnitRange) at /share/home-user/xjwang/.julia/packages/Indexes/GoZHL/src/bgzfindex.jl:40
Stacktrace:
  [1] iterate(iter::OverlapIterator{IOStream})
    @ Main /share/software/FADU/alignment_overlaps.jl:63
  [2] process_feature_overlaps!(feat_overlaps::Dict{String, FeatureOverlap}, multimapped_dict::Dict{String, StructArray}, reader::XAM.BAM.Reader{IOStream}, feature::GFF3.Record, args::Dict{String, Any})
    @ Main /share/software/FADU/feature_counts.jl:178
  [3] #24
    @ ./array.jl:0 [inlined]
  [4] iterate
    @ ./generator.jl:47 [inlined]
  [5] collect_to!
    @ ./array.jl:724 [inlined]
  [6] collect_to_with_first!(dest::Vector{Nothing}, v1::Nothing, itr::Base.Generator{Vector{GFF3.Record}, var"#24#25"{Dict{String, FeatureOverlap}, XAM.BAM.Reader{IOStream}, Dict{String, Any}, Dict{String, StructArray}}}, st::Int64)
    @ Base ./array.jl:702
  [7] collect(itr::Base.Generator{Vector{GFF3.Record}, var"#24#25"{Dict{String, FeatureOverlap}, XAM.BAM.Reader{IOStream}, Dict{String, Any}, Dict{String, StructArray}}})
    @ Base ./array.jl:683
  [8] process_all_feature_overlaps(feat_overlaps::Dict{String, FeatureOverlap}, features::Vector{GFF3.Record}, reader::XAM.BAM.Reader{IOStream}, args::Dict{String, Any})
    @ Main /share/software/FADU/feature_counts.jl:205
  [9] main()
    @ Main /share/software/FADU/fadu.jl:157
 [10] top-level scope
    @ /share/software/FADU/fadu.jl:206
in expression starting at /share/software/FADU/fadu.jl:206

The difference between problematic samples and normal ones is the log of samtools sort step. The former showed [bam_sort_core] merging from 0 files, while the latter showed [bam_sort_core] merging from 4 files, the 4 can be any number larger than 0.
I am not sure if this is related to the error, could you please help me to solve this problem? Thanks a lot.

@luolab-cuhk, I seriously apologize for the delay in my response. I have never observed this error before personally, but I believe the error is indicating that the reference sequence information potentially was not parsed from one or more lines from the problematic BAM files. The "overlapchunks" function accepts a stored index of the reference name as its second parameter, which was not passed. Is it possible for you to confirm this.

I got this error when I was accidentally used an .faa (not .fna) file for HISAT2 prior to using FADU.

@Emay222 Thanks for pointing this out. This weekend, I will try to write a catch for when the user passes in a .faa file instead of an .fna file.

Found this was addressed in BioJulia/XAM.jl#11

Pushed a commit to address this and will tag as release v1.8.3