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

Publish vignettes online using pkgdown #3

Open
omsai opened this issue Apr 4, 2018 · 0 comments
Open

Publish vignettes online using pkgdown #3

omsai opened this issue Apr 4, 2018 · 0 comments

Comments

@omsai
Copy link
Collaborator

omsai commented Apr 4, 2018

Currently, installing the package from GitHub does not install any pre-built vignettes:

> message(require(groHMM))
TRUE
> browseVignettes(package = "groHMM")
No vignettes found by browseVignettes(package = "groHMM")

Good practice is to only build and install the vignette in the release tarball, so committing the built HTML vignette in git for development builds is not an attractive option.

One way around this is to use pkgdown to directly publish the build vignette online. It appears that some changes to the C code might be necessary to get passed the "locked environment" error:

> pkgdown::build_site()
══ Building pkgdown site ═══════════════════════════════════════════════════════
Reading from: '/tmp/groHMM'
Writing to:   '/tmp/groHMM/docs'
── Initialising site ───────────────────────────────────────────────────────────
Writing 'docsearch.json'
── Building home ───────────────────────────────────────────────────────────────
Writing 'index.html'
── Building function reference ─────────────────────────────────────────────────
Loading groHMM
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:stats’:

    IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, cbind, colMeans, colnames,
    colSums, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, lengths, Map, mapply, match,
    mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rowMeans, rownames, rowSums, sapply, setdiff, sort,
    table, tapply, union, unique, unsplit, which, which.max, which.min

Loading required package: S4Vectors

Attaching package: ‘S4Vectors’

The following object is masked from ‘package:base’:

    expand.grid

Loading required package: IRanges
Loading required package: GenomeInfoDb
Error in importIntoEnv(pkgenv, exports, nsenv, exports) : 
  cannot add bindings to a locked environment
> 

In changing the C code, it may be worth modernizing and migrating over to Rcpp not least to fix many of the compile time warnings:

Re-compiling groHMM
Running /usr/lib/R/bin/R CMD INSTALL /tmp/groHMM \
  '--library=/tmp/RtmpiZ1kwp/devtools_install_ba036cf8bee' --no-R --no-data \
  --no-help --no-demo --no-inst --no-docs --no-exec --no-multiarch \
  --no-test-load --preclean
