SARTools icon indicating copy to clipboard operation
SARTools copied to clipboard

add column

Open lmanchon opened this issue 1 year ago • 4 comments

--Hi,

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

thank you --

lmanchon avatar Jul 04 '23 14:07 lmanchon

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

hvaret avatar Jul 13 '23 07:07 hvaret

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.

lmanchon avatar Jul 13 '23 07:07 lmanchon

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.

hvaret avatar Jul 13 '23 07:07 hvaret

Yes, I understand. Thank you.

lmanchon avatar Jul 13 '23 07:07 lmanchon