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
@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
@davfre
davfre / bamfilter_oneliners.md
Last active August 4, 2024 03:10
SAM and BAM filtering oneliners
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
@Michael0x2a
Michael0x2a / minimal-template.tex
Last active July 5, 2024 14:42
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}
@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:
@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)
@z3tt
z3tt / github.R
Last active November 6, 2024 02:59
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:
# 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),]