Skip to content

Instantly share code, notes, and snippets.

View mfcovington's full-sized avatar

Mike Covington mfcovington

View GitHub Profile
@mfcovington
mfcovington / PROTOCOL KEYWORDS
Created October 15, 2017 17:26
protocols i o
cell culture
purification
function extract_sequences {
GENE=$1
EXON=$2
CHR=$3
BAM_START=$4
BAM_END=$5
EXON_START=$6
sudo yum -y update
sudo yum install -y gcc48-plugin-devel.x86_64
sudo mkdir /installs
cd /installs
sudo wget https://github.com/samtools/samtools/releases/download/1.3.1/samtools-1.3.1.tar.bz2
sudo tar -xjf samtools-1.3.1.tar.bz2
cd samtools-1.3.1
@mfcovington
mfcovington / dge.R
Created November 10, 2016 18:38
DGE Example
library(edgeR)
library(ggplot2)
setwd('/path/to/counts-directory')
counts.files <- list.files(pattern="\\.counts$")
sample.names <- c('H6 GFP #1', 'H6 GFP #2', 'HIF-2α #3', 'HIF-2α #4', 'HIF-1α #7', 'HIF-1α #8')
counts.df <- readDGE(counts.files, labels=sample.names, group=c(rep('H6 GFP', 2), rep('HIF-2α', 2), rep('HIF-1α', 2)))
# In this case, need to remove the ".1", etc. in order to be able to merge with annotation file
#!/usr/bin/env sh
# Count reads and validate FASTQ files
FASTQ_DIR="$1"
if [ -z ${FASTQ_DIR+x} ]; then
echo "Usage: $0 /path/to/fastq/files/"
exit 1
fi
@mfcovington
mfcovington / merge-summarize-fda.sh
Last active August 13, 2016 18:15
Merging and Summarizing FDA Samples
################################
# Auto-merge by sample and end #
################################
BASE_DIR=/Volumes/seagate/giriget
for SAMPLE in {1..144}; do
for END in R1 R2; do
# Gather files to process
@mfcovington
mfcovington / reads-per-barcode.json
Created July 13, 2016 13:12
reads-per-barcode.json
[
{
sampleId: "CMMC001_33",
lane: 2,
barcode: "AACAGGCG",
clusters: 3681934
},
{
sampleId: "CMMC001_33",
lane: 3,
@mfcovington
mfcovington / parse-submission-form.py
Created July 6, 2016 00:50
Parse Excel Submission Form
from openpyxl import load_workbook
wb = load_workbook(filename = 'SubmissionForm.xlsx')
sheet = wb.get_sheet_by_name(wb.sheetnames[0])
header_row = sheet.rows[0]
for row in sheet.rows[1:]:
# Ignore empty rows
@mfcovington
mfcovington / djangocms-lab-site.md
Created January 14, 2016 07:34
django CMS Lab Site

I'm in the process of making a CMS for scientific research labs. Our lab does a lot of genome/transcriptome sequencing and bioinformatic analyses. Therefore, I've been creating apps that would be useful for a scientific lab in general as well as one with our focus. I chose to build these upon django CMS to give extra flexibility in the both site design and the way the lab members interact with/edit the content.

There are a few integral apps still in the pipeline, but below are the ones that are in a usable state (although they do vary in terms of completeness). Once I've made sufficient progress, I plan on writing up a manuscript to submit to a scientific journal, because I believe that this type of site could be very useful for many labs. The project that I have incorporated these apps into is djangocms-lab-site.

@mfcovington
mfcovington / repos-that-need-to-be-pushed.sh
Created January 12, 2016 01:37
Find git repositories that need to be pushed to GitHub
REPOS_DIR=~/git.repos
for DIR in find $REPOS_DIR/* -maxdepth 0 -type d; do
cd $DIR
NEEDS_PUSH=`git rev-list develop...origin/develop --count`
if [ "$NEEDS_PUSH" -gt 0 ]; then
echo $DIR >> ~/repos-that-need-pushed
fi
done