This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def extract_strings(binary_path, min_length=4): | |
with open(binary_path, "rb") as f: | |
data = f.read() | |
strings = [] | |
current = [] | |
for byte in data: | |
if 32 <= byte <= 126: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import matplotlib.pyplot as plt | |
import numpy as np | |
# Read the data | |
df = pd.read_csv("de_results/filtered_results.csv") | |
# Get unique targets and calculate stats | |
targets = df['target'].unique() | |
n_targets = len(targets) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Target: CHMP3, DE genes: 3508 | |
Target: AKT2, DE genes: 908 | |
Target: SHPRH, DE genes: 121 | |
Target: TMSB4X, DE genes: 291 | |
Target: KLF10, DE genes: 6500 | |
Target: TARBP2, DE genes: 1073 | |
Target: KDM2B, DE genes: 4582 | |
Target: non-targeting, DE genes: 0 | |
Target: SV2A, DE genes: 198 | |
Target: CLDN6, DE genes: 124 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uv run pdex-pairwise-fdr.py | |
Installed 44 packages in 198ms | |
Selected target: LAD1 | |
Selected target: TWF2 | |
INFO:pdex._single_cell:vectorized processing: 3 targets, 18080 genes | |
INFO:pdex._single_cell:Processing 2 targets | |
Processing targets: 100%|█████████████████████████████████████████████████████████████████| 2/2 [00:05<00:00, 2.82s/it] | |
target reference feature target_mean ... statistic pairwise_fdr fdr diff | |
22040 TWF2 non-targeting MASP1 0.135913 ... 18364126.0 0.044305 0.062304 -0.017999 | |
34612 TWF2 non-targeting PTPRT 0.887897 ... 17946027.5 0.041230 0.057592 -0.016361 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
import subprocess | |
import sys | |
from typing import Dict, Set, Tuple | |
def run_nix_eval(commit: str) -> Dict[str, str]: | |
"""Run nix eval command with the specified commit and return parsed JSON.""" | |
cmd = [ | |
"nix", "eval", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# requires-python = ">=3.10" | |
# dependencies = [ | |
# "anndata", | |
# "numpy", | |
# ] | |
# /// | |
import anndata as ad | |
import numpy as np | |
import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# dependencies = [ | |
# "numpy", | |
# "torch", | |
# "kernels", | |
# "pandas", | |
# "matplotlib" | |
# ] | |
# /// | |
# Benchmarking common shapes for Flux 1024x1024px image + varying text sequence lengths |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# dependencies = [ | |
# "numpy", | |
# "torch", | |
# "kernels", | |
# ] | |
# /// | |
import torch | |
import torch.nn as nn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# dependencies = [ | |
# "numpy", | |
# "torch", | |
# "kernels", | |
# ] | |
# /// | |
import torch | |
# reuse the models from the previous snippets or copy the class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# dependencies = [ | |
# "numpy", | |
# "torch", | |
# "kernels", | |
# ] | |
# /// | |
import torch | |
import torch.nn as nn |
NewerOlder