Skip to content

Instantly share code, notes, and snippets.

View jbothma's full-sized avatar

JD Bothma jbothma

View GitHub Profile
@jbothma
jbothma / claude_isolates_fastas.md
Last active November 1, 2025 17:59
Claude, what's the relationship between isolate, fasta file, sequence, and fasta file header when sharing genetic data for research?

The relationship between isolates, sequences, and FASTA headers depends on the assembly level of the genome:

Complete Genomes

For a single complete bacterial genome (one isolate):

  • The FASTA file contains multiple sequences (one per chromosome/plasmid)
  • Each header represents a different replicon (chromosome, plasmid, or organelle)

Example from one Klebsiella isolate:

@jbothma
jbothma / thingy.yaml
Created October 28, 2025 19:22
thingy
# Source: song/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: song
labels:
app.kubernetes.io/name: song
app.kubernetes.io/instance: song
spec:
# python scrape_wikipedia.py countries.json intros flags
#
# countries.json is countries search facet.
import requests
from lxml import html
import json
from sys import argv
import re
from normality.cleaning import collapse_spaces
This file has been truncated, but you can view the full file.
{"countries":{"us":{"positions":{"plural-3dd261998008c07e480fd7b0c70d73321d64dd20":{"id":"plural-3dd261998008c07e480fd7b0c70d73321d64dd20","name":"Member of the New Jersey Senate","categories":[],"topics":[],"counts":{"total":52,"current":40,"ended":12,"unknown":0}},"Q13218630":{"id":"Q13218630","name":"United States representative","categories":[],"topics":[],"counts":{"total":1200,"current":426,"ended":356,"unknown":418}},"plural-7522a42ade1387949ba0195e68636df4f7f010b0":{"id":"plural-7522a42ade1387949ba0195e68636df4f7f010b0","name":"Governor of Nebraska","categories":[],"topics":[],"counts":{"total":1,"current":0,"ended":1,"unknown":0}},"us-congress-d50d35cd1e6958979e846398314ffa63f0b6760c":{"id":"us-congress-d50d35cd1e6958979e846398314ffa63f0b6760c","name":"United States senator","categories":[],"topics":[],"counts":{"total":122,"current":100,"ended":22,"unknown":0}},"plural-8c7da9224053deecd023a2962fd131393e6220fd":{"id":"plural-8c7da9224053deecd023a2962fd131393e6220fd","name":"Member of the California S
{
"ocid": "ocds-0E7232F7-67EC-42BD-B081-3370171F20B7",
"id": "ocds-0E7232F7-67EC-42BD-B081-3370171F20B7-2022-03-30 13:40:05.8245389",
"date": "2022-03-30T13:40:05",
"initiationType": "tender",
"tender": {
"id": "3622",
"title": "LMN 03/2021",
"status": "active",
"mainProcurementCategory": "Administrative and support activities",
This file has been truncated, but you can view the full file.
{
"countries": {
"af": {
"positions": {
"us-cia-b1efcaa124e747b3612a9e4191f58ecef8d4f0e2": {
"position_name": "Deputy Prime Minister",
"counts": {
"total": 3,
"current": 3,
"ended": 0,
@jbothma
jbothma / spec.json
Created July 10, 2023 07:48
grouped horizonal bar chart
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "A basic grouped bar chart example.",
"width": 300,
"height": 240,
"padding": 5,
"data": [
{
"name": "table",
"values": [

API data practice tasks

This task will give you practice

  • making sense of an unfamiliar API using its documentation
  • handling, transforming and combining data, and coming up with data structures that enable you to present it easily
  • dealing with interdependent API responses that complete in an arbitrary order, and ideally presenting progressively more information to the user as more data becomes available

Focus on logic and clean understandable code rather than visual design.

@jbothma
jbothma / gist:9cb2fcd36dd9b34d10b55d58c8b55aa5
Created May 12, 2023 13:08
Common and varied needs when capturing and presenting fiscal data
Every country probably has its own chart of accounts.
Most of the south african chart doesn't fit in the open fiscal data package standard.
Sometimes you want to impose an ordering on items in a summary. Often the account numbering isn't the correct ordering for long. On muni money we captured that ordering alongside the codes and dimensions.
https://docs.google.com/presentation/d/1tWw1N-LB6FYrHfXs9jM0P0x8ajMQgk53ESMCCpbSaAE/edit?usp=sharing