Giter Site home page Giter Site logo

biojulia / biosymbols.jl Goto Github PK

View Code? Open in Web Editor NEW
30.0 13.0 14.0 2.15 MB

Nucleic and amino acid primitive types

Home Page: https://biojulia.dev/BioSymbols.jl/stable/

License: MIT License

Julia 100.00%
biology bioinformatics biological-data-analysis computational-biology nucleotides nucleic-acids amino-acids biojulia

biosymbols.jl's Introduction

BioSymbols

Latest release MIT license Stable documentation Latest documentation Pkg Status Chat

Description

BioSymbols defines the primitive types for nucleic acids and amino acids that are used for many other packages in the BioJulia software ecosystem.

Installation

BioSymbols is bundled into BioSequences and so you may not need to install this package explicitly.

You can install BioSymbols from the julia REPL. Press ] to enter pkg mode again, and enter the following:

add BioSymbols

If you are interested in the cutting edge of the development, please check out the master branch to try new features before release.

Testing

BioSymbols is tested against Julia 1.X on Linux, OS X, and Windows.

Unit tests Documentation

Contributing

We appreciate contributions from users including reporting bugs, fixing issues, improving performance and adding new features.

Take a look at the contributing files detailed contributor and maintainer guidelines, and code of conduct.

Financial contributions

We also welcome financial contributions in full transparency on our open collective. Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.

Backers & Sponsors

Thank you to all our backers and sponsors!

Love our work and community? Become a backer.

backers

Does your company use BioJulia? Help keep BioJulia feature rich and healthy by sponsoring the project Your logo will show up here with a link to your website.

Questions?

If you have a question about contributing or using BioJulia software, come on over and chat to us on Gitter, or you can try the Bio category of the Julia discourse site.

biosymbols.jl's People

Contributors

bicycle1885 avatar ciaranomara avatar dcjones avatar jakobnissen avatar jamiecm17 avatar kescobo avatar mortenpi avatar staticfloat avatar timholy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

biosymbols.jl's Issues

Errors thrown when using symbols as pmap input with multiple Julia processes

Expected Behavior

Amino acid and nucleic acid symbols are passed along like other values when using multiple Julia processes.

Current Behavior

Error is thrown when using more than one Julia process.

Possible Solution / Implementation

Steps to Reproduce (for bugs)

  1. start interpreter with julia -p 2
julia> using BioSymbols
julia> f(aa) = aa
julia> pmap(f, [AA_A])
ERROR: MethodError: no method matching write(::TCPSocket, ::BioSymbols.DNA)
Closest candidates are:
  write(::IO, ::Any) at io.jl:284
  write(::IO, ::Any...) at io.jl:286
  write(::IO, ::Complex) at complex.jl:175
  ...
Stacktrace:
 [1] #573 at ./asyncmap.jl:178 [inlined]
 [2] foreach(::Base.##573#575, ::Array{Any,1}) at ./abstractarray.jl:1733
 [3] maptwice(::Function, ::Channel{Any}, ::Array{Any,1}, ::Array{BioSymbols.DNA,1}, ::Vararg{Array{BioSymbols.DNA,1},N} where N) at ./asyncmap.jl:178
 [4] wrap_n_exec_twice(::Channel{Any}, ::Array{Any,1}, ::Base.Distributed.##204#207{WorkerPool}, ::Function, ::Array{BioSymbols.DNA,1}, ::Vararg{Array{BioSymbols.DNA,1},N} where N) at ./asyncmap.jl:154
 [5] #async_usemap#558(::Function, ::Void, ::Function, ::Base.Distributed.##188#190, ::Array{BioSymbols.DNA,1}, ::Vararg{Array{BioSymbols.DNA,1},N} where N) at ./asyncmap.jl:103
 [6] (::Base.#kw##async_usemap)(::Array{Any,1}, ::Base.#async_usemap, ::Function, ::Array{BioSymbols.DNA,1}, ::Vararg{Array{BioSymbols.DNA,1},N} where N) at ./<missing>:0
 [7] (::Base.#kw##asyncmap)(::Array{Any,1}, ::Base.#asyncmap, ::Function, ::Array{BioSymbols.DNA,1}) at ./<missing>:0
 [8] #pmap#203(::Bool, ::Int64, ::Void, ::Array{Any,1}, ::Void, ::Function, ::WorkerPool, ::Function, ::Array{BioSymbols.DNA,1}) at ./distributed/pmap.jl:126
 [9] pmap(::WorkerPool, ::Function, ::Array{BioSymbols.DNA,1}) at ./distributed/pmap.jl:101
 [10] #pmap#213(::Array{Any,1}, ::Function, ::Function, ::Array{BioSymbols.DNA,1}) at ./distributed/pmap.jl:156
 [11] pmap(::Function, ::Array{BioSymbols.DNA,1}) at ./distributed/pmap.jl:156

Your Environment

  • Package Version used: 2.0.0
  • Julia Version used: 0.6.3
  • Operating System and version (desktop or mobile): Linux 4.13.0

Getting string name of amino acids or other symbols (dna/rna)

I have a table of the masses of each amino acid and their names but there doesn't seem to be any easy way of getting the table in https://biojulia.net/BioSequences.jl/stable/symbols/#Amino-acids-1. So I have to create the mapping between these weird AA_M things and "Methionine" manually, mainly doing this by accessing the docstrings ๐Ÿคฃ. Is there functionality to make this easier?

Could there be the table or a function to access the real names of these things?

Just noticed that string(AA_M) at least gives me the 1-char representation.

thanks

Add the alphabets

I think the alphabets from BioSequences might be better placed here. They may be useful in contexts outside of BioSequences and I think it's natural to keep the alphabets with their symbol elements. BioSequences can then import and e-export them, just as it does with the symbols.

Version 5

Right, so we've made two breaking changes over the last months:

  • Remove conversion to/from integers (#38)
  • Remove iteration of biosymbols (#41)

I'd like to merge v5 soon, since it's required for BioSequences v3. Is anything missing that this package needs?

It would be neat to have an interface (#42), such that it was unabiguously clear what you needed to implement if you wanted to make a new BioSymbol type - but I don't think it's critical to get that into place, and changing the interface could risk being quite breaking, so I think we don't need to do it now, or perhaps ever.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

tryparse should not return Nullable

The current method of tryparse(AminoAcid, str) returns a nullable value, which is the standard way of Julia 0.5 and 0.6. However, the next version of Julia (i.e. 0.7) will deprecate the nullable type and Julia 1.0 will remove it at all. Along with it, tryparse will be changed to return a "nothing"-able value of Union{T,Nothing} type. For example, trypare(Int, "xxx") returns nothing to indicate that it failed to parse the given string as an integer. We should respect the convention in the next version of BioSymbols.jl (maybe in BioSymbols.jl 0.3).

Remove iteration of BioSymbol

In Base Julia, almost anything can be iterated, e.g. integers. I really, really dislike that. How many times have you done something like

for i in n_iter
    foo()
end

only to find out you should have done for i in 1:n_iter? This weak typing causes unneeded errors, and I can't really think of a reason it should be there. In general, if you try to iterate a non-collection, something has gone wrong in your algorithm.

I suggest we remove iterate it from BioSymbols.

Does this pakcage need an interface?

Suppose someone who studied modified RNAs want to work with this package. So they create a new BioSymbol type (and an Alphabet type for BioSequences work).

Does it make sense to have an interface with what is minimally expected to implement? I suppose one can get away with implementing very little.

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.