marschall-lab / gaftools

General purpose utility related to GAF files
https://gaftools.readthedocs.io/
MIT License
9 stars 0 forks source link

Feature Request: Orient a GFA #4

Open mir-cat opened 1 year ago

mir-cat commented 1 year ago

I have a request related to the orientation of the sequence in GFA graphs. With the GFA graphs I am working with, the strand represented in the GFA segment sequence is essentially random. One way this manifests in the graph is that links from the same node end arrive have opposite "to orientation" For example, for nodes utig4-1529 to utig4-1530 and utig4-1527 in this fork structure

Screenshot 2023-08-14 at 3 50 36 PM

The edge from 1529 to 1530 has a + "to orientation" while the edge to 1527 has a - "to orientation"

Screenshot 2023-08-14 at 4 05 08 PM

I believe that this could be done, in the acyclic case, by traversing the graph from one end to the other and taking reverse complements when relative misorientations are detected.

tobiasmarschall commented 1 year ago

I encouraged @mir-cat to post this feature request because I thought that this might fit into the order_gfa subcommand (see https://github.com/marschall-lab/gaftools/blob/main/gaftools/cli/order_gfa.py).