-
Notifications
You must be signed in to change notification settings - Fork 0
Home
HeatMap.R
load.abundance.data()
is a method for loading abundance table in .csv files in the appropriate format for use with the heat map creating functions
load.abundance.data(path, column = 1)
path the path from the working directory to the .csv file containing the abundance table
column the column number containing the feature names
The abundance table needs to be loaded into R in such a way that the row names are the feature names, the sample names are the column names, and all its values are numerics.
Returns a numerical matrix created from the abundance table
load.meta.data()
is a method for loading metadata in .csv files in the appropriate format for use with the heat map creating functions
load.meta.data(path, tax_column = 1)
path the path from the working directory to the .csv file containing the metadata
tax_column the column number containing the taxonomical or sample (ie identifying) name for the metadata
This can be used to load feature or sample metadata. Metadata needs to be loaded in such a way that the row names are the identifying names and the traits are the column names.
Returns a data.frame containing information extracted from the metadata
This will eliminate all duplicate entries from the metadata without merging their data resulting in potential data loss.
create.correlogram()
creates a heat map based on the correlation of features given an abundance table and feature metadata.
create.correlogram(data, feature_meta, show = TRUE)
data abundance data in a numerical matrix
feature_meta a data.frame containing feature metadata
show if true, will display the graph upon completion
The features need to be the rows of the abundance data.
Returns a pheatmap with the following components: row hclusters, column hclusters, kmeans, and gtable
create.heatmap()
creates a heat map based on relative abundance, with row and column dendrograms based on given metadata
create.heatmap(data, sample_meta, feature_meta, percentile = 0.75, show = FALSE, omit_na = TRUE)
data abundance data in a numerical matrix
sample_meta a data.frame containing sample metadata
feature_meta a data.frame containing feature metadata
percentile a filter for displaying only entries with a threshold correlation
show if true, will display the graph upon completion
omit_na whether to eliminate entries that are missing meta data
The features need to be the rows of the abundance data.
Returns a pheatmap with the following components: row hclusters, column hclusters, kmeans, and gtable
one.v.all()
uses the create.heatmap function, but filters the metadata such that it labels only a single feature category and type, labeling all others as 'other'
one.v.all(data, sample_meta, feature_meta, which = 2, percentile = 0.75, show = FALSE, column, trait)
data abundance data in a numerical matrix
sample_meta a data.frame containing sample metadata
feature_meta a data.frame containing feature metadata
which a number representing whether to filter the sample(1) or feature(2) metadata
percentile a filter for displaying only entries with a threshold correlation
show if true, will display the graph upon completion
column the column number with the feature category
trait the specific feature type to use
Compare only one feature type against all others in a feature category (ex. aerobic respiration v all other oxygen requirements). The features need to be the rows of the abundance data. Can supply any number of feature categories, but only one will be used.
Returns a pheatmap with the following components: row hclusters, column hclusters, kmeans, and gtable
all.one.v.all()
uses the one.v.all function, creates a heatmap for every feature type found
all.one.v.all <- function(data, sample_meta, feature_meta, which = 2, percentile = 0.75, show = FALSE, column, directory='')
data abundance data in a numerical matrix
sample_meta a data.frame containing sample metadata
feature_meta a data.frame containing feature metadata
which a number representing whether to filter the sample(1) or feature(2) metadata
percentile a filter for displaying only entries with a threshold correlation
show if true, will display the graph upon completion
column the column number with the feature category
directory the path from the working directory to where the file should be saved
Creates a heatmap for every feature type found (ex. 3 forms of oxygen requirements). The features need to be the rows of the abundance data. Can supply any number of feature categories, but only one will be used. Will automatically name the files based on the trait