theislab / scCODA

A Bayesian model for compositional single-cell data analysis
BSD 3-Clause "New" or "Revised" License
141 stars 23 forks source link

How to save the results as dataframe or show the whole summary? #51

Closed Zifeng-L closed 2 years ago

Zifeng-L commented 2 years ago

Hi here, thank you for giving us a new method for evaluating the celltype abundance. I tried this tool following tutorials but still could not get the full results for my own data. When I tried to print, the data is too long to display completely. Can we write it into csv? so we can use it for other analysis. Thanks a lot!

johannesostner commented 2 years ago

Hi, thanks for your interest in scCODA! There are multiple ways to save the results objects in scCODA.

The two tables for intercepts and effects that you see in result.summary() are pandas DataFrames, which can be saved as csv's by result.intercept_df.to_csv(path_to_file) and result.effect_df.to_csv(path_to_file), respectively.

You can also dump the whole results object via pickle: result.save(path_to_file). This allows you to re-load the class with all its functions later, but is probably not what you are looking for for further analysis.

Zifeng-L commented 2 years ago

Got it! Thanks again!