Starlitnightly / omicverse

A python library for multi omics included bulk, single cell and spatial RNA-seq analysis.
https://starlitnightly.github.io/omicverse/
GNU General Public License v3.0
474 stars 57 forks source link

dds.deg_analysis function error #163

Open WeiQin2001 opened 2 months ago

WeiQin2001 commented 2 months ago

Run the follow code: test_adata=adata[adata.obs['cell_type'].isin(['CD4 T cells'])] dds=ov.bulk.pyDEG(test_adata.to_df(layer='counts').T) dds.drop_duplicates_index() print('... drop_duplicates_index success')

treatment_groups=test_adata.obs[test_adata.obs['label']=='stim'].index.tolist() control_groups=test_adata.obs[test_adata.obs['label']=='ctrl'].index.tolist() dds.deg_analysis(treatment_groups,control_groups,method='DEseq2')

the error can be found:

TypeError Traceback (most recent call last) Cell In[43], line 8 6 treatment_groups=test_adata.obs[test_adata.obs['label']=='stim'].index.tolist() 7 control_groups=test_adata.obs[test_adata.obs['label']=='ctrl'].index.tolist() ----> 8 dds.deg_analysis(treatment_groups,control_groups,method='DEseq2')

File ~/miniconda3/envs/omicverse/lib/python3.10/site-packages/omicverse/bulk/_Deseq2.py:566, in pyDEG.deg_analysis(self, group1, group2, method, alpha, multipletests_method, n_cpus, cooks_filter, independent_filter) 564 #Determining the version of pydeseq2 smaller than 0.4 565 if pydeseq2.version<='0.3.5': --> 566 dds = DeseqDataSet( 567 counts=counts_df, 568 clinical=clinical_df, 569 design_factors="condition", # compare samples based on the "condition" 570 ref_level=["condition", "Control"], 571 # column ("B" vs "A") 572 refit_cooks=True, 573 n_cpus=n_cpus, 574 ) 575 elif pydeseq2.version<='0.4.1': 576 dds = DeseqDataSet( 577 counts=counts_df, 578 metadata=clinical_df, (...) 583 n_cpus=n_cpus, 584 )

TypeError: DeseqDataSet.init() got an unexpected keyword argument 'ref_level'

Snipaste_2024-09-22_23-37-07

Starlitnightly commented 2 months ago

Maybe you need to update the pydeseq2

Starlitnightly commented 1 month ago

Could you try pydeseq2==0.4.1 ?

WeiQin2001 commented 1 month ago

Yes, update the version of pydeseq2 can sovle this problem! thank you!!!