Skip to content

Instantly share code, notes, and snippets.

@Colelyman
Colelyman / citation
Created December 6, 2019 21:55
Generate a citation in Markdown from a BibTeX entry.
#!/bin/sh
TEMP_BIB_PATH=".mybib.bib"
TEMP_MD_PATH=".mybib.md"
TEMP_CITATION_PATH=".mycitation.md"
clean() {
rm -rf $TEMP_BIB_PATH $TEMP_MD_PATH $TEMP_CITATION_PATH
}
@Colelyman
Colelyman / eulerian_cycle.py
Last active January 2, 2021 18:16
Discover an Eulerian Cycle from a graph.
"""Discover an Eulerian Cycle from a graph."""
import argparse
from typing import Dict, List
def construct_graph_from_adjacency(
graph_file_path: str,
) -> Dict[str, List[str]]:
"""Construct a graph from an adjacency list in `graph_file_path`.
@Colelyman
Colelyman / eulerian_path.py
Created January 2, 2021 18:16
Discover an Eulerian Path from a Graph.
"""Discover an Eulerian Path from a graph."""
import argparse
from collections import Counter
from typing import Dict, List, Optional
def construct_graph_from_adjacency(
graph_file_path: str,
) -> Dict[str, List[str]]:
@Colelyman
Colelyman / simPairedReadsWithAdapter.py
Created October 7, 2022 19:54 — forked from kclem/simPairedReadsWithAdapter.py
Simulate paired reads with adapter readthrough and substitutions for testing adapter trimming and read merging
import random
simulate_deletion_lens = range(30) #deletions to simulate - here, 0 to 30bp deletions. The longer the deletion, the more adapter will be included in the read
simulate_mismatch_counts = range(3) #number of mismatches to simulate - her, 0, 1, and 2 mismatches between r1 and r2. The higher the number of mismatches, the less likely the read will be merged.
read_len = 210 #length of reads to generate
read = ' CGGATGTTCCAATCAGTACGCAGAGAGTCGCCGTCTCCAAGGTGAAAGCGGAAGTAGGGCCTTCGCGCACCTCATGGAATCCCTTCTGCAGCACCTGGATCGCTTTTCCGAGCTTCTGGCGGTCTCAAGCACTACCTACGTCAGCACCTGGGACCCCGCCACCGTGCGCCGGGCCTTGCAGTGGGCGCGCTACCTGCGCCACATCCATCGGCGCTTTGGTCGG '
readthrough = 'ACACTCTTTCCCTACACGACGCTCTTCCGATCTCGGATGTTCCAATCAGTACGCAGAGAGTCGCCGTCTCCAAGGTGAAAGCGGAAGTAGGGCCTTCGCGCACCTCATGGAATCCCTTCTGCAGCACCTGGATCGCTTTTCCGAGCTTCTGGCGGTCTCAAGCACTACCTACGTCAGCACCTGGGACCCCGCCACCGTGCGCCGGGCCTTGCAGTGGGCGCGCTACCTGCGCCACATCCATCGGCGCTTTGGTCGGAGATCGGAAGAGCACACGTCTGAACTCCAGTC
@Colelyman
Colelyman / qwc.py
Created November 3, 2025 21:57
Extract Quantification Windows from CRISPResso Runs
"""Report the quantification window indexes used from a CRISPResso run.
The script expects to be adjacent to any number of CRISPResso runs, it will
search among the runs and extract each CRISPResso2_info.json file and print
out the quantification windows for each amplicon.
"""
import glob
import json
@Colelyman
Colelyman / README.md
Created February 6, 2026 18:41
Pi Coding Agent Extensions - Debug, Guardrails, Review, Todos, Emacs Bridge, Web Browser

Pi Coding Agent Extensions

Custom extensions for pi, a CLI coding agent.

Directory Structure

Place these files in ~/.pi/agent/extensions/:

~/.pi/agent/extensions/