Skip to contents

Create the microbiome_dataset object.

Usage

create_microbiome_dataset(
  expression_data,
  sample_info,
  variable_info,
  otu_tree,
  taxa_tree,
  otu_tree_link,
  taxa_tree_link,
  ref_seq,
  sample_info_note,
  variable_info_note
)

Arguments

expression_data

MS1 peak table name.

sample_info

Sample information name.

variable_info

MS1 peak table name. Columns are samples and rows are variables.

otu_tree

otu_tree

taxa_tree

taxa_tree

explicit mapping between variable_id and otu_tree.

explicit mapping between variable_id and taxa_tree.

ref_seq

ref_seq

sample_info_note

Sample information name.

variable_info_note

Sample information name.

Value

A microbiome_dataset-class object.

Author

Xiaotao Shen xiaotao.shen@outlook.com

Examples


expression_data <-
  as.data.frame(matrix(
    sample(1:100, 100, replace = TRUE),
    nrow = 10,
    ncol = 10
  ))

rownames(expression_data) <- paste0("OTU", 1:nrow(expression_data))
colnames(expression_data) <-
  paste0("Sample", 1:ncol(expression_data))
expression_data
#>       Sample1 Sample2 Sample3 Sample4 Sample5 Sample6 Sample7 Sample8 Sample9
#> OTU1       70      75      69      48      42      60      90      33      12
#> OTU2        7      98      28      87      41      27      66      17      61
#> OTU3        7      74      12      96      54      34      73      65      13
#> OTU4        6      11      89      23      61      42      42      28      72
#> OTU5        5       8      29      64      88      71      12      97      59
#> OTU6       12      82      47      11      62      55       6      57      61
#> OTU7        8      86      28      26      35      52      45      35       1
#> OTU8       11      81      81       7      76      44      58      16      20
#> OTU9       32      69      97      70      10      13      98      95      42
#> OTU10      16      79      82      21      74      28      66      41      35
#>       Sample10
#> OTU1        82
#> OTU2        39
#> OTU3        14
#> OTU4        42
#> OTU5        79
#> OTU6        34
#> OTU7        21
#> OTU8         6
#> OTU9        42
#> OTU10       61

variable_info <-
  as.data.frame(matrix(
    sample(letters, 70, replace = TRUE),
    nrow = nrow(expression_data),
    ncol = 7
  ))

rownames(variable_info) <- rownames(expression_data)
colnames(variable_info) <-
  c("Domain",
    "Phylum",
    "Class",
    "Order",
    "Family",
    "Genus",
    "Species")

variable_info$variable_id <-
  rownames(expression_data)

sample_info <-
  data.frame(sample_id = colnames(expression_data),
             class = "Subject")

object <-
  create_microbiome_dataset(
    expression_data = expression_data,
    sample_info = sample_info,
    variable_info = variable_info
  )

object
#> -------------------- 
#> microbiomedataset version: 0.99.1 
#> -------------------- 
#> 1.expression_data:[ 10 x 10 data.frame]
#> 2.sample_info:[ 10 x 2 data.frame]
#> 3.variable_info:[ 10 x 8 data.frame]
#> 4.sample_info_note:[ 2 x 2 data.frame]
#> 5.variable_info_note:[ 8 x 2 data.frame]
#> -------------------- 
#> Processing information (extract_process_info())
#> create_microbiome_dataset ---------- 
#>             Package               Function.used                Time
#> 1 microbiomedataset create_microbiome_dataset() 2026-03-04 20:40:14