This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function to extract the overall ANOVA p-value out of a linear model object | |
lmp <- function (modelobject) { | |
if (class(modelobject) != "lm") stop("Not an object of class 'lm' ") | |
f <- summary(modelobject)$fstatistic | |
p <- pf(f[1],f[2],f[3],lower.tail=F) | |
attributes(p) <- NULL | |
return(p) | |
} | |
# simulate some data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your key bindings in this file to overwrite the defaults | |
[ | |
// RStudio: Copy lines up/down with alt+cmd+up/down | |
{ | |
"key": "alt+cmd+down", | |
"command": "editor.action.copyLinesDownAction", | |
"when": "editorTextFocus && !editorReadonly" | |
}, | |
{ | |
"key": "shift+alt+down", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
human | mouse | |
---|---|---|
A1BG | A1bg | |
A1CF | A1cf | |
A2LD1 | A2ld1 | |
A2M | A2m | |
A4GALT | A4galt | |
A4GNT | A4gnt | |
AAAS | Aaas | |
AACS | Aacs | |
AADAC | Aadac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To source this file into an environment to avoid cluttering the global workspace, put this in Rprofile: | |
# my.env <- new.env(); sys.source("C:/PathTo/THIS_FILE.r", my.env); attach(my.env) | |
#----------------------------------------------------------------------- | |
# Load packages, set options and cwd, set up database connection | |
#----------------------------------------------------------------------- | |
## Load packages | |
# require(ggplot2) #plotting | |
# require(plyr) #data manipulation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# R session 1: model training and deployment ------------------------------ | |
library(tidymodels) | |
library(vetiver) | |
library(plumber) | |
# Not the way you'd actually split data - for demo only | |
cars_train <- mtcars[1:24,] | |
cars_test <- mtcars[25:32,] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your key bindings in this file to overwrite the defaults | |
[ | |
// RStudio: Copy lines up/down with alt+cmd+up/down | |
{ | |
"key": "alt+cmd+down", | |
"command": "editor.action.copyLinesDownAction", | |
"when": "editorTextFocus && !editorReadonly" | |
}, | |
{ | |
"key": "shift+alt+down", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Sci-Hub Lookup", | |
"alias": "Sci-Hub", | |
"icon": "null", | |
"_urlTemplate": "https://sci-hub.tw/{z:DOI}", | |
"description": "Sci-Hub full text PDF search", | |
"hidden": false, | |
"_urlParams": [], | |
"_urlNamespaces": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Adds allelic depth (AD)=2 to a VCF. | |
# Usage: bcftools view my.vcf.gz | addad.py | bcftools sort -Oz -o my.ad.vcf.gz && tabix my.ad.vcf.gz | |
import pysam | |
vcf_in=pysam.VariantFile("-","r") | |
vcf_in.header.formats.add("AD",".","Integer","Allelic depth, hard-coded as 2") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start window and pane indices at 1 instead of 0 | |
set -g base-index 1 | |
set -g pane-base-index 1 | |
# Shift arrow keys to move around panes | |
bind -n S-Up select-pane -U | |
bind -n S-Down select-pane -D | |
bind -n S-Left select-pane -L | |
bind -n S-Right select-pane -R |
NewerOlder