ciernialab / MicrogliaMorphologyR

R package for microglia morphology analysis. Complimentary to ImageJ macro, MicrogliaMorphology
https://ciernialab.github.io/MicrogliaMorphologyR/
Other
6 stars 0 forks source link

Issues Generating Data Table: Problems with skeleton_tidying() and merge_data() Functions #3

Closed EFontBel closed 1 month ago

EFontBel commented 2 months ago

Hi everyone,

I'm experiencing issues with the "skeleton_tidying()" function. It doesn't include some of the SkeletonResult files, resulting in the "fraclac" and "skeleton" data tables having different row numbers. I've tried using different numbers of input images, and although the issue doesn't always occur, it happens frequently. Additionally, when I try to merge the tables using the "merge_data(fraclac, skeleton)" function, the resulting table only contains the column names but is otherwise empty. This issue occurs regardless of whether the "fraclac" and "skeleton" tables have the same number of rows or not. Notably, both the FracLac and SkeletonResult folders contain the same files after using the MicrogliaMorphology plugin on FIJI.

Does anyone know what might be causing this and how I can resolve it?

Thanks! Enrique Font

jenn-kim commented 2 months ago

Hi Enrique,

The skeleton_tidying() function will output a dataframe with row numbers sometimes less than the number of input files because sometimes there are multiple skeletons generated from a single roi: Example1

So, the function takes this into account by only including cells with one skeleton result (aka one line in the .csv file for the cell it is reading in): Example2

I will make a note to either update the function or add an additional function to include an output of IDs for cells that get excluded in this way so that the user can manually search for these in their singlecells image folder for further examination / decision-making.

As for your second issue (merge_data function) - could you check out the discussion in this issue and see if it helps you? https://github.com/ciernialab/MicrogliaMorphologyR/issues/1

If not, could you please include some screenshots of the "Name" columns in your dataframes that you're merging as well as the code that you're using?

Jenn

EFontBel commented 1 month ago

Hi Jenn,

Ok, thanks! I thought that it was missing data during the tying.

And yes, the problem with the "mergedata()" was name for the skeleton analysis file was different to the names for the FracLac analysis. In my case, it included one space before each "".

Thanks for your help!

jenn-kim commented 1 month ago

Awesome, glad that got resolved!