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

Error in aggregateFeatures #54

Open
yafeng opened this issue Dec 8, 2023 · 1 comment
Open

Error in aggregateFeatures #54

yafeng opened this issue Dec 8, 2023 · 1 comment

Comments

@yafeng
Copy link

yafeng commented Dec 8, 2023

Hi,
i got en error while using aggregateFeatures command from MSqrob2.
pe <- aggregateFeatures(pe,i = "peptideNorm", fcol = "PG.ProteinGroups", na.rm = TRUE, name = "protein")

Error in contrasts<-(*tmp*, value = contr.funs[1 + isOF[nn]]) :
[: contrasts can be applied only to factors with 2 or more levels]

Could you point out how i should fix the error? I guess it is related to my input, but i don't know where to start.
Thanks for your help!

Yafeng

@hassansaei
Copy link

Hi, i got en error while using aggregateFeatures command from MSqrob2. pe <- aggregateFeatures(pe,i = "peptideNorm", fcol = "PG.ProteinGroups", na.rm = TRUE, name = "protein")

Error in contrasts<-(*tmp*, value = contr.funs[1 + isOF[nn]]) : [: contrasts can be applied only to factors with 2 or more levels]

Could you point out how i should fix the error? I guess it is related to my input, but i don't know where to start. Thanks for your help!

Yafeng

Hi,
I faced the same issue and I figured out I had blanks and NAs in my intensity columns. I removed the blanks and performed aggregateFeatures function and it worked. Here is the example:

pep <- read.table(peptidesFile, sep = "\t", header = T)
pep <- pep %>%
mutate(Proteins = ifelse(Proteins == "", NA, Proteins)) %>%
mutate(Intensity.A = ifelse(Intensity.A == "", NA, Intensity.1C3_d37_ECM_R1)) %>%
filter(Proteins != "NA") %>%
filter(Intensity.A != "NA")

I hope this helps.
Hassan Saei

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

2 participants