Number of samples

Number of variables

Sample IDs

Variable IDs

Get missing value number/percentage in expression data.

###old version #' @title apply #' @method apply mass_dataset #' @param X X #' @param MARGIN MARGIN #' @param FUN FUN #' @param ... ... #' @param simplify simplify #' @export #' @rdname summary-mass_dataset #' @return result

#' @title intersect #' @method intersect mass_dataset #' @param x x #' @param y y #' @export #' @rdname summary-mass_dataset #' @return result

get_sample_number(object)

get_variable_number(object)

get_sample_id(object)

get_variable_id(object)

get_mv_number(
  object,
  by = c("total", "sample", "variable"),
  show_by = c("number", "percentage")
)

# S3 method for mass_dataset
dim(x)

# S3 method for mass_dataset
nrow(x)

# S3 method for mass_dataset
ncol(x)

# S3 method for mass_dataset
colnames(x)

# S3 method for mass_dataset
rownames(x)

# S4 method for mass_dataset
apply(X, MARGIN, FUN, ..., simplify = TRUE)

# S4 method for mass_dataset,mass_dataset
intersect(x, y)

# S3 method for mass_dataset
summary(object, ...)

# S3 method for mass_dataset
length(x)

# S3 method for mass_dataset
names(x)

# S3 method for mass_dataset
dimnames(x)

# S3 method for mass_dataset
is.na(x)

# S4 method for mass_dataset
add_column(
  .data,
  ...,
  .before = NULL,
  .after = NULL,
  .name_repair = c("check_unique", "unique", "universal", "minimal")
)

Arguments

object

object

by

total: Missing value number in total. sample: Missing value number in each sample. variable: Missing value number in each variable.

show_by

number: missing value number. percentage: missing value percentage.

x

x

X

X

MARGIN

MARGIN

FUN

FUN

...

dynamic-dots Name-value pairs, passed on to tibble(). All values must have the same size of .data or size 1.

simplify

simplify

y

y

.data

mass_data class

.before

One-based column index or column name where to add the new columns, default: after last column.

.after

One-based column index or column name where to add the new columns, default: after last column.

.name_repair

Treatment of problematic column names: "minimal": No name repair or checks, beyond basic existence, "unique": Make sure names are unique and not empty, "check_unique": (default value), no name repair, but check they are unique, "universal": Make the names unique and syntactic a function: apply custom name repair (e.g., .name_repair = make.names for names in the style of base R). A purrr-style anonymous function, see rlang::as_function() This argument is passed on as repair to vctrs::vec_as_names(). See there for more details on these terms and the strategies used to enforce them.

Value

A numeric.

A numeric.

A character vector.

A character vector.

A numeric (vector).

message

message

message

message

message

result

result

vector object

vector object

vector object

message

mass_dataset class

Details

apply.mass_dataset = function(X, MARGIN, FUN, ..., simplify = TRUE) apply(as.matrix(X@expression_data), MARGIN, FUN, ..., simplify = simplify)

intersect.mass_dataset = function(x, y) intersect(x@sample_info$sample_id, y@sample_info$sample_id)

Author

Xiaotao Shen shenxt1990@outlook.com

Examples

data("expression_data")
data("sample_info")
data("variable_info")
object =
  create_mass_dataset(
    expression_data = expression_data,
    sample_info = sample_info,
    variable_info = variable_info,
  )
 get_sample_number(object = object)
#> [1] 8
data("expression_data")
data("sample_info")
data("variable_info")
object =
  create_mass_dataset(
    expression_data = expression_data,
    sample_info = sample_info,
    variable_info = variable_info,
  )
 get_variable_number(object = object)
#> [1] 1000
data("expression_data")
data("sample_info")
data("variable_info")
object =
  create_mass_dataset(
    expression_data = expression_data,
    sample_info = sample_info,
    variable_info = variable_info,
  )
 get_sample_id(object = object)
#> [1] "Blank_3" "Blank_4" "QC_1"    "QC_2"    "PS4P1"   "PS4P2"   "PS4P3"  
#> [8] "PS4P4"  
data("expression_data")
data("sample_info")
data("variable_info")
object =
  create_mass_dataset(
    expression_data = expression_data,
    sample_info = sample_info,
    variable_info = variable_info,
  )
 head(get_variable_id(object = object))
#> [1] "M136T55_2_POS" "M79T35_POS"    "M307T548_POS"  "M183T224_POS" 
#> [5] "M349T47_POS"   "M182T828_POS" 
data("expression_data")
data("sample_info")
data("variable_info")
object =
  create_mass_dataset(
    expression_data = expression_data,
    sample_info = sample_info,
    variable_info = variable_info,
  )
object
#> -------------------- 
#> massdataset version: 1.0.12 
#> -------------------- 
#> 1.expression_data:[ 1000 x 8 data.frame]
#> 2.sample_info:[ 8 x 4 data.frame]
#> 3.variable_info:[ 1000 x 3 data.frame]
#> 4.sample_info_note:[ 4 x 2 data.frame]
#> 5.variable_info_note:[ 3 x 2 data.frame]
#> 6.ms2_data:[ 0 variables x 0 MS2 spectra]
#> -------------------- 
#> Processing information (extract_process_info())
#> 1 processings in total
#> create_mass_dataset ---------- 
#>       Package         Function.used                Time
#> 1 massdataset create_mass_dataset() 2022-08-07 19:33:21
head(get_variable_id(object = object))
#> [1] "M136T55_2_POS" "M79T35_POS"    "M307T548_POS"  "M183T224_POS" 
#> [5] "M349T47_POS"   "M182T828_POS" 
get_mv_number(object)
#> [1] 3829
get_mv_number(object, by = "sample")
#> Blank_3 Blank_4    QC_1    QC_2   PS4P1   PS4P2   PS4P3   PS4P4 
#>     682     702     397     381     424     427     405     411 
head(get_mv_number(object, by = "variable", "percentage"))
#> M136T55_2_POS    M79T35_POS  M307T548_POS  M183T224_POS   M349T47_POS 
#>         0.250         0.250         0.375         0.750         0.250 
#>  M182T828_POS 
#>         0.125