Skip to content

Instantly share code, notes, and snippets.

View alexpreynolds's full-sized avatar
👋
Hello

Alex Reynolds alexpreynolds

👋
Hello
  • Altius Institute for Biomedical Sciences
  • Seattle, WA USA
View GitHub Profile
@alexpreynolds
alexpreynolds / tabix-s3-example.md
Created February 28, 2025 23:22 — forked from knmkr/tabix-s3-example.md
tabix s3 example

Tabix command of htslib can query a locus to a remote s3 file using s3:// protocol.

$ aws s3 ls s3://your_bucket/
vcf.gz
vcf.gz.tbi

$ tabix -l s3://your_bucket/vcf.gz
chr1
chr2
@alexpreynolds
alexpreynolds / fiberscope_soda.py
Last active December 2, 2024 18:24
Automate generating PNG or SVG snapshots of regions in the Fiberscope browser
#!/usr/bin/env python
import os
import sys
import time
from pathlib import Path
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
@alexpreynolds
alexpreynolds / get_gcc_youtube_av_stream.sh
Last active November 19, 2024 07:53
How to download a Granite Curling Club livestream
#!/bin/bash
pip install yt-dlp
yt-dlp -f "bv*+ba/b" "https://www.youtube.com/watch?v=wmc-oKHvZsA"
@alexpreynolds
alexpreynolds / aws_s3_move_storage_class.sh
Last active November 18, 2024 19:23
Move list of AWS S3 objects in one bucket to a different storage class
#!/bin/bash
in_fn=${1}
aws_s3_bucket=${2}
aws_s3_dest_storage_class=${3}
while IFS= read -r line; do
aws_s3_key=$(echo "${line}" | cut -d' ' -f1)
aws_s3_path="s3://${aws_s3_bucket}/${aws_s3_key}"
echo "Moving [${aws_s3_path}] to storage class [${aws_s3_dest_storage_class}]"
@alexpreynolds
alexpreynolds / longest_isoform_from_gff3.py
Created November 18, 2024 05:34
Get per-gene longest isoform from GFF3 input
#!/usr/bin/env python
import sys
import pandas as pd
i_fn = sys.argv[1]
if not i_fn:
raise Exception("Error: Missing input file")
@alexpreynolds
alexpreynolds / gff3_gene_to_genesearch_json.py
Created October 24, 2024 04:34
Convert Gencode GFF3 to GeneSearch widget JSON
#!/usr/bin/env python
import sys
import json
genes = []
for line in sys.stdin:
elems = line.rstrip().split('\t')
chromosome = elems[0]
@alexpreynolds
alexpreynolds / README.md
Created February 5, 2024 08:28 — forked from manzt/README.md
minimal higlass + vite

minimal higlass vite

pnpm install
pnpm dev
@alexpreynolds
alexpreynolds / example.bed
Created October 25, 2022 08:15
Example of a BED file to bring into index.html
chr7 5563000 5573000 TxFlnk 10.26175 +
chr17 39843800 39853800 TxFlnk 10.16751 +
chr6 32935400 32945400 TxFlnk 10.10112 +
chr22 39915200 39925200 TxFlnk 10.02993 +
chr17 79475800 79485800 TxFlnk 9.96371 +
chr11 65264200 65274200 TxFlnk 9.72111 +
chr19 3977800 3987800 TxFlnk 9.71104 +
chr12 56551000 56561000 TxFlnk 9.69233 +
chr1 234739400 234749400 TxFlnk 9.66319 +
chr20 42085400 42095400 TxFlnk 9.66160 +
@alexpreynolds
alexpreynolds / index.html
Created October 25, 2022 08:12
Client-side BED file upload demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Client-side BED file upload test</title>
</head>
@alexpreynolds
alexpreynolds / app.js
Created October 25, 2022 08:02
Basic local web server running on port 3000
const PORT_NUMBER = 3000;
// Requiring express for routing
const express = require('express');
// Creating app from express
const app = express();
// Requiring in-built file system
const fs = require('fs');