Skip to content

Instantly share code, notes, and snippets.

View slowkow's full-sized avatar
🐄
moooooo

Kamil Slowikowski slowkow

🐄
moooooo
View GitHub Profile
@slowkow
slowkow / income.svg
Last active October 15, 2020 13:46
Trends in Income From 1975 to 2018 by Carter C. Price, Kathryn A. Edwards
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@slowkow
slowkow / writeMMgz.R
Created March 16, 2020 21:08
Write a gzip compressed Matrix Market file in R.
#' @param x A sparse matrix from the Matrix package.
#' @param file A filename that ends in ".gz".
writeMMgz <- function(x, file) {
mtype <- "real"
if (is(x, "ngCMatrix")) {
mtype <- "integer"
}
writeLines(
c(
sprintf("%%%%MatrixMarket matrix coordinate %s general", mtype),
@slowkow
slowkow / needleman-wunsch.py
Last active April 29, 2024 06:05
A simple version of the Needleman-Wunsch algorithm in Python.
#!/usr/bin/env python
"""
The Needleman-Wunsch Algorithm
==============================
This is a dynamic programming algorithm for finding the optimal alignment of
two strings.
Example
-------
@slowkow
slowkow / read_cellranger.R
Last active March 20, 2023 11:17
Read Cell Ranger HDF5 .h5 files in R
# install.packages(c("Matrix", "rhdf5", "tidyverse"))
library(Matrix)
library(rhdf5)
library(tidyverse)
library(glue)
my_h5_files <- Sys.glob(
"path/to/cellranger-per-channel/output/*/filtered_feature_bc_matrix.h5"
)
@slowkow
slowkow / install-units.md
Last active December 17, 2021 12:45
Install the 'units' R package on Partners

Summary

I had a difficult time installing the units R package on the Partners ERIS servers.

I hope this post helps you to figure out how to work around the errors.

Instructions

@slowkow
slowkow / pubmed-publications.html
Created May 3, 2019 01:22
Get an HTML list of PubMed publications
<!DOCTYPE html>
<body>
<!-- Copied directly from http://www.ephys.org/ by Damian J Williams -->
<input placeholder="Kamil Slowikowski" name="name"/>
<p id="demo"></p>
<script>
@slowkow
slowkow / README.md
Last active May 10, 2021 22:47
Generate a DESCRIPTION file with all of your installed packages

Problem

We need to install a lot of R packages each time we upgrade to a new version of R.

Solution

  1. Before installing the new R, run Rscript make_description.R to write a list of all installed packages.
  2. Install the new version of R.
  3. Use devtools to reinstall the packages.
@slowkow
slowkow / out.pdf
Last active February 5, 2019 02:36
Make a PCA plot in Bash with the OpenCPU API
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@slowkow
slowkow / contentScript.js
Created January 10, 2019 15:43
Chrome extension to automatically click the "Send SMS" button on okta.com
/*
* The purpose of this script is to automatically click the "Send SMS"
* button as soon as the page is loaded, instead of clicking on it manually.
*
* This is the page with the button:
*
* https://partnershealthcare.okta.com/signin/verify/okta/sms
*
*/
@slowkow
slowkow / rsg2018.json
Last active December 12, 2018 02:45
RSGDREAM2018 poster abstracts in JSON format
[
{
"id": "1",
"title": "Methods for Identifying Tumor Heterogeneity and Rare Subclones in Single Cell DNA Sequence Data",
"text": "Background With the advancements of single cell sequencing technologies it is now possible to interrogate thousands of cells in a single experiment. Single-cell RNA-Seq has been available for several years but high-throughput single-cell DNA analysis is in its infancy. Therefore, it is essential to develop new capabilities for assessing genetic variation present in rare cells and to better understand the role that these cells play in the evolution of tumor progression. To address these challenges and enable the characterization of genetic diversity in cancer cell populations, we developed a novel approach to identify mutation signatures which define subclones present in a tumor population. Methods Here we present a two-step clustering and subclone identification method using data generated on the Tapestri single-cell DNA platform which can generate upto 10000 cells