r/CircleProgramming • u/Illuminatesfolly • Mar 21 '13
How do I make this code faster without loosing the function?
http://pastebin.com/ie9XTrc7
3
Upvotes
r/CircleProgramming • u/Illuminatesfolly • Mar 21 '13
View all comments
Show parent comment
1
u/Illuminatesfolly Mar 21 '13
So, this is a part of a panel that draws a Motif Tree and recolors it depending on the "clustering threshold" that the user defines by left clicking somewhere on screen. All of the nodes and connecting lines of the tree to the right (inside of the clustering threshold) are recolored to denote that they are all one "motif". Simultaneously, the program groups nodes into "clusters", the names of which are an established convention in the fasta file database that went into making the tree. A GraphicalCluster is a class that I made that contains all of the nodes in the cluster and an associated color (as well as their on screen coordinates, which are used to define an area on screen that the cluster occupies).
When the user clicks, the tree is subdivided and all of the same color parts are grouped together. Later on, these groups of clusters can be right clicked to recompute a meta-motif for the given motifs that are represented by the branches of the tree.
It looks like this when it is functioning correctly, and slowly.
ALso, an update, I rewrote the main sort portion recursively, and that cut down on time somewhat, but its still slow.