coOncoplot: Draw two oncoplots side by side for cohort comparision.

View source: R/coOncoplot.R

coOncoplotR Documentation

Draw two oncoplots side by side for cohort comparision.

Description

Draw two oncoplots side by side for cohort comparision.

Usage

coOncoplot(
  m1,
  m2,
  genes = NULL,
  m1Name = NULL,
  m2Name = NULL,
  clinicalFeatures1 = NULL,
  clinicalFeatures2 = NULL,
  annotationColor1 = NULL,
  annotationColor2 = NULL,
  annotationFontSize = 1.2,
  sortByM1 = FALSE,
  sortByM2 = FALSE,
  sortByAnnotation1 = FALSE,
  annotationOrder1 = NULL,
  sortByAnnotation2 = FALSE,
  annotationOrder2 = NULL,
  sampleOrder1 = NULL,
  sampleOrder2 = NULL,
  additionalFeature1 = NULL,
  additionalFeaturePch1 = 20,
  additionalFeatureCol1 = "white",
  additionalFeatureCex1 = 0.9,
  additionalFeature2 = NULL,
  additionalFeaturePch2 = 20,
  additionalFeatureCol2 = "white",
  additionalFeatureCex2 = 0.9,
  sepwd_genes1 = 0.5,
  sepwd_samples1 = 0.5,
  sepwd_genes2 = 0.5,
  sepwd_samples2 = 0.5,
  colors = NULL,
  removeNonMutated = TRUE,
  anno_height = 2,
  legend_height = 4,
  geneNamefont = 0.8,
  showSampleNames = FALSE,
  SampleNamefont = 0.5,
  barcode_mar = 1,
  outer_mar = 3,
  gene_mar = 1,
  legendFontSize = 1.2,
  titleFontSize = 1.5,
  keepGeneOrder = FALSE,
  bgCol = "#CCCCCC",
  borderCol = "white"
)

Arguments

m1

first MAF object

m2

second MAF object

genes

draw these genes. Default plots top 5 mutated genes from two cohorts.

m1Name

optional name for first cohort

m2Name

optional name for second cohort

clinicalFeatures1

columns names from 'clinical.data' slot of m1 MAF to be drawn in the plot. Dafault NULL.

clinicalFeatures2

columns names from 'clinical.data' slot of m2 MAF to be drawn in the plot. Dafault NULL.

annotationColor1

list of colors to use for 'clinicalFeatures1' Default NULL.

annotationColor2

list of colors to use for 'clinicalFeatures2' Default NULL.

annotationFontSize

font size for annotations Default 1.2

sortByM1

sort by mutation frequency in 'm1'

sortByM2

sort by mutation frequency in 'm2'

sortByAnnotation1

logical sort oncomatrix (samples) by provided 'clinicalFeatures1'. Sorts based on first 'clinicalFeatures1'. Defaults to FALSE. column-sort

annotationOrder1

Manually specify order for annotations for 'clinicalFeatures1'. Works only for first value. Default NULL.

sortByAnnotation2

same as above but for m2

annotationOrder2

Manually specify order for annotations for 'clinicalFeatures2'. Works only for first value. Default NULL.

sampleOrder1

Manually specify sample names in m1 for oncolplot ordering. Default NULL.

sampleOrder2

Manually specify sample names in m2 for oncolplot ordering. Default NULL.

additionalFeature1

a vector of length two indicating column name in the MAF and the factor level to be highlighted.

additionalFeaturePch1

Default 20

additionalFeatureCol1

Default "white"

additionalFeatureCex1

Default 0.9

additionalFeature2

a vector of length two indicating column name in the MAF and the factor level to be highlighted.

additionalFeaturePch2

Default 20

additionalFeatureCol2

Default "white"

additionalFeatureCex2

Default 0.9

sepwd_genes1

Default 0.5

sepwd_samples1

Default 0.5

sepwd_genes2

Default 0.5

sepwd_samples2

Default 0.5

colors

named vector of colors for each Variant_Classification.

removeNonMutated

Logical. If TRUE removes samples with no mutations in the oncoplot for better visualization. Default TRUE.

anno_height

Height of clinical margin. Default 2

legend_height

Height of legend margin. Default 4

geneNamefont

font size for gene names. Default 1

showSampleNames

whether to show sample names. Defult FALSE.

SampleNamefont

font size for sample names. Default 0.5

barcode_mar

Margin width for sample names. Default 1

outer_mar

Margin width for outer. Default 3

gene_mar

Margin width for gene names. Default 1

legendFontSize

font size for legend. Default 1.2

titleFontSize

font size for title. Default 1.5

keepGeneOrder

force the resulting plot to use the order of the genes as specified. Default FALSE

bgCol

Background grid color for wild-type (not-mutated) samples. Default gray - "#CCCCCC"

borderCol

border grid color for wild-type (not-mutated) samples. Default 'white'

Details

Draws two oncoplots side by side to display difference between two cohorts.

Value

Invisibly returns a list of sample names in their order of occurrences in M1 and M2 respectively.

Examples

#' ##Primary and Relapse APL
primary.apl <- system.file("extdata", "APL_primary.maf.gz", package = "maftools")
relapse.apl <- system.file("extdata", "APL_relapse.maf.gz", package = "maftools")
##Read mafs
primary.apl <- read.maf(maf = primary.apl)
relapse.apl <- read.maf(maf = relapse.apl)
##Plot
coOncoplot(m1 = primary.apl, m2 = relapse.apl, m1Name = 'Primary APL', m2Name = 'Relapse APL')
dev.off()

PoisonAlien/maftools documentation built on March 26, 2024, 11:13 a.m.