Skip to content

Commit ec25e7b

Browse files
committed
Update v02_Evaluation_using_Trio.Rmd
1 parent da3706a commit ec25e7b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

vignettes/v02_Evaluation_using_Trio.Rmd

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,24 @@ library(glmnet)
1515

1616
# Import microbiome data
1717

18-
The `Trio` object in `BenchHub` can take datasets provided by users. To demonstrate, its ability to take user-provided datasets, we'll be using a microbiome dataset called `Lubomski` obtained from the `PD16Sdata` package. The following code will import the `Lubomksi` data into R. `lubomski_microbiome_data.Rdata` contains two data objects: `x` and `lubomPD`. `x` is a 575 by 1192 matrix containing the abundance of 1192 microbial taxa for 575 samples. `lubom_pd` is a factor vector of binary patient classes for 575 samples where where `1` represents `PD` and `0` represents `HC`.
18+
The `Trio` object in `BenchHub` can take datasets provided by users. To demonstrate this workflow, we use the `lubomski_microbiome_data` example dataset distributed with `BenchHub`. We first load the example objects into a temporary environment to avoid placing `x` and `lubomPD` directly into the global workspace. The dataset contains two objects: `x`, a 575 by 1192 matrix of microbial abundances for 575 samples, and `lubomPD`, a binary factor indicating Parkinson's disease (`PD`) or healthy control (`HC`) status for each sample.
1919

2020
```{r}
21-
# import the microbiome data
22-
data("lubomski_microbiome_data", package = "BenchHub")
21+
# import the microbiome data into a temporary environment
22+
exampleEnv <- new.env(parent = emptyenv())
23+
data("lubomski_microbiome_data", envir = exampleEnv, package = "BenchHub")
24+
25+
x <- exampleEnv[["x"]]
26+
lubomPD <- exampleEnv[["lubomPD"]]
2327
2428
# check the dimension of the microbiome matrix
2529
dim(x)
2630
2731
# check the length of the patient status
2832
length(lubomPD)
33+
34+
# Add sample IDs so the evidence matches the dataset rows by name.
35+
names(lubomPD) <- rownames(x)
2936
```
3037

3138
The task we'll be evaluating uses a binary classification task where each sample is either a Parkinson's Disease (PD) patient or Healthy Control (HC). Once the data are ready to be inputted to `Trio`, we can load `Trio`.

0 commit comments

Comments
 (0)