{"id":43316301,"url":"https://github.com/will-rowe/gfa","last_synced_at":"2026-02-01T22:03:42.517Z","repository":{"id":57492650,"uuid":"125120285","full_name":"will-rowe/gfa","owner":"will-rowe","description":"A Go library for working with Graphical Fragment Assembly format","archived":false,"fork":false,"pushed_at":"2019-05-02T08:48:28.000Z","size":45,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T16:36:19.869Z","etag":null,"topics":["gfa","graphical-fragment-assembly","variation-graph"],"latest_commit_sha":null,"homepage":"","language":"Go","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/will-rowe.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}},"created_at":"2018-03-13T22:01:45.000Z","updated_at":"2021-02-07T18:55:44.000Z","dependencies_parsed_at":"2022-08-28T13:40:15.301Z","dependency_job_id":null,"html_url":"https://github.com/will-rowe/gfa","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/will-rowe/gfa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will-rowe%2Fgfa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will-rowe%2Fgfa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will-rowe%2Fgfa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will-rowe%2Fgfa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/will-rowe","download_url":"https://codeload.github.com/will-rowe/gfa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will-rowe%2Fgfa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28992657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T22:01:47.507Z","status":"ssl_error","status_checked_at":"2026-02-01T21:58:37.335Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gfa","graphical-fragment-assembly","variation-graph"],"created_at":"2026-02-01T22:03:42.442Z","updated_at":"2026-02-01T22:03:42.508Z","avatar_url":"https://github.com/will-rowe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003egfa\u003c/h1\u003e\n  \u003ch3\u003ea Go library for working with Graphical Fragment Assembly format\u003c/h3\u003e\n  \u003chr\u003e\n  \u003ca href=\"https://travis-ci.org/will-rowe/gfa\"\u003e\u003cimg src=\"https://travis-ci.org/will-rowe/gfa.svg?branch=master\" alt=\"travis\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://godoc.org/github.com/will-rowe/gfa\"\u003e\u003cimg src=\"https://godoc.org/github.com/will-rowe/gfa?status.svg\" alt=\"GoDoc\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/will-rowe/gfa\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/will-rowe/gfa\" alt=\"goreportcard\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/will-rowe/gfa\"\u003e\u003cimg src=\"https://codecov.io/gh/will-rowe/gfa/branch/master/graph/badge.svg\" alt=\"codecov\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n***\n\n## Overview\n\nThis is a Go library for working with the `Graphical Fragment Assembly` (GFA) format.\n\n\u003e The purpose of the GFA format is to capture sequence graphs as the product of an assembly, a representation of variation in genomes, splice graphs in genes, or even overlap between reads from long-read sequencing technology.\n\nRead the GFA spec [here](https://github.com/GFA-spec/GFA-spec/blob/master/GFA1.md).\n\nCurrent limitations:\n\n* restricted to GFA version 1\n* does not handle the containment field\n* validation is limited\n\n## Installation\n\n``` go\ngo get github.com/will-rowe/gfa\n```\n\n## Example usage\n\n### convert an MSA file to a GFA file\n\n``` go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/will-rowe/gfa\"\n)\n\nvar (\n\tinputFile = \"./example.msa\"\n)\n\nfunc main() {\n\t// open the MSA\n\tmsa, _ := gfa.ReadMSA(inputFile)\n\n\t// convert the MSA to a GFA instance\n\tmyGFA, err := gfa.MSA2GFA(msa)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// create a gfaWriter\n\toutfile, err := os.Create(\"./example.gfa\")\n\tdefer outfile.Close()\n\twriter, err := gfa.NewWriter(outfile, myGFA)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// write the GFA content\n\tif err := myGFA.WriteGFAContent(writer); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\n### process a GFA file line by line\n\n``` go\npackage main\n\nimport (\n\t\"flag\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/will-rowe/gfa\"\n)\n\nvar (\n\tinputFile = flag.String(\"inputFile\", \"\", \"input GFA file (empty for STDIN)\")\n)\n\nfunc main() {\n\tflag.Parse()\n\tvar r io.Reader\n\n\t// open file stream and close it when finished\n\tif *inputFile == \"\" {\n\t\tr = os.Stdin\n\t} else {\n\t\tfh, err := os.Open(*inputFile)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"could not open file %q:\", err)\n\t\t}\n\t\tdefer fh.Close()\n\t\tr = fh\n\t}\n\n\t// create a GFA reader\n\treader, err := gfa.NewReader(r)\n\tif err != nil {\n\t\tlog.Fatal(\"can't read gfa file: %v\", err)\n\t}\n\n\t// collect the GFA instance\n\tmyGFA := reader.CollectGFA()\n\n\t// check version and print the header / comment lines\n\tif myGFA.GetVersion() != 1 {\n\t\tlog.Fatal(\"gfa file is not in version 1 format\")\n\t}\n\tlog.Println(myGFA.PrintHeader())\n\tif comments := myGFA.PrintComments(); comments != \"\" {\n\t\tlog.Println(comments)\n\t}\n\n\t// read the GFA file\n\tfor {\n\t\tline, err := reader.Read()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"error reading line in gfa file: %v\", err)\n\t\t}\n\n\t\t// each line produced by Read() satisfies the gfaLine interface\n\t\tformattedLine := line.PrintGFAline()\n\t\tlog.Printf(\"gfa line: %v\", formattedLine)\n\n\t\t// you can also add the line to the GFA instance\n\t\tif err := line.Add(myGFA); err != nil {\n\t\t\tlog.Fatal(\"error adding line to GFA instance: %v\", err)\n\t\t}\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwill-rowe%2Fgfa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwill-rowe%2Fgfa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwill-rowe%2Fgfa/lists"}