Skip to content

Instantly share code, notes, and snippets.

View mfansler's full-sized avatar
⚙️

Mervin Fansler mfansler

⚙️
View GitHub Profile
@mfansler
mfansler / pval.go
Created January 1, 2021 21:58
Student-t test for correlation
package main
import (
"fmt"
"math"
"gonum.org/v1/gonum/stat/distuv"
)
@mfansler
mfansler / so-ipopt.yaml
Created December 9, 2020 18:13
Conda environment for Pyomo with IPOPT
name: so-ipopt
channels:
- conda-forge
- defaults
dependencies:
- pyomo
- ipopt
@mfansler
mfansler / so-dms-env.yaml
Created October 27, 2020 17:35
Conda environment YAML for SO issue with shared libs
name: foo
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=1_gnu
- _r-mutex=1.0.1=anacondar_1
- binutils_impl_linux-64=2.35=h18a2f87_9
@mfansler
mfansler / so-seurat-full.yaml
Last active September 22, 2020 20:03
Seurat install on OSX-64
name: so-seurat
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- _r-mutex=1.0.1=anacondar_1
- bwidget=1.9.14=0
- bzip2=1.0.8=haf1e3a3_3
- c-ares=1.16.1=haf1e3a3_3
@mfansler
mfansler / list_export_to_yaml.awk
Last active November 30, 2023 20:18
Convert `conda list` output to YAML
#!/usr/bin/env awk -f
#' Author: Mervin Fansler
#' GitHub: @mfansler
#' License: MIT
#'
#' Basic usage
#' $ conda list --export | awk -f list_export_to_yaml.awk
#'
#' Omitting builds with 'no_builds'
#' $ conda list --export | awk -v no_builds=1 -f list_export_to_yaml.awk
@mfansler
mfansler / bamfilter_oneliners.md
Last active June 23, 2020 18:55 — forked from davfre/bamfilter_oneliners.md
SAM and BAM filtering oneliners
@mfansler
mfansler / kallisto-build.yaml
Last active October 6, 2020 00:27
Conda Environment for Building Kallisto
name: kallisto-build
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- autoconf
- automake
- hdf5
- make
@mfansler
mfansler / genewalk-latest.yaml
Last active September 7, 2019 16:42
Minimal Conda Environment for `genewalk`
name: genewalk
channels:
- bioconda
- conda-forge
- defaults
dependencies:
- pandas
- networkx>=2.1
- gensim
- goatools
@mfansler
mfansler / nesting-example.R
Last active May 10, 2019 02:43
Using tidyverse nesting to unpack a vector of results into a long-format tibble
library(tidyverse)
# values at which to evaluate
# this can be changed arbitrarily
x <- c(1,2,3)
# evaluate y's for every condition and output a long format table
df <- expand.grid(coef=c(1,2), pow=c(1,2,3)) %>%
group_by(coef, pow) %>%
mutate(y=map2(coef, pow, ~ tibble(x=x, y=.x*x^.y))) %>%
#!/usr/bin/env bash
# Example Usage
# ./extract_10X_cell.sh possorted_genome_bam.bam GCCAAATTCACATACG | samtools view -b > cell.bam
#
# Compare with 10X post:
# https://kb.10xgenomics.com/hc/en-us/articles/360022448251-Is-there-way-to-filter-the-BAM-file-produced-by-10x-pipelines-with-a-list-of-barcodes-
if [ "$#" -ne 2 ]; then
echo -e "Incorrect number of parameters! Usage:\n extract_10X_cell.sh <file.bam> <cell_bx>" >&2