setwd("~/Github/entrain/other_method_comparisons/Fig4A_osteobs_nichenet_cellcall")
obj_total <- readRDS("../../R/ryan_19k_labelled.rds")
Idents(obj_total) <- "celltype"
celltypes_keep <- c("SMCs", "Endothelial Cells",
"Osteoblasts", "Chondrocytes" )
obj <- subset(x = obj_total, idents = celltypes_keep)
celltype_label<-obj@meta.data$celltype
celltype_label<-gsub("[()-]", "", celltype_label)
celltype_label <- paste(rownames(obj@meta.data),celltype_label, sep="_")
dat<-GetAssayData(obj) %>% as.matrix() %>% as.data.frame()
library('plyr')
dat<-GetAssayData(obj) %>% as.matrix() %>% as.data.frame()
library("dplyr")
dat<-GetAssayData(obj) %>% as.matrix() %>% as.data.frame()
colnames(dat) <- celltype_label
colnames(dat) %>% head()
rownames(obj@meta.data)  %>% head()
colnames(dat)
setwd("/private/var/folders/0c/92tw7w8n7vgdq9rjl6tw97lh0000gn/T/fz3temp-4")
download.file("https://zenodo.org/record/7196702/files/Manno_E10_E11_subsampled.h5ad", h5ad_path)
h5ad_path = "Manno_E10_E11_subsampled.h5ad"
download.file("https://zenodo.org/record/7196702/files/Manno_E10_E11_subsampled.h5ad", h5ad_path)
tempfile()
R.home()
R.home()
R.home
R.home()
R.home()
library("monocle3")
library("reticulate")
repl_py
repl_python()
library("reticulate")
reticulate::use_condaenv("scverse-arm64")
repl_python()
reticulate::use_condaenv("scverse-x86")
repl_python()
library("reticulate")
reticulate::use_condaenv("scverse-x86")
repl_python()
reticulate::source_python("/Users/wk/Dropbox (Garvan)/WunnasDropbox/HPC files/spatial_entrain/entrain_spatial.py")
library("reticulate")
reticulate::use_condaenv("scverse-x86")
repl_python()
R.home()
R.home()
R.home()
library("MatrixExtra")
install.packages("float")
setwd("/Users/wk/Dropbox (Garvan)/WunnasDropbox/Misc/Rama/RamaSanity/MBC/MBC_3")
df=read.csv("log_transcription_quotients.txt", sep="\t")
View(df)
df=read.csv("log_transcription_quotients.txt", sep="\t", row.names=0)
df=read.csv("log_transcription_quotients.txt", sep="\t", row.names=1)
View(df)
library("Seurat")
CreateSeuratObject(df)
df2=read.csv("log_transcription_quotients.txt", sep="\t")
library("Seurat")
View(df2)
View(df)
df <- data.frame(a = c(1, 2, 3),
b = c(4, 5, 6),
c = c(7, 8, 9))
# Set row names with pipe symbol
row.names(df) <- c("Name1|Info", "Name2|Info", "Name3|Info")
View(df)
View(df2)
df<-df2
row.names(df)<-df2$GeneID
View(df2)
row.names(df2)<-df2$GeneID
View(df2)
gsub("^.*\\|", "", row.names(df2))
# Remove all characters before and including the "|" symbol
row.names(df2) <- gsub("^.*\\|", "", row.names(df2))
setwd("~/Github/entrain_draft/python_package/pypi/docs")
library("rmarkdown")
convert_ipynb("entrain_spatial_velocity.ipynb", output = xfun::with_ext(input, "Rmd"))
convert_ipynb(input = "entrain_spatial_velocity.ipynb", output = xfun::with_ext(input, "Rmd"))
setwd("~/Github/entrain_draft/python_package/pypi/docs")
convert_ipynb(input = "entrain_spatial_velocity.ipynb")
convert_ipynb(input = "entrain_spatial_velocity_output.ipynb")
