Skip to contents

Construct a multiOmicDataSet object from data frames

Usage

create_multiOmicDataSet_from_dataframes(
  sample_meta_dat,
  count_dat,
  sample_id_colname = "sample_id",
  count_type = "raw"
)

Arguments

sample_meta_dat

sample metadata as a data frame or tibble. Must contain a sample_id column.

count_dat

data frame of feature counts (e.g. expected gene counts from RSEM)

sample_id_colname

name of the column in sample_meta_filepath that contains the sample IDs

count_type

type to assign the values of gene_counts_filepath to in the counts slot

Value

multiOmicDataSet object

Examples

sample_meta <- data.frame(
  sample_id = c("KO_S3", "KO_S4", "WT_S1", "WT_S2"),
  condition = factor(
    c("knockout", "knockout", "wildtype", "wildtype"),
    levels = c("wildtype", "knockout")
  )
)
create_multiOmicDataSet_from_dataframes(sample_meta, gene_counts)
#> <MOSuite::multiOmicDataSet>
#>  @ sample_meta:'data.frame':	4 obs. of  2 variables:
#>  .. $ sample_id: chr  "KO_S3" "KO_S4" "WT_S1" "WT_S2"
#>  .. $ condition: Factor w/ 2 levels "wildtype","knockout": 2 2 1 1
#>  @ counts     :List of 1
#>  .. $ raw: spc_tbl_ [58,929 × 5] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
#>  ..  ..$ gene_id: 'glue' chr [1:58929] "ENSG00000121410.11|A1BG" "ENSG00000268895.5|A1BG-AS1" "ENSG00000148584.15|A1CF" "ENSG00000175899.14|A2M" ...
#>  ..  ..$ KO_S3  : num [1:58929] 0 0 0 0 0 0 0 0 0 0 ...
#>  ..  ..$ KO_S4  : num [1:58929] 0 0 0 0 0 0 0 0 0 0 ...
#>  ..  ..$ WT_S1  : num [1:58929] 0 0 0 0 0 0 0 0 0 0 ...
#>  ..  ..$ WT_S2  : num [1:58929] 0 0 0 0 0 0 0 0 0 0 ...
#>  ..  ..- attr(*, "spec")=List of 3
#>  ..  .. ..$ cols   :List of 6
#>  ..  .. .. ..$ gene_id : list()
#>  ..  .. .. .. ..- attr(*, "class")= chr [1:2] "collector_character" "collector"
#>  ..  .. .. ..$ GeneName: list()
#>  ..  .. .. .. ..- attr(*, "class")= chr [1:2] "collector_character" "collector"
#>  ..  .. .. ..$ KO_S3   : list()
#>  ..  .. .. .. ..- attr(*, "class")= chr [1:2] "collector_double" "collector"
#>  ..  .. .. ..$ KO_S4   : list()
#>  ..  .. .. .. ..- attr(*, "class")= chr [1:2] "collector_double" "collector"
#>  ..  .. .. ..$ WT_S1   : list()
#>  ..  .. .. .. ..- attr(*, "class")= chr [1:2] "collector_double" "collector"
#>  ..  .. .. ..$ WT_S2   : list()
#>  ..  .. .. .. ..- attr(*, "class")= chr [1:2] "collector_double" "collector"
#>  ..  .. ..$ default: list()
#>  ..  .. .. ..- attr(*, "class")= chr [1:2] "collector_guess" "collector"
#>  ..  .. ..$ delim  : chr "\t"
#>  ..  .. ..- attr(*, "class")= chr "col_spec"
#>  ..  ..- attr(*, "problems")=<externalptr> 
#>  @ analyses   : list()