Skip to content

Instantly share code, notes, and snippets.

View gwangjinkim's full-sized avatar

Gwang-Jin Kim gwangjinkim

  • Pharma
  • Freiburg i. Br., Germany
View GitHub Profile
@gwangjinkim
gwangjinkim / minimal-commands-CL-emacs.md
Last active March 29, 2023 19:18
Minimal set of commands for (Common) Lisp Developers in Emacs

My minimal set of useful commands for editing Lisp code in Emacs:

Start Emacs

what do
start emacs session type emacs in your terminal
open existing file C-x C-f `` RET (file)
##############################
# igenomes
##############################
# download GRCm38 from igenomes
wget ftp://igenome:G3nom3s4u@ussd-ftp.illumina.com/Mus_musculus/Ensembl/GRCm38/Mus_musculus_Ensembl_GRCm38.tar.gz
tar xvfz Mus_musculus_Ensembl_GRCm38.tar.gz
# install IGV viewer for visualization of alignments
wget http://data.broadinstitute.org/igv/projects/downloads/2.4/IGV_2.4.8.zip
unzip IGV_2.4.8.zip
cd IGV_2.4.8
bash igv.sh
# flagstat.fpath <- "~/testing/br-mgd-srt-srt.txt"
# content of the file (flagstat output):
51712430 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
46380832 + 0 mapped (89.69% : N/A)
@gwangjinkim
gwangjinkim / oop.rkt
Last active March 18, 2021 07:22
Message Passing Style and OOP using Racket. About the advantages using OOP. (This code nicely shows how to implement OOP using closures. Attributes are nothing else than closed-over variables. Methods are functions returned from the closure.)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; notes from the book "Vom Problem zum Programm" by Herbert Klaeren and Michael Sperber
;; on object oriented programming
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; object oriented programming = message passing style + state + self + inheritance
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; object = active container in message passing style
@gwangjinkim
gwangjinkim / how-to-save-entire-python-sessions-or-objects-or-session-code.py
Last active April 8, 2023 19:49
How to save entire Python sessions, single objects or only a session's code?
"""
Lisp languages support an image-based development cycle at the REPL.
R - having its roots in Lisp - it was first implemented in Scheme - has overtaken this.
R's base command `save.image(filepath)` can save the state of an entire REPL session in a file,
and next time you start R, you can start where you stopped, by hitting `load(filepath)`.
I was asking myself, since Python's REPL is ipython, what supports
similar functionailities for pythonistas.
@gwangjinkim
gwangjinkim / install-termux-arch.md
Created April 25, 2020 14:50 — forked from lisp-is-the-future/install-termux-arch.md
How to install TermuxArch in Termux of Android (Samsung Galaxy Tab 10.1)
#################################################################
# How to install Arch in your Android (into the App TermuxArch)
# and be able to use your Android device like a personal computer
# even running a X server to have GUI
#################################################################


###############################
# Install Termux
@gwangjinkim
gwangjinkim / csv_parsing.py
Last active November 6, 2019 06:26
partly solution for csv parsing problem
import pandas as pd
df = pd.read_csv("XXXXX_20180101_20171231_start.csv", sep=";", header=None)
df_target = pd.read_csv("XXXX_20180101_20171231_test2_target.csv", sep=";", header=None)
"""
inspect by:
df.head()
@gwangjinkim
gwangjinkim / xlsx2dfs.py
Last active April 23, 2021 15:41
print list of dataframes into excel sheets
#################################################
# solution mainly using pandas functionalities
# reading-in returns an ordered dict (which contains sheet_names as key) -> close to R functionality
# appending to excel like this might be slower
#################################################
def xlsx2dfs(fpath, **kwargs):
return pd.from_excel(fpath, sheet_name=None, **kwargs)
@gwangjinkim
gwangjinkim / install-and-start-postgresql-in-conda-locally
Last active May 5, 2024 14:02
How to install and run postgresql in conda
This gist I write, because I couldn't find step by step instructions
how to install and start postgresql locally (using conda within a conda environment - with the result
that you can run it without sudo/admin rights on your machine!)
and not globally in the operating system (which requires sudo/admin rights on that machine).
I hope, this will help especially people new to postgresql (and those who don't have sudo/admin rights on a specific machine but want
to run postgresql there)!
####################################
# create conda environment