proteo_hm: Makes heat maps

View source: R/specialty.R

proteo_hmR Documentation

Makes heat maps

Description

Makes heat maps

Usage

proteo_hm(
  df = NULL,
  id = NULL,
  df_meta = NULL,
  sample_ids = NULL,
  filepath = NULL,
  filename = NULL,
  complete_cases = FALSE,
  annot_cols = NULL,
  annot_colnames = NULL,
  annot_rows = NULL,
  xmin = -1,
  xmax = 1,
  xmargin = 0.1,
  ...
)

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.

df_meta

A file name of meta data.

sample_ids

A character vector containing the sample IDs for an ascribing analysis.

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.

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.

...

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

Examples


proteo_hm(
  df = Protein_delta.txt, 
  id = gene, 
  df_meta = hm_meta.xlsx, 
  filepath = file.path(dat_dir, "Protein/Heatmap"), 
  filename = "kin_delta.png",
  complete_cases = FALSE, 
  annot_cols = NULL, 
  annot_colnames = NULL, 
  annot_rows = c("kin_class"), 
  cluster_rows = FALSE, 
  xmin = -1, 
  xmax = 1, 
  xmargin = .1, 
  width = 5, 
  height = 12,
  arrange2_by = exprs(kin_class, gene), 
)



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