Created
May 29, 2018 15:08
-
-
Save lwaldron/9b4ed2499709eee8374d40af8b67da9f to your computer and use it in GitHub Desktop.
Import OVC single-cell data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "OVC single-cell analysis" | |
author: "Levi Waldron" | |
date: "5/29/2018" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` | |
# Data Import | |
```{r} | |
library(readr) | |
X150923_TPM_output <- read_delim("150923_TPM_output.txt", | |
"\t", escape_double = FALSE, trim_ws = TRUE) | |
X150923_TPM_output <- X150923_TPM_output[!is.na(X150923_TPM_output$Bulk_2), ] | |
``` | |
Make SingleCellExperiment | |
```{r} | |
library(SingleCellExperiment) | |
dat <- as.matrix(X150923_TPM_output[, -1:-2]) | |
rownames(dat) <- X150923_TPM_output[[1]] | |
sce <- SingleCellExperiment(assays=list(counts=dat), | |
colData=DataFrame(type=c("bulk", rep("singlecell", ncol(dat)-1))), | |
rowData=DataFrame(X150923_TPM_output[, 2])) | |
``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment