Skip to content

Instantly share code, notes, and snippets.

@hbeale
hbeale / bash_profile_addition
Last active April 8, 2021 20:34
append this to bash profile to start screen automatically on login
read -n1 -rsp $'Press Ctrl+C to skip screen...\n'
screen -Rx
@hbeale
hbeale / .screenrc
Last active April 7, 2021 20:13
My .screenrc
## .screenrc
# backspace throws an error, so fix it
bindkey -d ^? stuff ^H
bindkey -d ^@ stuff ^H
# to be able to attach to the same screen session
# from different computers without logging out:
multiuser on
@hbeale
hbeale / plot TCGA RINs.R
Created March 28, 2018 00:34
plot TCGA RIN scores for some samples
# to reproduce
# The biospecimen_analyte_combined file can be downloaded from Synapse.org under the id: `syn7499603`
library(tidyverse)
biospecimen_values=read_tsv("~/Documents/Dropbox/ucsc/operations/registry/TCGA biospecimen_analyted_combined.tsv")
biospecimen_values %>%
mutate(
rinNumeric=as.numeric(rinvalue),
a260_a280_ratioNumeric=as.numeric(a260_a280_ratio),
source=gsub("^([A-Z]*)[-_].*$", "\\1", bcr_sample_barcode)
@hbeale
hbeale / gist:2028899e9576a3d231421c8d505a730f
Created July 18, 2017 21:08
Analytical validation stats
# definitions of calculations
# sensitivity is the ability of test to detect the disease when it is present; it is defined as # true positives/# of samples with disease or condition
# specificity is the ability of a test to exclude the disease when it is absent, it is defined as the number of true negatives/# without the disease or condition
# positive predictive value (PPV) - the likelihood that a positive test truly represents the presence of the disease or condition; it is defined as # true positives/# all positives. A test has a high PPV if a large percentage of prople who get a positive test result actually have the disease or condition.
# negative predictive value (NPV) - the likelihood that a negative test truly represents the absence of the disease or condition; it is defined as # true negatives/# all negatives. A test has a high NPV if a large percentage of prople who get a negative test result really don't have the disease or condition.
@hbeale
hbeale / hbPublicFunctions.R
Created May 22, 2017 17:08
convenience functions I often use
## these are functions that I sometimes use in my code
## they are intended to be able to be run on any computer
## with R installed.
#################################
###
### load libraries
###
@hbeale
hbeale / checkBamEOF_error
Created December 12, 2016 00:28
check bam for EOF error
for i in *.bam ; do echo -n $i; samtools view -h $i | head -1 ; done 2>&1 | grep '\['
# for malformed bams, the output is "EGAD00001001620_ICGC_MB110.sorted.bam[bam_header_read] EOF marker is
absent. The input is probably truncated."
@hbeale
hbeale / Cautiously RENAME a comma delim list of files.txt
Last active August 26, 2016 22:10
Renaming strategy for cautious renamers
#################################
###
### Cautiously RENAME a comma delim list of files
###
#################################
### ASSIGN variable to input file
thisKey="Key_Renaming_26Aug2016_hb2.txt"
### All functions require a file containing renaming information
@hbeale
hbeale / twitter_word_cloud.R
Created June 14, 2011 23:37 — forked from drewconway/twitter_word_cloud.R
R function to create a comparative word cloud of two twitter hashtags, as introduced here http://www.drewconway.com/zia/?p=2624
# File-Name: twitter_word_cloud.R
# Date: 2011-01-30
# Author: Drew Conway
# Email: drew.conway@nyu.edu
# Purpose: Create a comparative word cloud of two twitter hashtags
# Data Used:
# Packages Used: twitteR, tm, ggplot2
# Output File: Hashtag word cloud
# Data Output:
# Machine: Drew Conway's MacBook Pro