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

Allow pmartR to accept e_meta with duplicate edata_cname and emeta_cname pairings #309

Open
rarichardson92 opened this issue Feb 20, 2024 · 1 comment
Assignees

Comments

@rarichardson92
Copy link
Collaborator

rarichardson92 commented Feb 20, 2024

This fix will allow pmartR to handle output from e_meta files aggregated over multiple samples that may have had different libraries for protein matching.

image

Need to update documentation to reflect fix also.

Additionally, if this is done so as to: 1) remove the requirement from preflight and 2) pull only unique pairing in edata_cname and emeta_cname at the point of use (bpquant and protein_quant), I think this chunk from the protein_quant example code should run without error:

library(pmartRdata)

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')

isoformRes = bpquant(statRes = imd_anova_res, pepData = mypepData)

# case where isoformRes is provided:
results = protein_quant(pepData = mypepData, method = 'rollup',
                          combine_fn = 'mean', isoformRes = isoformRes)

In summary - we want object construction to allow edata_cname + emeta_cname duplicates in e_meta, and make protein_quant/bpquant only use unique pairings when doing rollup.

@evanglass
Copy link
Collaborator

evanglass commented Mar 9, 2024

Experimental support for it in the protein_quant function only (no isoformRes) is now available in protein_quant-combine_dups branch.

Example code:

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

# Split up ProteinList into multiple rows (they should be joined back together by protein_quant)
mypepData$e_meta <- mypepData$e_meta %>%
    dplyr::mutate(ProteinList = strsplit(ProteinList, ";")) %>%
    tidyr::unnest(ProteinList) %>%
    data.frame(check.names = FALSE)	
attr(mypepData, "cnames")$emeta_cname <- "ProteinList"

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', parallel = FALSE, emeta_cols = "RazorProtein")

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

3 participants