packages <- c(
  "CIMseq", "printr", "ggthemes", "dplyr", 
  "tidyr", "ggplot2", "viridis"
)
purrr::walk(packages, library, character.only = TRUE)
rm(packages)

CIMseqSinglets and CIMseqMultiplets

Plot markers.

plotCountsMarkers(
  CIMseqSinglets_test, CIMseqMultiplets_test, markers = c("CD74", "ANXA3")
)

Plot cell number.

plotCountsERCC(CIMseqSinglets_test, CIMseqMultiplets_test)

Get the plotting data so you can make a custom plot.

plotCountsMarkers(
  CIMseqSinglets_test, CIMseqMultiplets_test, markers = c("CD74", "ANXA3")
) %>%
  plotData() %>%
  head()

plotCountsERCC(CIMseqSinglets_test, CIMseqMultiplets_test) %>%
  plotData() %>%
  head()

Plot the clustering and classification.

plotUnsupervisedClass(CIMseqSinglets_test, CIMseqMultiplets_test)

Plot a single marker.

plotUnsupervisedMarkers(CIMseqSinglets_test, CIMseqMultiplets_test, "CD74")

Plot markers in different cell types.

plotUnsupervisedMarkers(
  CIMseqSinglets_test, CIMseqMultiplets_test,
  markers = c("CD74", "ANXA3", "ACTG2")
)

Plot mean of multiple markers for the same cell type.

#use the data instead
plotUnsupervisedMarkers(
  CIMseqSinglets_test, CIMseqMultiplets_test, 
  markers = c("CD74", "HLA-DRA", "IL13RA2", "MAGEA4")
) %>%
  plotData() %>%
  gather(gene, value, -Sample, -(`Sample type`:Colour)) %>%
  group_by(Sample) %>%
  mutate(`Mean(markers)` = mean(value)) %>%
  ungroup() %>%
  select(`dim.red dim 1`, `dim.red dim 2`, `Mean(markers)`) %>%
  distinct() %>%
  ggplot() +
  geom_point(aes(`dim.red dim 1`, `dim.red dim 2`, colour = `Mean(markers)`)) +
  viridis::scale_colour_viridis(option = "E") +
  theme_few() +
  theme(legend.position = "top", legend.title.align = 0) +
  guides(colour = guide_colourbar(title.position = "top"))

Get the plotting data so you can make a custom plot.

plotUnsupervisedClass(CIMseqSinglets_test, CIMseqMultiplets_test) %>% 
  plotData() %>%
  head()

plotUnsupervisedMarkers(
  CIMseqSinglets_test, CIMseqMultiplets_test, 
  markers = c("CD74", "ANXA3", "ACTG2")
) %>% 
  plotData %>%
  head()

CIMseqSwarm

plotSwarmGraph(CIMseqSwarm_test, CIMseqSinglets_test, CIMseqMultiplets_test)
plotSwarmCircos(
  CIMseqSwarm_test, CIMseqSinglets_test, CIMseqMultiplets_test, alpha = 1
)

Custom plots

Get data to make a custom plot.

plotSwarmGraph(CIMseqSwarm_test, CIMseqSinglets_test, CIMseqMultiplets_test) %>%
 plotData()

Gene plots

#taking too long... why?
plotSwarmGenes(
  CIMseqSwarm_test, CIMseqSinglets_test, CIMseqMultiplets_test,
  c("CD74", "ANXA3", "ACTG2"), rownames(getData(CIMseqSwarm_test, "fractions"))
)


jasonserviss/CIMseq documentation built on Jan. 11, 2020, 4:42 a.m.