Skip to content

Commit

Permalink
adds html versions to targets
Browse files Browse the repository at this point in the history
and creates an index, and makes html look good
  • Loading branch information
rmflight committed Oct 2, 2024
1 parent 4977f12 commit 8e61f5e
Show file tree
Hide file tree
Showing 14 changed files with 3,796 additions and 66 deletions.
24 changes: 24 additions & 0 deletions R/replace_yaml.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
replace_yaml = function(alt_dep, rmd_doc, yaml_doc,
out_file = "docs/ici_kt_manuscript_html.Rmd")
{
# alt_dep = tar_read(manuscript)
# rmd_doc = "docs/ici_kt_manuscript.Rmd"
# yaml_doc = "docs/html_document_opts.yaml"
# out_file = "docs/ici_kt_manuscript_html.Rmd"
rmd_contents = readLines(rmd_doc)
yaml_locs = grep("---", rmd_contents)
yaml_range = seq(yaml_locs[1], yaml_locs[2], 1)
rmd_noyaml = rmd_contents[-yaml_range]

new_yaml = readLines(yaml_doc)
new_yaml_delim = c("---", new_yaml, "---")
rmd_newyaml = c(new_yaml_delim, rmd_noyaml)
cat(rmd_newyaml, file = out_file, sep = "\n", append = FALSE)
return(out_file)
}

copy_figure = function(manuscript_dep, from_loc, to_loc)
{
fs::file_copy(from_loc, to_loc)
to_loc
}
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ If you use any content, you must give attribution to this original work.

## R Packages Needed

The repository used R 4.1.0, and {renv} 1.0.0
The repository used R 4.3.0, and {renv} 1.0.0
For all of the other packages needed, see the file `renv.lock`.

To setup to be able to rerun everything here, you can clone the repo from [github](https://github.com/MoseleyBioinformaticsLab/manuscript.ICIKendallTau) or download it from [Zenodo](https://zenodo.org/doi/10.5281/zenodo.6309187), and then from within that folder:
Expand Down Expand Up @@ -81,12 +81,14 @@ Having this cache, you have the state of the computations when we submitted the
```
# make sure you are wherever you want the targets cache, like wherever
# you cloned the github repo to, at the top level of the directory.
wget https://zenodo.org/records/10570286/files/manuscript.ICIKendallTau.targets_cache.parts0.tar?download=1 --output-document=manuscript.ICIKendallTau.targets_cache.parts0.tar
wget https://zenodo.org/records/10570286/files/manuscript.ICIKendallTau.targets_cache.parts1.tar?download=1 --output-document=manuscript.ICIKendallTau.targets_cache.parts1.tar
wget https://zenodo.org/records/10570256/files/manuscript.ICIKendallTau.targets_cache.parts2.tar?download=1 --output-document=manuscript.ICIKendallTau.targets_cache.parts2.tar
wget 'https://zenodo.org/records/13873347/files/manuscript.ICIKendallTau.targets_cache.parts0.tar?download=1' --output-document=manuscript.ICIKendallTau.targets_cache.parts0.tar
wget 'https://zenodo.org/records/13873347/files/manuscript.ICIKendallTau.targets_cache.parts1.tar?download=1' --output-document=manuscript.ICIKendallTau.targets_cache.parts1.tar
wget 'https://zenodo.org/records/13874988/files/manuscript.ICIKendallTau.targets_cache.parts2.tar?download=1' --output-document=manuscript.ICIKendallTau.targets_cache.parts2.tar
wget 'https://zenodo.org/records/13874988/files/manuscript.ICIKendallTau.targets_cache.parts3.tar?download=1' --output-document=manuscript.ICIKendallTau.targets_cache.parts3.tar
# now untar them. Note the "k", this keeps the directory from getting overwritten by subsequent un-tar
tar -xkvf manuscript.ICIKendallTau.targets_cache.parts0.tar
tar -xkvf manuscript.ICIKendallTau.targets_cache.parts1.tar
tar -xkvf manuscript.ICIKendallTau.targets_cache.parts2.tar
tar -xkvf manuscript.ICIKendallTau.targets_cache.parts3.tar
```
17 changes: 16 additions & 1 deletion _targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,22 @@ documents_plan = tar_plan(
tar_render(manuscript,
"docs/ici_kt_manuscript.Rmd"),
tar_render(lod_stuff,
"docs/check_variable_lod.Rmd")
"docs/check_variable_lod.Rmd"),
tar_render(supp_html,
"docs/supplemental_materials.Rmd",
output_format = "rmarkdown::html_document"),
tar_target(manuscript_alt,
replace_yaml(manuscript, "docs/ici_kt_manuscript.Rmd",
"docs/html_document_opts.yaml",
"docs/ici_kt_manuscript_html.Rmd"),
format = "file"),
tar_render(manuscript_html,
"docs/ici_kt_manuscript_html.Rmd",
output_file = "ici_kt_manuscript.html"),
tar_render(readme_index,
"README.md",
output_file = "docs/index.html"),
copy_fig1 = copy_figure(manuscript, "docs/the_problem.png", "docs/ici_kt_manuscript_files/figure-docx/Figure_1-the-problem.png")

)

Expand Down
14 changes: 14 additions & 0 deletions docs/html_document_opts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
title: 'Information-Content-Informed Kendall-tau Correlation: Utilizing Missing Values'
author: "Robert M Flight, Praneeth S Bhatt, Hunter NB Moseley"
output:
rmarkdown::html_document:
self_contained: yes
toc: true
toc_float:
collapsed: false
smooth_scroll: false
date: '`r Sys.time()`'
bibliography: '`r here::here("docs/icikt_references.json")`'
csl: plos-computational-biology.csl
editor_options:
chunk_output_type: console
2 changes: 0 additions & 2 deletions docs/ici_kt_manuscript.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ output:
pandoc_args:
- '--lua-filter=scholarly-metadata.lua'
- '--lua-filter=author-info-blocks.lua'
rmarkdown::html_document:default:
self_contained: yes
date: '`r Sys.time()`'
bibliography: '`r here::here("docs/icikt_references.json")`'
csl: plos-computational-biology.csl
Expand Down
Binary file modified docs/ici_kt_manuscript.docx
Binary file not shown.
1,202 changes: 1,187 additions & 15 deletions docs/ici_kt_manuscript.html

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions docs/ici_kt_manuscript.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ output:
pandoc_args:
- '--lua-filter=scholarly-metadata.lua'
- '--lua-filter=author-info-blocks.lua'
rmarkdown::html_document:default:
self_contained: yes
date: '2024-09-30 17:38:15.03703'
date: '2024-10-02 09:18:59.613449'
bibliography: '/home/rmflight/Documents/manuscripts/in_progress/rmflight_ici-kendallt/docs/icikt_references.json'
csl: plos-computational-biology.csl
editor_options:
Expand Down
Loading

0 comments on commit 8e61f5e

Please sign in to comment.