atlas_protocol_scripts.tl.long_form_df_to_decoupler#
- atlas_protocol_scripts.tl.long_form_df_to_decoupler(df, *, gene_col='gene_id', p_col='pvalue', log_fc_col='log2FoldChange', group_col='cell_type')#
Convert a long-form data frame of DE results into a pair of logFC/pvalue matrices as used by decoupler.
- Parameters
df (
DataFrame) – long-form pandas data framegene_col (
str(default:'gene_id')) – column that contains the gene identifier (will be columns of the matrices)p_col (
str(default:'pvalue')) – column that contains the p-value or adjusted p-valuelog_fc_col (
str(default:'log2FoldChange')) – column that contains the log fold changegroup_col (
str(default:'cell_type')) – column that contains some grouping information (will be rows of the matrices)
- Return type