Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ project:
- 01_*
- 02_*
- 03_*
- 04_*
website:
google-analytics: "G-LZ35J3XE4D"
announcement:
Expand Down Expand Up @@ -69,6 +70,8 @@ website:
href: course/02_FilePaths/index.qmd
- text: "03 - Inside a .FCS file"
href: course/03_InsideFCSFile/index.qmd
- text: "04 - Intro to Tidyverse"
href: course/04_IntroToTidyverse/index.qmd
- section: "Cytometry Core"
href: Schedule.qmd
- section: "Beyond the Sandbox"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,673 changes: 3,673 additions & 0 deletions course/01_InstallingRPackages/homeworks/jttoivon/exercises.html

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions course/01_InstallingRPackages/homeworks/jttoivon/exercises.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
title: "Solutions for week01"
author: Jarkko Toivonen
date: "`r Sys.Date()`"
format:
html:
embed-resources: true
---

```{r}
library(PeacoQC)
```


## Problem 1

> We installed PeacoQC during this session, but we didn’t have time to explore what functions are present within the package. Using what you have learned about accessing documentation, figure out and list what functions it contains

```{r}
help(package = PeacoQC)
```


```{r}
ls("package:PeacoQC")
```

## Problem 2

> Take a closer look at the list of Bioconductor cytometry packages. Report back on how many there are currently in Bioconductor, the author/maintainer with the most contributed cytometry R packages, and a couple packages that you would be interested in exploring more in-depth later in the course.

There are 69 Bioconductor packages about cytometry.

Mike Jiang has contributed to 10 cytometry packages.

These packages seem interesting:

Package | Maintainer | Title | Rank
--------+------------+-------+-----
flowViz | Mike Jiang | Visualization for flow cytometry | 227
ggcyto | Mike Jiang | Visualize Cytometry data with ggplot | 237
flowPeaks | Yongchao Ge | An R package for flow data clustering | 648

## Problem 3



> There is another way to install R packages, using the newer pak package. Positron uses this when installing suggested dependencies.

> After learning more about it via the documentation and it’s pkgdown website, I would like you to attempt to install the following three R packages using this newer method: “broom”, “cytoMEM”, “DillonHammill/CytoExploreR”.

> Take screenshots, and in a new quarto markdown document, describe how the installation process differed from what you saw for install.packages(), install() and install_github().

### broom

```{r}
pak::pkg_install("broom")
```

It is easy to see in what stage the installation is. Meaning that all the time it
shows how many packages have finished installing out of the total number of needed packages.
It is then easier to estimate how long the installation will still take.

### cytoMEM

```{r}
pak::pkg_install("cytoMEM")
```


![](cytomem.png)

![](kernsmooth_fail1.png)

![](kernsmooth_fail2.png)

Installing cytoMEM causes pak::pkg_install() to install also KernSmooth, even though it is already installed.
It fails installing it because fortran compiler and blas library development package are not installed.

Works after installing these.

### DillonHammill/CytoExploreR

The next chunk is disabled.

```{r}
#| eval: FALSE
pak::pkg_install("DillonHammill/CytoExploreR")
```

Error:
! ! error in pak subprocess
Caused by error:
! Could not solve package dependencies:
* DillonHammill/CytoExploreR:
* Can't install dependency EmbedSOM (>= 1.0.0)
* Can't install dependency superheat (>= 1.0.0)
* EmbedSOM: Can't find package called EmbedSOM.
Show Traceback

![](failure_due_to_embed_som.png)

Package ‘EmbedSOM’ was removed from the CRAN repository.

Formerly available versions can be obtained from the archive.

Archived on 2025-12-22 as issues were not corrected in time.

So, it seems that this package cannot be installed. At least not with pkg_install().

pkg_install() does not print endless messages about compilation, unlike some other installation
methods, which is good.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions course/02_FilePaths/homeworks/DavidRach/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Making Sure I can save things.
3,710 changes: 3,710 additions & 0 deletions course/02_FilePaths/homeworks/jttoivon/filepaths.html

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions course/02_FilePaths/homeworks/jttoivon/filepaths.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: Solutions for week02
author: Jarkko Toivonen
date: "`r Sys.Date()`"
format:
html:
embed-resources: true
---

```{r setup}
library(magrittr) # For the pipe
library(fs)
```
## Problem 1

> Plug in an external hard-drive or USB into your computer. Manually, create a folder within called “TargetFolder”. Try to programmatically specify the file path to identify the folders and files present on your external drive. Then, try to copy your .fcs files from their current folder on your desktop to the TargetFolder on your drive using R. Remember, just copy, no deletion, you need to walk before you can run :D

```{r}
fcs_files <- list.files("data", pattern = ".fcs", full.names = TRUE)
fcs_files
```


```{r}
usb_stick <- file.path("", "media", "jttoivon", "KINGSTON")
if (file.exists(usb_stick)) {
target <- usb_stick
} else {
target <- file.path("", "tmp")
}
target <- file.path(target, "TargetFolder")
target
```

```{r}
dir.create(target)
```

```{r}
file.copy(fcs_files, target)
```

## Problem 2

> In this session, we used list.files() with the “full.names argument” set to TRUE, as well as the basename() function to identify specific files. But what if you wanted a particular directory. Run list.files() with “full.names argument” and “recursive” argument set to TRUE, and then search online to find an R function that would retrieve the “” individual directory folders.


```{r}
all_files <- list.files(".", full.names = TRUE, recursive = TRUE)
all_files
```

Split the paths into components.

```{r}
all_files %>%
fs::path_norm() %>% # Get rid of the "." in the beginning
fs::path_split() # Split into components
```

## Problem 3

> R packages often come with internal datasets, that are typically used for use in the help documentation examples. These can be accessed through the use of the `system.file()` function. See an example below.

```{r}
#| eval: FALSE
system.file("extdata", package = "FlowSOM")
```

> Using what we have learned about file.path navigation, search your way down the file.directory of the `FlowSOM` and `flowWorkspace` packages, and identify any .fcs files that are present for use in the documentation.

```{r}
system.file("extdata", package = "FlowSOM") %>%
list.files(pattern = "\\.fcs$", full.names = TRUE, recursive = TRUE)
```

```{r}
system.file("extdata", package = "flowWorkspace") %>%
list.files(pattern = "\\.fcs$", full.names = TRUE, recursive = TRUE)
```

No .fcs files found for package flowWorkspace.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading