Parsing GFA and GAF Alignment Files

Provides tools for extracting segment paths from Graphical Fragment Assembly ('GFA') and Graph Alignment Format ('GAF') files. parse_paths_gfa() reads P (path) and W (walk) records and returns a named list of segment identifiers for each accession. parse_paths_gaf() parses the path string from each alignment and returns a named list of segments traversed by each query. parse_segment_lengths_gfa() reads S records and returns a named list of segment lengths keyed by segment identifier. These tools are intended to simplify downstream interpretation and analysis of pangenome graphs.


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

  • GFA: plain-text, tab-delimited. P lines (column 2 = accession name, column 3 = comma-separated segments) and W lines (key = sample#hap_index#seq_id, column 7 = >/<-delimited walk) are supported.
  • GAF: plain-text, tab-delimited. Column 1 = query name, column 6 = path string (e.g. >seg1>seg2<seg3).

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("MatchAlign")

0.1.2 by Camille R. Mazurek, a month ago


https://github.com/cromazurek/MatchAlign


Report a bug at https://github.com/cromazurek/MatchAlign/issues


Browse source code at https://github.com/cran/MatchAlign


Authors: Camille R. Mazurek [aut, cre] , Michael J. Tisza [ctb]


Documentation:   PDF Manual  


MIT + file LICENSE license


Suggests testthat


See at CRAN