Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abPOA prune graph #71

Open
cgroza opened this issue Jun 24, 2024 · 9 comments
Open

abPOA prune graph #71

cgroza opened this issue Jun 24, 2024 · 9 comments

Comments

@cgroza
Copy link

cgroza commented Jun 24, 2024

Hi,

Is it possible to delete nodes from a graph, then remap reads to it?

If so, could I have small snippet showing how?
It's not clear to me which fields I need to update when I delete a node.

@yangao07
Copy link
Owner

Hi, do you have an example case where specific nodes need to be deleted?

@cgroza
Copy link
Author

cgroza commented Jun 24, 2024 via email

@yangao07
Copy link
Owner

Thanks! The overall idea of this paper looks interesting.
abPOA does not support APIs for deleting nodes right now.

For diploid input reads, it is indeed a promising scenario for abPOA.
We may implement something specific for it, including deleting nodes.

@cgroza
Copy link
Author

cgroza commented Jun 24, 2024 via email

@yangao07
Copy link
Owner

Sure, you are very welcome to implement!
Here is the code to add node/edge.
So to remove node/edge, you need something similar.

@cgroza
Copy link
Author

cgroza commented Jul 17, 2024

Hi
Thank you for the pointers.

I did manage to remove nodes and edges and the GFA output shows that the graph looks good.
I tried to align reads to the pruned graph and this also works fine in most cases.

However, sometimes I prune the graph and then run the topological sort, I get the error:
"Failed to set node index".

I tried to read the source code but no obvious cause presents to me.
Am I forgetting to update some fields?

@yangao07
Copy link
Owner

In abPOA, graph updating includes adding edges, adding nodes, and adding aligned nodes (for mismatch bases).
So, to remove, you may also remove everything about the node, including edges and aligned nodes.
I am not 100% sure, but did you remove the aligned_node_id for those nodes?

@cgroza
Copy link
Author

cgroza commented Jul 17, 2024 via email

@yangao07
Copy link
Owner

Actually, I think the aligned nodes may not be the issue.
Did you clean the out_edge_n/out_id/in_edge_n/in_id for nodes around the deleted nodes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants