Skip to content

Commit

Permalink
Update to BedGraph v2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
CiaranOMara committed May 5, 2024
1 parent 31855d1 commit 730dcbc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ TableTraits = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
TableTraitsUtils = "382cd787-c1b6-5bf2-a167-d5b971a19bda"

[compat]
Bedgraph = "1.2"
Bedgraph = "2.3"
DataValues = "0.4"
FileIO = "1.0.1"
IterableTables = "0.9, 0.10, 0.11, 1"
Expand Down
12 changes: 1 addition & 11 deletions src/BedgraphFiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@ function Base.collect(T::Type, x::BedgraphFile)
return collect(T, getiterator(x))
end

function Base.convert(::Type{T}, nt::NamedTuple{(:chrom, :first, :last, :value),Tuple{String,Int64,Int64,R}}) where {R <: Real, T<: Bedgraph.Record}
@debug "Convert - strict."
return T(nt.chrom, nt.first, nt.last, nt.value)
end

function Base.convert(::Type{T}, nt::NamedTuple{names,Tuple{String,Int64,Int64,R}}) where {R <: Real, names, T<: Bedgraph.Record}
@debug "Convert - names."
return T(nt[1], nt[2], nt[3], nt[4])
end

function Vector{T}(x) where {T <: Bedgraph.Record}
return collect(T, getiterator(x))
end
Expand All @@ -96,7 +86,7 @@ function save(file::BedgraphFileFormat, records::Vector{<:Bedgraph.Record}; bump

sort!(records)

header = Bedgraph.generateBasicHeader(records, bump_forward = bump_forward) #TODO: consolidate header generation and determine whether there is a need for bump_forward.
header = Bedgraph.generate_basic_header(records, bump_forward = bump_forward) #TODO: consolidate header generation and determine whether there is a need for bump_forward.

return save(file, header, records)
end
Expand Down
4 changes: 0 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ using .Bag
# Check return of data from save method.
@test Bag.records == Bag.records |> save(Bag.tmp_output_path)

# Check convert
@test Bag.record == convert(Bedgraph.Record, (chrom = "chr1", first=1, last=1, value=0))
@test Bag.record == convert(Bedgraph.Record, (chrom = "chr1", left=1, right=1, value=0))

@testset "Integrations" begin
include("integrations/test-Tables.jl")
include("integrations/test-QueryOperators.jl")
Expand Down

0 comments on commit 730dcbc

Please sign in to comment.