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

add column #101

Open
lmanchon opened this issue Jul 4, 2023 · 4 comments
Open

add column #101

lmanchon opened this issue Jul 4, 2023 · 4 comments

Comments

@lmanchon
Copy link

lmanchon commented Jul 4, 2023

--Hi,

is it possible to add a log2(CPM) column (for each condition) in the complete table ?

thank you --

@hvaret
Copy link
Member

hvaret commented Jul 13, 2023

Hi,
thanks for the suggestion. There are already many columns in the complete table so I would prefer not adding to much information. However, you can get the log CPM of each condition as a R object using the following code:
t(apply(cpm(counts, log=TRUE), 1, function(x) tapply(x, target[, varInt], mean)))
Best regards,
Hugo

@lmanchon
Copy link
Author

Hi,

it seems in your complete table there are 2 columns (just after "baseMean" column) that represent the mean of normalised counts of each replicat. It's computed by this piece of code (from exportResults.DESeq2.R):
for (cond in levels(group)){ base[,cond] <- round(apply(as.data.frame(tmp[,group==cond]),1,mean),0) }
i think i can use these 2 columns to make heatmap.

Thanks.

@hvaret
Copy link
Member

hvaret commented Jul 13, 2023

Yes you can use these columns which are the means of the normalized counts per condition. You just have to be careful when doing heatmaps with these columns because you will lose the between-sample variability which is often meaningful.

@lmanchon
Copy link
Author

Yes, I understand.
Thank you.

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