stemangiola / bioc_2020_tidytranscriptomics

Workshop on tidytranscriptomics: Performing tidy transcriptomics analyses with tidybulk, tidyverse and tidyheatmap
https://stemangiola.github.io/bioc_2020_tidytranscriptomics/
Other
26 stars 10 forks source link

scale_abundance no longer takes the factor_of_interest argument #44

Closed davwong47 closed 1 year ago

davwong47 commented 1 year ago

When running the following code form the course notebook to scale counts:

counts_scaled <- counts_tt %>% scale_abundance(factor_of_interest = dex)

I get the following error:

Error in scale_abundance(., factor_of_interest = dex) : 
  unused argument (factor_of_interest = dex)

This does not occur when using the legacy versions on the docker image provided. Please could you advise whether there is a workaround for the scaling of counts with the up to date version of tidybulk? This would be useful for future projects! Thanks!

stemangiola commented 1 year ago

@william-hutchison

william-hutchison commented 1 year ago

Hello @davwong47! Would you be able to post the output of sessionInfo()?

I am not able to reproduce this error while using tidybulk v1.1.5.

Thank you

davwong47 commented 1 year ago

Hello! It was tidybulk 1.12.0

I found the workaround was in the 2021 version of this Tidy Transcriptomics course. It seems that in newer versions of tidybulk, factor of interest is specified in the keep_abundant command rather than in scale_abundance. There are some other little changes too - worth checking out for future Googlers!

Here is the code I ended up using, which gave no errors:

# Filtering counts
counts_scaled <- counts %>% 
    keep_abundant(factor_of_interest = dex) %>%
    scale_abundance()
william-hutchison commented 1 year ago

That's great! Thank you for posting the solution.