pycytominer
pycytominer copied to clipboard
Normalization of Location columns by pycytominer.normalize
When trying to normalize a dataframe, I noticed that pycytominer.normalize is acting on all the _Location_Center_X and Y columns (which are associated with objects' locations). The following code gives me the Nuclei_Location_Center_X and Y columns normalized, which I can't use for single-cell plots since the location is wrong:
df_norm = pycytominer.normalize(df, meta_features = cols_keep, method = 'mad_robustize', mad_robustize_epsilon = 0)
If I specify those columns in a list and provide it to meta_features as an argument, such as:
cols_keep = ['Nuclei_Location_Center_X', 'Nuclei_Location_Center_Y']
Then as a result df_norm will have those columns renamed for Nuclei_Location_Center_X_x and Nuclei_Location_Center_Y_x as the raw features columns, and also Nuclei_Location_Center_X_y and Nuclei_Location_Center_Y_y with the normalized values.
For me, it's just a fact of dropping those columns before normalization or adjusting the column's names for the following analysis, since pycytominer is working perfectly for me! Maybe it's something to draw attention to in the documentation.