Commit 951ee15e authored by Amine  GHOZLANE's avatar Amine GHOZLANE
Browse files

Change the way to follow the app

parent a9887e8f
#### to avoid conflict between d3heatmap and rnvd3 #####
# the conflict come from the fact that both libraries use d3 but not the same version
# when the most recent one is loaded (the one of d3heatmap), it breaks the one of rNVD3
# the idea here is to modify the d3 of d3heatmap so that the library create an object called d33
# then modify the d3heatmap files so that it use this d33 object instead of d3
# first get d3heatmap javascript library path
d3heatmap_path = paste(.libPaths(), 'd3heatmap/htmlwidgets/lib/', sep='/')
# then get all js files in this directory
js_files = dir(path=d3heatmap_path, pattern = "*.js$", recursive = T, full.names = T)
# then create a function tu update the files
d3_to_d33 = function(target){
# the function will use the bash tool sed on the file target
# it makes 3 replacements
system(command=paste('sed -i .bck -e "s/d3\\ /d33 /g" -e "s/d3\\./d33./g" -e "s/d3;/d33;/g" ', target))
}
# apply the replacement function to all js files
sapply(js_files, d3_to_d33)
# change from d3.min.js to d3.js in the yaml file
system(command=paste('sed -i .bck -e "s/d3\\.min/d3/g" ', .libPaths(), '/d3heatmap/htmlwidgets/d3heatmap.yaml', sep=''))
# it's done. d3heatmap should use d33 object now
#### replacement of the css cals of the rNVD3 ####
# get the rNVD3 path
#rNVD3_path = paste(.libPaths(), 'rNVD3/nvd3/css/', sep='/')
# get the path of the current source. may need to be modified (parent.frame(1) or parent.frame(2) or parent.frame(3) or else)
#current_path = dirname(parent.frame(2)$ofile)
# get the css files path
#css_files = dir(path=current_path, pattern = "*.css$", full.names = T)
# create the function to copy the css file
#cp_to_rNVD3 = function(p, dest){
# system(paste('cp', p, dest))
#}
#apply the copy to all the css files
#sapply(css_files, cp_to_rNVD3, rNVD3_path)
# first get d3heatmap javascript library path
scatterD3_path = paste(.libPaths(), 'scatterD3/htmlwidgets/', sep='/')
# then get all js files in this directory
js_files = dir(path=scatterD3_path, pattern = "*.js$", recursive = T, full.names = T)
# then create a function tu update the files
d3_to_d333 = function(target){
# the function will use the bash tool sed on the file target
# it makes 3 replacements
system(command=paste('sed -i .bck -e "s/d3\\ /d333 /g" -e "s/d3\\./d333./g" -e "s/d3;/d333;/g" -e "s/d3=/d333=/g" ', target))
}
# apply the replacement function to all js files
sapply(js_files, d3_to_d333)
# change from d3.min.js to d3.js in the yaml file
system(command=paste('sed -i .bck -e "s/d3$/d333/g" ', .libPaths(), '/scatterD3/htmlwidgets/scatterD3.yaml', sep=''))
......@@ -71,7 +71,8 @@ body <- dashboardBody(
div(style="width:100% ; max-width: 1200px; height: 550px",
tabBox(title="Welcome to SHAMAN", id="tabset1", width=NULL,
tabPanel("About", tags$script(type="text/javascript", language="javascript", src="google-analytics.js"),
# tags$script(type="text/javascript", language="javascript", src="google-analytics.js"),
tabPanel("About",
p("SHAMAN is a SHiny application for Metagenomic ANalysis including the normalization,
the differential analysis and mutiple visualization.",style = "font-family: 'times'; font-si16pt"),
p("SHAMAN is based on DESeq2 R package", a("[Anders and Huber 2010]", href="http://www.ncbi.nlm.nih.gov/pubmed/20979621"), "for the analysis of metagenomic data, as suggested in", a("[McMurdie and Holmes 2014,",href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3974642/"),a("Jonsson2016]",href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4727335/"),
......
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-72614324-2', 'auto');
ga('send', 'pageview');
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment