-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror_no_subject_qc.Rmd
More file actions
executable file
·79 lines (60 loc) · 1.72 KB
/
error_no_subject_qc.Rmd
File metadata and controls
executable file
·79 lines (60 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
title: "No Subject or QC"
author:
- name: Xiaotao Shen (https://www.shenxt.info/)
date: "Created on 2022-02-08 and updated on `r Sys.Date()`"
output:
html_document:
df_print: paged
toc: no
pdf_document:
toc: no
vignette: >
%\VignetteIndexEntry{align_batch}
%\VignettePackage{masscleaner}
% \VignetteEngine{knitr::rmarkdown}
% \usepackage[utf8]{inputenc}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE, echo=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
warning = FALSE,
message = TRUE,
out.width = "100%"
)
```
When you use the functions which need specific identification for `Subject` or `QC` samples in `class` of `sample_info`, if there is a error:
```
Error: error: No Subject samples in object, please check and see here:
```
You need to change the column `class` in `sample_info`.
# Step 1: check the class in your sample_info
```{r,eval=TRUE,echo=FALSE,warning=FALSE, R.options="", message=FALSE, cache=TRUE}
load("object_neg")
object <- object_neg
```
```{r,eval=TRUE,warning=FALSE, R.options="", message=FALSE, cache=TRUE}
library(masscleaner)
library(tidyverse)
object@sample_info$class
```
We can see there are no "Subject" in the class, so we need to change the `case` and `control` to `Subject`.
# Step 2: change class
```{r,eval=TRUE,warning=FALSE, R.options="", message=FALSE, cache=TRUE}
object <-
object %>%
activate_mass_dataset(what = "sample_info") %>%
mutate(class = case_when(
class == "QC" ~ "QC",
TRUE ~ "Subject"
))
```
```{r,eval=TRUE,warning=FALSE, R.options="", message=FALSE, cache=TRUE}
object@sample_info$class
```
# Session information
```{r,eval=TRUE,warning=FALSE, R.options="", message=FALSE, cache=TRUE}
sessionInfo()
```