ISS_map: Plot function for MolDiaISS data.

Description Usage Arguments Details Examples

View source: R/3.6_ISS_map.R

Description

Map RCA data based on cell, cluster or tSNE

Usage

1
2
3
4
5
ISS_map(data, what = "cell", xlab = "centroid_x",
  ylab = "centroid_y", main = "Plot title", ptsize = 1,
  pchuse = 16, image = TRUE, live = FALSE, label.topgene = NULL,
  gene = NULL, cluster_id = NULL, same.y.lims = FALSE,
  adjust.use = 0.5, log = "")

Arguments

data

Input data in class MolDiaISS. Output of readISS.

what

What to plot. Values can be "cell", "cluster", "tsne", "tsneAll" and "vlnplot". Default is "cell". See details.

xlab

Label of x-axis

ylab

Label of y-axis

main

Main title

ptsize

Point size

pchuse

Pch for plotting

image

Plot image. Default is TRUE.

live

Plot interactive image. Default is FALSE.

label.topgene

Active only when "what = cluster or tsne". Number of genes to label each cluster. Only work when data is clustered and clusted marker has identified in cluster.marker slot of input data.

gene

Gene of interest. When live= TRUE, limited to max 20 genes.

cluster_id

Which cluster to plot. Only work when what = "cluster".

same.y.lims

Set all the y-axis limits to the same values.

adjust.use

A multiplicate bandwidth adjustment. This makes it possible to adjust the bandwidth while still using the a bandwidth estimator. For exampe, adjust = 1/2 means use half of the default bandwidth.

log

a character string which contains "x" if the x axis is to be logarithmic, "y" if the y axis is to be logarithmic and "xy" or "yx" if both axes are to be logarithmic.

Details

what parameter can have the value "cell", "gene", "cluster", "tsne", "tsneAll" and "vlnplot".

"cell" will plot all cells with selected/all genes togather.

"gene" will plot all/selected gene separately one by one on the tissue.

"cluster" will plot all cluster information.

"tsne" and "tsneAll" will plot the Dimention reduction by tSNE

"vlnplot" will plot the violin plot on cluster data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## Reading ISS data
left_hypo <- readISS(file = system.file("extdata", "Hypocampus_left.csv", package="MolDia"), 
                        cellid = "CellId", centX = "centroid_x", centY = "centroid_y")

############################# Plot cell                                                  
## Plot all cell with selected/all genes togather
res       <- ISS_map(data = left_hypo, what = "cell", gene = left_hypo@gene[1:4], main = "Plot all cells gene")

############################# Plot gene                                                 
## Plot each single gene
res       <- ISS_map(data = left_hypo, what = "gene", gene = left_hypo@gene[1:4], main = "Plot selected genes")

############################# Data Pre-processing
left_hypo <- ISS_preprocess(data = left_hypo, normalization.method = "LogNormalize",
                            do.scale = TRUE, do.center = FALSE)
                            
############################# Plot tsne and tsneAll
## Dimention reduction by tSNE on non-clustered data
left_hypo <- ISS_tsne(data = left_hypo, perplexity= 30, pc = 0.7)
# Plot tSNE
result <- ISS_map(data = left_hypo, what = "tsneAll")
# Plot selected gene on tSNE plot
result <- ISS_map(data = left_hypo, what = "tsne", gene = left_hypo@gene[1:4] )

## Dimention reduction by tSNE on clustered data
# Cluster data based on SEURAT pipeline
left_hypo_clust  <- ISS_cluster(data = left_hypo, pc = 0.7, resolution = 0.3, method = "seurat")
# Dimention reduction by tSNE
left_hypo_clust   <- ISS_tsne(data = left_hypo_clust, pc= 0.9, perplexity= 100)
Plot cluster on tSNE plot
result <- ISS_map(data = left_hypo_clust, what = "tsneAll")

############################# Plot cluster 
# Cluster data based on SEURAT pipeline
left_hypo <- ISS_cluster(data = left_hypo, pc = 0.7, resolution = 0.08, method = "seurat")
res       <- ISS_map(data = left_hypo, what = "cluster")
res       <- ISS_map(data = left_hypo, what = "cluster", cluster_id = 1:2)

############################# Plot violin plot
res       <- ISS_map(data = left_hypo_clust, what = "vlnplot", gene = left_hypo@gene[4:7], same.y.lims = F, adjust.use = 1)


###### Reading non-segmentated file
data_nonsegment  <- readISS(file = system.file("extdata", "nonSeg_QT_0.35_0_details.csv", package="MolDia"), segment = FALSE,
                            centX = "PosX", centY = "PosY", nogene = "NNNN")
res   <- ISS_map(data = data_nonsegment, what = "gene")
res   <- ISS_map(data = data_nonsegment, what = "gene", gene= c("Gdf7","WNT1","Pak3","Tfap2a"))

mashranga/MolDia documentation built on May 26, 2019, 9:36 a.m.