Skip to content

Instantly share code, notes, and snippets.

@cmdcolin
cmdcolin / b73_converter.ts
Created April 22, 2025 17:02
b73_converter.ts
import fs from 'fs'
const tracks = JSON.parse(fs.readFileSync(process.argv[2], 'utf8')) as {
tracks: any[]
}
const asm = 'B73'
const assemblyNames = [asm]
const base = 'https://jbrowse.maizegdb.org/B73/'
console.log(
[
{ "role": "user", "type": "message", "content": "hello" },
{
"role": "assistant",
"type": "message",
"content": "Hello! How can I help you today?\n"
},
{
"role": "user",
"type": "message",
@cmdcolin
cmdcolin / out.tsv
Last active March 9, 2025 17:24
plot.R
program size time mean sd
biojsmsa 1024 1.7980085814 1.7634212551000001 0.054614392814706154
biojsmsa 1024 1.7561014924 1.7634212551000001 0.054614392814706154
biojsmsa 1024 1.7711577354 1.7634212551000001 0.054614392814706154
biojsmsa 1024 1.6753254374000002 1.7634212551000001 0.054614392814706154
biojsmsa 1024 1.7957582314 1.7634212551000001 0.054614392814706154
biojsmsa 1024 1.8305949124 1.7634212551000001 0.054614392814706154
biojsmsa 1024 1.8173887264 1.7634212551000001 0.054614392814706154
biojsmsa 1024 1.7924422974 1.7634212551000001 0.054614392814706154
biojsmsa 1024 1.6920777054 1.7634212551000001 0.054614392814706154
@cmdcolin
cmdcolin / gist:053b46493eb6066ac64e19ae43093456
Last active March 5, 2025 20:42
hap-ibd to bed file (not plink bed, just normal genome track bed)
#!/bin/bash
# create a bed file from hap-ibd output with columns "chr, start, end, sample_name1 hap1 sample_name2 hap2"
# add this config to jbrowse get(feature,'sample1')+':HP'+get(feature,'hap1')+' '+get(feature,'sample2')+':HP'+get(feature,'hap2')
zcat out1234.ibd.gz | cut -f 5,6,7 >! out.bed
zcat out1234.ibd.gz | cut -f 1,2,3,4 >! samples.txt
echo "#chr start end sample1 hap1 sample2 hap2" > out.bed
paste out.bed samples.txt >> out.bed
@cmdcolin
cmdcolin / gist.md
Last active March 2, 2025 20:14
fix for baobab deleting wrong folder

Fixing Disk Usage Analyzer (aka baobab) bug where it was deleting the wrong file

Issue thread https://gitlab.gnome.org/GNOME/baobab/-/issues/157#note_2367208

Background on the bug

The Disk Usage Analyzer app (aka baobab) has a "bug" where if you right-click a file, it brings up a context menu and you can then click "Move to Trash". However, if your mouse moves outside the context menu, then it "highlights" or "selects" a different file with the context menu still open, and then trashes the newly highlighted/selected file instead of the one that you originally right-clicked

image

If you want to publish ESM/CJS you can update your package.json to use the
"exports" field, and run the tsc compiler twice over the code, once using
--module cjs
```json
{
"name": "dualpackage",
"version": "1.0.0",
"description": "demo of dual esm/cjs package",
@cmdcolin
cmdcolin / static_jbrowse.md
Last active February 4, 2025 14:47
Using JBrowse on a static file host

One thing that is important to note about JBrowse is that it is a "static site compatible application"

What is a "static site"?

A static site is just a set of plain files like HTML, JS, and CSS

Static sites don't use dynamic "server side" code like PHP, Node.js, Java Servlets, or things like that.

@cmdcolin
cmdcolin / eslint.config.mjs
Last active February 22, 2025 15:18
example eslint v9 config for a vite app
import eslint from '@eslint/js'
import importPlugin from 'eslint-plugin-import'
import eslintPluginReact from 'eslint-plugin-react'
import eslintPluginReactHooks from 'eslint-plugin-react-hooks'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
// might be able to find a way to not ignore some of these but i just ignore them
ignores: [
@cmdcolin
cmdcolin / breakpoints.md
Last active January 3, 2025 17:30
How to access breakpoint split view in jbrowse 2

JBrowse 2 has a special "view type" called the "breakpoint split view" that allows you to see the connection between split long reads (e.g. SA tag) and paired-end reads

Ways to access the breakpoint split view

Using the SV inspector to launch a breakpoint split view

The SV inspector lets you load a VCF containing SV calls and then will launch a "breakpoint split view". Note that the breakpoint split view that it launches will be empty but you can then add your BAM or CRAM reads to it (on both top and bottom levels sometimes is needed)

@cmdcolin
cmdcolin / gist:f8dae7f7232c7260edb52b62e0222207
Created January 2, 2025 22:15
posts i made to /r/experimental_ambient
jason lescalleet - the pilgrim https://www.youtube.com/watch?v=lU6PbEg6YRk (dedicated to his dad, over an hour of morbid ambience and then harsh noise)
j peterson https://www.youtube.com/watch?v=eVX7DkYr_oA (weird ambient that also explores morbid themes in his other works)
mattias gustaffson https://youtu.be/0pxzWUbuzYo (dark tape manipulations)
morgan hall - skid row palace https://youtu.be/2gfBktiURew (muted dark ambient power electronics)
all of korea undok group stuff https://soundcloud.com/korea-undok-group
work/death - mulberries ripen and rot side b midway thru particularly dragging
hazl fog https://youtu.be/zjqZWejfOmE (everything makade star and b.p.)
prurient - sexual magic (erik satie reinterpreted by prurient. also entire prurient backcatalog)
the humble bee - morning music https://youtu.be/leu6YmRWS2s (soft tape music for healing)
gordan wilson - https://iatrogenesis.bandcamp.com/track/american-ulterior (and entire gordon/oscillating innards backcatalog)