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

[Microarray] Unintentional renaming of columns causes issues later in selection of columns #97

Open
cyouh95 opened this issue Jun 6, 2024 · 0 comments

Comments

@cyouh95
Copy link
Contributor

cyouh95 commented Jun 6, 2024

Description

The following error occurred when rendering Affymetrix.qmd for one dataset:

Error in (function (cond)  : 
    error in evaluating the argument 'x' in selecting a method for function 'as.data.frame': Problem while computing `Group.Mean_(1G) = rowMeans(dplyr::select(.,
  all_of(current_samples)))`.
  Caused by error:
  ! error in evaluating the argument 'x' in selecting a method for function 'rowMeans': Problem while evaluating `all_of(current_samples)`.

In this particular dataset, some columns were unintentionally renamed because they happen to contain the substring that's being replaced (for other columns), causing this error when trying to select them later on.

Solution

Be more explicit about which columns we want to rename using rename_with() here in Affymetrix.qmd:

df_interim <- df_interim %>% dplyr::rename_with(reformat_names, .cols = matches('\\.condition'), group_name_mapping = design_data$mapping)

The same can be done here for Agile1CMP.qmd to prevent something similar from happening in the future:

df_interim <- df_interim %>% dplyr::rename_with(reformat_names, .cols = matches('\\.condition|^Genes\\.'), group_name_mapping = design_data$mapping)
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

1 participant