Mainly updates to the way chertex.sh handles Shiny.

master
Taha Ahmed 10 years ago
parent 4ef82b2e13
commit ef85917a71

@ -64,19 +64,19 @@ if [ $# -eq 1 ]; then
#### Special treatment for sample-matrix.Rnw
# If $jobname is sample-matrix, run only knitr and markdown, then exit
# If $jobname is sample-matrix, restart Shiny and term this script
if [[ $jobname == "sample-matrix" ]]; then
echo "<cheRTeX> -----------------------------------------------------------"
echo "<cheRTeX> sample-matrix: update SHINY, run knit() + markdownToHTML()"
echo "<cheRTeX> -----------------------------------------------------------"
echo "<cheRTeX> -------------------------------"
echo "<cheRTeX> sample-matrix: restarting Shiny"
echo "<cheRTeX> -------------------------------"
# Before starting new shiny process, kill any previous instances
# kill Shiny
pkill -f "shiny::runApp"
# start Shiny
bash -c "/home/taha/chepec/chetex/common/bash/shiny-matrix.sh" &
Rscript -e "library(knitr); knit(input='$jobname.Rmd', output='$jobname.md')"
Rscript -e "library(markdown); markdownToHTML('$jobname.md', '$jobname.html', stylesheet = 'custom.css')"
# terminate this script
echo "<cheRTeX> Terminating..."
/home/taha/chepec/chetex/common/bash/simpledelay.sh 14
/home/taha/chepec/chetex/common/bash/simpledelay.sh 4
exit 1
fi

@ -0,0 +1,14 @@
#!/bin/bash
# http://tex.stackexchange.com/a/18776
# The "holy imagemagick batman" answer :-)
# run this script like this:
# findlines.sh <file> # without specifying file extension
# works for two-column pages, not so well for single-column
convert $1.pdf -crop 50x100% png:$1
for f in $1-*; do
convert $f -flatten -resize 1X1000! -black-threshold 99% -white-threshold 10% -negate -morphology Erode Diamond -morphology Thinning:-1 Skeleton -black-threshold 50% txt:-| \
sed -e '1d' -e '/black/d' -e 's/^[^,]*,//' -e 's/[(]//g' -e 's/:.*//' -e 's/,/ /g' > $f.txt;
done

@ -21,7 +21,7 @@ echo $PORT > /home/taha/chepec/chetex/sample-matrix/shinyapp/shiny.port
# Run R Shiny app at localhost port
# Note: this process does not return control to bash...
nohup R -e "shiny::runApp('~/chepec/chetex/sample-matrix/shinyapp', port = $PORT)"
nohup R -e "shiny::runApp('/home/taha/chepec/chetex/sample-matrix/shinyapp', port = $PORT)"

Loading…
Cancel
Save