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

data.scale question #36

Open
gianfilippo opened this issue Sep 29, 2023 · 2 comments
Open

data.scale question #36

gianfilippo opened this issue Sep 29, 2023 · 2 comments

Comments

@gianfilippo
Copy link

Hi,

does the data.scale function process raw counts or normalized data ?

Thanks

@rezakj
Copy link
Owner

rezakj commented Sep 29, 2023

Hi, this function scales the normalized data but it dose not replace it (puts it in another data slot). Therfore, this function is really un-necessary because all the downstream funtions that require sacled data (like plots or running PCA, etc.) they do so on the fly and keep the normalized data as is.

This is because at the DE step the fold changes are calculated from the normalized data and not transformed (log, etc.) data.

@gianfilippo
Copy link
Author

Hi,

thanks. I am asking really because I tried to make a number of the functions from your package compatible with a Seurat object and functions, and I am testing them.

This is still work in progress, though.

I was not sure about the main.data slot. My understanding is that it takes the normalized data (while the raw.data is for counts).

Anyway, I normalized the raw counts with the modified norm.data iCellR function, and I wanted to scale the data, but I ended up with values as well as many NaNs, so I was trying to figure out if I had made a mistake in the conversion of the normalize function.

In your run.pca function you have
TopNormLogScale <- log(TopNormLogScale + plus.log.value)
when scale.data is TRUE, but your data.scale function has
NormLog = log2(DATA + 1)
NormLog = as.data.frame(t(NormLog))
TopNormLogScale <- t(scale(NormLog, center = F))

I think this is confusing for me. Can you please explain ?

Thanks

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

No branches or pull requests

2 participants