Giter Club home page Giter Club logo

bioinform's People

Contributors

vorontsovie avatar

Stargazers

 avatar

Watchers

 avatar  avatar

bioinform's Issues

Avoiding creation of a new String in files such as validator.rb

Hello Ilya,

This may be really minor but I had a look at files such a validator.rb

There is code such as this:

def to_s
      msg = ""

      if errors && !errors.empty?
        msg += "Errors:\n" + errors.join("\n") + "\n"
      end

      if warnings && !warnings.empty?
        msg += "Warnings:\n" + warnings.join("\n")
      end

      msg.empty? ? "{No errors, no warnings}" : "{#{msg}}"
    end

You can replace "msg +=" with "msg <<".

The reason why I mention this is because << is slightly faster than +=
because you avoid creating a new string object via <<, whereas the
+= variant will create a new String object.

You can try this in IRB to see the new string ID:

x = 'abc'       # => "abc"
x.object_id     # => 76410130
x += 'def'      # => "abcdef"
x.object_id     # => 76379190

x = 'abc'       # => "abc"
x.object_id     # => 76332000
x << 'def'      # => "abcdef"
x.object_id     # => 76332000

You can see in the second example via << the object id
stays the same; in the first example it is changed.

Thanks for reading! May the elegance of ruby be with you.

Suggestion: Please consider adding a short usage example for the commandline scripts of bioinform (those under the bin/ hierarchy)

Hello Ilya,

I had a look at your bioinform gem. You have a README.md in where you list "Command-line applications".

In particular:

  • pcm2pwm
  • split_motifs
  • merge_into_collection

Could you perhaps consider adding ONE usage example for each? Just a short line, e. g. how to use it with any dataset. I would like to test the bioinform gem but I struggle a bit with how things fit together, how to use them and so on.

Thank you for reading! May the beauty of ruby be with you.

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.