Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement DESeq2 like normalization #22

Open
lpantano opened this issue Jan 18, 2018 · 2 comments
Open

Implement DESeq2 like normalization #22

lpantano opened this issue Jan 18, 2018 · 2 comments

Comments

@lpantano
Copy link
Contributor

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

@shruthibandyadka
Copy link
Member

Is this count matrix the one created in gff/convert.py ? (example file at data/examples/gff/gff_tsv_expression_counts.tsv)

@lpantano
Copy link
Contributor Author

lpantano commented Feb 1, 2018

Hi!
This would be to do an extra step from that matrix. So, the idea is once you have the matrix, apply this calculation to get a normalize one.

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

No branches or pull requests

2 participants