plotHM: Makes heat maps

plotHMR Documentation

Makes heat maps

Description

Makes heat maps

Usage

plotHM(
  df,
  id,
  col_select,
  col_order,
  col_benchmark,
  label_scheme_sub,
  filepath,
  filename,
  scale_log2r,
  complete_cases,
  annot_cols = NULL,
  annot_colnames = NULL,
  annot_rows = annot_rows,
  xmin = -1,
  xmax = 1,
  xmargin = 0.1,
  p_dist_rows = 2,
  p_dist_cols = 2,
  hc_method_rows = "complete",
  hc_method_cols = "complete",
  x = NULL,
  p = NULL,
  method = NULL,
  diag = NULL,
  upper = NULL,
  annotation_col = NULL,
  annotation_row = NULL,
  clustering_method = NULL,
  rm_allna = TRUE,
  ...
)

Arguments

df

The name of a primary data file. By default, it will be determined automatically after matching the types of data and analysis with an id among c("pep_seq", "pep_seq_mod", "prot_acc", "gene"). A primary file contains normalized peptide or protein data and is among c("Peptide.txt", "Peptide_pVal.txt", "Peptide_impNA_pVal.txt", "Protein.txt", "Protein_pVal.txt", "protein_impNA_pVal.txt"). For analyses require the fields of significance p-values, the df will be one of c("Peptide_pVal.txt", "Peptide_impNA_pVal.txt", "Protein_pVal.txt", "protein_impNA_pVal.txt").

id

Character string; one of pep_seq, pep_seq_mod, prot_acc and gene.

col_select

Character string to a column key in expt_smry.xlsx. At the NULL default, the column key of Select in expt_smry.xlsx will be used. In the case of no samples being specified under Select, the column key of Sample_ID will be used. The non-empty entries under the ascribing column will be used in indicated analysis.

col_order

Character string to a column key in expt_smry.xlsx. Numeric values under which will be used for the left-to-right arrangement of samples in graphic outputs or top-to-bottom arrangement in text outputs. At the NULL default, the column key Order will be used. If values under column Order are left blank, samples will be ordered by their names.

col_benchmark

Not used.

label_scheme_sub

A data frame. Subset entries from label_scheme for selected samples.

filepath

A file path to output results. By default, it will be determined automatically by the name of the calling function and the value of id in the call.

filename

A representative file name to outputs. By default, the name(s) will be determined automatically. For text files, a typical file extension is .txt. For image files, they are typically saved via ggsave or pheatmap where the image type will be determined by the extension of the file name.

scale_log2r

Logical; if TRUE, adjusts log2FC to the same scale of standard deviation across all samples. The default is TRUE. At scale_log2r = NA, the raw log2FC without normalization will be used.

complete_cases

Logical; if TRUE, only cases that are complete with no missing values will be used. The default is FALSE.

annot_cols

A character vector of column keys in expt_smry.xlsx. The values under the selected keys will be used to color-code sample IDs on the top of the indicated plot. The default is NULL without column annotation.

annot_colnames

A character vector of replacement name(s) to annot_cols. The default is NULL without name replacement.

annot_rows

A character vector of column keys that can be found from input files of Peptide.txt, Protein.txt etc. The values under the selected keys will be used to color-code peptides or proteins on the side of the indicated plot. The default is NULL without row annotation.

xmin

Numeric; the minimum x at a log2 scale. The default is -1.

xmax

Numeric; the maximum x at a log2 scale. The default is 1.

xmargin

Numeric; the margin in heat scales. The default is 0.1.

p_dist_rows

Numeric; the power of the Minkowski distance in the measures of row dist at clustering_distance_rows = "minkowski". The default is 2.

p_dist_cols

Numeric; similar to p_dist_rows but for column data.

hc_method_rows

A character string; the same agglomeration method for hclust of data rows. The default is complete.

hc_method_cols

A character string; similar to hc_method_rows but for column data.

x

Dummy argument to avoid incurring the corresponding argument in dist by partial argument matches.

p

Dummy argument to avoid incurring the corresponding argument in dist by partial argument matches.

method

Dummy argument to avoid incurring the corresponding argument in dist by partial argument matches.

diag

Dummy argument to avoid incurring the corresponding argument in dist by partial argument matches.

upper

Dummy argument to avoid incurring the corresponding argument in dist by partial argument matches.

annotation_col

Dummy argument to avoid incurring the corresponding argument in pheatmap.

annotation_row

Dummy argument to avoid incurring the corresponding argument in pheatmap.

clustering_method

Dummy argument to avoid incurring the corresponding argument in pheatmap.

rm_allna

Logical; if TRUE, removes data rows that are exclusively NA across ratio columns of log2_R126 etc. The setting also applies to log2_R000 in LFQ.

...

filter_: Variable argument statements for the row filtration against data in a primary file linked to df. Each statement contains to a list of logical expression(s). The lhs needs to start with filter_. The logical condition(s) at the rhs needs to be enclosed in exprs with round parenthesis. For example, pep_len is a column key in Peptide.txt. The statement filter_peps_at = exprs(pep_len <= 50) will remove peptide entries with pep_len > 50. See also pepHist, normPSM.

arrange_: Variable argument statements for the row ordering against data in a primary file linked to df. The lhs needs to start with arrange_. The expression(s) at the rhs needs to be enclosed in exprs with round parenthesis. For example, arrange_peps_by = exprs(gene, prot_n_pep) will arrange entries by gene, then by prot_n_pep.

Additional parameters for plotting:
width, the width of plot
height, the height of plot

Additional arguments for pheatmap:
cluster_rows, clustering_method, clustering_distance_rows...

Notes about pheatmap:
annotation_col disabled; instead use keys indicated in annot_cols
annotation_row disabled; instead use keys indicated in annot_rows
clustering_method breaks into hc_method_rows for row data and hc_method_cols for column data
clustering_distance_rows = "minkowski" allowed together with the powder of p_dist_rows and/or p_dist_cols


qzhang503/proteoQ documentation built on Dec. 14, 2024, 12:27 p.m.