extract_intensity
extract_intensity(
object,
sample_wise = "sample_id",
taxonomic_rank = c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species"),
data_type = c("wider", "longer"),
what = c("sum_intensity", "mean_intensity", "median_intensity"),
na.rm = TRUE,
relative = TRUE,
...
)
# S3 method for microbiome_dataset
extract_intensity(
object,
sample_wise = "sample_id",
taxonomic_rank = c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species"),
data_type = c("longer", "wider"),
what = c("sum_intensity", "mean_intensity", "median_intensity"),
na.rm = TRUE,
relative = TRUE,
...
)
microbiome_dataset
sample_wise, default is sample_id
taxonomic_rank
if return_same_object is FALSE, the return data.frame
which you want to mutate
na.rm
relative intensity or not
other params
microbiome_dataset
data("global_patterns", package = "microbiomedataset")
x <-
extract_intensity(
object = global_patterns,
taxonomic_rank = "Genus",
data_type = "longer",
relative = TRUE
)
head(x)
#> sample_id Genus value
#> 1 AQC1cm 4-29 0.5340725502
#> 2 AQC1cm 4041AA30 0.0000000000
#> 3 AQC1cm A17 0.8746237084
#> 4 AQC1cm Abiotrophia 0.0000000000
#> 5 AQC1cm Acaryochloris 0.0052303079
#> 6 AQC1cm Acetivibrio 0.0005811453
x <-
extract_intensity(
object = global_patterns,
taxonomic_rank = "Genus",
data_type = "wider",
relative = FALSE,
what = "sum_intensity"
)
head(x[, 1:5])
#> AQC1cm AQC4cm AQC7cm CC1 CL3
#> 4-29 919 5586 8175 3 2
#> 4041AA30 0 4 0 0 0
#> A17 1505 1046 1003 4242 1061
#> Abiotrophia 0 0 0 0 0
#> Acaryochloris 9 0 3 0 0
#> Acetivibrio 1 5 3 0 0