MatchAlign

R-CMD-check

An R package for parsing GAF and GFA files, allowing easier interpretation and pangenomic analysis.

Installation

# install.packages("remotes")
remotes::install_github("cromazurek/MatchAlign")

Usage

Parse GFA files

GFA (Graphical Fragment Assembly) files encode the variation captured by pangenome graphs. parse_paths_gfa() extracts the segment path for each accession from P (path) and W (walk) lines.

library(MatchAlign)

accession_paths <- parse_paths_gfa("path/to/example.gfa")
# Returns named list: each accession represented as vector of segment names
accession_paths[["CM294333.1"]]
#> [1] "2+" "3+" "4+" "6+" "7+" "9+" "10+"

Parse GAF files

GAF (Graph Alignment Format) files store alignments of sequences to a pangenome graph. parse_paths_gaf() extracts the segments traversed by each alignment.

alignment_paths <- parse_paths_gaf("path/to/example.gaf")
# Returns a named list: read name -> vector of segment names
alignment_paths[["A01127:121:HCLF5DRX5:2:2203:13579:24680"]]
#> [1] "5001" "5002" "5003" "5004" "5005" "5006" "5007"

Input formats