Skip to content

Commit

Permalink
Make load and save methods private
Browse files Browse the repository at this point in the history
  • Loading branch information
CiaranOMara committed Feb 25, 2019
1 parent 0c6f7c5 commit e9ec50d
Showing 1 changed file with 6 additions and 7 deletions.
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 e9ec50d

Please sign in to comment.