Skip to content

Commit

Permalink
SingleR --> celldex
Browse files Browse the repository at this point in the history
  • Loading branch information
lcolladotor committed Aug 13, 2021
1 parent f467e6e commit f2c7b0d
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 72 deletions.
60 changes: 30 additions & 30 deletions 02-postcards.R
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------------------------
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------
## # se descargó previamente, así que solo se carga
## library("here") # busca la raiz del proyecto en el que se encuentre


## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------------------------
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------
## here::here()


## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------------------------
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------
## getwd() # regresa la path en donde nos encontramos
## setwd("direccion/deseada") # nos lleva a la path indicada


## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------------------------
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------
## getwd() # para checar en donde nos encontramos
## here::here() # para checar dónde te encuentras
##
## # nos movemos al subdirectorio R
## setwd(here::here("R")) # podemos cambiar de directorio, aun así `here está en la raíz


## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------------------------
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------
## # como ejemplo: vamos a guardar datos en archivo y cargarlos
## a <- 1
## c <- 23
Expand All @@ -39,11 +39,11 @@
## list.files(here::here(), recursive = TRUE)


## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------------------------
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------
## usethis::use_r("notas-prueba.R") # no importando en qué path estemos


## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------------------------
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------
## # paquetes que vamos a requerir
## install.packages(c("gitcreds", "gert", "gh"))
## # cargarlos de manera separada
Expand All @@ -52,14 +52,14 @@
## library("gh")


## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------------------------
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------
## # Para iniciar conexión con GitHub
## usethis::create_github_token() # redirige a github donde eligiras nombre especifico del token
## # copia el token para después ingresarlo con gitcreds_set()
## gitcreds::gitcreds_set() # aquí colocas el token (NO tu contraseña de github!!!)


## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------------------------
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------
## # Configurar usuario de gitHub
## usethis::edit_git_config() # que abre el archivo .gitconfig
## # colocaremos nombre y correo de cuenta de github. SOLO borrar los # y respetar los demas espacios
Expand All @@ -68,19 +68,19 @@
## # email = correodeGithub


## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------------------------
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------
## # inicializar el repositorio de Git
## usethis::use_git() #
##
## # conectar tu repositorio local de Git con los servidores de GitHub
## usethis::use_github()


## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------------------------
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------
## gh::gh_whoami() # para checar cómo quedó la configuración


## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------------------------
## ---- eval=FALSE, warning=FALSE, message=FALSE--------------------------
## # escribimos un nuevo archivo, volvemos a usar here::here para especificar path
## writeLines("hola", here::here("R", "prueba-here.R"))
## # otra manera es usar use_r
Expand All @@ -99,96 +99,96 @@
## gert::git_push() # COMANDO IMPORTANTE


## ----postcards_proj, eval = FALSE---------------------------------------------------------
## ----postcards_proj, eval = FALSE---------------------------------------
## ## Creen el RStudio project. Es MUY importante que el usuario debe sea igual que en github
## usethis::create_project("Su_Usuario.github.io")


## ----echo=FALSE, fig.cap="git user", out.width = "40%"------------------------------------
## ----echo=FALSE, fig.cap="git user", out.width = "40%"------------------
knitr::include_graphics("img_postcard/proyecto_github_user.png")


## ----postcards_git, eval = FALSE----------------------------------------------------------
## ----postcards_git, eval = FALSE----------------------------------------
## ## Configura Git y GitHub
##
## # Con use_git() preguntará si desean hacer un commit, y después pedirá reiniciar Rstudio para que obtengan un nuevo botón llamado "git()"
## usethis::use_git()


## ----echo=FALSE, fig.cap="button_git", out.width = "40%"----------------------------------
## ----echo=FALSE, fig.cap="button_git", out.width = "40%"----------------
knitr::include_graphics("img_postcard/activa_boton_git.png")


## ----postcards_github, eval = FALSE-------------------------------------------------------
## ----postcards_github, eval = FALSE-------------------------------------
## usethis::use_github()


