saezlab / decoupleR

R package to infer biological activities from omics data using a collection of methods.
https://saezlab.github.io/decoupleR/
GNU General Public License v3.0
183 stars 24 forks source link

Inconsistent condition values in the decouple function output #56

Closed vntasis closed 2 years ago

vntasis commented 2 years ago

Brief description I am following one of your tutorials (https://saezlab.github.io/decoupleR/articles/tf_bk.html). When I run the decouple function with just one condition as in the example below, some of the techniques return as condition name the column name ('FC_Pvalue'), while others return the value 'V1' as condition. This creates an inconsistency, with the function providing two consensus values per transcription factor instead of just one (one for 'FC_Pvalue', another for 'V1').

It is not a big deal. The workaround is to not run consensus with the decouple function, correct the inconsistency manually in the 'condition' column, and then run the run_consensus function. However, it would make sense to correct this.

Example

>   activity_de <-
+     decouple(deg[, 'FC_Pvalue', drop=FALSE], net,
+              .source = 'source', .target = 'target')

>   activity_de %>% filter(source=="ATF1")
# A tibble: 5 x 6
  run_id statistic source condition  score p_value
   <dbl> <chr>     <chr>  <chr>      <dbl>   <dbl>
1      1 mlm       ATF1   FC_Pvalue 0.0237   0.981
2      2 ulm       ATF1   FC_Pvalue 1.15     0.250
3      3 corr_wsum ATF1   V1        0.390    0.66
4      3 norm_wsum ATF1   V1        1.07     0.66
5      3 wsum      ATF1   V1        2.16     0.66

> packageVersion('decoupleR')
[1] ‘2.3.1’

Thanks

PauBadiaM commented 2 years ago

Hi @vntasis

Thanks for checking out the package and opening an issue! Indeed there was a bug in the code. You can update it again from:

devtools::install_github('saezlab/decoupleR')

It should work now, else you can reopen this issue.