Starlitnightly/omicverse

How to get the filtered dataframe with dds.foldchange_set?

Closed this issue · 2 comments

Hi,
How do I get the filtered dataframe under dds.foldchange_set parameters?

And, the output of dds.foldchange_set(fc_threshold=-1, pval_threshold=0.05, logp_max=10), like Fold change threshold: 1.5340973642745421 is the raw foldchange of DEGs of the log2 foldchange of DEGs?
If I would like to set the increased and decreased foldchange thresholds simultaneously, could I write like this fc_threshold=[-1.5, 1.5]?

Thank you very much!

Hi,

You can use result=dds.result.loc[dds.result['sig']!='normal'] to get the filtered dataframe in result. Besides, you can set fc_threshold=1.5 to set the increased and decreased foldchange thresholds simultaneously.

But more flexibly, you can manually go ahead and specify different upper and lower thresholds with just the following code:

dds.result['sig']='normal'
dds.result.loc[dds.result['log2FC']>1.5,'sig']='up'
dds.result.loc[dds.result['log2FC']<-1.5,'sig']='down'

Sincerely,

Zehua

Thank you very much.