Skip to content

Instantly share code, notes, and snippets.

View joowkim's full-sized avatar

J Kim joowkim

  • Ohio, USA
View GitHub Profile
@joowkim
joowkim / gist:35db1cae580449a8aa6f2e031d1b7bd9
Created April 1, 2024 17:37
geom_jitter: how to get rid of duplicate dots?
geom_boxplot(outlier.colour=NA )
@joowkim
joowkim / renamer.sh
Created April 1, 2024 13:58
fastq file rename
renamer 's@_R([12])\.fastq\.gz@-R$1.fastq.gz@' *.gz -v
import sys
import openai
import json
import pandas as pd
from Bio import Entrez
from datetime import datetime
from PyQt6 import QtWidgets, QtGui
from PyQt6.QtCore import Qt
# Replace with your own ChatGPT API key
@joowkim
joowkim / coin_test.Rscript
Last active October 11, 2022 13:33
coin-test problem
func <- function(num) {
result <- c()
vec <- c("TT", "TT", "HT", "TH", "HH", "HH")
# bst <- sample(vec, num, replace = T)
for (i in 1:num) {
coin <- sample(vec, 1)[1]
if (startsWith(coin, "H")) {
result <- c(result, coin)
Dockerfile
FROM rocker/r-ver
RUN /rocker_scripts/install_tidyverse.sh
RUN /rocker_scripts/install_python.sh
RUN R --quiet -e 'BiocManager::install("preprocessCore")'
RUN R --quiet -e 'install.packages("pacman", repos="http://cran.us.r-project.org")'
RUN R --quiet -e 'pacman::p_install("methods")'
RUN R --quiet -e 'pacman::p_install("lattice")'
@joowkim
joowkim / RLE.R
Created April 22, 2022 22:24
RLE for DEseq2
rle <- function(vec) {
n <- length(vec)
return (round( (prod(vec) ^ (1/n))))
}
vec <- c(65,78,67,34,56,23)
rle(vec)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joowkim
joowkim / jupyter-notebook
Created July 30, 2021 01:53
Question about batch effect
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### I am going to make up the tech variable as a batch effect. For example, tech1 is measured by technician 1 and tech2 is measure by technician 2. And I am not interested in the effect of the tech variale, but would like to ignore or remove the effect of the tech variable. "
]
},
{
@joowkim
joowkim / miss_r.Rscript
Created May 8, 2021 00:40
missing data library in R
library(naniar)
vis_miss(airquality)
reference
https://cran.r-project.org/web/packages/naniar/vignettes/naniar-visualisation.html
@joowkim
joowkim / tips.txt
Created February 21, 2021 04:02
R library permission denied error!
do not use the username\document\somethingpath
use the below path
.libPaths(.libPaths()[2])