Skip to content

Instantly share code, notes, and snippets.

@heejongkim
heejongkim / Dockerfile
Created November 13, 2024 04:51
DiaNN 1.9.2 Dockerfile
FROM ubuntu
USER root
ENV DEBIAN_FRONTEND=noninteractive
# Update package lists and ensure package versions are up to date
RUN apt-get update && apt-get upgrade -y
# Install necessary packages including locales
RUN apt-get install wget unzip libgomp1 locales -y
@heejongkim
heejongkim / cuda_pytorch.sh
Created June 12, 2022 15:13 — forked from unnir/cuda_pytorch.sh
Install CUDA v8.0, cuDNN v6.0, Anaconda, and PyTorch GPU on Ubuntu 16.04
#!/bin/bash
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda-8-0
#nvidia-smi
echo 'export PATH=$PATH:$CUDA_HOME/bin' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64' >> ~/.bashrc
@heejongkim
heejongkim / protein_calc.py
Last active October 23, 2022 02:47
(protein, complex) concentration calculator
### HOW TO USE:
##### python protein_calc.py <Uniprot Accession Number(s)> <Nanodrop Reading> <Total Sample Volume in ul>
## Example:
### For Single Protein:
##### python protein_calc.py P61830 0.44 200
### For Protein Complex: (comma separated proteins)
##### python protein_calc.py P61830,P02309 0.44 200
@heejongkim
heejongkim / mzTab2tables.R
Created May 7, 2021 18:51
generalized mzTab parsing tool in R
## mzTab parsing to tsv files
## Unlike MSnbase, this will dumbly crawl over mzTab file and generate multiple tsv files
## The logic is that, except "MTD" which is the mzTab header, the first column's unique identifier for each sub-table
## will be utilized to sort each row out to corresponding tsv file(s).
mzTab2list <- function(mzTab_filename){
nested_lines <- lapply(readLines(mztab_filename), function(x) unlist(strsplit(x, "\t")))
nested_lines <- nested_lines[lapply(nested_lines,length)>0] # clean up empty lines
nested_lines_identifiers <- unlist(lapply(nested_lines, `[[`, 1)) # extract first column value as it tells you where this line belongs to
@heejongkim
heejongkim / ipi2uniprot.R
Last active May 8, 2021 03:52
Convert IPI accession number to Uniprot accession number via local BLAST
### Purpose
# This is a simple single function that takes a list of IPI accession numbers, query their sequences from IPI fasta DB,
# blast against given uniprot fasta, report the best hit in a table format, which contains both IPI and uniprot accession number
# side by side along with BLAST result and its sequence
# rudimentary exception handlings are included but not even close to production quality
### dependencies
# Biostrings
# rBLAST + BLAST 2.9.0+ local installation
@heejongkim
heejongkim / Vreg click code
Created March 22, 2021 04:38 — forked from Electronza/Vreg click code
VREG Click: adjustable power supply with Arduino Uno
# Project page
# https://medium.com/electronza/vreg-click-adjustable-power-supply-with-arduino-uno-2c61422e17bd