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

protein_quant() -- Argument emeta_cols doesn't seem to keep the columns specified? #302

Closed
rarichardson92 opened this issue Jan 2, 2024 · 3 comments · Fixed by #308
Closed
Assignees

Comments

@rarichardson92
Copy link
Collaborator

This guy doesn't keep "ProteinList" :(

mypepData <- group_designation(omicsData = pep_object, main_effects = c("Phenotype"))
mypepData = edata_transform(omicsData = mypepData, "log2")

imdanova_Filt <- imdanova_filter(omicsData = mypepData)
mypepData <- applyFilt(filter_object = imdanova_Filt, omicsData = mypepData, min_nonmiss_anova = 2)

imd_anova_res <- imd_anova(omicsData = mypepData, test_method = 'comb', pval_adjust_a_multcomp = 'bon', pval_adjust_g_multcomp = 'bon')

results <- protein_quant(pepData = mypepData, method = 'rollup', combine_fn = 'median', emeta_cols = "ProteinList")

@evanglass evanglass self-assigned this Jan 3, 2024
@evanglass
Copy link
Collaborator

evanglass commented Jan 20, 2024

This is kind of a note-to-self, but it seems the issue is this code

n_row_emeta <- if (is.null(results$e_meta)) {
  # Use either the original or isoform e_meta depending on the input.
  if (is.null(isoformRes)) {
    nrow(unique(pepData$e_meta))
  } else {
    nrow(e_meta_iso)
  }
} else {
  nrow(unique(results$e_meta))
}

is using the original (non rolled up) e_meta, which means the n_row_emeta is not equal to n_row_edata, so the column gets removed. As a test I tried using length(unique(pepData$e_meta[[emeta_cname]])) in place of nrow(unique(pepData$e_meta)), but it ended up with problems further down the line (e_meta was getting duplicate rows, meaning as.proData was throwing an error).

@rarichardson92
Copy link
Collaborator Author

rarichardson92 commented Jan 29, 2024

As it turns out, the above example is a more complex version of the problem, where sometimes the extra columns have multiple possible entries when rolled up. Appending the following lines to the above example should illustrate the simpler case:

mypepData$e_meta$Org <- round(runif(nrow(mypepData$e_meta)), 1)*10
results <- protein_quant(pepData = mypepData, method = 'rollup', combine_fn = 'median', emeta_cols = "Org")

@clabornd
Copy link
Contributor

Were gonna now keep those columns and paste() together their elements

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

Successfully merging a pull request may close this issue.

3 participants