Giter VIP home page Giter VIP logo

hclust's Introduction

Welcome

banner that says James Knight - programmer, scientist and bioinformatician alongside a cartoon of James

Although formally trained as a molecular biologist, I have been programming for over twenty years. I specialize in making webs apps for analyzing and sharing data, as well as for general scientific productivity.

Around the web

hclust's People

Contributors

derekperkins avatar knightjdr avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

hclust's Issues

Feature Request: Improved handling of node names

The Problem

You libraries proofs really useful to create a dendrogram, but at the moment it is not really possible iterate through the tree structure and colleced the leaf names (e.g. ids) by their distance: The dendogram data structure itself doesn't know the names (the labels are only node numbers), and when processed with the Tree() method, I only receive a string (Newick) representation of the tree with names/ids assigned. I would have to parse this string representation, which is error-prone and not really desirable performance-wise.

In more general terms, the use of the generate Tree is quite limited at the moment.

My Proposal

Let the Tree() method return a typed Tree (which doesn not just hold some strings but nodes and leafs (with distance as well as names/ids). The returned Tree type could provide a method String() for the Newick representation, as well as an Order() method and maybe some others.

The advantage of this approach is not limited to my special use case: in general a real tree structure allows you (and all users of the library basically) to provide more and more methods on that very Tree, not just String() and Order(), and could be even abstracted into a visitor pattern (which might become more relevant once Generics finally make it onto Go, which should happen in the nearer future). With the visitor pattern, you'ld unlock huge flexibility without the need add new methods.

If I find time I could try to provide a PR myself, but I'ld like to hear your opinion about that first.

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.