neurorestore / Libra

MIT License
153 stars 25 forks source link

Issue of avg_logFC in pseudobulk RNA seq output file #42

Open jujurring opened 1 year ago

jujurring commented 1 year ago

I wonder why avg_LFC column is multiplyed by "-1" in libra pseudobulk RNA seq output file. I think It changed the direction of expression in DEG genes.

For example ,I ran the pseudo bulk RNA seq using two samples which are the IL6 High cluster and IL6 low cluster. I got the output file and there are IL6 gene is negative DEG in IL6High cluster as the "-8.2"

cell_type | gene | avg_logFC | p_val | p_val_adj | de_family | de_method | de_type Il-6-high | Il6 | -8.236474 | 9.177778e-06 | 0.006047032 | pseudobulk | edgeR | LRT

jordansquair commented 1 year ago

It is just to make it consistent with other softwares that define label orders. You just need to set your factor levels in your meta data prior to running it to give the desired direction.

jujurring commented 1 year ago

Thank you for your reply.

I ran this code to relevel the metadata but i got the same result about the direction of gene expresion .

My code is meta_vsmc$vsmc <-relevel(factor(meta_vsmc$vsmc), ref = "VSMC_Il-6-low") VSMC@meta.data <- meta_vsmc

Pseudo bulk analysis

vsmc_de = run_de(VSMC, meta = meta_vsmc, cell_type_col = "vsmc", label_col = "status", replicate_col = "replicate", de_family = 'pseudobulk', de_method = 'edgeR', de_type = 'LRT')

Is this code wrong to relevel the metadata? I'm used to run DEseq2 in RNA sequencing so i 'm not good at EdgeR code.

jordansquair commented 1 year ago

just re-level with the other group as your reference then.