* installing *source* packagegroHMM’ ...
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -UNDEBUG -Wall -pedantic -g -Og -fdiagnostics-color=always -c AnnotateProbes.c -o AnnotateProbes.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -UNDEBUG -Wall -pedantic -g -Og -fdiagnostics-color=always -c DecayAlgorithm.c -o DecayAlgorithm.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -UNDEBUG -Wall -pedantic -g -Og -fdiagnostics-color=always -c MLEfit.c -o MLEfit.o
In file included from MLEfit.c:44:0:
hmmHeader.h:302:16: warning: ‘expSum’ defined but not used [-Wunused-function]
 static  double expSum(double *logValues, int length) {
                ^~~~~~
hmmHeader.h:282:16: warning: ‘MargainalizeSumLogProbOver’ defined but not used [-Wunused-function]
 static  double MargainalizeSumLogProbOver(int state, int position,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -UNDEBUG -Wall -pedantic -g -Og -fdiagnostics-color=always -c RegisterRRoutines.c -o RegisterRRoutines.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -UNDEBUG -Wall -pedantic -g -Og -fdiagnostics-color=always -c Windowing.c -o Windowing.o
Windowing.c: In functionWindowAnalysis’:
Windowing.c:147:6: warning: unused variableII’ [-Wunused-variable]
  int II = 0;
      ^~
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -UNDEBUG -Wall -pedantic -g -Og -fdiagnostics-color=always -c hmmEM.c -o hmmEM.o
In file included from hmmEM.c:47:0:
hmmHeader.h:302:16: warning: ‘expSum’ defined but not used [-Wunused-function]
 static  double expSum(double *logValues, int length) {
                ^~~~~~
hmmHeader.h:282:16: warning: ‘MargainalizeSumLogProbOver’ defined but not used [-Wunused-function]
 static  double MargainalizeSumLogProbOver(int state, int position,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from hmmHeader.h:36:0,
                 from hmmEM.c:47:
UsefulValues.h:39:15: warning: ‘VERY_LARGE_DOUBLE_VALUE’ defined but not used [-Wunused-variable]
 static double VERY_LARGE_DOUBLE_VALUE = 1e20;
               ^~~~~~~~~~~~~~~~~~~~~~~
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -UNDEBUG -Wall -pedantic -g -Og -fdiagnostics-color=always -c hmmFwBw.c -o hmmFwBw.o
hmmFwBw.c: In functionforward’:
hmmFwBw.c:143:7: warning: thisforclause does not guard... [-Wmisleading-indentation]
       for(k=1; k<n; k++)
       ^~~
hmmFwBw.c:146:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by theforfor (k = 0; k<n; k++) {
         ^~~
In file included from hmmFwBw.c:46:0:
At top level:
hmmHeader.h:302:16: warning: ‘expSum’ defined but not used [-Wunused-function]
 static  double expSum(double *logValues, int length) {
                ^~~~~~
hmmHeader.h:282:16: warning: ‘MargainalizeSumLogProbOver’ defined but not used [-Wunused-function]
 static  double MargainalizeSumLogProbOver(int state, int position,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from hmmHeader.h:36:0,
                 from hmmFwBw.c:46:
UsefulValues.h:39:15: warning: ‘VERY_LARGE_DOUBLE_VALUE’ defined but not used [-Wunused-variable]
 static double VERY_LARGE_DOUBLE_VALUE = 1e20;
               ^~~~~~~~~~~~~~~~~~~~~~~
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -UNDEBUG -Wall -pedantic -g -Og -fdiagnostics-color=always -c hmmMiscFunctions.c -o hmmMiscFunctions.o
hmmMiscFunctions.c: In functionSStatsNormExp’:
hmmMiscFunctions.c:383:10: warning: unused variablewi’ [-Wunused-variable]
   double wi, *newEx;
          ^~
hmmMiscFunctions.c: In functionUpdateNormExp’:
hmmMiscFunctions.c:416:10: warning: unused variableepsilon’ [-Wunused-variable]
   double epsilon=0.00001;
          ^~~~~~~
In file included from hmmHeader.h:36:0,
                 from hmmMiscFunctions.c:44:
At top level:
UsefulValues.h:39:15: warning: ‘VERY_LARGE_DOUBLE_VALUE’ defined but not used [-Wunused-variable]
 static double VERY_LARGE_DOUBLE_VALUE = 1e20;
               ^~~~~~~~~~~~~~~~~~~~~~~
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -UNDEBUG -Wall -pedantic -g -Og -fdiagnostics-color=always -c hmmViterbi.c -o hmmViterbi.o
In file included from hmmViterbi.c:49:0:
hmmHeader.h:302:16: warning: ‘expSum’ defined but not used [-Wunused-function]
 static  double expSum(double *logValues, int length) {
                ^~~~~~
hmmHeader.h:282:16: warning: ‘MargainalizeSumLogProbOver’ defined but not used [-Wunused-function]
 static  double MargainalizeSumLogProbOver(int state, int position,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from hmmHeader.h:36:0,
                 from hmmViterbi.c:49:
UsefulValues.h:39:15: warning: ‘VERY_LARGE_DOUBLE_VALUE’ defined but not used [-Wunused-variable]
 static double VERY_LARGE_DOUBLE_VALUE = 1e20;
               ^~~~~~~~~~~~~~~~~~~~~~~
g++ -shared -L/usr/lib/R/lib -Wl,-z,relro -o groHMM.so AnnotateProbes.o DecayAlgorithm.o MLEfit.o RegisterRRoutines.o Windowing.o hmmEM.o hmmFwBw.o hmmMiscFunctions.o hmmViterbi.o -L/usr/lib/R/lib -lR
installing to /tmp/RtmpiZ1kwp/devtools_install_ba036cf8bee/groHMM/libs
* DONE (groHMM)
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

1 participant