Skip to content

Instantly share code, notes, and snippets.

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 / hgen-473-rna-seq.R
Created April 11, 2018 10:43 — forked from jdblischak/hgen-473-rna-seq.R
RNA-seq analysis with R/Bioconductor
# HGEN 473 - Genomics
# Spring 2017
# Tuesday, May 9 & Thursday, May 11
#
# RNA-seq analysis with R/Bioconductor
#
# John Blischak
# Introduction -------------------------------------------------------
@joowkim
joowkim / jupyter_shortcuts.md
Created March 23, 2018 01:50 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command
@joowkim
joowkim / gist:f2622177ee8265340ed6f165f1fdcb01
Created September 18, 2017 05:52 — forked from conormm/r-to-python-data-wrangling-basics.md
R to Python: Data wrangling with dplyr and pandas
R to python useful data wrangling snippets
The dplyr package in R makes data wrangling significantly easier.
The beauty of dplyr is that, by design, the options available are limited.
Specifically, a set of key verbs form the core of the package.
Using these verbs you can solve a wide range of data problems effectively in a shorter timeframe.
Whilse transitioning to Python I have greatly missed the ease with which I can think through and solve problems using dplyr in R.
The purpose of this document is to demonstrate how to execute the key dplyr verbs when manipulating data using Python (with the pandas package).
dplyr is organised around six key verbs
library(devtools)
library(sleuth)
library(dplyr)
library("biomaRt")
#load annotation from ensembl
ensembl = useMart("ENSEMBL_MART_ENSEMBL",dataset="mmusculus_gene_ensembl", host="www.ensembl.org")
t2g <- biomaRt::getBM(attributes = c("ensembl_transcript_id", "ensembl_gene_id", "external_gene_name"), mart = ensembl)
t2g <- dplyr::rename(t2g, target_id = ensembl_transcript_id, ens_gene = ensembl_gene_id, ext_gene = external_gene_name)
#change this directory as your directory
@joowkim
joowkim / README.md
Created February 5, 2017 02:31 — forked from jdblischak/README.md
rnaseq-de-tutorial

Differential expression analysis with edgeR

This is a tutorial I have presented for the class Genomics and Systems Biology at the University of Chicago. In this course the students learn about study design, normalization, and statistical testing for genomic studies. This is meant to introduce them to how these ideas are implemented in practice. The specific example is a differential expression analysis with edgeR starting with a table of counts and ending with a list of differentially expressed genes.

Past versions:

/*
* ------------------------------------------------------------
* "THE BEERWARE LICENSE" (Revision 42):
* <author> wrote this code. As long as you retain this
* notice, you can do whatever you want with this stuff. If we
* meet someday, and you think this stuff is worth it, you can
* buy me a beer in return.
* ------------------------------------------------------------
*/
@joowkim
joowkim / .vimrc
Created December 14, 2016 07:56 — forked from sooop/.vimrc
Just My $VIMRC
"===============================================================================
"FILE: myvimrc
"CREATED BY: sooop
"LAST UPDATEd: 2014. 04. 23.
"DESCRIPTION:
" my vimrc settting
" github repository : https://github.com/sooop/myvimrc.git
"===============================================================================
@joowkim
joowkim / ParseFastQ.py
Created May 18, 2016 04:15 — forked from xguse/ParseFastQ.py
Simple Python FastQ Parser class
class ParseFastQ(object):
"""Returns a read-by-read fastQ parser analogous to file.readline()"""
def __init__(self,filePath,headerSymbols=['@','+']):
"""Returns a read-by-read fastQ parser analogous to file.readline().
Exmpl: parser.next()
-OR-
Its an iterator so you can do:
for rec in parser:
... do something with rec ...