Skip to content

Instantly share code, notes, and snippets.

View kdiverson's full-sized avatar

Kathryn Iverson kdiverson

View GitHub Profile
OTU Rank
Otu29838 49.448
Otu29833 45.884
Otu29741 45.536
Otu29878 43.366
Otu29860 42.776
Otu29842 42.67
Otu29835 42.616
Otu29839 42.542
Otu29834 42.528
@kdiverson
kdiverson / do.science().ipynb
Created October 8, 2014 20:48
do.science notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kdiverson
kdiverson / diginorm.sh
Last active August 29, 2015 14:08
Shell script for running the digital normalization part of khmer
#!/bin/sh
#script to run digital normalization
#####
#files
R1=$1 #"R1_001" forward fastq reads
R2=$2 #"R2_001" reversed fastq reads
COM=$3 #"combined_001" interleaved reads
#paths
#multi k velvet
seq_file=$1
fq=$(basename $seq_file .trimmed.fq.keep.abundfilt)
for k in {19..51..2};
do
quicksubmit "velveth && velvetg"
name=$(basename $i .pe.fq.gz);
import sys
def get_next_fasta (fileObject):
'''usage: for header, seq in get_next_fasta(fileObject):
'''
header = ''
seq = ''
#The following for loop gets the header of the first fasta
#record. Skips any leading junk in the file
for line in fileObject:
#!/usr/bin/python2.7
'''USAGE: quicksubmit.py "command -l parameter" [options]
This script submits your one line command as a job to the pbs job scheduler.
'''
import subprocess as s
import sys
import argparse
def submitjob(job_name, command, subtype = "qsub", walltime = "10:00:00", cput = "10:00:00", pm = "nodes=1:ppn=1:mem=2gb", mailto = "", afterok = "", verbose = False):
'''USAGE: submitjob('my_job', 'echo "hello world!"')
@kdiverson
kdiverson / gist:c2419d467c436fecee31
Last active August 29, 2015 14:11
mock data iterative assembly stats
132585322 (100.00%) were unpaired; of these:
4790404 (3.61%) aligned 0 times
98633353 (74.39%) aligned exactly 1 time
29161565 (21.99%) aligned >1 times
N50: 10038
N90: 100
total contigs: 2097980
average length: 282 bp
trimmed average length: 281 bp
greater than or equal to 100: 1437022
import argparse
import logging
parser = argparse.ArgumentParser()
parser.add_argument('-d','--debug',
help='Print lots of debugging statements',
action="store_const",dest="loglevel",const=logging.DEBUG,
default=logging.WARNING
)
parser.add_argument('-v','--verbose',
@kdiverson
kdiverson / parse_human.bash
Last active August 29, 2015 14:20
run LMAT
hit_total=`awk '{total += $3} END {print total}' *fastsummary.species`
nohit_total=`awk '{total += $2} END {print total}' *nomatchsum`
total=(($hit_total + $nohit_total))
human=`awk '{if ($4==9606) {print $3} }' *fastsummary.species`
echo (($human / $total))
hit_total=`awk '{total += $3} END {print total}' *fastsummary.species`; nohit_total=`awk '{total += $2} END {print total}' *nomatchsum`; total=(($hit_total + $nohit_total)); human=`awk '{if ($4==9606) {print $3} }' *fastsummary.species`; echo (($human / $total))
@kdiverson
kdiverson / .bash_profile
Created May 12, 2015 21:31
My .bash_profile from axiom
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
# Set colors
export CLICOLOR=1