{"id":21773490,"url":"https://github.com/dubssieg/rs-pancat-compare","last_synced_at":"2025-07-19T10:30:54.107Z","repository":{"id":255692290,"uuid":"853410537","full_name":"dubssieg/rs-pancat-compare","owner":"dubssieg","description":"Compares pangenome graphs by calculating the segmentation distance between two GFA (Graphical Fragment Assembly) files.","archived":false,"fork":false,"pushed_at":"2024-11-19T09:26:23.000Z","size":1177,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-19T10:30:35.232Z","etag":null,"topics":["distance","distance-calculation","distance-measures","graph-distance","pangenome","pangenome-graph","pangenomics","variation-graph","variation-graphs"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dubssieg.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":"2024-09-06T15:47:43.000Z","updated_at":"2024-11-19T09:22:42.000Z","dependencies_parsed_at":"2024-11-19T10:24:42.427Z","dependency_job_id":"2cc78d20-e065-436e-9da2-157fc6eaf591","html_url":"https://github.com/dubssieg/rs-pancat-compare","commit_stats":null,"previous_names":["tharos-ux/rs-pancat-compare","dubssieg/rs-pancat-compare"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dubssieg%2Frs-pancat-compare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dubssieg%2Frs-pancat-compare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dubssieg%2Frs-pancat-compare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dubssieg%2Frs-pancat-compare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dubssieg","download_url":"https://codeload.github.com/dubssieg/rs-pancat-compare/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226584451,"owners_count":17655036,"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":["distance","distance-calculation","distance-measures","graph-distance","pangenome","pangenome-graph","pangenomics","variation-graph","variation-graphs"],"created_at":"2024-11-26T17:01:22.315Z","updated_at":"2025-07-19T10:30:54.092Z","avatar_url":"https://github.com/dubssieg.png","language":"Rust","funding_links":[],"categories":["A list of software capable of analyzing mainly **eukaryotic** genomes for pangenomics."],"sub_categories":[],"readme":"# Pairwise edit distance between pangenome graphs\n\n\nProgram that calculates the distance between two pangenome graphs in GFA (Graphical Fragment Assembly) format. It takes in the file paths of the two GFA files. The program first identifies the common paths between the two graphs by finding the intersection of their path names. For each common path, the program reads those and output differences in segmentation in-between them. The purpose is to output the necessary operations (merges and splits) required to transform the graph represented by the first GFA file into the graph represented by the second GFA file.\n\n![edition algorithm](https://github.com/dubssieg/dubssieg/blob/main/algorithm.gif)\n\n## Install instructions:\n\n(For Linux-based systems only) Find the latest stable pre-compiled binaries [in the release page here](https://github.com/dubssieg/rs-pancat-compare/releases).\n\n(For anyone) Build from source: requires rust and cargo.\n\n```bash\ngit clone \ncd rs-pancat-compare\ncargo build --release\n```\n\n## Basic usage\n\n:warning: This program is intended to be used on **sequence graphs** and does not take into account overlaps.\n\n```bash\nrs-pancat-compare example/graph_A.gfa example/graph_B.gfa \u003e output.tsv\n```\n\nOn included graphs (in `example/` folder), you should obtain this output:\n\n```bash\n# Intersection of paths: [\"CASBJH01\", ... \"CASBJS01\"]\n## CASBJH01     219308\n...\n## CASBJS01     206475\n# Path name     Position        Operation       NodeA   NodeB   BreakpointA     BreakpointB\nCASBJH01        20      S       15707   21230   20      7565\nCASBJH01        21      S       15706   21230   21      7565\nCASBJH01        23      S       15704   21230   23      7565\n...\nCASBJU01        222414  M       21721   23661   222416  222414\nCASBJU01        222416  S       21721   23662   222416  222417\nCASBJU01        222418  S       21723   23663   222418  222419\n# Distance: 34203 (E=208247, S=21435, M=12768).\n```\n\nThe order of the graphs is used to qualify editions. It is computed as \"the minimal set of required operations to obtain the graph B out of the graph A\".\n\n## Filter spurious breakpoints\n\n```bash\nrs-pancat-compare example/graph_A.gfa example/graph_B.gfa -s \u003e output.tsv\n```\n\nThe `-s/--spurious` flag tells to search for spurious breakpoints and to discard them. Spurious breakpoints are segmentations in a genome that does not creates different paths. It corresponds to breakpoints that could be removed without changing any meaning of the graph.\n\n## Timings and memory\n\n| Organism | Chromosom | Wall time | Memory |\n|----------|-----------|-----------|--------|\n| yeast    | 1         | 0.56s     | 3.0MB  |\n| human    | 21        | 5m08s     | 383MB  |\n| human    | 1         | 17m42s    | 1.2GB  |\n\nTimings and peak memory usage over diverse datasets. Jobs executed on a single core of a 13th Gen Intel® Core™ i7-1365U @ 3.6GHz.\n\n\u003e [!NOTE]\\\n\u003e Want to contribute? Feel free to open a PR on an issue about a missing, buggy or incomplete feature! **Please do bug reports in the issue tracker!**.\n\n## Output\n\nProgram outputs to `stdout` in a `.tsv` format editions as well as informations about the comparison.\n\n```\n# Intersection of paths: [pathname:str,+]\n## pathname:str\tpathlength:int\n# Path name\tPosition\tOperation\tNodeA\tNodeB\tBreakpointA\tBreakpointB\npathname:str\t[0-9]+:int\t[M|S]:str\t[0-9]+:str\t[0-9]+:str\t[0-9]+:int\t[0-9]+:int\n...\n# Distance: [0-9]+:int (E=[0-9]+:int, S=[0-9]+:int, M=[0-9]+:int).\n\n```\n\nOutput features:\n+ Lines starting with '#' are comments or information about the comparison\n+ Lines starting with '##' are haplotypes length information\n+ Every other line is either a merge (M) or a split (S)\n+ Equivalences are accounted in the final line but not written as output (too many in file)\n+ Distance is the sum of merges and splits\n+ `Path name` is the haplotype name string\n+ `Position` is the global position on the graph the edit takes place\n+ `NodeA` (resp. `NodeB`) is the node on pathA (resp. pathB) where the edition occurs\n+ `BreakpointA` (resp. `BreakpointB`) is the next breakpoint position on pathA (resp. pathB)\n\n## Test datasets\n\nYou can find datasets used for the paper [on Zenodo](https://zenodo.org/records/10932490) and instructions on how to use [on the dedicated repository](https://github.com/dubssieg/pancat_paper).\n\n\u003e [!NOTE]\\\n\u003e  [pancat compare](https://github.com/dubssieg/pancat) is a tool, originally written in Python, designed to compute a distance between pangenome graphs made from a same group of genomes. For performance, it has been reimplemented in Rust.\n\n\n## Citing\n\nPairwise graph edit distance characterizes the impact of the construction method on pangenome graphs\nSiegfried Dubois, Claire Lemaitre, Matthias Zytnicki, Thomas Faraut\nBioinformatics 2025.05.08; doi: [https://doi.org/10.1093/bioinformatics/btaf291](https://doi.org/10.1093/bioinformatics/btaf291)\n\n### Bibtex:\n\n```\n@article{dubois_pairwise_2025,\n\ttitle = {Pairwise graph edit distance characterizes the impact of the construction method on pangenome graphs},\n\tissn = {1367-4811},\n\turl = {https://doi.org/10.1093/bioinformatics/btaf291},\n\tdoi = {10.1093/bioinformatics/btaf291},\n\tabstract = {Pangenome variation graphs are an increasingly used tool to perform genome analysis, aiming to replace a linear reference in a wide variety of genomic analyses. The construction of a variation graph from a collection of chromosome-size genome sequences is a difficult task that is generally addressed using a number of heuristics. The question that arises is to what extent the construction method influences the resulting graph, and the characterization of variability.We aim to characterize the differences between variation graphs derived from the same set of genomes with a metric which expresses and pinpoint differences. We designed a pairwise variation graph comparison algorithm, which establishes an edit distance between variation graphs, threading the genomes through both graphs. We applied our method to pangenome graphs built from yeast and human chromosome collections, and demonstrate that our method effectively characterizes discordances between pangenome graph construction methods and scales to real datasets.pancat compare is published as free Rust software under the AGPL3.0 open source license. Source code and documentation are available at https://github.com/dubssieg/rs-pancat-compare. Snapshot available on Software Heritage at swh:1:dir:61acda8ba3dac1709ed60530147d3871831be629Supplementary data are available online at https://doi.org/10.5281/zenodo.10932489. Code to replicate figures and analysis is available online at https://github.com/dubssieg/pancat\\_paper.},\n\turldate = {2025-05-14},\n\tjournal = {Bioinformatics},\n\tauthor = {Dubois, Siegfried and Zytnicki, Matthias and Lemaitre, Claire and Faraut, Thomas},\n\tmonth = may,\n\tyear = {2025},\n\tpages = {btaf291},\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdubssieg%2Frs-pancat-compare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdubssieg%2Frs-pancat-compare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdubssieg%2Frs-pancat-compare/lists"}