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

ylim error - Unable to plot and save data #53

Open
ruzy1 opened this issue Jan 1, 2024 · 4 comments
Open

ylim error - Unable to plot and save data #53

ruzy1 opened this issue Jan 1, 2024 · 4 comments

Comments

@ruzy1
Copy link

ruzy1 commented Jan 1, 2024

Hello! I'm getting an error when I am saving the SAM data, and it crashes when I try to save. It is also unable to plot the graph in the SampleSize tab, so I think the crashing and the plot are related. Please help... :')

This is the error:
Warning: Error in plot.window: need finite 'ylim' values

This is my code:

library(shiny)
library(impute)
runGitHub("SAM", "MikeJSeo")
Downloading https://github.com/MikeJSeo/SAM/archive/HEAD.tar.gz

Listening on http://127.0.0.1:5696
Estimating sequencing depths...
Resampling to get new data matrices...
perm= 1
perm= 2
perm= 3
perm= 4
perm= 5
perm= 6
perm= 7
perm= 8
perm= 9
perm= 10
perm= 11
perm= 12
perm= 13
perm= 14
perm= 15
perm= 16
perm= 17
perm= 18
perm= 19
perm= 20
perm= 21
perm= 22
perm= 23
perm= 24
perm= 25
perm= 26
perm= 27
perm= 28
perm= 29
perm= 30
perm= 31
perm= 32
perm= 33
perm= 34
perm= 35
perm= 36
perm= 37
perm= 38
perm= 39
perm= 40
perm= 41
perm= 42
perm= 43
perm= 44
perm= 45
perm= 46
perm= 47
perm= 48
perm= 49
perm= 50
perm= 51
perm= 52
perm= 53
perm= 54
perm= 55
perm= 56
perm= 57
perm= 58
perm= 59
perm= 60
perm= 61
perm= 62
perm= 63
perm= 64
perm= 65
perm= 66
perm= 67
perm= 68
perm= 69
perm= 70
perm= 71
perm= 72
perm= 73
perm= 74
perm= 75
perm= 76
perm= 77
perm= 78
perm= 79
perm= 80
perm= 81
perm= 82
perm= 83
perm= 84
perm= 85
perm= 86
perm= 87
perm= 88
perm= 89
perm= 90
perm= 91
perm= 92
perm= 93
perm= 94
perm= 95
perm= 96
perm= 97
perm= 98
perm= 99
perm= 100
Number of thresholds chosen (all possible thresholds) = 142
Getting all the cutoffs for the thresholds...
Getting number of false positives in the permutation...
Number of thresholds chosen (all possible thresholds) = 144
Getting all the cutoffs for the thresholds...
Getting number of false positives in the permutation...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Number of thresholds chosen (all possible thresholds) = 1
Getting all the cutoffs for the thresholds...
Getting number of false positives in the permutation...
Warning: Error in plot.window: need finite 'ylim' values
64: plot.window
63: localWindow
62: plot.default
60: samr.assess.samplesize.plot
47: observe [C:\Users\rache\AppData\Local\Temp\RtmpuWIFEa\shinyappfa465b3b15\SAM-d998a4ed8cba4b7f071ec7f3b5b9606f4c192eed/server.R#916]
46:
3: runApp
2: runUrl
1: runGitHub

At line #916 in the server.R file, the code is as follows:

isolate({

dir = input$dir
file = input$fname

siggenes.table = getSiggenesTable()
missrate.table = getMissRateTable()
delta.table = getDeltaTable()
samr.assess.samplesize.obj =  getSampleSize()
Allgenes = getAllgenesTable()

samr.obj = getSamrObj()
delta = findDelta()
min.foldchange = input$min.foldchange

inputParameters = getInputParameters()
inputParameters = inputParameters[,-1, drop = FALSE]
  
computedValues = getComputedValues()
computedValues = computedValues[,-1, drop = FALSE]

eigengene = getEigengene()
imputedX = getImputedX()
originalX = getOriginalX()

titleStyle = createStyle(fontSize = 14, fontColour = "#FFFFFF", halign = "center", fgFill = "#4F81BD")

wb = createWorkbook()  
@MikeJSeo
Copy link
Owner

Is this still not working.. maybe did you try the example that is provided (i.e. Two class.xlsx)?

@ruzy1
Copy link
Author

ruzy1 commented Jan 13, 2024

Unfortunately, it's still not working. I did try the Two Class example, and it worked perfectly. But my own data is not working. I don't see any cells that are missing values, so I don't think missing values would be an issue. Do you have any ideas of what may be creating the ylim issue?

@MikeJSeo
Copy link
Owner

MikeJSeo commented Jan 13, 2024

Hmm yea I have no clue..
Maybe if you haven't already you can subset (delete) some of your data and try to narrow down data points that is causing the issue. Or does it not work even for the smallest data you can run?
You can also send me some permuted dataset of yours that doesn't work and I can take a look.

@SamGG
Copy link

SamGG commented Jan 14, 2024

As @MikeJSeo said, without some data and the parameters to reproduce the problem, it is difficult to solve the error. The ylim depends on ymax which is computed from FDRs. Probably one of those values is NA or Inf although the initial data are OK.

	temp = samr.assess.samplesize.obj$results
	ymax = max(c(temp[, "FDR,1-power", ], temp[, "FDR90", ],
		temp[, "FDR10", ], temp[, "FNR,type1 error", ], temp[,
			"FDR90", ], temp[, "FDR10", ]))

https://github.com/cran/samr/blob/bf0d63f2bc4d93ba7baad0dabdce3bf9d22c5ccf/R/samr.morefuns.R#L1334C3-L1334C3

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