Skip to content

Instantly share code, notes, and snippets.

View sr320's full-sized avatar

Steven Roberts sr320

View GitHub Profile
@sr320
sr320 / gist:f535043258d757592bba
Last active August 29, 2015 14:04
eimd morning
#!/bin/bash
#script to start the morning right!
#below line not needed if already mounted.
#open afp://usr:password@maxene.fhl.washington.edu/Students
cd /Volumes/Students/diseases/steven
say lets get ready to have some fun!
ipython notebook
@sr320
sr320 / blastcheck
Created July 30, 2014 15:26
eimd_quickcheck
{
"metadata": {
"name": "",
"signature": "sha256:a998131beddc729ad529da2eb5f1f69ca26b8ef8a1cfb8a2d294d41b2393c04c"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
cd /Volumes/Shoelace/Dropbox/Steven/ipython_nb
rsync -avzr *.ipynb /Volumes/Shoelace/Dropbox/Public/ip/nbview/
@sr320
sr320 / nbsnap
Last active August 29, 2015 13:56
cd /Volumes/Shoelace/Dropbox/Public/nb
wget --no-check-certificate -N http://genefish.wikispaces.com/Sam%27s+Notebook?f=print
mv Sam\'s\+Notebook\?f\=print _sam.html
tail -n +106 /Volumes/Shoelace/Dropbox/Public/nb/_sam.html > /Volumes/Shoelace/Dropbox/Public/nb/__sam.html
sed 's/h1/h3/g' </Volumes/Shoelace/Dropbox/Public/nb/__sam.html> /Volumes/Shoelace/Dropbox/Public/nb/sam.html
{
"metadata": {
"name": "_scratch"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@sr320
sr320 / gist:7371110
Created November 8, 2013 13:33
sqlshare preview
set rowcount 10
SELECT *
FROM [sr320@washington.edu].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
@sr320
sr320 / gist:6998577
Created October 15, 2013 20:59
cleaning up methratio file
SELECT [chr]
, CAST([pos] as INTEGER) as [pos]
, [strand]
, [context]
, CAST([ratio] as FLOAT) as [ratio]
, CAST([eff_CT_count] as INTEGER) as [eff_CT_count]
, CAST([C_count] as INTEGER) as [C_count]
, CAST([CT_count] as INTEGER) as [CT_count]
, CAST([rev_G_count] as INTEGER) as [rev_G_count]
, CAST([CI_lower] as FLOAT) as [CI_lower]
@sr320
sr320 / CpG OE
Last active December 25, 2015 08:09
Counting C, G, and CpG motifs per sequence in Cgigas gene sequence table
SELECT
CGI_ID,
len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
(len(sequence)- len(REPLACE(sequence, 'G', ''))) + (len(sequence)- len(REPLACE(sequence, 'C', ''))) as C_Gcount,
len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CpGcount,
len(sequence) as sequence_len,
sequence
FROM [sr320@washington.edu].[qDOD_Cgigas_gene_fasta]​
@sr320
sr320 / sumcol.sh
Created July 26, 2013 03:13
Summing Column #10 in a tab delimited text file
cat file.txt | awk -F"\t" '{ sum+=$10} END {print sum}'