Skip to content

DP simulated data has inverted logFC and only one bimodal group #125

@ChristophH

Description

@ChristophH

Hi,

Thanks for creating and maintaining muscat, and all your hard work that goes into method development and benchmarking!

I think there is a bug/inconsistency in the sign of the logFC of simulated data. When simulated with the 'dp' category, the logFC is applied in the opposite direction as, for example, with the 'de' or 'dm' category.

In .sim() you can see how either '-lfc', or 'lfc' is used with group 1

muscat/R/utils-simData.R

Lines 329 to 352 in 10cd326

"de" = {
list(
.nb(cs_g1, d, m_g1, -lfc), # lfc < 0 => all g1 hi
.nb(cs_g2, d, m_g2, lfc)) # lfc > 0 => all g2 hi
},
"dp" = {
props <- sample(c(dp, 1 - dp), 2)
g1_hi <- sample(ng1, round(ng1 * props[1]))
g2_hi <- sample(ng2, round(ng2 * props[2]))
list(
.nb(cs_g1[-g1_hi], d, m_g1),
.nb(cs_g1[ g1_hi], d, m_g1, lfc), # lfc > 0 => dp/(1-dp)% up
.nb(cs_g2[-g2_hi], d, m_g2),
.nb(cs_g2[ g2_hi], d, m_g2, -lfc)) # lfc < 0 => (1-dp)/dp% up
},
"dm" = {
g1_hi <- sample(ng1, round(ng1 * dm))
g2_hi <- sample(ng2, round(ng2 * dm))
list(
.nb(cs_g1[-g1_hi], d, m_g1),
.nb(cs_g1[ g1_hi], d, m_g1, -lfc), # lfc < 0 => 50% g1 hi
.nb(cs_g2[-g2_hi], d, m_g2),
.nb(cs_g2[ g2_hi], d, m_g2, lfc)) # lfc > 0 => 50% g2 hi
},

But maybe I'm missing something.

Cheers,
Christoph

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions