gfatools
gfatools copied to clipboard
gfatools view to subset a gfa file
Hi, sir:
I wanted to subset a gfa file from a region (eg: Chr01:1-10000) , and I thought the parameter -R might help, but got a empty file, may your help me with the right code: The code I used:
[path to]/gfa view -R Chr01:1-10000 -r 1 my.gfa >1_10k.gfa
# I tried -r 1 , -r 10, or without -r
# I also tried -l Chr01:1-10000 with or without -r parameter
It output a empty file 1_10k.gfa
I used vg to construct the graph genome .vg, then got the gfa file.
the example code was successful:
./gfatools view -l MTh4502 -r 1 test/MT.gfa >test/sub.gfa
Thanks for your time.
I am also confused about -R option, each time I use it, I will get an empty file.
However, -l is useful. When I use ./gfatools view -l 1,2,3 my.gfa > subgraph.gfa, the result is segment 1,2,3 and related segments and links.
@pioneer-pi
Thanks for sharing. Yes, -l is useful as the example.
I use vg find to get a subset gfa file now:
vg find -x your.xg -p your_region -c 3 |vg view - > out.gfa