## ----postcards_create, eval = FALSE-------------------------------------------------------
## ----postcards_create, eval = FALSE-------------------------------------
## ## Solo uno de estos, de acuerdo al templado que más les gustó
## postcards::create_postcard(template = "jolla")
## postcards::create_postcard(template = "jolla-blue")
## postcards::create_postcard(template = "trestles")
## postcards::create_postcard(template = "onofre")


## ----postcards_git2, eval = FALSE---------------------------------------------------------
## ----postcards_git2, eval = FALSE---------------------------------------
## ## Configura Git y GitHub
##
## # Con use_git() preguntará si desean hacer un commit, y después pedirá reiniciar Rstudio para que obtengan un nuevo botón llamado "git()"
## usethis::use_git()


## ----echo=FALSE, fig.cap="button_git", out.width = "40%"----------------------------------
## ----echo=FALSE, fig.cap="button_git", out.width = "40%"----------------
knitr::include_graphics("img_postcard/activa_boton_git.png")


## ----echo=FALSE, fig.cap="button_branch", out.width = "40%"-------------------------------
## ----echo=FALSE, fig.cap="button_branch", out.width = "40%"-------------
knitr::include_graphics("img_postcard/branch.png")


## ----echo=FALSE, fig.cap="add_file", out.width = "40%"------------------------------------
## ----echo=FALSE, fig.cap="add_file", out.width = "40%"------------------
knitr::include_graphics("img_postcard/add_stag.png")


## ----echo=FALSE, fig.cap="button_git", out.width = "80%"----------------------------------
## ----echo=FALSE, fig.cap="button_git", out.width = "80%"----------------
knitr::include_graphics("img_postcard/commit_message.png")


## ----postcards_pull, eval = FALSE---------------------------------------------------------
## ----postcards_pull, eval = FALSE---------------------------------------
## ## Guardamos los archivos nuevos con el commit
## gert::git_commit_all("mensaje sobre el commit")
##
## ## Subimos los archivos a github
## gert::git_push()


## ----fawesome_yaml, eval = FALSE----------------------------------------------------------
## ----fawesome_yaml, eval = FALSE----------------------------------------
##
##
## # Utlilizando `r fontawesome::fa("font-awesome-logo-full", fill = "forestgreen")` en código YAML
##


## ----echo=FALSE, fig.cap="y_fawesome", out.width = "40%"----------------------------------
## ----echo=FALSE, fig.cap="y_fawesome", out.width = "40%"----------------
knitr::include_graphics("img_postcard/yaml_awesome.png")


## ----echo=FALSE, fig.cap="fawesome", out.width = "40%"------------------------------------
## ----echo=FALSE, fig.cap="fawesome", out.width = "40%"------------------
knitr::include_graphics("img_postcard/awesome.png")


## ----fawesome_text, eval = FALSE----------------------------------------------------------
## ----fawesome_text, eval = FALSE----------------------------------------
##
##
## # Utlilizando `r fontawesome::fa("font-awesome-logo-full", fill = "forestgreen")` en el texto
##


## ----echo=FALSE, fig.cap="tfawesome", out.width = "40%"-----------------------------------
## ----echo=FALSE, fig.cap="tfawesome", out.width = "40%"-----------------
knitr::include_graphics("img_postcard/text_awesome.png")


## -----------------------------------------------------------------------------------------
## -----------------------------------------------------------------------
## Información de la sesión de R
Sys.time()
proc.time()
Expand Down
24 changes: 12 additions & 12 deletions 04-estructura_datos.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## ---- warning=FALSE, message=FALSE------------------------------------------------------------------
## ---- warning=FALSE, message=FALSE--------------------------------------
library("scRNAseq")
sce.416b <- LunSpikeInData(which = "416b")

Expand Down Expand Up @@ -233,7 +233,7 @@ sizeFactors(sce) <- scater::librarySizeFactors(sce)
head(sizeFactors(sce))


