Ejemplo n.º 1
0
                shortest.append(x)
    
    
        # Insert the spines in perc
    def calc_perc_pos(self, start, end, value):
        """Calc the percentual of the spine in the dends
        lenght : 1 = value : x
        x = value/lenght 
        """
        real_value = value - start
        length = end -start
        x = real_value/length
        return x
        
if __name__ == "__main__":
    l = Loader()
    
    spines_pos = l.load('spines_pos.pickle')
    plt.hist(spines_pos, bins=30, label='normal')
    
    spinePer = spinePercentual()
    spines_pos = spinePer.reduce_noise(spines_pos)
    
    plt.hist(spines_pos, bins=30, label='noise red')
    plt.legend()
    
    print "Calculating the spines pos normalized to 1"
    spinePer.convert_to_perc(spines_pos)
    l.save(spinePer.mids, '.', 'mid_spines_per_branch.pickle')
    l.save(spinePer.dists, '.', 'dist_spines_per_branch.pickle')
    plt.show()