Saving scCODA proportion data to a csv in Pertpy

Is it possible to export the individual proportion data for each sample generated from scCODA in Pertpy into a csv?

I want to obtain the matrix that generates the plot using the following function in the tutorial, modality_key=“coda_salm”, feature_name=“condition”, add_dots=True)

Dear @hmnzo5gy,

if I understand you right you should be able to access the data using something like:


Thank you Zethson. I want to obtain the proportions and perform statistical tests on the proportions between different groups. How should I organize the .X matrix and export a csv file for this purpose?
What I’ve tried is using the following to export a csv with the count X matrix

df_prop = df.div(df.sum(axis=1), axis=0)
df_prop=df_prop * 100

Is there a more straight forward way to directly export a csv file containing the proportions and count for each sample for downstream statistical test?