This file contains 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 scanpy as sc | |
import pandas as pd | |
data = pd.read_csv('path_to_file.csv') | |
feature_annotations = pd.read_csv('path_to_annotations.csv') | |
# Make sure samples are rows and features are columns. if not data = data.T | |
adata = sc.AnnData(data, obs=sample_names, var=feature_annotations) | |
sc.pp.pca(adata, n_comps=10) |
This file contains 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 os | |
import numpy as np | |
import scipy as sp | |
import pandas as pd | |
import scanpy as sc | |
import scprocessing.pipeline as scpipe | |
import scprocessing.preprocessing as scpp | |
import scprocessing.preprocessing.Svensson2019 as Svensson2019 | |
import scprocessing.plotting.anndata as scpl | |
import dewakss.decomposition as dede |
This file contains 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 scanpy.api as _sc | |
import scanpy.plotting as _scp | |
import seaborn as _sns | |
import numpy as _np | |
import matplotlib.pyplot as plt | |
def clustered_heatmap(data, var_names=None, groupby=None, figsize=(12, 6), cluster=True, use_raw=None, log=False, num_categories=7, cbar=False, vmin=None, vmax=None, **kwds): | |
from anndata import AnnData |
This file contains 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(tm) | |
library(wordcloud) | |
library(memoise) | |
text_file <- 'SBW2015_book.txt' | |
# Using "memoise" to automatically cache the results | |
text <- readLines(sprintf("./%s", text_file), encoding="UTF-8") | |
text <- stemDocument(text) # doesn't seem to do anything |
This file contains 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
(defun change-theme-on-time () | |
(destructuring-bind (sec min h m year junk junk junk junk) (decode-time (current-time))) | |
(if (or (> (string-to-number (format-time-string "%H" (current-time))) 18) | |
(< (string-to-number (format-time-string "%H" (current-time))) 9)) | |
(unless custom-enabled-themes (load-theme 'my-theme t)) (disable-theme custom-enabled-themes))) | |
(add-hook 'before-make-frame-hook 'change-theme-on-time) |