Skip to content

Instantly share code, notes, and snippets.

View k3yavi's full-sized avatar
:octocat:
Single Cell Biology

Avi Srivastava k3yavi

:octocat:
Single Cell Biology
View GitHub Profile
# get the data as per https://www.cedricscherer.com/2019/05/17/the-evolution-of-a-ggplot-ep.-1/#code
library(tidyverse)
devtools::source_gist("https://gist.github.com/Z3tt/301bb0c7e3565111770121af2bd60c11")
# convert to data.frame, attach and sort region
df <- as.data.frame(df_ratios)
attach(df)
# get rid of NAs
df <- df[ ! is.na(student_ratio),]
@z3tt
z3tt / github.R
Last active June 5, 2024 12:40
Configure GitHub for Rstudio
#### 1. Sign up at GitHub.com ################################################
## If you do not have a GitHub account, sign up here:
## https://github.com/join
# ----------------------------------------------------------------------------
#### 2. Install git ##########################################################
## If you do not have git installed, please do so:
@mikelove
mikelove / alevin_boot_importer.R
Last active February 19, 2019 14:13
alevin bootstrap importer
boot.cell.names <- read.table("quants_boot_rows.txt", strings=FALSE)[,1]
gene.names <- read.table("quants_mat_cols.txt", strings=FALSE)[,1]
cell.names <- read.table("quants_mat_rows.txt", strings=FALSE)[,1]
library(jsonlite)
jsonPath <- file.path("../cmd_info.json")
cmd_info <- jsonlite::fromJSON(jsonPath)
num.cells <- length(cell.names)
num.genes <- length(gene.names)
@NoraCodes
NoraCodes / work_queue.rs
Last active February 21, 2024 15:27
An example of a parallel work scheduling system using only the Rust standard library
// Here is an extremely simple version of work scheduling for multiple
// processors.
//
// The Problem:
// We have a lot of numbers that need to be math'ed. Doing this on one
// CPU core is slow. We have 4 CPU cores. We would thus like to use those
// cores to do math, because it will be a little less slow (ideally
// 4 times faster actually).
//
// The Solution:
@Michael0x2a
Michael0x2a / minimal-template.tex
Last active March 14, 2024 06:32
Minimal LaTeX template
\documentclass{article}
% General document formatting
\usepackage[margin=0.7in]{geometry}
\usepackage[parfill]{parskip}
\usepackage[utf8]{inputenc}
% Related to math
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\begin{document}
import sys
##########################################################
#requires snakemake, python3, pyfasta to be installed
#save this file and provide all the binaries and their path
#in variables below.
#to run flux pipeline:
#snakemake run_flux_pipeline
#to run rsem pipeline:
#snakemake run_rsem_pipeline
@davfre
davfre / bamfilter_oneliners.md
Last active February 24, 2024 01:23
SAM and BAM filtering oneliners
@slowkow
slowkow / GTF.py
Last active March 6, 2024 02:05
GTF.py is a simple module for reading GTF and GFF files
#!/usr/bin/env python
"""
GTF.py
Kamil Slowikowski
December 24, 2013
Read GFF/GTF files. Works with gzip compressed files and pandas.
http://useast.ensembl.org/info/website/upload/gff.html