gfapy icon indicating copy to clipboard operation
gfapy copied to clipboard

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

Open nhansen opened this issue 2 years ago • 7 comments

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

nhansen avatar Jan 24 '23 13:01 nhansen

Hi Nancy, thank you.

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

Kind regards GIorgio

ggonnella avatar Jan 26 '23 07:01 ggonnella

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

--Nancy

nhansen avatar Jan 26 '23 15:01 nhansen

Have a look to the manual! :)

ggonnella avatar Jan 26 '23 18:01 ggonnella

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!

nhansen avatar Jan 26 '23 21:01 nhansen

Fair enough

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

Thank you for asking!

ggonnella avatar Jan 26 '23 21:01 ggonnella

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!

nhansen avatar Jan 26 '23 22:01 nhansen

You're right

I reopen the issue and improve the docs.

Thank you for pointing this out.

ggonnella avatar Jan 27 '23 10:01 ggonnella