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

checkCountDepth: mcapply not supported on windows #2

Closed
jenzopr opened this issue Nov 29, 2016 · 5 comments
Closed

checkCountDepth: mcapply not supported on windows #2

jenzopr opened this issue Nov 29, 2016 · 5 comments

Comments

@jenzopr
Copy link
Contributor

jenzopr commented Nov 29, 2016

Dear Rhonda,

when running your code on windows, the checkCountDepth function gives an error if not explicitly run with NCores = 1.

checkCountDepth(Data = ExampleData, Conditions = Conditions, PLOT = F, FilterCellProportion = list(c(0.1),c(0.1))) 
Error in mclapply(X = 1:length(Genes), FUN = quickreg, InputData = list(LogData,  : 
  'mc.cores' > 1 is not supported on Windows

This has been described before (see thibautjombart/adegenet#109) and the proposed solution is introducing a platform dependency before using mclapply:

if( .Platform$OS.type == "windows" ){
  n.cores = 1
}

For fixing the error above, the code snippet has to introduced in GetSlopes.R, line 24.
Best,
Jens

@jenzopr
Copy link
Contributor Author

jenzopr commented Nov 29, 2016

The same issue obviously appears if calling the normalization procedure with

DataNorm <- SCnorm(ExampleData, Conditions = Conditions, OutputName = "ExampleData", NCores = 1)

The traceback shows:

> traceback()
8: stop("'mc.cores' > 1 is not supported on Windows")
7: mclapply(X = 1:length(Genes), FUN = quickreg, InputData = list(LogData, 
       SeqDepth, Genes, Tau), mc.cores = NCores)
6: unlist(mclapply(X = 1:length(Genes), FUN = quickreg, InputData = list(LogData, 
       SeqDepth, Genes, Tau), mc.cores = NCores))
5: GetSlopes(DataList[[x]][GeneFilterList[[x]], ], SeqDepthList[[x]], 
       Tau, NCores)
4: FUN(X[[i]], ...)
3: lapply(1:length(Levels), function(x) GetSlopes(DataList[[x]][GeneFilterList[[x]], 
       ], SeqDepthList[[x]], Tau, NCores))
2: checkCountDepth(Data = Data, NormalizedData = NORMDATA, Conditions = Conditions, 
       OutputName = "SCnorm_NormalizedData_FinalK", PLOT = PLOT, 
       FilterCellProportion = FilterCellProportion, FilterExpression = FilterExpression)
1: SCnorm(ExampleData, Conditions = Conditions, OutputName = "ExampleData", 
       NCores = 1)

This time, the issue is not fixed by setting NCores = 1, because the call to checkCountDepth seems not to pass on the NCores argument from the parent function (SCnorm) properly.

Best,
Jens

rhondabacher added a commit that referenced this issue Nov 29, 2016
Fix mclapply error on windows #2
@rhondabacher
Copy link
Owner

Thanks for testing this on Windows and your pull request!

@MarinusVL
Copy link

Hi Rhonda,

Still seems to be an issue running SCnorm on windows,

Error in mclapply(X = 1:length(Genes), FUN = quickreg, InputData = list(LogData, :
'mc.cores' > 1 is not supported on Windows

Looks like the GetK function doesn't handle the core number correctly.

best Marinus

@rhondabacher
Copy link
Owner

rhondabacher commented Apr 24, 2017 via email

@MarinusVL
Copy link

MarinusVL commented Apr 24, 2017 via email

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