{"action":"opened","issue":{"url":"https://api.github.com/repos/kdkorthauer/scDD/issues/4","repository_url":"https://api.github.com/repos/kdkorthauer/scDD","labels_url":"https://api.github.com/repos/kdkorthauer/scDD/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/kdkorthauer/scDD/issues/4/comments","events_url":"https://api.github.com/repos/kdkorthauer/scDD/issues/4/events","html_url":"https://github.com/kdkorthauer/scDD/issues/4","id":177343777,"number":4,"title":"Simulation error if n genes is zero","user":{"login":"lazappi","id":6869320,"avatar_url":"https://avatars.githubusercontent.com/u/6869320?v=3","gravatar_id":"","url":"https://api.github.com/users/lazappi","html_url":"https://github.com/lazappi","followers_url":"https://api.github.com/users/lazappi/followers","following_url":"https://api.github.com/users/lazappi/following{/other_user}","gists_url":"https://api.github.com/users/lazappi/gists{/gist_id}","starred_url":"https://api.github.com/users/lazappi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lazappi/subscriptions","organizations_url":"https://api.github.com/users/lazappi/orgs","repos_url":"https://api.github.com/users/lazappi/repos","events_url":"https://api.github.com/users/lazappi/events{/privacy}","received_events_url":"https://api.github.com/users/lazappi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-16T04:38:34Z","updated_at":"2016-09-16T04:38:34Z","closed_at":null,"body":"Hi\r\n\r\nI have been playing around with your simulation function and am getting an error if any of `nDE`, `nDP`, `nDM`, `nDB`, `nEE` or `nEP` is less than 2. \r\n\r\nIf one of them is set to 0 you get the following error (and traceback):\r\n\r\n```{r}\r\nError in if (xor(((x[n] - mean(x)) < (mean(x) - x[1])), opposite)) { : argument is of length zero \r\n\r\noutliers::grubbs.test(log(a + 1)) \r\ncalcMV(Dataset1[samplename[x], ], FC = 1, FC.thresh = FC2[x]^(-1/2), threshold = 3, include.zeroes = FALSE) \r\nFUN(X[[i]], ...) \r\nlapply(X = X, FUN = FUN, ...) \r\nsapply(1:length(samplename), function(x) calcMV(Dataset1[samplename[x], ], FC = 1, FC.thresh = FC2[x]^(-1/2), threshold = 3, include.zeroes = FALSE)) \r\nt(sapply(1:length(samplename), function(x) calcMV(Dataset1[samplename[x], ], FC = 1, FC.thresh = FC2[x]^(-1/2), threshold = 3, include.zeroes = FALSE))) \r\nsingleCellSimu(Dataset1, Method = \"DP\", index, FC, modeFC, DP = c(0.5, 0.5), Validation = FALSE, numGenes = nEP, numDE = 0, numSamples = numSamples, generateZero = generateZero, constantZero = constantZero, varInflation) \r\n```\r\n\r\nIf any of them are 1 you get this error instead:\r\n\r\n```{r}\r\nError in apply(Dataset1[samplename, ], 1, function(a) length(which(a ==  :  dim(X) must have a positive length \r\nstop(\"dim(X) must have a positive length\") \r\napply(Dataset1[samplename, ], 1, function(a) length(which(a == 0))/length(a))\r\nas.matrix(apply(Dataset1[samplename, ], 1, function(a) length(which(a == 0))/length(a)))\r\nsingleCellSimu(Dataset1, Method = \"DP\", index, FC, modeFC, DP = c(0.5, 0.5), Validation = FALSE, numGenes = nEP, numDE = 0, numSamples = numSamples, generateZero = generateZero, constantZero = constantZero, varInflation)\r\n```\r\nRunning the simulation also seems to leave behind orphaned R sessions (at least when running RStudio on OSX). If run multiple times in a row they build up and the simulation starts to hang."}}
{"actor":{"display_login":"lazappi"}}