3dgliomaatlas's People
3dgliomaatlas's Issues
Dockerize Shiny App in order to deploy it on a ShinyProxy serve
After having wrapped up the Shiny App in an R package (Issue #2), it should be pretty straightforward(*) to create a Docker container for this Shiny App, which is required in order to deploy it on a ShinyProxy server (I never read this far before so this was news to me).
(*) Is should be possible also without an R package, but it'll be more tedious.
Is the .RData file meant to be part of the Git repos?
I'm not sure whether .RData
contain objects necessary to run the Shiny app or not? If not, I guess it needs to be removed from the repos and added to .gitignore
.
If it contains objects needed by the app, then, first, .RData
should not be used for such purposes. It should be considered for temporary usage between R sessions on the local machine by a single user. Also, when someone else wanna run you app locally, the content of .RData
will clutter up their workspace, which is not what people want. (FWIW, I never ever save .RData
when I close my session.)
Instead, save the individual objects you need to RDS files to make it explicit what your data are in this repos. Use something like:
saveRDS(mut_413, "mut_413.rds")
saveRDS(mut_485, "mut_485.rds")
and then read them in using:
mut_413 <- readRDS("mut_413.rds")
mut_485 <- saveRDS("mut_485.rds")
Alternatively, put them in an R list and save that:
mutations <- list(mut_413 = mut_413, mut_485 = mut_485)
saveRDS(mutations, "mutations.rds")
and then read them in using:
mutations <- readRDS("mutations.rds")
where you can access the indivual elements as:
mutations[["mut_413"]]
mutations[["mut_485"]]
and so on.
Create an R package
I propose that you create an R package named ThreeDGliomaAtlas
that serves your function. The advantage is that all package dependencies will be installed automatically, there is no need for source()
in the Shiny app - just a library(ThreeDGliomaAtlas)
. When there is a first working R package, we can then automatically check it with R CMD check
which is an awesome tool for catching current mistakes but also future ones (you can have GitHub Actions to run these check every time you push and you'll be notified if you made a mistake).
The gist is:
-
Create a
DESCRIPTION
file that specifies the name of the package, has a short description and that specify all package dependencies that your app needs. -
Move your
scripts/**/*.R
files toR/*.R
-
Run
devtools::install()
. Tweak what needs to be tweaked, and repeat.
If you haven't done an R package or struggle, then I can help you. For me, it's pretty straightforward to do but if you want to learn, this is a great opportunity.
When the above is in place, the next step is to also move in the data files into the R package. Hosting data is something R packages do well too. Then, one can move in also the Shiny app into the package. At this point, you will have your Shiny app/artifact fully contained in a single R package. This is where you can consider submitting it to CRAN and have it archived there until the end of time.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.