ggonnella / gfapy

Gfapy: a flexible and extensible software library for handling sequence graphs in Python
Other
65 stars 7 forks source link

Improve documentation on Methods to access segments, edges, etc. by id #28

Open nhansen opened 1 year ago

nhansen commented 1 year ago

Thanks @ggonnella for a great library!

This is more of a question than an issue. I don't see any documentation on how I can access particular segments and edges in my gfa object after I've read it in from a file. Is there a simple way to do something like gfa.get_segment('mysegid')?

Thanks again, --Nancy

ggonnella commented 1 year ago

Hi Nancy, thank you.

Sure. You can use gfa.segment("mysegid") or gfa.line("mysegid").

Kind regards GIorgio

nhansen commented 1 year ago

Thanks so much! I knew there had to be a way, but couldn't guess it.

--Nancy

ggonnella commented 1 year ago

Have a look to the manual! :)

nhansen commented 1 year ago

I actually spent quite a bit of time reading the manual, but I didn't catch the one place that you use the Gfa segment method, in a section titled "Renaming lines." And there you only use the method to illustrate how to rename segments:

g.segment('A').name = 'C'

As far as I can tell, you never give the usage elsewhere. But still, thanks for the library!

ggonnella commented 1 year ago

Fair enough

I think it's explained in section 3.2, but maybe not good enough.

Thank you for asking!

nhansen commented 1 year ago

Thanks Giorgio. We'll have to agree to disagree then, because all I see in section 3.2 is methods that return strings, when I wanted a method to return the Segment object from the id. I think it would be nice to add a couple of sentences somewhere to introduce these methods, but I fully admit that I'm being picky about an otherwise very useful package. Thanks again for your help!

ggonnella commented 1 year ago

You're right

I reopen the issue and improve the docs.

Thank you for pointing this out.