Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Strand Lab
sc-TissueMapper
Commits
46c8acdb
Commit
46c8acdb
authored
Jan 12, 2019
by
Gervaise Henry
🤠
Browse files
Remove more as.matrix to prevent memory errors
parent
d5bfc948
Changes
1
Hide whitespace changes
Inline
Side-by-side
r.scripts/sc-TissueMapper_functions.R
View file @
46c8acdb
...
...
@@ -142,8 +142,8 @@ scQC <- function(sc10x,lg=500,hg=2500,hm=0.1,sub=FALSE){
plot2
<-
ggplot
(
data.frame
(
cbind
(
sc10x
$
nCount_RNA
,
sc10x
$
percent.mito
)))
+
geom_point
(
aes
(
x
=
X1
,
y
=
X2
,
color
=
density2
),
size
=
0.1
)
+
scale_color_viridis
(
option
=
"inferno"
)
+
geom_hline
(
yintercept
=
hm
,
size
=
1
,
color
=
"red"
)
+
labs
(
x
=
"nUMI"
,
y
=
"Percent Mitochondrial"
,
color
=
"Count"
)
+
cowplot
::
theme_cowplot
()
grid.arrange
(
plot1
,
plot2
,
nrow
=
1
)
dev.off
()
counts.cell.raw
<-
ncol
(
as.matrix
(
GetAssayData
(
object
=
sc10x
,
slot
=
"counts"
))
)
counts.gene.raw
<-
nrow
(
as.matrix
(
GetAssayData
(
object
=
sc10x
,
slot
=
"counts"
))
)
counts.cell.raw
<-
ncol
(
GetAssayData
(
object
=
sc10x
,
slot
=
"counts"
))
counts.gene.raw
<-
nrow
(
GetAssayData
(
object
=
sc10x
,
slot
=
"counts"
))
#Filter/normalize data
sc10x.sub
<-
subset
(
x
=
sc10x
,
subset
=
nFeature_RNA
>
lg
)
...
...
@@ -168,8 +168,8 @@ scQC <- function(sc10x,lg=500,hg=2500,hm=0.1,sub=FALSE){
plot2
<-
ggplot
(
data.frame
(
cbind
(
sc10x.sub
$
nCount_RNA
,
sc10x.sub
$
percent.mito
)))
+
geom_point
(
aes
(
x
=
X1
,
y
=
X2
,
color
=
density2
),
size
=
0.1
)
+
scale_color_viridis
(
option
=
"inferno"
)
+
labs
(
x
=
"nUMI"
,
y
=
"Percent Mitochondrial"
,
color
=
"Count"
)
+
cowplot
::
theme_cowplot
()
grid.arrange
(
plot1
,
plot2
,
nrow
=
1
)
dev.off
()
counts.cell.filtered
<-
ncol
(
as.matrix
(
GetAssayData
(
object
=
sc10x.sub
,
slot
=
"counts"
))
)
counts.gene.filtered
<-
nrow
(
as.mat
rix
(
GetAssayData
(
object
=
sc10x.sub
,
slot
=
"counts"
))
)
counts.cell.filtered
<-
ncol
(
GetAssayData
(
object
=
sc10x.sub
,
slot
=
"counts"
))
counts.gene.filtered
<-
nrow
(
rix
(
GetAssayData
(
object
=
sc10x.sub
,
slot
=
"counts"
))
results
<-
list
(
sc10x
=
sc10x.sub
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment