{"id":17493464,"url":"https://github.com/ciaranomara/bedgraphfiles.jl","last_synced_at":"2025-04-22T22:16:51.523Z","repository":{"id":49052481,"uuid":"100575769","full_name":"CiaranOMara/BedgraphFiles.jl","owner":"CiaranOMara","description":"FileIO.jl integration for bedGraph files","archived":false,"fork":false,"pushed_at":"2024-05-09T11:42:54.000Z","size":107,"stargazers_count":2,"open_issues_count":1,"forks_count":6,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-04-22T22:16:26.537Z","etag":null,"topics":["bedgraph","bioinformatics","dna","julia"],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CiaranOMara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-17T07:41:19.000Z","updated_at":"2024-09-07T08:32:21.000Z","dependencies_parsed_at":"2024-05-09T12:45:29.911Z","dependency_job_id":"9682ed68-0d55-43f2-98f1-b01f5942334a","html_url":"https://github.com/CiaranOMara/BedgraphFiles.jl","commit_stats":{"total_commits":126,"total_committers":6,"mean_commits":21.0,"dds":"0.10317460317460314","last_synced_commit":"684f055e3bd1618b906bf8b361ad4f81b5d9487a"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CiaranOMara%2FBedgraphFiles.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CiaranOMara%2FBedgraphFiles.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CiaranOMara%2FBedgraphFiles.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CiaranOMara%2FBedgraphFiles.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CiaranOMara","download_url":"https://codeload.github.com/CiaranOMara/BedgraphFiles.jl/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250331819,"owners_count":21413103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bedgraph","bioinformatics","dna","julia"],"created_at":"2024-10-19T12:07:32.716Z","updated_at":"2025-04-22T22:16:51.480Z","avatar_url":"https://github.com/CiaranOMara.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BedgraphFiles.jl\n\n[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)\n[![Unit Tests](https://github.com/CiaranOMara/BedgraphFiles.jl/actions/workflows/UnitTests.yml/badge.svg?branch=master)](https://github.com/CiaranOMara/BedgraphFiles.jl/actions/workflows/UnitTests.yml)\n[![codecov](https://codecov.io/gh/CiaranOMara/BedgraphFiles.jl/branch/master/graph/badge.svg?branch=master)](https://codecov.io/gh/CiaranOMara/BedgraphFiles.jl?branch=master)\n\n\u003e This project follows the [semver](http://semver.org) pro forma and uses the [git-flow branching model](http://nvie.com/git-model \"original\nblog post\").\n\n## Overview\n\nThis package provides load and save support for [Bedgraph](https://github.com/CiaranOMara/Bedgraph.jl)\nunder the [FileIO](https://github.com/JuliaIO/FileIO.jl) package, and also implements the [IterableTables](https://github.com/davidanthoff/IterableTables.jl) interface for easy conversion between tabular data structures.\n\n## Installation\nYou can install BedgraphFiles from the [Julia REPL](https://docs.julialang.org/en/v1/manual/getting-started/).\nPress `]` to enter [pkg mode](https://docs.julialang.org/en/v1/stdlib/Pkg/), then enter the following:\n\n```julia\nadd BedgraphFiles\n```\n\nIf you are interested in the cutting edge of the development, please check out the [develop branch](https://github.com/CiaranOMara/BedgraphFiles.jl/tree/develop) to try new features before release.\n\n## Usage\n\n### Loading bedGraph files\n\nTo load a bedGraph file into a ``Vector{Bedgraph.Record}``, use the following Julia code:\n````julia\nusing FileIO, BedgraphFiles, Bedgraph\n\nrecords = Vector{Bedgraph.Record}(load(\"data.bedgraph\"))\nrecords = collect(Bedgraph.Record, load(\"data.bedgraph\"))\n````\n\n### Saving bedGraph files\n\n\u003e **Note:** saving on top of an existing file will overwrite metadata/header information with a minimal working header.\n\nThe following example saves a ``Vector{Bedgraph.Record}`` to a bedGraph file:\n````julia\nusing FileIO, BedgraphFiles, Bedgraph\n\nrecords = [Bedgraph.Record(\"chr\", i, i + 99, rand()) for i in 1:100:1000]\n\nsave(\"output.bedgraph\", records)\n````\n\n### IterableTables\nThe execution of ``load`` returns a ``struct`` that adheres to the [IterableTables](https://github.com/davidanthoff/IterableTables.jl) interface, and can be passed to any function that also implements the interface, i.e. all the sinks in [IterableTable.jl](https://github.com/davidanthoff/IterableTables.jl).\n\nThe following code shows an example of loading a bedGraph file into a [DataFrame](https://github.com/JuliaData/DataFrames.jl):\n```julia\nusing FileIO, BedgraphFiles, DataFrames\n\ndf = DataFrame(load(\"data.bedgraph\"))\n```\n\nHere are some more examples of materialising a bedGraph file into other data structures:\n```julia\nusing FileIO, BedgraphFiles, DataTables, IndexedTables, Gadfly\n\n# Load into a DataTable\ndt = DataTable(load(\"data.bedgraph\"))\n\n# Load into an IndexedTable\nit = table(load(\"data.bedgraph\"))\n\n# Plot directly with Gadfly\nplot(load(\"data.bedgraph\"), xmin=:leftposition, xmax=:rightposition, y=:value, Geom.bar)\n```\n\nThe following code saves any compatible source to a bedGraph file:\n```julia\nusing FileIO, BedgraphFiles\n\nit = getiterator(data)\n\nsave(\"output.bedgraph\", it)\n```\n\n### Using the pipe syntax\n\nBoth `load` and `save` also support the pipe syntax. For example, to load a bedGraph file into a `DataFrame`, one can use the following code:\n```julia\nusing FileIO, BedgraphFiles, DataFrame\n\ndf = load(\"data.bedgraph\") |\u003e DataFrame\n```\n\nTo save an iterable table, one can use the following form:\n```julia\nusing FileIO, BedgraphFiles, DataFrame\n\ndf = # Aquire a DataFrame somehow.\n\ndf |\u003e save(\"output.bedgraph\")\n```\n\nThe `save` method returns the data provided or `Vector{Bedgraph.Record}`. This is useful when periodically saving your work during a sequence of operations.\n```julia\nrecords = some sequence of operations |\u003e save(\"output.bedgraph\")\n```\n\nThe pipe syntax is especially useful when combining it with [Query.jl](https://github.com/davidanthoff/Query.jl) queries. For example, one can easily load a bedGraph file, pipe its data into a query, and then store the query result by piping it to the `save` function.\n```julia\nusing FileIO, BedgraphFiles, Query\nload(\"data.bedgraph\") |\u003e @filter(_.chrom == \"chr19\") |\u003e save(\"data-chr19.bedgraph\")\n```\n## Acknowledgements\nThis package is largely -- if not completely -- inspired by the work of [David Anthoff](https://github.com/davidanthoff). Other influences are from the [BioJulia](https://github.com/BioJulia) community.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciaranomara%2Fbedgraphfiles.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fciaranomara%2Fbedgraphfiles.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciaranomara%2Fbedgraphfiles.jl/lists"}