## ---------------------------------------------------------------------------------------------------
## -----------------------------------------------------------------------
# Creamos un data.frame
df <- data.frame(x = c(TRUE, FALSE, NA, NA), y = c(12, 34, 56, 78))
row.names(df) <- letters[1:4]
Expand Down Expand Up @@ -266,7 +266,7 @@ bool_info <- df$y < 20 | df$y > 60
df[bool_info, ]


## ---------------------------------------------------------------------------------------------------
## -----------------------------------------------------------------------
library("SingleCellExperiment")
library("scRNAseq")

Expand All @@ -282,17 +282,17 @@ col.data <- DataFrame(read.csv(archivo_colData, row.names = 1, header = TRUE, ch
row.data <- read.csv(archivo_rowData, row.names = 1, header = TRUE, check.names = F)


## ---------------------------------------------------------------------------------------------------
## -----------------------------------------------------------------------
int_gen <- c("Angpt1", "Chic2", "Mir503", "Magee2", "Nenf", "Eps15l1", "Hsf2bp", "Gnptg", "Vegfb", "Atmin", "Gad1", "Gad2", "Slc32a1", "Dner", "Slc2a13", "Slc6a1", "Nrxn3")


## ---- eval= FALSE-----------------------------------------------------------------------------------
## ---- eval= FALSE-------------------------------------------------------
## library("scater")
##
## plotHeatmap(object = tej_min_sce, features = rownames(tej_min_sce), order_columns_by = "level1class")


## ---------------------------------------------------------------------------------------------------
## -----------------------------------------------------------------------
sce <- SingleCellExperiment(
assays = list(counts = counts),
colData = col.data,
Expand All @@ -304,30 +304,30 @@ sce <- scater::logNormCounts(sce)
sce


## ---------------------------------------------------------------------------------------------------
## -----------------------------------------------------------------------
bool_data <- rownames(rowData(sce))
min_sce <- sce[bool_data %in% int_gen, ]


## ---------------------------------------------------------------------------------------------------
## -----------------------------------------------------------------------
tej_int <- min_sce$level1class == "interneurons"
tej_pyr <- min_sce$level1class == "pyramidal CA1"


tej_min_sce <- min_sce[, tej_int | tej_pyr]


## ---------------------------------------------------------------------------------------------------
## -----------------------------------------------------------------------
library("scater")

plotHeatmap(object = tej_min_sce, features = rownames(tej_min_sce), order_columns_by = "level1class")


## ---------------------------------------------------------------------------------------------------
## -----------------------------------------------------------------------
int_gen <- c("ENSMUSG00000071076", "ENSMUSG00000002076", "ENSMUSG00000024962", "ENSMUSG00000031224", "ENSMSG00000036560", "ENSMUSG00000037499", "ENSMUSG00000006276", "ENSMUSG00000035521", "ENSMUSG00000047388", "ENSMUSG0000051079", "ENSMUSG00000076122", "ENSMUSG00000029229", "ENSMUSG00000022309", "ENSMUSG00000036766", "ENSMUSG00000070880", "ENSMUSG00000026787", "ENSMUSG00000066392", "ENSMUSG00000036298", "ENSMUSG00000037771", "ENSMUSG00000030310")


## ---------------------------------------------------------------------------------------------------
## -----------------------------------------------------------------------
# Descarga datos de ejemplo procesados con CellRanger
# Paréntesis: al usar BiocFileCache solo tenemos que descargar
# los datos una vez.
Expand Down Expand Up @@ -466,7 +466,7 @@ lun.sce
lobstr::obj_size(lun.sce) / 1024^2 ## En MB


## ---------------------------------------------------------------------------------------------------
## -----------------------------------------------------------------------
## Información de la sesión de R
Sys.time()
proc.time()
Expand Down
Loading

0 comments on commit f2c7b0d

Please sign in to comment.