1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-11-23 10:19:56 +00:00

Flatten elseif

This commit is contained in:
Ciarán O'Mara 2020-02-02 21:32:02 +11:00
parent ef99c70317
commit 789cccbaff
3 changed files with 6 additions and 6 deletions

View file

@ -67,7 +67,8 @@ function Base.iterate(iter::OverlapIterator, state)
c = compare_intervals(state.record, (state.refindex, iter.interval)) c = compare_intervals(state.record, (state.refindex, iter.interval))
if c == 0 if c == 0
return copy(state.record), state return copy(state.record), state
elseif c > 0 end
if c > 0
# no more overlapping records in this chunk since records are sorted # no more overlapping records in this chunk since records are sorted
break break
end end

View file

@ -30,11 +30,9 @@ end
function Reader(input::IO; index=nothing) function Reader(input::IO; index=nothing)
if isa(index, AbstractString) if isa(index, AbstractString)
index = BAI(index) index = BAI(index)
else elseif index != nothing
if index != nothing
error("unrecognizable index argument") error("unrecognizable index argument")
end end
end
reader = init_bam_reader(input) reader = init_bam_reader(input)
reader.index = index reader.index = index
return reader return reader

View file

@ -163,7 +163,8 @@ function checked_refid(record::Record)
id = refid(record) id = refid(record)
if id == 0 if id == 0
throw(ArgumentError("record is not mapped")) throw(ArgumentError("record is not mapped"))
elseif !isdefined(record, :reader) end
if !isdefined(record, :reader)
throw(ArgumentError("reader is not defined")) throw(ArgumentError("reader is not defined"))
end end
return id return id