{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "84c8862c-7ddd-4ef1-b5fb-27bdd8c948f6", "metadata": { "collapsed": true, "jupyter": { "outputs_hidden": true }, "tags": [] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "------------------------------------------------------------------------------\n", "\n", "You have loaded plyr after dplyr - this is likely to cause problems.\n", "If you need functions from both plyr and dplyr, please load plyr first, then dplyr:\n", "library(plyr); library(dplyr)\n", "\n", "------------------------------------------------------------------------------\n", "\n", "\n", "Attaching package: ‘plyr’\n", "\n", "\n", "The following objects are masked from ‘package:dplyr’:\n", "\n", " arrange, count, desc, failwith, id, mutate, rename, summarise,\n", " summarize\n", "\n", "\n", "\n", "Attaching package: ‘purrr’\n", "\n", "\n", "The following object is masked from ‘package:plyr’:\n", "\n", " compact\n", "\n", "\n" ] } ], "source": [ "suppressPackageStartupMessages(library(readxl))\n", "suppressPackageStartupMessages(library(dplyr))\n", "suppressPackageStartupMessages(library(tidyr))\n", "suppressPackageStartupMessages(library(tibble))\n", "suppressPackageStartupMessages(library(ggplot2))\n", "suppressPackageStartupMessages(library(patchwork))\n", "suppressPackageStartupMessages(library(Seurat))\n", "suppressPackageStartupMessages(library(SeuratDisk))\n", "suppressPackageStartupMessages(library(stringr))\n", "library(hise)\n", "library(plyr)\n", "library(purrr)\n", "suppressPackageStartupMessages(library(H5weaver))\n", "library(parallel)" ] }, { "cell_type": "code", "execution_count": 2, "id": "414d81e9-23a1-4293-a12d-4557273eeb84", "metadata": { "collapsed": true, "jupyter": { "outputs_hidden": true }, "tags": [] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Loading required package: SeuratObject\n", "\n", "Loading required package: sp\n", "\n", "\n", "Attaching package: ‘SeuratObject’\n", "\n", "\n", "The following object is masked from ‘package:base’:\n", "\n", " intersect\n", "\n", "\n", "Loading required package: Seurat\n", "\n" ] } ], "source": [ "reference <- readRDS(\"/home//jupyter/pbmc_multimodal_2023.rds\")\n", "#add level 2.5 labels\n", "l3 <- as.character(reference[[]]$celltype.l3)\n", "l2 <- as.character(reference[[]]$celltype.l2)\n", "l2.5 <- l2\n", "l2.5[l3 == \"Treg Naive\"] <- \"Treg Naive\"\n", "l2.5[l3 == \"Treg Memory\"] <- \"Treg Memory\"\n", "l2.5[l3 %in% c(\"CD8 TEM_4\", \"CD8 TEM_5\")] <- \"CD8 TEMRA\"\n", "reference <- AddMetaData(reference, metadata = l2.5, col.name = \"celltype.l2.5\")" ] }, { "cell_type": "code", "execution_count": 9, "id": "541385ef-05b2-4092-8698-3a184f6f7cbd", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "\n", "