Skip to content

Commit

Permalink
Merge pull request #20 from FredHutch/patch_cpm_calcs
Browse files Browse the repository at this point in the history
fix cpm calculations
  • Loading branch information
kweav authored Mar 22, 2024
2 parents 1e7217e + 6467636 commit 6027dad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/00-setup_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ setup_data <- function(counts = NULL, pg_metadata = NULL, sample_metadata = NULL

# Transform the data
new_data$transformed_data$count_norm <- apply(counts, 2, function(x) -log10((x+1)/sum(x)))
new_data$transformed_data$cpm <- apply(counts, 2, function(x) (x/new_data$counts_per_sample)*1e6)
new_data$transformed_data$log2_cpm <- log2(new_data$cpm +1)
new_data$transformed_data$cpm <- apply(counts, 2, function(x) (x/sum(x))*1e6)
new_data$transformed_data$log2_cpm <- log2(new_data$transformed_data$cpm +1)

return(new_data)
}
Expand Down

0 comments on commit 6027dad

Please sign in to comment.