Skip to content

Instantly share code, notes, and snippets.

View jusu-E404's full-sized avatar
πŸ€“

jusu-E404

πŸ€“
  • Stanford
  • Bay Area, CA
View GitHub Profile
@jusu-E404
jusu-E404 / gtf2bed.py
Created August 11, 2019 11:07 β€” forked from davidliwei/gtf2bed.py
Converting Cufflinks predictions (.GTF) into .BED annotations
#!/usr/bin/env python3
'''
gtf2bed.py converts GTF file to BED file.
Usage: gtf2bed.py {OPTIONS} [.GTF file]
History
Nov.5th 2012:
1. Allow conversion from general GTF files (instead of only Cufflinks supports).
2. If multiple identical transcript_id exist, transcript_id will be appended a string like "_DUP#" to separate.
'''
@jusu-E404
jusu-E404 / venn_pie_chart.r
Created July 28, 2019 20:44 β€” forked from sterding/venn_pie_chart.r
R script to generate multi-layer pie chart (or called it venn pieagram) to visualize the NGS reads distribution in different annotation regions
## data input (number of reads mapped to each category)
total=100
rRNA=5 # mapped to nuclear rRNA regions
mtRNA=7 # mapped to mitochondria genome
# for the rest of above, then we divide into different category, like http://www.biomedcentral.com/1741-7007/8/149 did.
intergenic=48
introns=12
exons=30
upstream=3
downstream=6
@jusu-E404
jusu-E404 / README.md
Created April 3, 2019 22:18 β€” 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:

@jusu-E404
jusu-E404 / rpkm_versus_tpm.R
Created January 14, 2019 17:45 β€” forked from slowkow/rpkm_versus_tpm.R
Comparison of RPKM (reads per kilobase per million) and TPM (transcripts per million).
# RPKM versus TPM
#
# RPKM and TPM are both normalized for library size and gene length.
#
# RPKM is not comparable across different samples.
#
# For more details, see: http://blog.nextgenetics.net/?e=51
rpkm <- function(counts, lengths) {
rate <- counts / lengths
@jusu-E404
jusu-E404 / counts_to_tpm.R
Created January 14, 2019 17:44 β€” forked from slowkow/counts_to_tpm.R
Convert read counts to transcripts per million (TPM).
#' Convert counts to transcripts per million (TPM).
#'
#' Convert a numeric matrix of features (rows) and conditions (columns) with
#' raw feature counts to transcripts per million.
#'
#' Lior Pachter. Models for transcript quantification from RNA-Seq.
#' arXiv:1104.3889v2
#'
#' Wagner, et al. Measurement of mRNA abundance using RNA-seq data:
#' RPKM measure is inconsistent among samples. Theory Biosci. 24 July 2012.
@jusu-E404
jusu-E404 / WSL-ssh-server.md
Created September 10, 2018 22:32 β€” forked from dentechy/WSL-ssh-server.md
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Uninstall and reinstall the ssh server using the following commands:
    1. sudo apt remove openssh-server
    2. sudo apt install openssh-server
  2. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
  3. Change UsePrivilegeSeparation to no
@jusu-E404
jusu-E404 / RDavidQuery.R
Created August 24, 2018 05:27 β€” forked from svigneau/RDavidQuery.R
This snippet illustrates how to query David from R, using the RDAVIDWebService package.
# This snippet illustrates how to query David from R, using the RDAVIDWebService package.
# Load RDAVIDWebService.
library("RDAVIDWebService")
# Create a DAVIDWebService object connected to David, using your registration email.
# To register, go to: http://david.abcc.ncifcrf.gov/content.jsp?file=WS.html.
david <- DAVIDWebService$new(email='[email protected]')
# Define foreground and background gene lists.
@jusu-E404
jusu-E404 / query_biomart.R
Created August 19, 2018 20:02 β€” forked from slowkow/query_biomart.R
Get symbols (or any other ids) corresponding to Ensembl gene ids
# 1. Install biomart.
source("http://bioconductor.org/biocLite.R")
biocLite("biomaRt")
# 2. Load biomart.
library(biomaRt)
# 3. Get symbols for Ensembl IDs
@jusu-E404
jusu-E404 / deseq2-analysis-template.R
Created July 24, 2018 09:26 β€” forked from stephenturner/deseq2-analysis-template.R
Template for analysis with DESeq2
## RNA-seq analysis with DESeq2
## Stephen Turner, @genetics_blog
# RNA-seq data from GSE52202
# http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=gse52202. All patients with
# ALS, 4 with C9 expansion ("exp"), 4 controls without expansion ("ctl")
# Import & pre-process ----------------------------------------------------
# Import data from featureCounts