diff --git a/setup.py b/setup.py index 6abe3cf1b573abb65a0ce31a453b470c801dd148..9f9ac82ee5a96ab610b33371a72757e89968a872 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r") as fh: setuptools.setup( name = "impetuous-gfa", - version = "0.35.2", + version = "0.35.3", author = "Richard Tjörnhammar", author_email = "richard.tjornhammar@gmail.com", description = "Impetuous Quantification, a Statistical Learning library for Humans : Alignments, Clustering, Enrichments and Group Analysis", diff --git a/src/impetuous/clustering.py b/src/impetuous/clustering.py index d79d343ad18c357a0f1a0c95859777d7cffe3e7d..255ee59bfd03faa7023ac2b4b5737881ac24c2dd 100755 --- a/src/impetuous/clustering.py +++ b/src/impetuous/clustering.py @@ -109,7 +109,7 @@ from scipy.spatial.distance import squareform , pdist absolute_coordinates_to_distance_matrix = lambda Q:squareform(pdist(Q)) distance_matrix_to_geometry_conversion_notes = """ -*) TAKE NOTE THAT THE OLD ALGORITHM CALLED DISTANCE GEOMETRY EXISTS. IT CAN BE EMPLOYED TO ANY DIMENSIONAL DATA. HERE YOU FIND A SVD BASED ANALOG OF THAT OLD METHOD +*) TAKE NOTE THAT THE OLD ALGORITHM CALLED DISTANCE GEOMETRY EXISTS. IT CAN BE EMPLOYED TO ANY DIMENSIONAL DATA. HERE YOU FIND A SVD BASED ANALOG OF THAT OLD METHOD. *) PDIST REALLY LIKES TO COMPUTE SQUARE ROOT OF THINGS SO WE SQUARE THE RESULT IF IT IS NOT SQUARED. @@ -366,17 +366,15 @@ def make_clustering_visualisation_df ( CLUSTER , df=None , add_synonyms = False clustering_df.to_csv( output_name , '\t' ) return ( clustering_df ) - - -def exact_backprojection_clustering ( analyte_df , bRanked=False , n_dimensions=2 , - bDoFeatures=True , bDoSamples=True ): +def backprojection_clustering ( analyte_df , bRanked=False , n_dimensions=2 , + bDoFeatures=True , bDoSamples=True ) : from scipy.stats import rankdata - if bRanked: + if bRanked : rana_df = analyte_df .apply( lambda x:(rankdata(x,'average')-0.5)/len(x) ) - else: + else : rana_df = analyte_df - dimcrdnames = [ 'd'+str(i) for i in n_dimensions ] + dimcrdnames = [ 'd'+str(i) for i in range(n_dimensions) ] # # Do backprojection clustering with backprojection cluster_coords_f = None