Skip to content

Instantly share code, notes, and snippets.

@ionox0
ionox0 / classify.py
Created October 8, 2026 00:23
ad classifier runner
"""Label transcript lines as Ad or Program using best_model.joblib.
Usage:
.venv/bin/python classify.py transcript.txt # one line of transcript per row
.venv/bin/python classify.py transcript.csv --column text # a CSV column (name or 0-based index)
cat transcript.txt | .venv/bin/python classify.py # stdin
.venv/bin/python classify.py transcript.txt -o labels.csv # write CSV instead of printing
Lines must be in broadcast order: each one is classified together with its neighbours.
Capture-tool log lines ("Template NOT found", WebSocket errors, ...) are skipped.
@ionox0
ionox0 / triplanar_mapping_threejs_nodes.ts
Last active September 5, 2024 00:15
triplanar_mapping_threejs_nodes.ts
import { abs, float, vec3, tslFn, vec2, vec4, sin, fract, max, normalize, mul, texture, floor, sub, min, smoothstep, mix, storage, instanceIndex, uint, uv, normalLocal, positionLocal, positionWorld, normalWorld } from '../../../three.js/examples/jsm/nodes/Nodes';
import StorageInstancedBufferAttribute from '../../../three.js/examples/jsm/renderers/common/StorageInstancedBufferAttribute';
function _PS(data: any, diffuseTex: THREE.TextureAtlas, noiseTexture: THREE.Texture ) {
const TRI_SCALE = float(10.0);
const TerrainBlend_4 = (d0: any, d1: any, d2: any, d3: any) => {
const depth = float( 0.2 ).toVar();
fusion_id direct_support discordant_support total_support effect topo chr3 exon3 gene3 transcript3 bp3 chr5 exon5 gene5 transcript5 bp5 new_whitelist new_reportable self_fusion is_hard_filtered meets_support_criteria contains_relevant_domains_3 contains_relevant_domains_5 fusion_domains order_id
be1f8268-44ee-4c99-b0db-e4766db2c977 30 28 58 in-frame NaN 10 18.0 FGFR2 ENST00000457416 123242706 5 2.0 SUB1 ENST00000265073 32589733 False False False False False False False [] 22fwudfy
24a800ce-1d7b-4ce8-9c9a-041508bbbc99 30 28 58 in-frame NaN 5 3.0 SUB1 ENST00000265073 32589733 10 17.0 FGFR2 ENST00000457416 123242706 False False False False False False True [] 22fwudfy
@ionox0
ionox0 / access_qc_aggregator.cwl
Last active May 20, 2021 19:14
access_qc_aggregator.cwl
class: Workflow
cwlVersion: v1.0
id: access_qc_aggregator
label: access_qc_aggregator
$namespaces:
sbg: 'https://www.sevenbridges.com/'
inputs:
- id: duplex_extraction_files
type:
type: array
@ionox0
ionox0 / import_access_reference_files.py
Last active January 27, 2021 19:23
import_access_reference_files.py
import requests
gene_list = {
'path': '/juno/work/access/production/resources/msk-access/v1.0/regions_of_interest/versions/v1.0/juber-hg19-gene-list.bed',
'file_type': 'bed',
}
hotspots = {
'path': '/juno/work/access/production/resources/msk-access/v1.0/regions_of_interest/versions/v1.0/hotspot-list-union-v1-v2_with_TERT.txt',
'file_type': 'txt',
@ionox0
ionox0 / ACCESS_variant_calling_parameters.yaml
Last active September 22, 2020 20:53
ACCESS_variant_calling_parameters.yaml
# Params
mutect_params:
dcov: 5000
read_filter: ['BadCigar']
fraction_contamination: 0.0005
minimum_mutation_cell_fraction: 0.0005
vardict_params:
allele_freq_thres: 0.0005
min_num_variant_reads: 1
@ionox0
ionox0 / optimize_meetings_dp.py
Created March 16, 2020 17:22
dynamic programming for scheduling meetings of varying length given max available time
def optimize_meetings(meetings, max_time):
memo = [[0] * (max_time + 1) for _ in range(len(meetings) + 1)]
for i in range(len(meetings) + 1):
if i == 0: continue
for j in range(max_time + 1):
cur_mtg = meetings[i - 1]
index = j - cur_mtg
@ionox0
ionox0 / brass.sh
Last active January 7, 2020 18:04
brass with singularity
singularity run -B /folder/with/tumor_normal/bams:/tmp /home/johnsoni/brass/quay_io-brass_v6.3.0.simg
brass.pl -c 2 -o myout -t /tmp/tumor.bam -n /tmp/normal.bam
# causes error - why is -d required? ask Peter...
@ionox0
ionox0 / toil_tmp_dirs.md
Last active December 11, 2019 17:15
Understanding Toil temporary directories

Here are all of the current arguments related to input / output / temporary directories used by Toil and cwltool:


cwltool:

--outdir - Final outputs directory

--tmpdir-prefix - This is a prefix for folders that do not yet exist, but will be used as intermediate working directories

@ionox0
ionox0 / bsub_copy.py
Last active January 27, 2020 15:53
Script to copy a bunch of folders using bsub
# Uses bsub with rsync to copy large folders
#
# Uses a walltime limit of 60 hours (should be enough for very large folders)
#
# Runs in parallel across each subfolder of the source folder, and creates logs for each as well
#
# Usage: python bsub_copy.py /source/folder /dest/folder
import os
import sys