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
# Here is the workflow in a nutshell: | |
# | |
# 1) Annotate cells in your favorite single cell framework or system | |
# 2) Perform your favorite dimensionality reduction into 3D. | |
# 3) Export annotation and 3D coordinates to .csv. | |
# 4) I imported these data into Blender and created the objects using the below ‘retina_3d_umap_blender.py’ script. Some of it is automated, some of it is hard-coded and project specific. | |
# - For each age (since cells here are colored by developmental age) I create a new mesh and add each datapoint for a given age to the mesh as a vertex. | |
# 5) I then created a single ’sample object’ for each mesh consisting of a UV sphere primitive. Added a material to that to match the color scheme I had selected. These were the ’templates’ to be used and applied to each vertex in the mesh using a particle system | |
# 6) Next created a particle system for each age with the params indicated in the python script. | |
# 7) Finally I created an empty parent object to group all of the particles so I could track wi |
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
import bpy | |
import bmesh | |
import random | |
import csv | |
# Set render engine to cycles | |
bpy.context.scene.render.engine = 'CYCLES' | |
#Read in retina UMAP data | |
filename = "retina_pdata.csv" |
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
#!/usr/bin/etc python | |
from numpy.random import choice | |
from itertools import count,chain | |
from copy import deepcopy | |
import sys | |
############### | |
# Globals | |
############### | |
possible_states = ["progenitor","differentiated"] |
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
library(ggplot2) | |
library(grid) | |
############# | |
#Utility Functions | |
############# | |
# multiplot <- function(..., plotlist=NULL, cols) { | |
# require(grid) | |
# |
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
library(cummeRbund) | |
library(limma) | |
library(GSA) | |
cuff<-readCufflinks() | |
Input_df<-data.frame("gene_id"=rownames(dat),"gene_short_name"=rownames(dat)) | |
Input_df<-cbind(Input_df,fpkmMatrix(genes(cuff))) | |
Input_df$gene_short_name<-toupper(Input_df$gene_short_name) |
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
require(ggplot2) | |
require(grid) | |
require(scales) | |
ternary <- function(t, l, r, clr = clr, pts = pts, labels = c("top", "left", "right"), showGrid = TRUE){ | |
library(ggplot2) | |
ddf <- data.frame(t, l, r) | |
# convert points to cartesian coordinates |