Code Monkey home page Code Monkey logo

Comments (2)

inmanjm avatar inmanjm commented on July 21, 2024

Need to find out how to refer to a file in a script's BinDir... or even how to find a script's BinDir in R. In my searches I'm seeing a plethora of circumstance-specific hacks (for example, "From within RStudio except on Windows" or "not in Rstudio but not on Linux") but no definitive method.
I would rather not have to ask the user (or wrapper script, as in the pipeline case) to:

  • Copy a file into the workdir
  • Always invoke with a parameter pointing to the default list
  • Edit the path to the default list within the Rscript the first time this repo is cloned

But so far I don't see the ideal solution, which would be a native-language solution for referring to a script's location on the file system from within the script. The first two options could be ok for runs from within a pipeline, but the default location of the list of genes to filter would still need to be hand-edited into the pipeline script(s) prior to the first invocation.

I might have to turn this into a package in order to do that in R... I think I saw somewhere that a script within a package could refer to locations within that package. That is, an R script could reference relative paths from within a package directory.

Of course, if this isn't widely distributed it's probably ok to hard-code a path... except I don't know of a path that would be accessible to everywhere... other than making a path relative to the bindir... sigh...

from cellranger-snakemake.

inmanjm avatar inmanjm commented on July 21, 2024

Solved by having the pipeline wrapper copy the file into the workdir during execution. One good thing this does is also provide a copy of the exact files (will also copy the EnsemblID->Gene Symbol mapping file) used for each particular run. The files aren't large so this isn't a burden on either the processing time or resources.

from cellranger-snakemake.

Related Issues (8)

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.