Skip to content

Instantly share code, notes, and snippets.

library(XLConnect)
library(magrittr)
library(dplyr)
# mouse rna seq data download Zeisel et al. download------
dir.create('data-raw/ZeiselMouse', showWarnings=FALSE)
download.file(url= 'http://storage.googleapis.com/linnarsson-lab-www-blobs/blobs/cortex/expression_mRNA_17-Aug-2014.txt',
destfile='data-raw/ZeiselMouse/mouseRNASeq_Zeisel 2015.txt')
download.file(url = 'http://science.sciencemag.org/highwire/filestream/628248/field_highwire_adjunct_files/1/aaa1934_TableS1.xlsx',
destfile = 'data-raw/ZeiselMouse/markerGenes.xlsx')
@pimentel
pimentel / sleuth_DESeq2.R
Created March 18, 2016 18:47
very simple sleuth/DESeq2 comparison at transcript level
suppressPackageStartupMessages({
library('Biobase')
library('DESeq2')
library('sleuth')
})
base_dir <- "~/Downloads/cuffdiff2_data_kallisto_results"
sample_id <- dir(file.path(base_dir,"results"))
@stephenturner
stephenturner / tucr.grch38.bed.tsv
Last active June 10, 2016 04:34
Translated Ultra Conserved Regions (TUCRs) lifted to GRCh38 from data at http://ucbase.unimore.it/
1 10537640 10537846 uc.1
1 10672486 10672692 uc.2
1 10691108 10691332 uc.3
1 10698192 10698550 uc.4
1 10721294 10721507 uc.5
1 10735064 10735364 uc.6
1 10776076 10776331 uc.7
1 10791761 10791976 uc.8
1 10865353 10865554 uc.9
1 108697806 108698069 uc.36
human mouse
A1BG A1bg
A1CF A1cf
A2LD1 A2ld1
A2M A2m
A4GALT A4galt
A4GNT A4gnt
AAAS Aaas
AACS Aacs
AADAC Aadac
@danielecook
danielecook / parallel_bcftools.sh
Last active March 18, 2022 07:46
parallel bcftools
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
function bam_chromosomes() {
# Fetch chromosomes from a bam file
samtools view -H $1 | \
grep -Po 'SN:(.*)\t' | \
cut -c 4-1000
}
@danielecook
danielecook / pubmed.js
Last active June 30, 2020 01:31
Function for fetching a pubmed citation in google sheets
/**
* Returns formatted pubmed citation.
*
* @param {id} Pubmed identifier.
* @return Formatted pubmed citation.
* @customfunction
*/
function pubmed(id) {
// Special thanks to http://www.alexhadik.com/blog/2014/6/12/create-pubmed-citations-automatically-using-pubmed-api
var content = UrlFetchApp.fetch("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=" + id + "&retmode=json")
@jroetman
jroetman / README.md
Last active March 9, 2019 08:02
Band Zoom

D3 V4.

Hit the pull data button to pull in the testData.json file.

Drag a rectangle around an area of interest to zoom in.

If anyone is interested in a more general version (to take in custom data), or would like me to correct something, leave a comment on the gist.

Update Dec 29th 2017

  • Mashed things together to make it work with v4
@slowkow
slowkow / bigWigRegions.sh
Created August 24, 2015 20:45
Print bigWig data for each region in a BED file
#!/usr/bin/env bash
# bigWigRegions
# Kamil Slowikowski
#
# Depends on bigWigToBedGraph: http://hgdownload.cse.ucsc.edu/admin/exe/
if [[ $# -ne 2 ]]; then
echo "bigWigRegions - Print bigWig data for each region in a bed file."
echo -e "usage:\n bigWigRegions in.bigWig in.bed > out.bedGraph"
echo " bigWigRegions in.bigWig <(zcat in.bed.gz) > out.bedGraph"
@mblondel
mblondel / multiclass_svm.py
Last active March 3, 2023 07:57
Multiclass SVMs
"""
Multiclass SVMs (Crammer-Singer formulation).
A pure Python re-implementation of:
Large-scale Multiclass Support Vector Machine Training via Euclidean Projection onto the Simplex.
Mathieu Blondel, Akinori Fujino, and Naonori Ueda.
ICPR 2014.
http://www.mblondel.org/publications/mblondel-icpr2014.pdf
"""
@sterding
sterding / venn_pie_chart.r
Last active July 28, 2019 20:44
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