GithubHelp home page GithubHelp logo

Comments (6)

prete avatar prete commented on June 4, 2024

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)" 

from celltypist.

bbimber avatar bbimber commented on June 4, 2024

@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.

from celltypist.

ChuanXu1 avatar ChuanXu1 commented on June 4, 2024

@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.

from celltypist.

bbimber avatar bbimber commented on June 4, 2024

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:

https://github.com/bimberlabinternal/RIRA_classification/blob/342d6a6e3d51b8b9ce91e967e8a1ed509784029a/R/CellTypist.R#L26

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:

https://github.com/BimberLab/cellhashR/blob/7aa9fee0649a5f82d51e09180f396a5299582380/R/GMM_Demux.R#L26

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.

from celltypist.

ChuanXu1 avatar ChuanXu1 commented on June 4, 2024

@bbimber, this has been fixed by calling the main() function. 0e16949

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?

from celltypist.

bbimber avatar bbimber commented on June 4, 2024

@ChuanXu1 thanks - i really appreciate this!

from celltypist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.