Skip to content

Commit

Permalink
Merge branch 'hotfix/methods'
Browse files Browse the repository at this point in the history
  • Loading branch information
CiaranOMara committed Feb 25, 2019
2 parents 4d8b9b7 + e9ec50d commit 6e9e6d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BedgraphFiles"
uuid = "85eb9095-274b-55ce-be28-9e90f41ac741"
authors = ["Ciarán O'Mara <[email protected]>"]
version = "2.0.1"
version = "2.0.2"

[deps]
Bedgraph = "0bcc2ff6-69eb-520d-bede-0374fc5bd2fd"
Expand Down
13 changes: 6 additions & 7 deletions src/BedgraphFiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ using TableShowUtils

import IterableTables

export load, save

const BedgraphFileFormat = File{format"bedGraph"}

Expand All @@ -24,7 +23,7 @@ function Base.show(io::IO, source::BedgraphFile)
TableShowUtils.printtable(io, getiterator(source), "bedGraph file")
end

function fileio_load(f::BedgraphFileFormat; args...)
function load(f::BedgraphFileFormat; args...)
return BedgraphFile(f.filename, args)
end

Expand Down Expand Up @@ -59,20 +58,20 @@ function Base.collect(x::BedgraphFile)
return collect(getiterator(x))
end

function fileio_save(file::BedgraphFileFormat, header::Bedgraph.BedgraphHeader, records::Vector{Bedgraph.Record})
function save(file::BedgraphFileFormat, header::Bedgraph.BedgraphHeader, records::Vector{Bedgraph.Record})
write(file.filename, header, records)
end

function fileio_save(file::BedgraphFileFormat, records::Vector{Bedgraph.Record}; bump_forward = true)
function save(file::BedgraphFileFormat, records::Vector{Bedgraph.Record}; bump_forward = true)

#TODO: bump_forward records.

header = Bedgraph.generateBasicHeader(records, bump_forward = bump_forward)

return fileio_save(file, header, records)
return save(file, header, records)
end

function fileio_save(file::BedgraphFileFormat, data; bump_forward = true)
function save(file::BedgraphFileFormat, data; bump_forward = true)
isiterabletable(data) || error("Can't write this data to bedGraph file.")

it = getiterator(data)
Expand All @@ -88,7 +87,7 @@ function fileio_save(file::BedgraphFileFormat, data; bump_forward = true)

header = Bedgraph.generateBasicHeader(records, bump_forward = bump_forward)

return fileio_save(file, header, records)
return save(file, header, records)
end

end # module

0 comments on commit 6e9e6d3

Please sign in to comment.