Skip to content

Instantly share code, notes, and snippets.

View FloWuenne's full-sized avatar
💻

Florian Wuennemann FloWuenne

💻
View GitHub Profile
@FloWuenne
FloWuenne / Run_clustering_module_Rds.R
Last active April 27, 2018 13:53
Run certain gists in R from GithubGist
library(devtools)
#### Specific datasets
## Specific time point Rds
source_gist("https://gist.github.com/FloWuenne/df2dca6804f562ed90db26a04508af31", filename = "Create_clustering_module_Rds.R")
## Specific time point .Rdata
source_gist("https://gist.github.com/FloWuenne/dfd1e00c198b2ae1adeb16720a844441",, filename = "Create_clustering_module_Rds.R")
#### All datasets
@FloWuenne
FloWuenne / Clustering_module_shiny_ALL_Rds.R
Last active April 20, 2018 19:17
Create clustering module for shiny server for all timepoints
library(dplyr)
library(tidyr)
## Define S4 object with required components
Clustering_info <- setClass("clustering_module",slots=c(tsne="data.frame",
metadata="data.frame",
norm_exprs="data.frame",
marker_list="data.frame"))
@FloWuenne
FloWuenne / gist:4a4c1532011186e1c5aae3150556b5c6
Created April 18, 2018 15:03
Make a nice ClusterTree from the initial ClusterTree plot from Seurat
## Build the ClusterTree from Seurat object
expression_seurat <- BuildClusterTree(expression_seurat,
do.plot=TRUE)
## Plot custom phylogenetic tree that is more easily interpretable
png(filename="./with_Batch_Cycle_Correction/ClusterTree.png", width=1800, height=1700, bg = "white", res = 150)
plot(ladderize([email protected][[1]]), adj=0,
label.offset=50,
edge.width=1)
nodelabels(frame="circle",bg="grey")
@FloWuenne
FloWuenne / gist:b2c31b18f60fbe1ffa20ca72e3006f5b
Created April 20, 2018 17:51
Takes as input an Rds file for clustering module (.Rmd code)
---
title: "Transform_to_feather"
author: "Florian Wuennemann"
date: "April 20, 2018"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
@FloWuenne
FloWuenne / extract_shiny_data_Full_dataset.R
Last active April 26, 2018 14:31
Create an Rds file for the full heart maturation dataset
library(dplyr)
library(tidyr)
## Define S4 object with required components
Clustering_info <- setClass("clustering_module",slots=c(tsne="data.frame",
metadata="data.frame",
norm_exprs="data.frame",
marker_list="data.frame"))
@FloWuenne
FloWuenne / cluster_module_shiny_ALL_renamed.R
Last active April 26, 2018 14:12
Create shiny cluster modules for renamed datasets
library(dplyr)
library(tidyr)
## Define S4 object with required components
Clustering_info <- setClass("clustering_module",slots=c(tsne="data.frame",
metadata="data.frame",
norm_exprs="data.frame",
marker_list="data.frame"))
@FloWuenne
FloWuenne / extract_shiny_clustering_renamed_full.R
Last active May 2, 2018 20:28
Extract shiny clustering data for full dataset
library(dplyr)
library(tidyr)
## Define S4 object with required components
Clustering_info <- setClass("clustering_module",slots=c(tsne="data.frame",
metadata="data.frame",
norm_exprs="data.frame",
marker_list="data.frame"))
@FloWuenne
FloWuenne / gist:aec5aa1f6fcf3bf1721b4794247098ec
Created May 1, 2018 15:04
Save raw UMI counts and metadata for each object
## Create vector with timepoints
time_points <- c("E14.5","E16.5","E18.5","P1","P4","P7")
for(time in time_points){
rds_object <- readRDS(paste("/home/wueflo00/project/Dropseq/Andelfingerlab_Dropseq/Heart_Maturation/Analysis/Objects/",time,".expression_seurat.renamed_clusters.Rds",sep=""))
raw_umi <- as.matrix([email protected])
metadata <- [email protected]
raw_umi <- raw_umi[,rownames(metadata)]
@FloWuenne
FloWuenne / gist:098afe3bff11ed588cc6496bcf4312ac
Created June 14, 2018 20:15
Check correlation between number of genic reads and genes and transcripts detected per cell
## Read in summary file from Drop-seq pipe
infile =
DGE_info <- read.table(infile,
sep="\t",
header=T)
## Correlation Number of genic reads vs num of genes detected per cell
ggplot(DGE_info,aes(NUM_GENIC_READS,NUM_GENES,col=NUM_TRANSCRIPTS)) +
geom_point()
@FloWuenne
FloWuenne / gist:ff003a56a50d34acedaaa6512b6cb960
Last active July 20, 2018 15:35
Analyze and fix .gtf file for Drop-seq pipeline to remove warnings and skipping for genes with issues
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Load libraries
```{r}
library(refGenome)
library(dplyr)