Skip to content

Commit

Permalink
high res png files
Browse files Browse the repository at this point in the history
  • Loading branch information
topepo committed Jun 26, 2022
1 parent d706ce1 commit dc9c69d
Show file tree
Hide file tree
Showing 23 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion 01-software-modeling.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ For example, large scale measurements of RNA have been possible for some time us

An early method for evaluating such issues were probe-level models, or PLMs [@bolstad2004]. A statistical model would be created that accounted for the known differences in the data, such as the chip, the RNA sequence, the type of sequence, and so on. If there were other, unknown factors in the data, these effects would be captured in the model residuals. When the residuals were plotted by their location on the chip, a good quality chip would show no patterns. When a problem did occur, some sort of spatial pattern would be discernible. Often the type of pattern would suggest the underlying issue (e.g., a fingerprint) and a possible solution (wipe off the chip and rescan, repeat the sample, etc.). Figure \@ref(fig:software-descr-examples)(a) shows an application of this method for two microarrays taken from @Gentleman2005. The images show two different color values; areas that are darker are where the signal intensity was larger than the model expects while the lighter color shows lower than expected values. The left-hand panel demonstrates a fairly random pattern while the right-hand panel exhibits an undesirable artifact in the middle of the chip.

```{r software-descr-examples, echo = FALSE, fig.cap = "Two examples of how descriptive models can be used to illustrate specific patterns", out.width = '80%', dev = "png", fig.height = 8, warning = FALSE, message = FALSE}
```{r software-descr-examples, echo = FALSE, fig.cap = "Two examples of how descriptive models can be used to illustrate specific patterns", out.width = '80%', fig.height = 8, warning = FALSE, message = FALSE}
load("RData/plm_resids.RData")
resid_cols <- RColorBrewer::brewer.pal(8, "Set1")[1:2]
Expand Down
4 changes: 0 additions & 4 deletions 16-dimensionality-reduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ bean_rec_trained %>%
```

```{r bean-pca, ref.label = "dimensionality-pca"}
#| dev = "png",
#| echo = FALSE,
#| fig.height = 7,
#| fig.cap = "First two principal component scores for the bean validation set, colored by class",
Expand Down Expand Up @@ -360,7 +359,6 @@ bean_rec_trained %>%
```

```{r bean-pls, ref.label = "dimensionality-pls"}
#| dev = "png",
#| fig.height = 7,
#| echo = FALSE,
#| fig.cap = "First two PLS component scores for the bean validation set, colored by class",
Expand Down Expand Up @@ -398,7 +396,6 @@ bean_rec_trained %>%
```

```{r bean-ica, ref.label = "dimensionality-ica"}
#| dev = "png",
#| echo = FALSE,
#| fig.height = 7,
#| fig.cap = "First two ICA component scores for the bean validation set, colored by class",
Expand Down Expand Up @@ -436,7 +433,6 @@ bean_rec_trained %>%

```{r bean-umap}
#| echo = FALSE,
#| dev = "png",
#| fig.height = 5,
#| fig.width = 10.1,
#| fig.cap = "The first two UMAP component scores for the bean validation set, colored by class. Results are shown for supervised and unsupervised versions.",
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Imports:
probably,
pscl,
purrr,
ragg,
ranger,
recipes (>= 0.1.16),
rlang,
Expand All @@ -88,7 +89,6 @@ Imports:
xgboost,
yardstick
Remotes:
tidymodels/censored,
tidymodels/learntidymodels
biocViews: mixOmics
Encoding: UTF-8
Expand Down
8 changes: 7 additions & 1 deletion _common.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ options(dplyr.print_min = 6, dplyr.print_max = 6)
options(cli.width = 85)
options(crayon.enabled = FALSE)

library(ragg)

knitr::opts_chunk$set(
comment = "#>",
collapse = TRUE,
fig.align = 'center',
tidy = FALSE
tidy = FALSE,
# see https://www.tidyverse.org/blog/2020/08/taking-control-of-plot-scaling/#the-solution
dev = "agg_png",
dev.args = list(res = 300, units = "in"),
fig.ext = "png"
)


Expand Down
Binary file modified extras/ames.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extras/ames_chull.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extras/ames_plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 6 additions & 7 deletions extras/ames_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ plain_ames <-
ggplot() +
xlim(ames_x) +
ylim(ames_y) +
theme_vo
<id() +
theme_void() +
theme(legend.position = "none") +
geom_sf(data = ia_roads, aes(geometry = geometry), alpha = .1) +
geom_point(
Expand Down Expand Up @@ -251,7 +250,7 @@ mitchell <-
# mitchell_box + plot_spacer() + mitchell + plot_layout(widths = c(2, 0.1, 3))

# guide inset in plot
agg_png("mitchell.png", width = 480 * mitchell_ratio * 2, height = 480 * 2, res = 200)
agg_png("mitchell.png", width = 480 * mitchell_ratio * 3, height = 480 * 3, res = 300, scaling = 1)
print(mitchell)
print(mitchell_box, vp = viewport(0.8, 0.27, width = 0.3 * ames_ratio, height = 0.3))
dev.off()
Expand Down Expand Up @@ -317,7 +316,7 @@ timberland <-
scale_shape_manual(values = ames_pch)

# guide inset in plot
agg_png("timberland.png", width = 480 * timberland_ratio)
agg_png("timberland.png", width = 480 * timberland_ratio, res = 300, scaling = 1/3)
print(timberland)
print(timberland_box, vp = viewport(0.85, 0.2, width = 0.3 * ames_ratio, height = 0.3))
dev.off()
Expand Down Expand Up @@ -378,7 +377,7 @@ dot_rr <-
)

# guide inset in plot
agg_png("dot_rr.png", width = 480 * dot_rr_ratio)
agg_png("dot_rr.png", width = 480 * dot_rr_ratio, res = 300, scaling = 1/3)
print(dot_rr)
print(dot_rr_box, vp = viewport(0.5, 0.26, width = 0.45 * ames_ratio, height = 0.45))
dev.off()
Expand Down Expand Up @@ -440,7 +439,7 @@ crawford <-
)

# guide inset in plot
agg_png("crawford.png", width = 480 * crawford_ratio)
agg_png("crawford.png", width = 480 * crawford_ratio, res = 300, scaling = 1/3)
print(crawford)
print(crawford_box, vp = viewport(0.5, 0.2, width = 0.35 * ames_ratio, height = 0.35))
dev.off()
Expand Down Expand Up @@ -523,7 +522,7 @@ northridge <-
# northridge_box + plot_spacer() + northridge + plot_layout(widths = c(2, 0.1, 3))

# guide inset in plot
agg_png("northridge.png", width = 480 * northridge_ratio)
agg_png("northridge.png", width = 480 * northridge_ratio, res = 300, scaling = 1/3)
print(northridge)
print(northridge_box, vp = viewport(0.85, 0.21, width = 0.35 * ames_ratio, height = 0.35))
dev.off()
Binary file modified extras/crawford.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extras/dot_rr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extras/iowa_highway.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions extras/iowa_highway.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
Binary file modified extras/mitchell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extras/northridge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extras/timberland.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified premade/ames_chull.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified premade/ames_plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified premade/crawford.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified premade/dot_rr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified premade/mitchell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified premade/morphology.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified premade/northridge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified premade/timberland.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dc9c69d

Please sign in to comment.