Skip to content

Instantly share code, notes, and snippets.

@lwaldron
Created May 29, 2018 15:08
Show Gist options
  • Save lwaldron/9b4ed2499709eee8374d40af8b67da9f to your computer and use it in GitHub Desktop.
Save lwaldron/9b4ed2499709eee8374d40af8b67da9f to your computer and use it in GitHub Desktop.
Import OVC single-cell data
---
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