In [1]:
library(Seurat)
library(dplyr)
library(Matrix)
library(cowplot)
library(monocle)
library(cellrangerRkit)
library(reshape)
library(tidyverse)


Loading required package: ggplot2
Loading required package: cowplot

Attaching package: ‘cowplot’

The following object is masked from ‘package:ggplot2’:

    ggsave

Loading required package: Matrix
Warning message:
“replacing previous import ‘colorspace::plot’ by ‘graphics::plot’ when loading ‘NMF’”Warning message:
“replacing previous import ‘dendextend::cutree’ by ‘stats::cutree’ when loading ‘NMF’”
Attaching package: ‘dplyr’

The following object is masked from ‘package:Biobase’:

    combine

The following objects are masked from ‘package:BiocGenerics’:

    combine, intersect, setdiff, union

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

Loading required package: VGAM
Loading required package: stats4
Loading required package: splines
Loading required package: DDRTree
Loading required package: irlba
Loading required package: RColorBrewer
Loading required package: bit64
Loading required package: bit
Attaching package bit
package:bit (c) 2008-2012 Jens Oehlschlaegel (GPL-2)
creators: bit bitwhich
coercion: as.logical as.integer as.bit as.bitwhich which
operator: ! & | xor != ==
querying: print length any all min max range sum summary
bit access: length<- [ [<- [[ [[<-
for more help type ?bit

Attaching package: ‘bit’

The following object is masked from ‘package:base’:

    xor

Attaching package bit64
package:bit64 (c) 2011-2012 Jens Oehlschlaegel
creators: integer64 seq :
coercion: as.integer64 as.vector as.logical as.integer as.double as.character as.bin
logical operator: ! & | xor != == < <= >= >
arithmetic operator: + - * / %/% %% ^
math: sign abs sqrt log log2 log10
math: floor ceiling trunc round
querying: is.integer64 is.vector [is.atomic} [length] format print str
values: is.na is.nan is.finite is.infinite
aggregation: any all min max range sum prod
cumulation: diff cummin cummax cumsum cumprod
access: length<- [ [<- [[ [[<-
combine: c rep cbind rbind as.data.frame
WARNING don't use as subscripts
WARNING semantics differ from integer
for more help type ?bit64

Attaching package: ‘bit64’

The following object is masked from ‘package:bit’:

    still.identical

The following object is masked from ‘package:Biobase’:

    cache

The following objects are masked from ‘package:BiocGenerics’:

    match, order, rank

The following objects are masked from ‘package:base’:

    :, %in%, is.double, match, order, rank

Loading required package: Rmisc
Loading required package: lattice
Loading required package: plyr
------------------------------------------------------------------------------
You have loaded plyr after dplyr - this is likely to cause problems.
If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
library(plyr); library(dplyr)
------------------------------------------------------------------------------

Attaching package: ‘plyr’

The following objects are masked from ‘package:dplyr’:

    arrange, count, desc, failwith, id, mutate, rename, summarise,
    summarize


Attaching package: ‘cellrangerRkit’

The following object is masked from ‘package:Seurat’:

    run_tsne


Attaching package: ‘reshape’

The following objects are masked from ‘package:plyr’:

    rename, round_any

The following object is masked from ‘package:dplyr’:

    rename

The following object is masked from ‘package:Matrix’:

    expand

Loading tidyverse: tibble
Loading tidyverse: tidyr
Loading tidyverse: readr
Loading tidyverse: purrr
Conflicts with tidy packages ---------------------------------------------------
arrange():   dplyr, plyr
combine():   dplyr, Biobase, BiocGenerics
compact():   purrr, plyr
count():     dplyr, plyr
expand():    tidyr, reshape, Matrix
failwith():  dplyr, plyr
fill():      tidyr, VGAM
filter():    dplyr, stats
ggsave():    ggplot2, cowplot
id():        dplyr, plyr
lag():       dplyr, stats
mutate():    dplyr, plyr
Position():  ggplot2, BiocGenerics, base
rename():    dplyr, reshape, plyr
summarise(): dplyr, plyr
summarize(): dplyr, plyr

In [2]:
p73ko.data <- as.matrix(read.csv("./sf.csv", header=TRUE, row.names=1))
wt.data <- as.matrix(read.csv("./eq.csv", header=TRUE, row.names=1))


# cells, we do no additional filtering here
colnames(p73ko.data) = paste0("sf", colnames(p73ko.data) )
colnames(wt.data) = paste0("eq", colnames(wt.data) )

In [3]:
p73ko.data[is.na(p73ko.data)] <- 0
wt.data[is.na(wt.data)] <- 0

In [4]:
p73ko <- CreateSeuratObject(raw.data = p73ko.data)
wt <- CreateSeuratObject(raw.data = wt.data)

In [5]:
p73ko <- NormalizeData(object = p73ko)
wt <- NormalizeData(object = wt)

In [6]:
p73ko <- ScaleData(object = p73ko)
wt <- ScaleData(object = wt)


[1] "Scaling data matrix"
  |======================================================================| 100%
[1] "Scaling data matrix"
  |======================================================================| 100%

In [7]:
p73ko <- FindVariableGenes(object = p73ko, do.plot = FALSE)
wt <- FindVariableGenes(object = wt, do.plot = FALSE)

In [ ]:


In [31]:
length(x = p73ko@var.genes)
length(x = wt@var.genes)


1264
1880

In [40]:
pbmc <- numeric(0)
pbmc <- RunPCA(object = p73ko, pc.genes = p73ko@var.genes, do.print = FALSE)
pbmc <- FindClusters(object = pbmc, reduction.type = "pca", dims.use = 1:10, 
                     resolution = 0.6, print.output = 0, save.SNN = TRUE)
pbmc <- RunTSNE(object = pbmc, dims.use = 1:10, do.fast = TRUE)
TSNEPlot(object = pbmc)



In [33]:
pbmc <- numeric(0)
pbmc <- RunPCA(object = wt, pc.genes = wt@var.genes, do.print = FALSE)
pbmc <- FindClusters(object = pbmc, reduction.type = "pca", dims.use = 1:10, 
                     resolution = 0.6, print.output = 0, save.SNN = TRUE)
pbmc <- RunTSNE(object = pbmc, dims.use = 1:10, do.fast = TRUE)
TSNEPlot(object = pbmc)



In [24]:


In [ ]:


In [ ]:


In [ ]:


In [ ]: