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
pt.pl.coda.boxplots(sccoda_data, 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:

sccoda_data["coda_salm"].X

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

adata=sccoda_data["coda_salm"]
df=adata.X
#count
pandas.DataFrame(data=df,index=adata.obs_names,columns=adata.var_names).to_csv('coda.csv')
#proportions
df_prop = df.div(df.sum(axis=1), axis=0)
df_prop=df_prop * 100
pandas.DataFrame(data=df_prop,index=adata.obs_names,columns=adata.var_names).to_csv('coda_prop.csv')

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?