API
MicrobiomeAnalysis.jl offers the following features
- functions and workflows for the analysis of microbiome data
- real time-series simulation
- ready-to-use example datasets
- easy conversion from and to EcoJulia objects
α diversity
Microbiome.shannon
— Functionshannon(se::SummarizedExperiment, assay_name::String)
Evaluates the shannon diversity index for each sample and returns it as a vector.
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_name::String
: the name of the assay to base the evaluation on.
Microbiome.shannon!
— Functionshannon!(se::SummarizedExperiment, assay_name::String)
Evaluates the shannon diversity index for each sample and stores it into coldata(se)
.
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_name::String
: the name of the assay to base the evaluation on.
Microbiome.ginisimpson
— Functionginisimpson(se::SummarizedExperiment, assay_name::String)
Evaluates the ginisimpson diversity index for each sample and returns it as a vector.
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_name::String
: the name of the assay to base the evaluation on.
Microbiome.ginisimpson!
— Functionginisimpson!(se::SummarizedExperiment, assay_name::String)
Evaluates the ginisimpson diversity index for each sample and stores it into coldata(se)
.
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_name::String
: the name of the assay to base the evaluation on.
β diversity
Microbiome.braycurtis
— Functionbraycurtis(se::SummarizedExperiment, assay_name::String)
Evaluates the braycurtis dissimilarity index for each sample and rturns it as a matrix.
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_name::String
: the name of the assay to base the evaluation on.
Microbiome.jaccard
— Functionjaccard(se::SummarizedExperiment, assay_name::String)
Evaluates the jaccard dissimilarity index for each sample and rturns it as a matrix.
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_name::String
: the name of the assay to base the evaluation on.
Microbiome.hellinger
— Functionhellinger(se::SummarizedExperiment, assay_name::String)
Evaluates the hellinger dissimilarity index for each sample and rturns it as a matrix.
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_name::String
: the name of the assay to base the evaluation on.
Microbiome.pcoa
— Functionpcoa(se::SummarizedExperiment, assay_name::String)
Runs a Multidimensional Scaling (MDS) for the selected assay of se and returns a model that can be executed with predict(model)
.
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_name::String
: the name of the assay to base the evaluation on.
Modelling and Simulations
MicrobiomeAnalysis.LVmodel
— FunctionLVmodel(N::Int64 = 20, tSpan::Vector{<:Real} = [0, 50]; β = 1, h = 0.1, random = false)
Generates a Lotka-Volterra model for N species over the given time span. The output is a time series of abundance values that can be stored as two separate objects: t, Xapp = LVmodel()
Arguments
N::Int64
: the size of the model community, that is, the number of species in the system.tSpan::Vector{<:Real}
: the time span along which computation is performed.β::Real
: the order of derivation for all the differential equations of the LV model.h::Real
: the step size for correction.random::Bool
: whether the function should return a randomised (true
) or constant (false
) model.
Assay Transformation
Missing docstring for transform
. Check Documenter's build log for details.
DataFrames.transform!
— Functiontransform(se::SummarizedExperiment, assay_name::String, method::Function, kwargs...; output_name::String = "transformed_" * assay_name)
Applies a transformation to a given assay and stores it into se
as a new assay.
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_name::String
: the name of the assay to base the evaluation on.method::Function
: the transformation to apply. It can entail the following values:log10
,pa
,ztransform
,clr
.kwargs...
: additional parameters specific to some methods.output_name::String
: custom name for the newly created assay.
Sorting and Filtering
MicrobiomeAnalysis.select_top_taxa
— Functionselect_top_taxa(se::SummarizedExperiment, assay_name::String; top_n::Int64 = 10, sel_method::Function = mean)
Sorts rows / features by one specific assay and returns the top elements.
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_name::String
: the name of the assay to base the evaluation on.top_n::Int64
: the number of top elements that are returned.sel_method::Function
: statistical measure to perform sorting (mean
by default).
select_top_taxa(se::SummarizedExperiment, assay_names::Vector{String}; top_n::Int64 = 10, sel_method::Function = mean)
Sorts rows / features by multiple assays and returns the top elements.
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_names::Vector{String}
: a vector of multiple assay names to base the evaluation on.top_n::Int64
: the number of top elements that are returned.sel_method::Function
: statistical measure to perform sorting (mean
by default).
DataFrames.dropmissing
— Functiondropmissing(se::SummarizedExperiment, assay_name::String)
Drop rows / features with missing elements for a specific assay.
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_name::String
: the name of the assay whose missing values should be dropped.
Visualisation
MicrobiomeAnalysis.abundance_plot
— Functionabundance_plot(se::SummarizedExperiment, assay_name::String)
Plots a time series of the abundance for each feature (row) of an assay in a SummarizedExperiment object. The corresponding should include a column named 'time' containing an array of sampling times
Arguments
se::SummarizedExperiment
: the experiment object of interest.assay_name::String
: the name of the assay to base the visualisation on.
Importing Datasets
MicrobiomeAnalysis.HintikkaXOData
— FunctionHintikkaXOData()
Retrieves the HintikkaXO MultiAssayExperiment, consisting of the microbiota, metabolite and biomarker SummarizedExperiment data, by Hintikka et al. (2021), https://doi.org/10.3390/ijerph18084049.
MicrobiomeAnalysis.OKeefeDSData
— FunctionOKeefeDSData()
Retrieves the OKeefeDS SummarizedExperiment, consisting of the microbiota, contains microbiome data from a study with African and African American groups undergoing a two-week diet swap, by O'Keefe et al. (2015), https://dx.doi.org/10.1038/ncomms7342.
MicrobiomeAnalysis.import_se_from_csv
— Functionimport_se_from_csv(assays_file::AbstractString, rowdata_file::AbstractString, coldata_file::AbstractString)
Imports a SummarizedExperiment object from its components stored as csv files.
Arguments
assays_file::AbstractString
: the path to a csv file containing the assays. It is produced in R withwrite.csv(assays(se), "assays_file.csv")
.rowdata_file::AbstractString
: the path to a csv file containing the rowdata. It is produced in R withwrite.csv(rowData(se), "rowdata_file.csv")
.coldata_file::AbstractString
: the path to a csv file containing the coldata. It is produced in R withwrite.csv(colData(se), "coldata_file.csv")
.
import_se_from_csv(assays_file::AbstractString)
Imports a SummarizedExperiment object from a csv file containing the assays. Rowdata and coldata are generated based on the information stored in the row and column names of assays_file
. This is the method of choice if the rowdata and coldata of the original SummarizedExperiment object does not provide valuable information either because they are empty or because they are part of a MultiAssayExperiment object.
Arguments
assays_file::AbstractString
: the path to a csv file containing the assays. It is produced in R withwrite.csv(assays(se), "assays_file.csv")
.
MicrobiomeAnalysis.import_mae_from_csv
— Functionimport_mae_from_csv(experiment_files::Vector{<:AbstractString}, sample_data_file::AbstractString, sample_map_file::AbstractString; experiment_names::Vector{<:AbstractString} = experiment_files)
Imports a MultiAssayExperiment object from its components stored as csv files.
Arguments
experiment_files::Vector{<:AbstractString}
: a list of paths to the csv files containing the assays of different experiments. For example, if a MultiAssayExperiment object has 3 experiments,experiment_files
is defined as:[assays_file1, assays_file2, assays_file3]
Eachassays_file
is produced in R withwrite.csv(assays(se), "assays_file.csv")
. It is produced in R withwrite.csv(assays(se), "assays_file.csv")
.sample_data_file::AbstractString
: the path to a csv file containing the sample data. It is produced in R withwrite.csv(colData(mae), "sample_data_file.csv")
.sample_map_file::AbstractString
: the path to a csv file containing the sample map. It is produced in R withwrite.csv(colData(mae), "sample_map_file.csv", row.names = FALSE)
.experiment_names::Vector{<:AbstractString}
: a vector of names to assign to the experiments listed inexperiment_files
. By default, the experiments are named with the filepaths specified inexperiment_files
.
SummarizedExperiments.SummarizedExperiment
— TypeSummarizedExperiment(comm::CommunityProfile)
Converts a CommunityProfile to a SummarizedExperiment object.
Arguments
comm::CommunityProfile
: the CommunityProfile to be converted.
Microbiome.CommunityProfile
— TypeCommunityProfile(se::SummarizedExperiment)
Converts a SummarizedExperiment object to a CommunityProfile.
Arguments
se::SummarizedExperiment
: the SummarizedExperiment object to be converted.