Rust gfautil
Command line tool for various operations on GFA and related files.
Usage
Install with cargo:
Or clone and build it:
The compiled binary will be located at target/release/gfautil.
)
GAF -> PAF
Given a GAF file, and the GFA used to create it, output a PAF file derived from the GAF records. For every path segment in each GAF record, a corresponding PAF record is produced.
Convert example.gaf, via example.gfa, with output on stdout:
Save output to out.paf:
GFA -> VCF
Find the ultrabubbles in the input GFA, then use those to identify variants. For each ultrabubble, the section covered by the bubble is extracted from each embedded path. Those sub-paths are then compared pairwise.
The -u option can be used to load the ultrabubbles from a file (output
by the ultrabubbles command) instead of computing them.
Currently the variant identification is mostly based on the nodes that make up each path, and only barely takes the sequences into account.
Outputs is in the VCF format, on stdout.
There's a setting to skip comparing a pair of paths if their orientations at the start and end of the bubble don't match:
Loading the list of ultrabubbles from a file:
Identify SNPs in GFA against reference path
Given the name of a path in the input GFA to use as reference,
identify SNPs among all other paths, using either a list of
ultrabubbles constructed using the gfautil ultrabubbles command, or
a list of SNP positions.
Outputs a tab-delimited list in the format:
<query-path-name>\t<reference base>\t<reference pos>\t<query base>\t<query pos>
SNP positions can be provided as a list in the arguments to gfautil:
SNP positions can also be provided as a file, with one position per line:
Using ultrabubbles from a file:
Subgraph
Return a subgraph of the given GFA. Provide either a list of segment names, or a list of path names. If segment names are provided, the resulting subgraph will include the lines that contain at least one of those segments. If path names are provided, the segments in the given paths are used instead.