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

"Missing value where true/false needed" error with teGeneRetrieval #3

Closed
aseetharam opened this issue Nov 11, 2021 · 4 comments
Closed

Comments

@aseetharam
Copy link

Hi Ashish,

I'm trying to create a custom TissueEnrich dataset but having an issue with the teGeneRetrieval. Specifically, my commands are:

> head(test[,1:7])
                  CTBs        EPI       EVTs   Hypoblast        ICM    PSA.EPI       STBs
A4GALT       28.256089  87.818451   9.739999  35.0449376 124.365134 14.0052407  3.8816029
AAAS        166.393659 176.695678 169.025785 166.5609337 178.972602 54.4752599 73.8415541
AACS          3.705388  10.217619   8.844224  11.4724415   5.290590  4.9312505  3.2401403
AADACL2      13.170123   2.072885  16.220174   0.5474843   2.843561  3.5183490 18.3895300
AADACL2-AS1   9.378275   3.074869   8.883682   0.6346828   3.913311  4.3598354 11.7280428
AADACL3       3.670026   5.607436  26.660207  36.3240296   5.195383  0.4045552  0.2788972
> test <- test[,1:7]
> se<-SummarizedExperiment(assays = SimpleList(as.matrix(test)),rowData = row.names(test),colData = colnames(test))
> te.dataset.xiang <-teGeneRetrieval(se)
Error in if (sum(idx) > 0) { : missing value where TRUE/FALSE needed

Could you please help me fix this?

Thanks!

@ashishjain1988
Copy link
Collaborator

Hi Arun,

The problem is the value of maxNumberOfTissues argument. In your test data, the tissue number is 7 whereas for calculating group enriched genes you are using 7 (by default). If you change that to less than or equal to "max(tissues)-1", it will work. I have seen this issue before and planning to add a check in the teGeneRetrieval function. I hope this helps.

@aseetharam
Copy link
Author

Hi Ashish, thanks for the quick reply. Yes, that worked!
Related question: so if I'm using say 20 or more tissues, should I still use this maxNumberOfTissues one less than the total tissues or the default 7 is fine?

@ashishjain1988
Copy link
Collaborator

I have put the default value (7) based on the Human Protein Atlas definition for the group-specific genes. The number depends on how you want to define the group-specific genes in your data. The "max(tissues)-1" check is just to ensure that code will not break when the maxNumberOfTissues >= max(tissues).

@aseetharam
Copy link
Author

I see. Okay, thanks for your help. I'm closing this issue.

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