z0on / GO_MWU

Rank-based Gene Ontology analysis of gene expression data
37 stars 17 forks source link

wilcoxon test error - not enough 'y' observations #6

Open zactobias44 opened 4 years ago

zactobias44 commented 4 years ago

Thanks for creating this package! It's been super useful.

Ran into an issue when trying to analyze a signed WGCNA module. Uncommented the lines in gomwuStats() accordingly, but I get the following error message:

Error in wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative): not enough 'y' observations
Traceback:

1. gomwuStats(input, goDatabase, goAnnotations, goDivision, perlPath = "perl", 
 .     largest = 0.1, smallest = 5, clusterCutHeight = 0.25, Module = TRUE, 
 .     Alternative = "g")
2. mwuTest(rsq.m, "g")
3. wilcox.test(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative)
4. wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative)
5. stop("not enough 'y' observations")

I traced it back to the wilcox.test.R script:

 else { ##-------------------------- 2-sample case ---------------------------
        if(length(y) < 1L)
            stop("not enough 'y' observations")

My input looks like:

transcript,kME
TRINITY_DN20052_c0_g1_i1,0
TRINITY_DN81967_c0_g1_i1,0.9317793
TRINITY_DN117943_c0_g1_i1,0
TRINITY_DN27472_c0_g1_i1,0
TRINITY_DN7112_c0_g1_i2,0
TRINITY_DN69001_c0_g1_i1,0

It works when I run it on the coral data you included.

The module has 374 transcripts in it, from a total of ~45K. Is this too small to be analyzed using this approach? Perhaps transcripts are being discarded earlier in the process? It works if I switch to a simple Fisher test (changing all non-zero values above to ones), but I'd like to be able to harness the power of MWU!

Thanks!

z0on commented 4 years ago

Hmm…. this is new. 374 is a big module, should work. Can you please send me your data files - kMEs, and annotations?

Misha

On Jan 14, 2020, at 4:48 PM, zactobias44 notifications@github.com wrote:

Thanks for creating this package! It's been super useful.

Ran into an issue when trying to analyze a signed WGCNA module. Uncommented the lines in gomwuStats() accordingly, but I get the following error message:

Error in wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative): not enough 'y' observations Traceback:

  1. gomwuStats(input, goDatabase, goAnnotations, goDivision, perlPath = "perl", . largest = 0.1, smallest = 5, clusterCutHeight = 0.25, Module = TRUE, . Alternative = "g")
  2. mwuTest(rsq.m, "g")
  3. wilcox.test(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative)
  4. wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative)
  5. stop("not enough 'y' observations") I traced it back to the wilcox.test.R script:

    else { ##-------------------------- 2-sample case --------------------------- if(length(y) < 1L) stop("not enough 'y' observations") My input looks like:

transcript,kME TRINITY_DN20052_c0_g1_i1,0 TRINITY_DN81967_c0_g1_i1,0.9317793 TRINITY_DN117943_c0_g1_i1,0 TRINITY_DN27472_c0_g1_i1,0 TRINITY_DN7112_c0_g1_i2,0 TRINITY_DN69001_c0_g1_i1,0 The module has 374 transcripts in it, from a total of ~45K. Is this too small to be analyzed using this approach? Perhaps transcripts are being discarded earlier in the process? It works if I switch to a simple Fisher test (changing all non-zero values above to ones), but I'd like to be able to harness the power of MWU!

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/z0on/GO_MWU/issues/6?email_source=notifications&email_token=ABZUHGFVNSYCPDJ46UQII53Q5Y6LTA5CNFSM4KG2YAV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IGGH6JA, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZUHGE3P3RNX7MD7KVI5FTQ5Y6LTANCNFSM4KG2YAVQ.

zactobias44 commented 4 years ago

Sure thing! Left my computer at the office. Will do first thing in the morning.

Thanks!

On Tue, Jan 14, 2020 at 7:06 PM Mikhail V Matz notifications@github.com wrote:

Hmm…. this is new. 374 is a big module, should work. Can you please send me your data files - kMEs, and annotations?

Misha

On Jan 14, 2020, at 4:48 PM, zactobias44 notifications@github.com wrote:

Thanks for creating this package! It's been super useful.

Ran into an issue when trying to analyze a signed WGCNA module. Uncommented the lines in gomwuStats() accordingly, but I get the following error message:

Error in wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative): not enough 'y' observations Traceback:

  1. gomwuStats(input, goDatabase, goAnnotations, goDivision, perlPath = "perl", . largest = 0.1, smallest = 5, clusterCutHeight = 0.25, Module = TRUE, . Alternative = "g")
  2. mwuTest(rsq.m, "g")
  3. wilcox.test(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative)
  4. wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative)
  5. stop("not enough 'y' observations") I traced it back to the wilcox.test.R script:

