This file contains 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
FROM docker.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 | |
RUN apt update -y && apt install -y python3-pip | |
RUN pip install tensorflow torch torchvision tqdm pillow |
This file contains 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 time | |
while True: | |
print(f"{time.ctime():30s}", end="") | |
print("\b" * 30, end="", flush=True) | |
time.sleep(10) |
This file contains 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 {File} from 'fetch-blob/file.js' | |
import {Blob} from 'buffer' | |
import {default: Busboy} from 'busboy' | |
async function readForm(req) { | |
// My implementation is similar to | |
// https://github.com/cloudflare/miniflare/blob/master/packages/core/src/standards/http.ts#L302 | |
const data = {} | |
await new Promise( (resolve) => { |
This file contains 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
""" | |
Airflow Example: Build a dynamic read-mapping DAG for multiple samples | |
Author: linnil1 | |
Run bowtie2(read-maper) on two samples to a reference fasta | |
1. Prepare data like this | |
``` | |
$ ls /home/linnil1/airflow/data/ |
This file contains 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
# Replacing all UID, GID in directorary | |
# Requirement: python3.6 | |
# Usage: python3 replace_uidgid.py old_etc_passwd old_etc_group new_etc_passwd new_etc_group /home --dry-run -vv | |
# Author: linnil1 | |
import os | |
import argparse | |
from collections import defaultdict | |
import pathlib | |
This file contains 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
# Example of running aiohttp and aiocron together | |
# | |
# Packages: aiohttp==3.8.1 aiocron==1.8 | |
# Tested python version: python:3.10.0 | |
# Issue: aircron not working once aiohttp start | |
# Solution Concept: Both share the same event loop | |
import logging | |
import asyncio | |
import aiocron | |
from aiohttp import web |
This file contains 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 csv | |
import os | |
import shutil | |
def hash_id(id): | |
# input 12 | |
# output 000/dataset_12.dat | |
s = str(id) | |
l = len(s) |
This file contains 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 asyncio | |
import hmac | |
import json | |
from aiohttp import web | |
# custom import | |
from datetime import datetime | |
from pprint import pprint | |
This file contains 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
setInterval(() => { | |
if (document.querySelector(".tfny-circleGreen")) { | |
console.log("click"); | |
document.querySelector(".tfny-circleGreen").dispatchEvent(new Event('mousedown')); | |
} | |
}, 10); |
This file contains 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 os | |
import time | |
os.makedirs("data/", exist_ok=True) | |
hg38 = "data/GRCh38_latest_genomic" | |
image_fastqc = "quay.io/biocontainers/fastqc:0.11.9--0" | |
image_trimmomatic = "quay.io/biocontainers/trimmomatic:0.39--hdfd78af_2" | |
image_hisat = "quay.io/biocontainers/hisat2:2.2.1--he1b5a44_2" | |
image_samtool = "quay.io/biocontainers/samtools:1.10--h9402c20_2" |