plot_dendocluster {metaprotr}R Documentation

plot_dendocluster

Description

Draws a dendogram where samples are clustered based on the number of elements present on each sample from a "spectral_count_object". This graph is constructed based on Spearman correlations transformed into distances and plotted with the logic of the package dendextend.

Usage

plot_dendocluster(
  spectral_count_object,
  target_variable,
  file_title,
  hclust_method = "ward.D",
  correlation_method = "spearman",
  force = FALSE
)

Arguments

spectral_count_object

List defined as "spectral_count_object" containing dataframes with abundance expressed as spectral counts from peptides, subgroups, groups or taxonomic levels. The format of this object is similar to that generated from the functions "getsc_specific" and "crumble_taxonomy".

target_variable

Character indicating the name of one column from metadata. The different levels in this column will be represented as different colors in the final dendogram.

file_title

Character indicating the name of the generated file.

hclust_method

Character indicating the agglomeration method to be used for the hierarchical clustering. The possible methods are discribed on hclust. The default method is "ward.D".

correlation_method

Character indicating the correlation coeficient to be computed. The possible options are discribed in the function cor. The default value is "spearman".

force

Logic value set at FALSE by default in order to ask permission to create a pdf file in the workstation of the user.

Value

A dendogram plot (pdf) indicating the number of elements per sample.

Examples



data(fecal_waters)
str(fecal_waters$metadata)

plot_dendocluster(fecal_waters, "Condition", "title_dendogram")

plot_dendocluster(fecal_waters, "Condition", "title_dendogram", 
   hclust_method = "mcquitty")

plot_dendocluster(fecal_waters, "Condition", "title_dendogram_groups", 
   correlation_method = "pearson")



[Package metaprotr version 1.2.2 Index]