else { ##-------------------------- 2-sample case

if(length(y) < 1L) stop("not enough 'y' observations") My input looks like:

transcript,kME TRINITY_DN20052_c0_g1_i1,0 TRINITY_DN81967_c0_g1_i1,0.9317793 TRINITY_DN117943_c0_g1_i1,0 TRINITY_DN27472_c0_g1_i1,0 TRINITY_DN7112_c0_g1_i2,0 TRINITY_DN69001_c0_g1_i1,0 The module has 374 transcripts in it, from a total of ~45K. Is this too small to be analyzed using this approach? Perhaps transcripts are being discarded earlier in the process? It works if I switch to a simple Fisher test (changing all non-zero values above to ones), but I'd like to be able to harness the power of MWU!

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/z0on/GO_MWU/issues/6?email_source=notifications&email_token=ABZUHGFVNSYCPDJ46UQII53Q5Y6LTA5CNFSM4KG2YAV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IGGH6JA>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABZUHGE3P3RNX7MD7KVI5FTQ5Y6LTANCNFSM4KG2YAVQ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/z0on/GO_MWU/issues/6?email_source=notifications&email_token=ANATA3G35TSELLRXVIMDBBLQ5ZHSDA5CNFSM4KG2YAV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI6SQWQ#issuecomment-574433370, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANATA3ECZ4PYQRRQ3KLTUXTQ5ZHSDANCNFSM4KG2YAVQ .

zactobias44 commented 4 years ago

Here are my inputs. I expression filtered my txm before running WGCNA, but not before annotation, so I thought the error could be due to transcript IDs appearing in the annotation file but not in the kME input. I made a reduced version of the annotations including only those transcripts that were included in the WGCNA analysis, but I am getting the same error.

Thanks!

GO_MWU_annot_1e-50_WGCNA_reduced.txt GO_MWU_WGCNA_FP_kMEgreenyellow.txt

z0on commented 4 years ago

Found the bug! please re-clone the repository - there will be a change to gomwu.functions.R

cheers Misha

On Jan 15, 2020, at 7:46 AM, zactobias44 notifications@github.com wrote:

Here are my inputs. I expression filtered my txm before running WGCNA, but not before annotation, so I thought the error could be due to transcript IDs appearing in the annotation file but not in the kME input. I made a reduced version of the annotations including only those transcripts that were included in the WGCNA analysis, but I am getting the same error.

Thanks!

GO_MWU_annot_1e-50_WGCNA_reduced.txt https://github.com/z0on/GO_MWU/files/4065134/GO_MWU_annot_1e-50_WGCNA_reduced.txt GO_MWU_WGCNA_FP_kMEgreenyellow.txt https://github.com/z0on/GO_MWU/files/4065135/GO_MWU_WGCNA_FP_kMEgreenyellow.txt — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/z0on/GO_MWU/issues/6?email_source=notifications&email_token=ABZUHGFO3MUBK6DVCYA7GGLQ54HTBA5CNFSM4KG2YAV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJALMVY#issuecomment-574666327, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZUHGAGTTOZ225QFNN4AJDQ54HTBANCNFSM4KG2YAVQ.

zactobias44 commented 4 years ago

It works! Awesome. Thanks again!

Zac

zactobias44 commented 4 years ago

Sorry to bother you again. Not sure if this is related to the other issue or bug fix, but just got this message when running the analysis on a different module/division combination:

shuffling values to calculate FDR, 20 reps
replicate 1
Warning message in wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative):
“cannot compute exact p-value with ties”Warning message in wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative):
“cannot compute exact p-value with ties”Warning message in wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative):
“cannot compute exact p-value with ties”Warning message in wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative
....
....
....

It still generates the output, but just wanna make sure the padj aren't affected.

Thanks!

z0on commented 4 years ago

i think i know what is going on - most likely everything is ok, but can you please send me that input file?

Misha

On Jan 15, 2020, at 4:12 PM, zactobias44 notifications@github.com wrote:

Sorry to bother you again. Not sure if this is related to the other issue or bug fix, but just got this message when running the analysis on a different module/division combination:

shuffling values to calculate FDR, 20 reps replicate 1 Warning message in wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative): “cannot compute exact p-value with ties”Warning message in wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative): “cannot compute exact p-value with ties”Warning message in wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative = Alternative): “cannot compute exact p-value with ties”Warning message in wilcox.test.default(nrg[sgo.yes], nrg[sgo.no], alternative .... .... .... It still generates the output, but just wanna make sure the padj aren't affected.

Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

zactobias44 commented 4 years ago

That same message is actually printed when I analyze the module I already sent for the CC division. Please let me know if you aren't able to replicate. I can send a different module if need be.

Thanks!

z0on commented 1 year ago

Maybe you left genes without annotations in the GO annotations table? They should be removed