maickrau / GraphAligner

MIT License
256 stars 30 forks source link

Mapping long reads to HGSVC graph #61

Closed jiadong324 closed 2 years ago

jiadong324 commented 2 years ago

Dear author,

I am trying to align long reads to HGSVC graph (HGSVC_hs38d1.vg) used in Giraffe paper.

Error message is:

GraphAligner bioconda 1.0.16-
Load graph from ./HGSVC_hs38d1.gfa
Error in the graph: Unspecified edge overlaps (*) are not supported

Is that mean the graph contain overlapped edges?

Thanks!

maickrau commented 2 years ago

The graph has edges which don't have overlaps specified. GraphAligner requires that all edges explicitly specify the overlap. If it's a vg graph then the edges most likely should have no overlap but you should confirm this with the people who made the graph. In case the edges do have no overlap, you can replace the unspecified edge overlaps with zero overlap using the following awk command:

awk 'BEGIN{OFS=FS="\t";}$1!="L"||$6!="*"{print;}$1=="L"&&$6=="*"{$6="0M";print;}' < HGSVC_hs38d1.gfa > HGSVC_hs38d1-fix.gfa
jiadong324 commented 2 years ago

Thanks! This works now!