-
Notifications
You must be signed in to change notification settings - Fork 48
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
Feature: concatenate bases with sequences #284
Comments
You can do More broadly, Base Julia tends to conflate containers of elements with elements: julia> iterate(5) # scalars are iterable
(5, nothing)
julia> hcat([1], 1) # scalars are equivalent to 0-dimensional tensors
1×2 Matrix{Int64}:
1 1
julia> eltype('a') # Chars apparently contain chars???
Char I think this is a design mistake, and I'm skeptical of bringing it into BioJulia. That's why we have: julia> iterate(DNA_A)
ERROR: MethodError: no method matching iterate(::DNA)
julia> append!(dna"TAG", DNA_A)
ERROR: MethodError: no method matching append!(::LongSequence{DNAAlphabet{4}}, ::DNA)
julia> dna"TAG" * DNA_A
ERROR: MethodError: no method matching *(::LongSequence{DNAAlphabet{4}}, ::DNA) |
I agree that it's a design mistake, I'm slightly less skeptical of replicating it though. I think I'm on @jakobnissen's side, but could be persuaded. I do think there's some utility in matching the semantics of Base, even when they're probably not great. That said, I think the desire to use |
Maybe having an operator that mimics the behavior. Currently it is possible to:
What if we get an operator that sends the |
You can certainly convert a biosymbol to a sequence - you just have to be explicit about it: julia> dna"S" * LongDNA{4}([DNA_W])
2nt DNA Sequence:
SW |
This operation can be done with strings and chars in Julia, seems like the analogous should be possible.
The text was updated successfully, but these errors were encountered: