Skip to content

Instantly share code, notes, and snippets.

View j-andrews7's full-sized avatar
💭
Figgerin' it out

Jared Andrews j-andrews7

💭
Figgerin' it out
View GitHub Profile
@j-andrews7
j-andrews7 / For_Nina_Heatmaps.R
Created August 24, 2018 16:37
Making heatmaps
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))
@j-andrews7
j-andrews7 / BoxScoreScraping.ipynb
Created February 24, 2020 01:48
A barebones example of basic table parsing for sports data.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 / sed cheatsheet
Created October 4, 2021 04:02 — forked from ssstonebraker/sed cheatsheet
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'
@j-andrews7
j-andrews7 / seurat_add_vdj_metadata.R
Last active November 1, 2022 11:16
A simple function to add 10x V(D)J info to a Seurat object.
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.