Closed bbimber closed 2 years ago
Hi @bbimber I'm not sure how you're using that command, but if you want to pull the models from R using reticulate I'd recommend you do this:
library(reticulate)
celltypist <- reticulate::import("celltypist")
celltypist$models$download_models(TRUE)
and from bash you can invoke the python module+method like this:
python -c "import celltypist; celltypist.models.download_models(True)"
@prete Thanks. While my example was a simple --update_models, do you know if one could replicate a more complex command-line as command-line arguments, rather than converting to python code? your idea about '-c' is a reasonable fallback.
@bbimber, not sure I understand correctly, but if you want to use celltypist as command-line, after installing it, you can just do celltypist --update-models
in the shell environment.
I realize this is a little abnormal, but here's the logic. We have an R package that calls celltypist. If someone installs the R package, I cant really control their environment. Therefore I dont know if celltypist is on their $PATH. R-Reticulate will provide the location of the python executable, and python can resolve the celltypist package.
The specific code is here, where I'm just assuming celltypist is in the $PATH currently:
The reason I opened this thread is because I was hoping there was some existing python hook I'm just not seeing, like "python.exe -m celltypist.command_line [arguments]". I assume this doesnt work since it somehow circumvents the arg-parsing code?
In contrast, we're able to run another command-line python tool, GMM-Demux, by calling their python entrypoint directly and passing in the full command-line args:
Also, my example of --update-models was mainly for example. Our goal is to run the full command-line in a way that didnt require knowing the location of your celltypist executable. Anyway, 'python -c' is a reasonable solution, like you suggested.
@bbimber, this has been fixed by calling the main()
function. 0e1694915fbdcb4b72408d806fb1260222f9aa59
This will be reflected in the next release, I will let you know then; for now, maybe you can install the latest CellTypist from Github?
@ChuanXu1 thanks - i really appreciate this!
Hello,
We're interested in running celltypist from R/reticulate. While I understand that celltypist makes a standalone executable, can something like the following work on the command line? For various reasons this is preferred since code would not need ot know the location of the celltypist executable file itself:
The above does not error, but it also doesnt seem to do anything either (no console output produced). Thanks.