Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Figgerin' it out

Jared Andrews j-andrews7

💭
Figgerin' it out
View GitHub Profile
View sed cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
View gist:f9017de53f2cc6a3c6613a6dfea9aca4
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE:
@j-andrews7
j-andrews7 / BoxScoreScraping.ipynb
Created Feb 24, 2020
A barebones example of basic table parsing for sports data.
View BoxScoreScraping.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j-andrews7
j-andrews7 / seurat_add_vdj_metadata.R
Last active Nov 1, 2022
A simple function to add 10x V(D)J info to a Seurat object.
View seurat_add_vdj_metadata.R
add_clonotype <- function(tcr_location, seurat_obj){
tcr <- read.csv(paste(tcr_folder,"filtered_contig_annotations.csv", sep=""))
# Remove the -1 at the end of each barcode.
# Subsets so only the first line of each barcode is kept,
# as each entry for given barcode will have same clonotype.
tcr$barcode <- gsub("-1", "", tcr$barcode)
tcr <- tcr[!duplicated(tcr$barcode), ]
# Only keep the barcode and clonotype columns.
View For_Nina_Heatmaps.R
make.heatmaps <- function(dds, res, rld, level, g1, g2, plot_annos=NULL) {
# plot_annos should be a vector of at least two columns from the sample sheet to use for labeling plots.
# g1 and g2 should be strings for the groups to be compared for the level (eg. "Progression", "Response")
# dds must be a DESeqExperiment object.
# rld is the log-transformed dds object.
## Should really make another generic function for the actual heatmap plots and feed it in the pval/lfc values.
# Set color breaks and palatte.
breaks <- c(seq(-3,-1.251,length=250),seq(-1.25,-0.1001,length=250),seq(-0.1,0.1,length=1),seq(0.1001,1.25,length=250),seq(1.251,3,length=250))