Skip to content

Instantly share code, notes, and snippets.

View partrita's full-sized avatar
🎯
Focusing on hobby

Taeyoon Kim partrita

🎯
Focusing on hobby
View GitHub Profile
@partrita
partrita / kanata.kbd
Last active April 26, 2024 06:27
Kanata: A cross-platform software keyboard remapper for Linux, macOS and Windows. This is my configuration file.
;; check out, https://github.com/jtroo/kanata
;; Caps lock key for hangul, left alt <-> left ctrl key for ergonomics
(defsrc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
caps a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl lmet lalt spc ralt rmet rctl
@partrita
partrita / pixi.toml
Last active April 25, 2024 13:01
`pixi.toml` file for pytorch
[project]
name = "my-ml-project"
description = "A project that does ML stuff"
authors = ["Your Name <your.name@gmail.com>"]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64"]
[tasks]
train-model = "python train.py"
evaluate-model = "python test.py"
@partrita
partrita / check_CUDA.md
Created April 19, 2024 00:49
Check CUDA version

nvidia GPU driver?

NVIDIA 그래픽 카드(혹은 GPU)와 컴퓨터 운영 체제(OS) 간의 통신을 관리하고 제어하는 소프트웨어로 NVIDIA GPU를 컴퓨터에서 올바르게 인식하고 제어, 리소스를 최적화하고, 그래픽 작업을 처리하기 위해 GPU에 명령을 전달하는 역할

CUDA(Computed Unified Device Architecture)란 뭘까?

CUDA는 C/C++ 프로그래밍 언어를 기반으로 하며, GPU에서 병렬 코드를 작성하고 실행할 수 있는 풍부한 라이브러리와 도구를 제공, CUDA는 GPU 컴퓨팅에서 일종의 컴파일러 역할을 수행한다.

CUDA는 2개의 API를 가지고 있는데, 하나는 runtime API이고 다른 하나는 driver API이다. 각 API가 각자의 version을 가지고 있다. nvidia-smi는 runtime API로 GPU 드라이버에 의해 설치된다. nvccCUDA toolkit에 의해 설치된다.

nvidia GPU 정보 확인

@partrita
partrita / lineplot.py
Created April 1, 2024 02:59
lineplot with errorbar and T-test
import warnings
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from scipy import stats
df = pd.read_csv("../input/tumor_growth.csv")
df.head()
@partrita
partrita / scRNA-seq_DataLoad.md
Last active March 29, 2024 02:50
snippet of scRAN-seq data load

GSE에 저장된 데이터에서 많이 보이는 유형

  1. 다음과 같이 3개의 파일로 구성(10X MEX 데이터 유형)
  • barcodes.tsv.gz, features.tsv.gz, and matrix.mtx.gz
  1. hdf5 포멧의 단일 파일

Seurat을 사용해 불러오기

10X MEX 형태 데이터 불러오기

@partrita
partrita / dotplot_meanbar.py
Last active March 27, 2024 07:21
Dotplot with mean value with black bar.
import matplotlib.pyplot as plt
import pands as pd
df = pd.read_csv("./data/230119_df_Bernard_Thienpont.csv")
# CellType Sample SampleType Values
# 0 NK_T 1 Tumor 0.007453
# 1 NK_T 4 Tumor 0.018171
# 2 NK_T 5 Tumor 0.052632
# 3 NK_T 6 Normal 0.151292
@partrita
partrita / errorbar_plot.py
Created March 27, 2024 06:06
Simple matplotlib errorbar plot/
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("./data/230116_Tumor_regression.csv")
# Group Mouse Day Tumor(mm2)
# 0 G1 2210ES50_1 0 0.000000
# 1 G1 2210ES50_1 7 107.827200
# 2 G1 2210ES50_1 11 674.233875
# 3 G1 2210ES50_1 14 1573.768326
Name entry_code
Abagovomab 3YK0326U7X
Abelacimab KX1N4TV7UY
Abiprubart No entry
Abituzumab 724QD330RD
Abrilumab Y9UQ37XT2T
Acrixolimab KHG83J8RMW
Actoxumab G3LU5LC5SX
Adalimumab FYS6T7F842
Adebrelimab 1XBY50W1OX
@partrita
partrita / pyproject.toml
Last active March 21, 2024 05:56
my `pyproject.toml` file for ruff linter.
# ref: https://beta.ruff.rs/docs/rules/
[tool.ruff]
# defaults to 88 like black
line-length = 100
# the python version to target, useful when considering code upgrades, defaults to "py310"
target-version = "py310"
# Linting file type
@partrita
partrita / Dockerfile
Created March 19, 2024 10:32
Docker images for micromamba
# https://micromamba-docker.readthedocs.io/en/latest/quick_start.html#running-commands-in-dockerfile-within-the-conda-environment
FROM mambaorg/micromamba:1.5.1
# RUN mkdir /home/mambauser/eggnog
COPY --chown=$MAMBA_USER:$MAMBA_USER environments.yml /tmp/env.yml
# to activate the conda environment
ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN micromamba install -y --file env.yml && \
micromamba clean --all --yes