Skip to content

Implement DESeq2 like normalization #22

Description

@lpantano

Add the code that from a count matrix, can get the size factor to normalize the data.

So, input would be: count data and output: normalized count data.

In R the code is like this:

loggeomeans <- rowMeans(log(counts))
sf <- apply(counts, 2, function(cnts) {
      exp(median((log(cnts) - loggeomeans)[is.finite(loggeomeans) & cnts > 0]))
    })
sf <- sf/exp(mean(log(sf)))
t(t(counts)/sf)

This code can be inside libs/math.py

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions