Skip to content
New issue

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

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

Already on GitHub? # to your account

chromosomes should return String array or make GenomicRanges accept Symbol array #26

Closed
Marlin-Na opened this issue Nov 15, 2020 · 4 comments

Comments

@Marlin-Na
Copy link

I think GenomicRanges perhaps should accept Array{Symbol,1} as chromosomes as well since chromosomes function is returning Array{Symbol,1}. Alternatively, chromosomes should return a String Array (which I prefer, since strings might be easier to work with).

Currently, I have to use map to replicate a GenomicRanges:

GenomicRanges(map(String, chromosomes(gr)), starts(gr), ends(gr), chr_info(gr))

Ideally, this should work:

GenomicRanges(chromosomes(gr), starts(gr), ends(gr), chr_info(gr))

Anyway, this should be a minor issue on UX.

@phaverty
Copy link
Owner

I thought about this a bunch when I did my last big batch of work on this project. Symbols seem like the right thing to use internally because I want them to be immutable labels. I've even played with making them part of the type definition by making the chromosomes slot a NamedTuple. I probably want both Symbol and String to work in the user API. I should experiment with this more now that Strings are more efficient (in 1.5+).

@Marlin-Na
Copy link
Author

Thanks @phaverty . I don't have much to comment about the Symbol vs String for internal use. But your idea of making them as part of type definition is interesting. Even chromosome lengths could be part of the type definition, so that it could be used to parameterize scalar integer as "genopos" (mentioned in #25 ). But such complex type probably would slow down JIT compiling. Also it won't work with megagenome, which might contain thousands of contigs.

@phaverty
Copy link
Owner

phaverty commented Dec 8, 2020

I did a bit of work to get GenomicVectors updated for some recent updates in Julia and dependency packages. I'll be able to have a look at this now.

@phaverty
Copy link
Owner

phaverty commented Jan 1, 2021

Fixed by 47078ec

@phaverty phaverty closed this as completed Jan 1, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants