Code Monkey home page Code Monkey logo

Comments (5)

TransGirlCodes avatar TransGirlCodes commented on June 4, 2024

Thanks for pointing this out @diegozea, perhaps we can include this method in version 2.0.

from biosequences.jl.

ardakdemir avatar ardakdemir commented on June 4, 2024

I have been going over the source code to get familiar and to add this functionality. I could not understand how the decode function call in indexing.jl properly decodes the given Int representation. I could not find a decode function in the source code. Below is the corresponding code from indexing.jl:

@inline function inbounds_getindex(seq::BioSequence{A}, i::Integer) where {A}
    j = bitindex(seq, i)
    @inbounds return decode(A, (seq.data[index(j)] >> offset(j)) & mask(A))
end

from biosequences.jl.

TransGirlCodes avatar TransGirlCodes commented on June 4, 2024

@ardakdemir The definitions for encode and decode are found here in the body of this loop

for A in (DNAAlphabet, RNAAlphabet)
. How encoding and decoding is done, depends on the alphabet parameter A of the BioSequence{A}, and so A is the first argument to the decode method, so as Julia's compiler can select the correct decode method at compile time.

from biosequences.jl.

ardakdemir avatar ardakdemir commented on June 4, 2024

@benjward Thanks for the explanation. @diegozea I have added a trivial implementation of subsequencing functionality on the "subsequencing" branch. Maybe you can give it a try.

from biosequences.jl.

jakobnissen avatar jakobnissen commented on June 4, 2024

This appears to be fixed on master, so closing it

from biosequences.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.