Skip to content

Commit

Permalink
Update data_import.Rmd
Browse files Browse the repository at this point in the history
  • Loading branch information
xec-cm committed Apr 22, 2024
1 parent cb0aec7 commit c24eabf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions vignettes/data_import.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ The `metaphlan` format is another commonly used format in bioinformatics for
microbiome sequencing data. Here's how you can import data in `metaphlan`
format to `TreeSummarizedExperiment.`


### To TreeSummarizedExperiment

To convert data from the `metaphlan` format to the `TreeSummarizedExperiment`
Expand All @@ -238,15 +237,20 @@ tse_metaphlan <- mia::loadFromMetaphlan(
file = system.file("extdata", "merged_abundance_table.txt", package = "mia"),
)
tse_metaphlan
tse_metaphlan <- TreeSummarizedExperiment::TreeSummarizedExperiment(
assays = list(counts = SummarizedExperiment::assay(tse_metaphlan)),
rowData = SummarizedExperiment::rowData(tse_metaphlan),
colData = SummarizedExperiment::colData(tse_metaphlan) |>
as.data.frame() |>
dplyr::mutate(condition = rep(c("A", "B"), times = 3))
)
# Recipe init
rec <- dar::recipe(tse_metaphlan)
rec <- dar::recipe(tse_metaphlan, var_info = "condition", tax_info = "Genus")
rec
```


## Conclusion

In this guide, we have explored various methods for importing microbiome
Expand Down

0 comments on commit c24eabf

Please sign in to comment.