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

Add low level methods for handle graphs #129

Open
rlorigro opened this issue Oct 4, 2021 · 2 comments
Open

Add low level methods for handle graphs #129

rlorigro opened this issue Oct 4, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@rlorigro
Copy link
Contributor

rlorigro commented Oct 4, 2021

I've been using paths quite a lot in bdsg and found that a couple methods would simplify things:

pop_path_front/back
rename_path

Based on the existing methods prepend_step and append_step, pop should be equivalently complex for each implementation. As it is now I am using this to "pop" elements:

        auto begin = graph.path_begin(p);
        auto next = graph.get_next_step(begin);
        graph.rewrite_segment(begin, next, vector<handle_t>());

And for the path renaming, I copy the entire path and delete the old one, so it would be cool if there was a copy-free method.

@rlorigro rlorigro added the enhancement New feature or request label Oct 4, 2021
@rlorigro
Copy link
Contributor Author

rlorigro commented Oct 18, 2021

A couple more that may be worth adding:

flip_edge(edge_t)
get_edge_count(handle_t h, bool go_left)   # nevermind about this one, just learned it is called get_degree()

@rlorigro rlorigro changed the title Add low level methods for paths Add low level methods for handle graphs Oct 18, 2021
@rlorigro
Copy link
Contributor Author

Another method that might be nice:

for_base_in_sequence(const function<void(char& base)>& f)

At the moment, the only way to iterate every base in a sequence (for kmer counting, for example) is to copy the whole sequence, or to use get_base() which may have to use a hash map for every iteration, depending on which implementation is used.

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

No branches or pull requests

1 participant